From: Kurt Zeilenga Date: Tue, 20 Oct 1998 19:51:08 +0000 (+0000) Subject: modified for OpenLDAP X-Git-Tag: PHP3_TOOL_0_0~18^2~44 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6880f37fdc5a133b07c2efb15b6128aceaa5c55a;p=openldap modified for OpenLDAP --- diff --git a/libraries/liblutil/getopt.c b/libraries/liblutil/getopt.c index a19d9ba2c9..112616fdce 100644 --- a/libraries/liblutil/getopt.c +++ b/libraries/liblutil/getopt.c @@ -2,33 +2,24 @@ getopt.c modified public-domain AT&T getopt(3) + modified by Kurt Zeilenga for inclusion into OpenLDAP */ +#include "portable.h" + +#ifndef HAVE_GETOPT + #include -#include -#ifdef _POSIX_SOURCE -# include -#else -# define STDERR_FILENO 2 -# ifdef __STDC__ - extern int write (int fildes, char * buf, unsigned nbyte); -# else - extern int write (); -# endif -#endif +#include +#include int opterr = 1; int optind = 1; int optopt; char * optarg; -#ifdef __STDC__ - static void ERR (char ** argv, char * s, char c) -#else - static void ERR (argv, s, c) - char ** argv, * s, c; -#endif +static void ERR (char ** argv, char * s, char c) { char errbuf[2]; @@ -45,13 +36,7 @@ printf("DF_TRACE_DEBUG: static void ERR () in getopt.c\n"); } } -#ifdef __STDC__ - int getopt (int argc, char ** argv, char * opts) -#else - int getopt (argc, argv, opts) - int argc; - char ** argv, * opts; -#endif +int getopt (int argc, char ** argv, char * opts) { static int sp = 1, error = (int) '?'; static char sw = '-', eos = '\0', arg = ':'; @@ -106,3 +91,4 @@ printf("DF_TRACE_DEBUG: int getopt () in getopt.c\n"); } return (int) c; } +#endif /* HAVE_GETOPT */