* Makefile.am (libguile_la_SOURCES): Remove backtrace.c, debug.c,
[bpt/guile.git] / libguile / feature.c
index 5bf986f..9aaee67 100644 (file)
@@ -62,14 +62,31 @@ scm_add_feature(str)
 
 
 \f
-
 SCM_PROC(s_program_arguments, "program-arguments", 0, 0, 0, scm_program_arguments);
+
 SCM 
 scm_program_arguments ()
 {
   return scm_progargs;
 }
 
+/* Set the value returned by program-arguments, given ARGC and ARGV.
+
+   If FIRST is non-zero, make it the first element; we do this in
+   situations where other code (like getopt) has parsed out a few
+   arguments, but we still want the script name to be the first
+   element.  */
+void
+scm_set_program_arguments (argc, argv, first)
+     int argc;
+     char **argv;
+     char *first;
+{
+  scm_progargs = scm_makfromstrs (argc, argv);
+  if (first)
+    scm_progargs = scm_cons (scm_makfrom0str (first), scm_progargs);
+}
+
 
 \f