help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] gengetopt: initialization of args_info_help[]


From: Andre Noll
Subject: Re: [help-gengetopt] gengetopt: initialization of args_info_help[]
Date: Thu, 4 Dec 2008 17:57:17 +0100
User-agent: Mutt/1.5.9i

On 09:30, Lorenzo Bettini wrote:
> >So for N parsers, I have to allocate N args_info structures and call
> >N init functions even in the case I just want to print the short help.
> >Is this behaviour intended?
> >
> 
> I never thought about such a situation actually; I think that that init 
> help function might be made public and callable from outside

Yes, that would be easiest, one just has to remove the static
keyword in the .c file and add the function prototype to the .h file.

Alternativly one could change the cmdline_parser_init function so that
it just calls init_help() if called with a NULL pointer. Currently,
such a usage would lead to a segfault.

> >An alternative would be to initialize also the short help by using
> >string literals, just like the detailed help. The duplicated strings
> >would not increase code size because the compiler should be smart
> >enough to put identical strings into memory only once.
> 
> please, do not ask for that ;-) ;-)
> this behavior was requested by other users and it was quite a nightmare 
> to implement it, so I wouldn't want to go back ;-)

OK, so I won't argue for this alternative any more :) But out of
curiosity, what were the problems in inplementing it this way?

Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

Attachment: signature.asc
Description: Digital signature


reply via email to

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