From 72709d26e45b686c6d5b6cc62cce73fc3501cb63 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Wed, 17 Jan 2007 22:55:10 +0000 Subject: [PATCH] A couple of tweaks to: * posix.texi (Runtime Environment): Expand program-arguments description, add set-program-arguments, add scm_set_program_arguments, note args are per-thread. --- doc/ref/posix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 142e116ba..a56f8a30d 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -1388,17 +1388,17 @@ and @code{command-line} above. @var{argv} is an array of null-terminated strings, as in a C @code{main} function. @var{argc} is the number of strings in -@var{argv}, or if it's negative then a @code{NULL} entry in @var{argv} -marks its end. +@var{argv}, or if it's negative then a @code{NULL} in @var{argv} marks +its end. @var{first} is an extra string put at the start of the arguments, or @code{NULL} for no such extra. This is a convenient way to pass the program name after advancing @var{argv} to strip option arguments. +Eg.@: @example @{ char *progname = argv[0]; - int i; for (argv++; argv[0] != NULL && argv[0][0] == '-'; argv++) @{ /* munch option ... */ @@ -1409,7 +1409,7 @@ program name after advancing @var{argv} to strip option arguments. @end example This sort of thing is often done at startup under -@code{scm_boot_guile} with any options handled at the C level removed. +@code{scm_boot_guile} with options handled at the C level removed. The given strings are all copied, so the C data is not accessed again once @code{scm_set_program_arguments} returns. @end deftypefn