1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 16:30:19 +02:00

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.
This commit is contained in:
Kevin Ryde 2007-01-17 22:55:10 +00:00
parent f697d9dbe7
commit 72709d26e4

View file

@ -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