help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?
Date: Sat, 29 Apr 2006 21:04:58 +0200
User-agent: Mail/News 1.5 (X11/20060228)

Andre Noll wrote:
Unfortunately, "optind = 0 means initialize" seems to be a glibc
feature that is not backed up by POSIX. So I agree that gengetopt
should not rely on it. Which leaves the question how to tell getopt
to discard any internal pointers in a portable way.


I guess the right thing to do is to never free arguments passed to getopt_long if another call has to be made: this seems to never be safe (even because getopt_long can rearrange the elements, as documented).

I uploaded a newer version here

http://rap.dsi.unifi.it/~bettini/gengetopt-2.17rc.tar.gz

I still haven't documented the use of multiple parsers but there's the test test_multiple_parsers that can be taken as an example of usage of three parsers.

there's the new parser function that can be generated with the gengetopt command line

-S, --string-parser         generate a string parser (the string
                                contains the command line)

see the test test_multiple_parsers.c

Of course I switched back to optind = 1

I hope to hear from you soon about this new feature (before I release it)

thanks in advance
        Lorenzo

--
+-----------------------------------------------------+
|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        : http://www.lorenzobettini.it    |
|  http://music.dsi.unifi.it         XKlaim language  |
|  http://www.purplesucker.com Deep Purple Cover Band |
|  http://www.gnu.org/software/src-highlite           |
|  http://www.gnu.org/software/gengetopt              |
|  http://www.lorenzobettini.it/software/gengen       |
|  http://www.lorenzobettini.it/software/doublecpp    |
+-----------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]