Blame lib/getopt_int.h

Packit Service c30d13
/* Internal declarations for getopt.
Packit Service c30d13
   Copyright (C) 1989-2018 Free Software Foundation, Inc.
Packit Service c30d13
   This file is part of the GNU C Library and is also part of gnulib.
Packit Service c30d13
   Patches to this file should be submitted to both projects.
Packit Service c30d13
Packit Service c30d13
   The GNU C Library is free software; you can redistribute it and/or
Packit Service c30d13
   modify it under the terms of the GNU General Public
Packit Service c30d13
   License as published by the Free Software Foundation; either
Packit Service c30d13
   version 3 of the License, or (at your option) any later version.
Packit Service c30d13
Packit Service c30d13
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service c30d13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service c30d13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service c30d13
   General Public License for more details.
Packit Service c30d13
Packit Service c30d13
   You should have received a copy of the GNU General Public
Packit Service c30d13
   License along with the GNU C Library; if not, see
Packit Service c30d13
   <https://www.gnu.org/licenses/>.  */
Packit Service c30d13
Packit Service c30d13
#ifndef _GETOPT_INT_H
Packit Service c30d13
#define _GETOPT_INT_H	1
Packit Service c30d13
Packit Service c30d13
#include <getopt.h>
Packit Service c30d13
Packit Service c30d13
extern int _getopt_internal (int ___argc, char **___argv,
Packit Service c30d13
			     const char *__shortopts,
Packit Service c30d13
			     const struct option *__longopts, int *__longind,
Packit Service c30d13
			     int __long_only, int __posixly_correct);
Packit Service c30d13
Packit Service c30d13

Packit Service c30d13
/* Reentrant versions which can handle parsing multiple argument
Packit Service c30d13
   vectors at the same time.  */
Packit Service c30d13
Packit Service c30d13
/* Describe how to deal with options that follow non-option ARGV-elements.
Packit Service c30d13
Packit Service c30d13
   REQUIRE_ORDER means don't recognize them as options; stop option
Packit Service c30d13
   processing when the first non-option is seen.  This is what POSIX
Packit Service c30d13
   specifies should happen.
Packit Service c30d13
Packit Service c30d13
   PERMUTE means permute the contents of ARGV as we scan, so that
Packit Service c30d13
   eventually all the non-options are at the end.  This allows options
Packit Service c30d13
   to be given in any order, even with programs that were not written
Packit Service c30d13
   to expect this.
Packit Service c30d13
Packit Service c30d13
   RETURN_IN_ORDER is an option available to programs that were
Packit Service c30d13
   written to expect options and other ARGV-elements in any order
Packit Service c30d13
   and that care about the ordering of the two.  We describe each
Packit Service c30d13
   non-option ARGV-element as if it were the argument of an option
Packit Service c30d13
   with character code 1.
Packit Service c30d13
Packit Service c30d13
   The special argument '--' forces an end of option-scanning regardless
Packit Service c30d13
   of the value of 'ordering'.  In the case of RETURN_IN_ORDER, only
Packit Service c30d13
   '--' can cause 'getopt' to return -1 with 'optind' != ARGC.  */
Packit Service c30d13
Packit Service c30d13
enum __ord
Packit Service c30d13
  {
Packit Service c30d13
    REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
Packit Service c30d13
  };
Packit Service c30d13
Packit Service c30d13
/* Data type for reentrant functions.  */
Packit Service c30d13
struct _getopt_data
Packit Service c30d13
{
Packit Service c30d13
  /* These have exactly the same meaning as the corresponding global
Packit Service c30d13
     variables, except that they are used for the reentrant
Packit Service c30d13
     versions of getopt.  */
Packit Service c30d13
  int optind;
Packit Service c30d13
  int opterr;
Packit Service c30d13
  int optopt;
Packit Service c30d13
  char *optarg;
Packit Service c30d13
Packit Service c30d13
  /* Internal members.  */
Packit Service c30d13
Packit Service c30d13
  /* True if the internal members have been initialized.  */
Packit Service c30d13
  int __initialized;
Packit Service c30d13
Packit Service c30d13
  /* The next char to be scanned in the option-element
Packit Service c30d13
     in which the last option character we returned was found.
Packit Service c30d13
     This allows us to pick up the scan where we left off.
Packit Service c30d13
Packit Service c30d13
     If this is zero, or a null string, it means resume the scan
Packit Service c30d13
     by advancing to the next ARGV-element.  */
Packit Service c30d13
  char *__nextchar;
Packit Service c30d13
Packit Service c30d13
  /* See __ord above.  */
Packit Service c30d13
  enum __ord __ordering;
Packit Service c30d13
Packit Service c30d13
  /* Handle permutation of arguments.  */
Packit Service c30d13
Packit Service c30d13
  /* Describe the part of ARGV that contains non-options that have
Packit Service c30d13
     been skipped.  'first_nonopt' is the index in ARGV of the first
Packit Service c30d13
     of them; 'last_nonopt' is the index after the last of them.  */
Packit Service c30d13
Packit Service c30d13
  int __first_nonopt;
Packit Service c30d13
  int __last_nonopt;
Packit Service c30d13
};
Packit Service c30d13
Packit Service c30d13
/* The initializer is necessary to set OPTIND and OPTERR to their
Packit Service c30d13
   default values and to clear the initialization flag.  */
Packit Service c30d13
#define _GETOPT_DATA_INITIALIZER	{ 1, 1 }
Packit Service c30d13
Packit Service c30d13
extern int _getopt_internal_r (int ___argc, char **___argv,
Packit Service c30d13
			       const char *__shortopts,
Packit Service c30d13
			       const struct option *__longopts, int *__longind,
Packit Service c30d13
			       int __long_only, struct _getopt_data *__data,
Packit Service c30d13
			       int __posixly_correct);
Packit Service c30d13
Packit Service c30d13
extern int _getopt_long_r (int ___argc, char **___argv,
Packit Service c30d13
			   const char *__shortopts,
Packit Service c30d13
			   const struct option *__longopts, int *__longind,
Packit Service c30d13
			   struct _getopt_data *__data);
Packit Service c30d13
Packit Service c30d13
extern int _getopt_long_only_r (int ___argc, char **___argv,
Packit Service c30d13
				const char *__shortopts,
Packit Service c30d13
				const struct option *__longopts,
Packit Service c30d13
				int *__longind,
Packit Service c30d13
				struct _getopt_data *__data);
Packit Service c30d13
Packit Service c30d13
#endif /* getopt_int.h */