getopt.h (126155) | getopt.h (126190) |
---|---|
1/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ | 1/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ |
2/* $FreeBSD: head/include/getopt.h 126155 2004-02-23 08:14:18Z ache $ */ | 2/* $FreeBSD: head/include/getopt.h 126190 2004-02-24 08:09:20Z ache $ */ |
3 4/*- 5 * Copyright (c) 2000 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Dieter Baron and Thomas Klausner. 10 * --- 27 unchanged lines hidden (view full) --- 38 */ 39 40#ifndef _GETOPT_H_ 41#define _GETOPT_H_ 42 43#include <sys/cdefs.h> 44 45/* | 3 4/*- 5 * Copyright (c) 2000 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Dieter Baron and Thomas Klausner. 10 * --- 27 unchanged lines hidden (view full) --- 38 */ 39 40#ifndef _GETOPT_H_ 41#define _GETOPT_H_ 42 43#include <sys/cdefs.h> 44 45/* |
46 * GNU-like getopt_long() with 4.4BSD optreset extension. | 46 * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. |
47 * getopt() is declared here too for GNU programs. 48 */ 49#define no_argument 0 50#define required_argument 1 51#define optional_argument 2 52 53struct option { 54 /* name of long option */ --- 7 unchanged lines hidden (view full) --- 62 int *flag; 63 /* if flag not NULL, value to set *flag to; else return value */ 64 int val; 65}; 66 67__BEGIN_DECLS 68int getopt_long(int, char * const *, const char *, 69 const struct option *, int *); | 47 * getopt() is declared here too for GNU programs. 48 */ 49#define no_argument 0 50#define required_argument 1 51#define optional_argument 2 52 53struct option { 54 /* name of long option */ --- 7 unchanged lines hidden (view full) --- 62 int *flag; 63 /* if flag not NULL, value to set *flag to; else return value */ 64 int val; 65}; 66 67__BEGIN_DECLS 68int getopt_long(int, char * const *, const char *, 69 const struct option *, int *); |
70int getopt_long_only(int, char * const *, const char *, 71 const struct option *, int *); |
|
70#ifndef _GETOPT_DECLARED 71#define _GETOPT_DECLARED 72int getopt(int, char * const [], const char *); 73 74extern char *optarg; /* getopt(3) external variables */ 75extern int optind, opterr, optopt; 76#endif 77#ifndef _OPTRESET_DECLARED 78#define _OPTRESET_DECLARED 79extern int optreset; /* getopt(3) external variable */ 80#endif 81__END_DECLS 82 83#endif /* !_GETOPT_H_ */ | 72#ifndef _GETOPT_DECLARED 73#define _GETOPT_DECLARED 74int getopt(int, char * const [], const char *); 75 76extern char *optarg; /* getopt(3) external variables */ 77extern int optind, opterr, optopt; 78#endif 79#ifndef _OPTRESET_DECLARED 80#define _OPTRESET_DECLARED 81extern int optreset; /* getopt(3) external variable */ 82#endif 83__END_DECLS 84 85#endif /* !_GETOPT_H_ */ |