Blame gnulib/lib/getopt_int.h

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