mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 08:50:23 +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:
parent
f697d9dbe7
commit
72709d26e4
1 changed files with 4 additions and 4 deletions
|
@ -1388,17 +1388,17 @@ and @code{command-line} above.
|
||||||
|
|
||||||
@var{argv} is an array of null-terminated strings, as in a C
|
@var{argv} is an array of null-terminated strings, as in a C
|
||||||
@code{main} function. @var{argc} is the number of strings in
|
@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}
|
@var{argv}, or if it's negative then a @code{NULL} in @var{argv} marks
|
||||||
marks its end.
|
its end.
|
||||||
|
|
||||||
@var{first} is an extra string put at the start of the arguments, or
|
@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
|
@code{NULL} for no such extra. This is a convenient way to pass the
|
||||||
program name after advancing @var{argv} to strip option arguments.
|
program name after advancing @var{argv} to strip option arguments.
|
||||||
|
Eg.@:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@{
|
@{
|
||||||
char *progname = argv[0];
|
char *progname = argv[0];
|
||||||
int i;
|
|
||||||
for (argv++; argv[0] != NULL && argv[0][0] == '-'; argv++)
|
for (argv++; argv[0] != NULL && argv[0][0] == '-'; argv++)
|
||||||
@{
|
@{
|
||||||
/* munch option ... */
|
/* munch option ... */
|
||||||
|
@ -1409,7 +1409,7 @@ program name after advancing @var{argv} to strip option arguments.
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
This sort of thing is often done at startup under
|
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
|
The given strings are all copied, so the C data is not accessed again
|
||||||
once @code{scm_set_program_arguments} returns.
|
once @code{scm_set_program_arguments} returns.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue