From: Kevin Ryde <user42@zip.com.au>
Subject: doc scm_set_program_arguments
Date: Sun, 14 Jan 2007 09:29:35 +1100 [thread overview]
Message-ID: <87d55iimr4.fsf@zip.com.au> (raw)
I wrote a few words for scm_set_program_arguments, which is mentioned
under scm_boot_guile but not otherwise described.
-- C Function: void scm_set_program_arguments (int argc, char **argv,
char *first)
Set the list of command line arguments to be returned by
`program-arguments' and `command-line' above.
ARGV is an array of null-terminated strings, as in a C `main'
function. ARGC is the number of strings in ARGV, or if it's
negative then a `NULL' entry in ARGV marks the end.
FIRST is an extra string put at the start of the arguments, or
`NULL' for no such extra. This is a convenient way to pass the
program name after advancing ARGV to strip option arguments or
similar.
{
char *progname = argv[0];
int i;
for (i = 1; i < argc && argv[i][0] == '-'; i++)
{
/* munch option ... */
}
/* remaining args for scheme level use */
scm_set_program_arguments (-1, argv+i, progname);
}
This sort of thing is often done at startup under `scm_boot_guile'
and similar. The given strings are all copied, so the C data is
not accessed again once `scm_set_program_arguments' returns.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2007-01-13 22:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-13 22:29 Kevin Ryde [this message]
2007-01-13 23:12 ` doc scm_set_program_arguments Neil Jerram
2007-01-15 22:20 ` Kevin Ryde
2007-01-17 19:26 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d55iimr4.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).