CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 
00023 #include "csextern.h"
00024 
00029 #if defined(__NeXT__) || defined(__APPLE__)
00030 // NeXT already has a valid getopt; avoid link errors.
00031 #define getopt __getopt
00032 #define optarg __optarg
00033 #define opterr __opterr
00034 #define optind __optind
00035 #define optopt __optopt
00036 #endif
00037 
00044 extern CS_CSUTIL_EXPORT char *optarg;
00045 
00058 extern CS_CSUTIL_EXPORT int optind;
00059 
00063 extern CS_CSUTIL_EXPORT int opterr;
00064 
00067 extern CS_CSUTIL_EXPORT int optopt;
00068 
00091 struct CS_CSUTIL_EXPORT getopt_option
00092 {
00093 #if defined (__STDC__) && __STDC__
00094   const char *name;
00095 #else
00096   char *name;
00097 #endif
00098   /* has_arg can't be an enum because some compilers complain about
00099      type mismatches in all the code that assumes it is an int.  */
00100   int has_arg;
00101   int *flag;
00102   int val;
00103 };
00108 #define option getopt_option
00109 
00110 /* Names for the values of the `has_arg' field of `struct option'.  */
00111 
00112 #define no_argument             0
00113 #define required_argument       1
00114 #define optional_argument       2
00115 
00116 extern CS_CSUTIL_EXPORT int getopt (int argc, char *const *argv, const char *shortopts);
00117 extern CS_CSUTIL_EXPORT int getopt_long (int argc, char *const *argv, const char *shortopts,
00118                         const struct getopt_option *longopts, int *longind);
00119 extern CS_CSUTIL_EXPORT int getopt_long_only (int argc, char *const *argv,
00120                              const char *shortopts,
00121                              const struct getopt_option *longopts, int *longind);
00122 
00123 /* Internal only.  Users should not call this directly.  */
00124 extern int _getopt_internal (int argc, char *const *argv,
00125                              const char *shortopts,
00126                              const struct getopt_option *longopts, int *longind,
00127                              int long_only);
00128 
00129 #endif // __CS_GETOPT_H__

Generated for Crystal Space by doxygen 1.2.18