This is the mail archive of the
mailing list for the glibc project.
- From: Marcus Brinkmann <Marcus dot Brinkmann at ruhr-uni-bochum dot de>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: Roland McGrath <roland at redhat dot com>, Simon Josefsson <jas at extundo dot com>,Jeff Bailey <jbailey at nisa dot net>, libc-alpha at sources dot redhat dot com
- Date: Thu, 17 Oct 2002 21:51:02 +0200
- Subject: Re: libio
- References: <200210171933.g9HJXfn06311@magilla.sf.frob.com> <3DAF11EE.email@example.com>
On Thu, Oct 17, 2002 at 12:39:26PM -0700, Ulrich Drepper wrote:
> Why would argp need to be reentrant? Not using getopt just means more
> code for no obvious reason.
So that you can run an argp parser from an argp handler. I have written a
console which loads drivers at run time, and that parses command
line options for the driver in the driver's argp. Eg, an invocation would
be like this:
console -d vga --font 8x13.bdf -d speaker --beep 440
And the main argp would parse the -d options and then invoke the driver's
argp after loading it. The driver's argp would parse the driver specific
options and return the number of options parsed to the main argp handler.
This code is written already, except that I can not use argp in the driver,
but have to implement my own option parser right now, which is ugly and
unnecessary if argp would be reentrant. As soon as argp is reentrant the
code will be very elegant.
`Rhubarb is no Egyptian god.' GNU http://www.gnu.org firstname.lastname@example.org
Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/