csutil/getopt.h
Go to the documentation of this file.00001 /* Declarations for getopt. 00002 Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. 00003 This file is part of the GNU C Library. 00004 00005 The GNU C Library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public License as 00007 published by the Free Software Foundation; either version 2 of the 00008 License, or (at your option) any later version. 00009 00010 The GNU C Library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with the GNU C Library; see the file COPYING.LIB. If not, 00017 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. */ 00019 00020 #ifndef __CS_GETOPT_H__ 00021 #define __CS_GETOPT_H__ 00022 00027 #if defined(__NeXT__) || defined(__APPLE__) 00028 // NeXT already has a valid getopt; avoid link errors. 00029 #define getopt __getopt 00030 #define optarg __optarg 00031 #define opterr __opterr 00032 #define optind __optind 00033 #define optopt __optopt 00034 #endif 00035 00042 extern char *optarg; 00043 00056 extern int optind; 00057 00061 extern int opterr; 00062 00065 extern int optopt; 00066 00089 struct getopt_option 00090 { 00091 #if defined (__STDC__) && __STDC__ 00092 const char *name; 00093 #else 00094 char *name; 00095 #endif 00096 /* has_arg can't be an enum because some compilers complain about 00097 type mismatches in all the code that assumes it is an int. */ 00098 int has_arg; 00099 int *flag; 00100 int val; 00101 }; 00106 #define option getopt_option 00107 00108 /* Names for the values of the `has_arg' field of `struct option'. */ 00109 00110 #define no_argument 0 00111 #define required_argument 1 00112 #define optional_argument 2 00113 00114 extern int getopt (int argc, char *const *argv, const char *shortopts); 00115 extern int getopt_long (int argc, char *const *argv, const char *shortopts, 00116 const struct getopt_option *longopts, int *longind); 00117 extern int getopt_long_only (int argc, char *const *argv, 00118 const char *shortopts, 00119 const struct getopt_option *longopts, int *longind); 00120 00121 /* Internal only. Users should not call this directly. */ 00122 extern int _getopt_internal (int argc, char *const *argv, 00123 const char *shortopts, 00124 const struct getopt_option *longopts, int *longind, 00125 int long_only); 00126 00127 #endif // __CS_GETOPT_H__
Generated for Crystal Space by doxygen 1.2.18