From 4920a9b6131f40004b03c076abce7ac45aa56e05 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Mon, 15 Jan 2007 21:28:52 +0000 Subject: [PATCH] (scm_set_program_arguments_scm): New function, implementing `set-program-arguments'. --- libguile/feature.c | 18 +++++++++++++++++- libguile/feature.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libguile/feature.c b/libguile/feature.c index 1d44a7790..6cd0e54ab 100644 --- a/libguile/feature.c +++ b/libguile/feature.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -76,6 +76,22 @@ scm_set_program_arguments (int argc, char **argv, char *first) scm_fluid_set_x (progargs_fluid, args); } +SCM_DEFINE (scm_set_program_arguments_scm, "set-program-arguments", 1, 0, 0, + (SCM lst), + "Set the command line arguments to be returned by\n" + "@code{program-arguments} (and @code{command-line}). @var{lst}\n" + "should be a list of strings, the first of which is the program\n" + "name (either a script name, or just @code{\"guile\"}).\n" + "\n" + "Program arguments are held in a fluid and therefore have a\n" + "separate value in each Guile thread. Neither the list nor the\n" + "strings within it are copied, so should not be modified later.") +#define FUNC_NAME s_scm_set_program_arguments_scm +{ + return scm_fluid_set_x (progargs_fluid, lst); +} +#undef FUNC_NAME + diff --git a/libguile/feature.h b/libguile/feature.h index 58db46422..f12f292ce 100644 --- a/libguile/feature.h +++ b/libguile/feature.h @@ -27,6 +27,7 @@ SCM_API void scm_add_feature (const char* str); SCM_API SCM scm_program_arguments (void); SCM_API void scm_set_program_arguments (int argc, char **argv, char *first); +SCM_API SCM scm_set_program_arguments_scm (SCM lst); SCM_API void scm_init_feature (void); #endif /* SCM_FEATURE_H */