1 /*****************************************************************************
2 * getopt.h - competent and free getopt library.
3 *
4 * Copyright (c)2002-2003 Mark K. Kim
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 *   * Redistributions of source code must retain the above copyright
12 *     notice, this list of conditions and the following disclaimer.
13 *
14 *   * Redistributions in binary form must reproduce the above copyright
15 *     notice, this list of conditions and the following disclaimer in
16 *     the documentation and/or other materials provided with the
17 *     distribution.
18 *
19 *   * Neither the original author of this software nor the names of its
20 *     contributors may be used to endorse or promote products derived
21 *     from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
30 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
34 * DAMAGE.
35 */
36 #ifndef GETOPT_H_
37 #define GETOPT_H_
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 
45 extern char* optarg;
46 extern int optind;
47 extern int opterr;
48 extern int optopt;
49 
50 int getopt(int argc, char** argv, char* optstr);
51 
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 
58 #endif /* GETOPT_H_ */
59 
60 
61 /* vim:ts=3
62 */
63