From owner-freebsd-hackers Wed Oct 20 16:19:49 1999 Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 583) id 6A4D414BE0; Wed, 20 Oct 1999 16:19:47 -0700 (PDT) To: asmodai@wxs.nl, hackers@freebsd.org Subject: Re: getopt.h Cc: bde@freebsd.org, billf@freebsd.org In-Reply-To: <19991020221007.A90211@daemon.ninth-circle.org> Message-Id: <19991020231947.6A4D414BE0@hub.freebsd.org> Date: Wed, 20 Oct 1999 16:19:47 -0700 (PDT) From: bde@FreeBSD.ORG (Bruce Evans) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message