pidgin/getopt.c

changeset 26378
e85d894af8a5
parent 25888
d0fdd378a635
child 37390
209a1350d87f
equal deleted inserted replaced
26377:9124a345ed3a 26378:e85d894af8a5
176 176
177 static enum 177 static enum
178 { 178 {
179 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER 179 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
180 } ordering; 180 } ordering;
181 181
182 #ifdef __GNU_LIBRARY__ 182 #ifdef __GNU_LIBRARY__
183 /* We want to avoid inclusion of string.h with non-GNU libraries 183 /* We want to avoid inclusion of string.h with non-GNU libraries
184 because there are many ways it can cause trouble. 184 because there are many ways it can cause trouble.
185 On some systems, it contains special magic macros that don't work 185 On some systems, it contains special magic macros that don't work
186 in GCC. */ 186 in GCC. */
217 int i; 217 int i;
218 for (i = 0; i < size; i++) 218 for (i = 0; i < size; i++)
219 to[i] = from[i]; 219 to[i] = from[i];
220 } 220 }
221 #endif /* GNU C library. */ 221 #endif /* GNU C library. */
222 222
223 /* Handle permutation of arguments. */ 223 /* Handle permutation of arguments. */
224 224
225 /* Describe the part of ARGV that contains non-options that have 225 /* Describe the part of ARGV that contains non-options that have
226 been skipped. `first_nonopt' is the index in ARGV of the first of them; 226 been skipped. `first_nonopt' is the index in ARGV of the first of them;
227 `last_nonopt' is the index after the last of them. */ 227 `last_nonopt' is the index after the last of them. */
257 /* Update records for the slots the non-options now occupy. */ 257 /* Update records for the slots the non-options now occupy. */
258 258
259 first_nonopt += (optind - last_nonopt); 259 first_nonopt += (optind - last_nonopt);
260 last_nonopt = optind; 260 last_nonopt = optind;
261 } 261 }
262 262
263 /* Scan elements of ARGV (whose length is ARGC) for option characters 263 /* Scan elements of ARGV (whose length is ARGC) for option characters
264 given in OPTSTRING. 264 given in OPTSTRING.
265 265
266 If an element of ARGV starts with '-', and is not exactly "-" or "--", 266 If an element of ARGV starts with '-', and is not exactly "-" or "--",
267 then it is an option element. The characters of this element 267 then it is an option element. The characters of this element
661 (int *) 0, 661 (int *) 0,
662 0); 662 0);
663 } 663 }
664 664
665 #endif /* _LIBC or not __GNU_LIBRARY__. */ 665 #endif /* _LIBC or not __GNU_LIBRARY__. */
666 666
667 #ifdef TEST 667 #ifdef TEST
668 668
669 /* Compile with -DTEST to make an executable for use in testing 669 /* Compile with -DTEST to make an executable for use in testing
670 the above definition of `getopt'. */ 670 the above definition of `getopt'. */
671 671

mercurial