Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* Internal declarations for getopt. 00004 Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2011 Free Software 00005 Foundation, Inc. 00006 This file is part of the GNU C Library. 00007 00008 This program is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00020 00021 #ifndef _GETOPT_INT_H 00022 #define _GETOPT_INT_H 1 00023 00024 #include <getopt.h> 00025 00026 extern int _getopt_internal (int ___argc, char **___argv, 00027 const char *__shortopts, 00028 const struct option *__longopts, int *__longind, 00029 int __long_only, int __posixly_correct); 00030 00031 00032 /* Reentrant versions which can handle parsing multiple argument 00033 vectors at the same time. */ 00034 00035 /* Describe how to deal with options that follow non-option ARGV-elements. 00036 00037 If the caller did not specify anything, 00038 the default is REQUIRE_ORDER if the environment variable 00039 POSIXLY_CORRECT is defined, PERMUTE otherwise. 00040 00041 REQUIRE_ORDER means don't recognize them as options; 00042 stop option processing when the first non-option is seen. 00043 This is what Unix does. 00044 This mode of operation is selected by either setting the environment 00045 variable POSIXLY_CORRECT, or using `+' as the first character 00046 of the list of option characters, or by calling getopt. 00047 00048 PERMUTE is the default. We permute the contents of ARGV as we 00049 scan, so that eventually all the non-options are at the end. 00050 This allows options to be given in any order, even with programs 00051 that were not written to expect this. 00052 00053 RETURN_IN_ORDER is an option available to programs that were 00054 written to expect options and other ARGV-elements in any order 00055 and that care about the ordering of the two. We describe each 00056 non-option ARGV-element as if it were the argument of an option 00057 with character code 1. Using `-' as the first character of the 00058 list of option characters selects this mode of operation. 00059 00060 The special argument `--' forces an end of option-scanning regardless 00061 of the value of `ordering'. In the case of RETURN_IN_ORDER, only 00062 `--' can cause `getopt' to return -1 with `optind' != ARGC. */ 00063 00064 enum __ord 00065 { 00066 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER 00067 }; 00068 00069 /* Data type for reentrant functions. */ 00070 struct _getopt_data 00071 { 00072 /* These have exactly the same meaning as the corresponding global 00073 variables, except that they are used for the reentrant 00074 versions of getopt. */ 00075 int optind; 00076 int opterr; 00077 int optopt; 00078 char *optarg; 00079 00080 /* Internal members. */ 00081 00082 /* True if the internal members have been initialized. */ 00083 int __initialized; 00084 00085 /* The next char to be scanned in the option-element 00086 in which the last option character we returned was found. 00087 This allows us to pick up the scan where we left off. 00088 00089 If this is zero, or a null string, it means resume the scan 00090 by advancing to the next ARGV-element. */ 00091 char *__nextchar; 00092 00093 /* See __ord above. */ 00094 enum __ord __ordering; 00095 00096 /* If the POSIXLY_CORRECT environment variable is set 00097 or getopt was called. */ 00098 int __posixly_correct; 00099 00100 00101 /* Handle permutation of arguments. */ 00102 00103 /* Describe the part of ARGV that contains non-options that have 00104 been skipped. `first_nonopt' is the index in ARGV of the first 00105 of them; `last_nonopt' is the index after the last of them. */ 00106 00107 int __first_nonopt; 00108 int __last_nonopt; 00109 00110 #if defined _LIBC && defined USE_NONOPTION_FLAGS 00111 int __nonoption_flags_max_len; 00112 int __nonoption_flags_len; 00113 # endif 00114 }; 00115 00116 /* The initializer is necessary to set OPTIND and OPTERR to their 00117 default values and to clear the initialization flag. */ 00118 #define _GETOPT_DATA_INITIALIZER { 1, 1 } 00119 00120 extern int _getopt_internal_r (int ___argc, char **___argv, 00121 const char *__shortopts, 00122 const struct option *__longopts, int *__longind, 00123 int __long_only, struct _getopt_data *__data, 00124 int __posixly_correct); 00125 00126 extern int _getopt_long_r (int ___argc, char **___argv, 00127 const char *__shortopts, 00128 const struct option *__longopts, int *__longind, 00129 struct _getopt_data *__data); 00130 00131 extern int _getopt_long_only_r (int ___argc, char **___argv, 00132 const char *__shortopts, 00133 const struct option *__longopts, 00134 int *__longind, 00135 struct _getopt_data *__data); 00136 00137 #endif /* getopt_int.h */