X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..20d7cd4c186bcbb50f0bb56ce882b5680664d965:/include/getopt.h?ds=sidebyside diff --git a/include/getopt.h b/include/getopt.h index 270fed8..490b92f 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -1,4 +1,5 @@ /* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ +/* $FreeBSD: src/include/getopt.h,v 1.6 2004/02/24 08:09:20 ache Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,9 +44,9 @@ #include /* - * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions + * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. + * getopt() is declared here too for GNU programs. */ -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) #define no_argument 0 #define required_argument 1 #define optional_argument 2 @@ -65,8 +66,21 @@ struct option { }; __BEGIN_DECLS -int getopt_long(int, char * const *, const char *, const struct option *, int *); -__END_DECLS +int getopt_long(int, char * const *, const char *, + const struct option *, int *); +int getopt_long_only(int, char * const *, const char *, + const struct option *, int *); +#ifndef _GETOPT +#define _GETOPT +int getopt(int, char * const [], const char *); + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; #endif +#ifndef _OPTRESET +#define _OPTRESET +extern int optreset; /* getopt(3) external variable */ +#endif +__END_DECLS #endif /* !_GETOPT_H_ */