1 /*	$NetBSD: commandline.h,v 1.4 2014/12/10 04:38:00 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (C) 1999-2001  Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp  */
21 
22 #ifndef ISC_COMMANDLINE_H
23 #define ISC_COMMANDLINE_H 1
24 
25 /*! \file isc/commandline.h */
26 
27 #include <isc/boolean.h>
28 #include <isc/lang.h>
29 #include <isc/platform.h>
30 
31 /*% Index into parent argv vector. */
32 LIBISC_EXTERNAL_DATA extern int isc_commandline_index;
33 /*% Character checked for validity. */
34 LIBISC_EXTERNAL_DATA extern int isc_commandline_option;
35 /*% Argument associated with option. */
36 LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument;
37 /*% For printing error messages. */
38 LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname;
39 /*% Print error message. */
40 LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint;
41 /*% Reset getopt. */
42 LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset;
43 
44 ISC_LANG_BEGINDECLS
45 
46 /*% parse command line */
47 int
48 isc_commandline_parse(int argc, char * const *argv, const char *options);
49 
50 ISC_LANG_ENDDECLS
51 
52 #endif /* ISC_COMMANDLINE_H */
53