apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Fogel <kfo...@galois.collab.net>
Subject Re: RFC on interface change to apr_getopt_long()
Date Tue, 21 Nov 2000 19:33:51 GMT
Greg Hudson <ghudson@MIT.EDU> writes:
> The current code uses the val field for exactly one purpose:
> determining what value to yield when a long option is matched.
> 
> I don't have any particular objection to overloading val to also be a
> short name of the option, when it is a valid character.  I just want
> to be clear that that is a change.

Totally.

> With that change, we have (with yet more renaming):
> 
> typedef struct apr_option_t {
>     /** long option name, or NULL if option has no long name */
>     const char *name;
>     /** option letter, or a value greater than 255 if option has no letter */
>     int optch;
>     /** nonzero if option takes an argument */
>     int has_arg;
> } apr_option_t;
> 
> APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
>                                           const apr_option_t *opts,
>                                           int *optch, const char **optarg);

+1.

-K

Mime
View raw message