1 /*
2 ********************************************************************************
3 File: mygetopt.h
4 
5 Tab size:           4
6 Max line length:    80
7 Programmer:         Volker Kuhlmann
8 
9 
10 mygetopt 1.1 Copyright (C) 1997 Volker Kuhlmann
11 This program is free software under the terms of the GNU General Public License
12 version 2 (or later, at your option).
13 See the file COPYING for details about license terms and warranty.
14 <VolkerKuhlmann@gmx.de>
15 
16 
17 DESCRIPTION:
18 
19 Header file for mygetopt.c.
20 
21 
22 CONDITIONALS:
23 	none
24 
25 
26 HISTORY:
27 
28 1.0   04Dec97	Created
29 
30 ********************************************************************************
31 */
32 
33 
34 
35 #ifndef MYGETOPT_H
36 #define MYGETOPT_H
37 
38 
39 
40 /* options to options */
41 enum {
42 	no_argument = 0,		/* no option */
43 	required_argument = 1,	/* option is required */
44 	optional_argument = 2	/* option is optional */
45 };
46 
47 struct option
48 {
49 	const char *name;		/* name of long option */
50 	int has_arg;			/* has this option an option? */
51 	int *flag;				/* address for a return value */
52 	int val;				/* value copied to *flag, or returned */
53 };
54 
55 
56 
57 /* index of arguments scanned so far, or index to first
58 	argument not an option */
59 extern int optind;
60 
61 /* value of the option to the option, if there was one (or NULL?) */
62 extern char *optarg;
63 
64 /* when returning '?' (short or long option not recognised), this is the
65 (short) option which was unrecognised */
66 extern int optopt;
67 
68 /* store 0 here to suppress error messages from getopt */
69 extern int opterr;
70 
71 
72 
73 int getopt_long (
74 		int argc,
75 		char *const argv[],
76 		const char *shortoptions,
77 		const struct option *options,
78 		int *lidx);
79 
80 
81 
82 #endif  /* #ifndef MYGETOPT_H */
83 
84 
85 
86 /* EOF mygetopt.h */
87 /******************************************************************************/
88