> In unistd.h we have definitions for getopt, optarg, optind, opterr, and
> optopt.

These are the standard POSIX (.2?) declarations.

> The things I propose to add to unistd.h are the following:

> struct option
> {
>       char    *name;
>       int     has_arg;
>       int     *flag;
>       int     val;
> };

> #define no_argument           0
> #define required_argument     1
> #define optional_argument     2

> extern int getopt_long (int, char *const [], const char *,
>                       const struct option *, int *);
> extern int getopt_long_only (int, char *const [], const char *,
>                            const struct option *, int *);
> extern int _getopt_internal (int, char *const [], const char *,
>                            const struct option *, int *, int );

> This should enable us to compile programs which require getopt.h by
> simply including unistd.h.

These are gnu extensions which we don't even support in libc, so they
shouldn't be declared anywhere in /usr/include.  I think ports that
use the gnu extensions handle this problem by duplication the gnu
sources.  Not ideal, but the getopt sources are small.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to