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
Received on Sat Oct 21 14:36:15 2006