[Top][All Lists]

[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

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 Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        :    |
|         XKlaim language  |
| Deep Purple Cover Band |
|           |
|              |
|       |
|    |

reply via email to

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