Blame posix/bits/getopt_core.h

Packit Service 82fcde
/* Declarations for getopt (basic, portable features only).
Packit Service 82fcde
   Copyright (C) 1989-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library and is also part of gnulib.
Packit Service 82fcde
   Patches to this file should be submitted to both projects.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _GETOPT_CORE_H
Packit Service 82fcde
#define _GETOPT_CORE_H 1
Packit Service 82fcde
Packit Service 82fcde
/* This header should not be used directly; include getopt.h or
Packit Service 82fcde
   unistd.h instead.  Unlike most bits headers, it does not have
Packit Service 82fcde
   a protective #error, because the guard macro for getopt.h in
Packit Service 82fcde
   gnulib is not fixed.  */
Packit Service 82fcde
Packit Service 82fcde
__BEGIN_DECLS
Packit Service 82fcde
Packit Service 82fcde
/* For communication from 'getopt' to the caller.
Packit Service 82fcde
   When 'getopt' finds an option that takes an argument,
Packit Service 82fcde
   the argument value is returned here.
Packit Service 82fcde
   Also, when 'ordering' is RETURN_IN_ORDER,
Packit Service 82fcde
   each non-option ARGV-element is returned here.  */
Packit Service 82fcde
Packit Service 82fcde
extern char *optarg;
Packit Service 82fcde
Packit Service 82fcde
/* Index in ARGV of the next element to be scanned.
Packit Service 82fcde
   This is used for communication to and from the caller
Packit Service 82fcde
   and for communication between successive calls to 'getopt'.
Packit Service 82fcde
Packit Service 82fcde
   On entry to 'getopt', zero means this is the first call; initialize.
Packit Service 82fcde
Packit Service 82fcde
   When 'getopt' returns -1, this is the index of the first of the
Packit Service 82fcde
   non-option elements that the caller should itself scan.
Packit Service 82fcde
Packit Service 82fcde
   Otherwise, 'optind' communicates from one call to the next
Packit Service 82fcde
   how much of ARGV has been scanned so far.  */
Packit Service 82fcde
Packit Service 82fcde
extern int optind;
Packit Service 82fcde
Packit Service 82fcde
/* Callers store zero here to inhibit the error message 'getopt' prints
Packit Service 82fcde
   for unrecognized options.  */
Packit Service 82fcde
Packit Service 82fcde
extern int opterr;
Packit Service 82fcde
Packit Service 82fcde
/* Set to an option character which was unrecognized.  */
Packit Service 82fcde
Packit Service 82fcde
extern int optopt;
Packit Service 82fcde
Packit Service 82fcde
/* Get definitions and prototypes for functions to process the
Packit Service 82fcde
   arguments in ARGV (ARGC of them, minus the program name) for
Packit Service 82fcde
   options given in OPTS.
Packit Service 82fcde
Packit Service 82fcde
   Return the option character from OPTS just read.  Return -1 when
Packit Service 82fcde
   there are no more options.  For unrecognized options, or options
Packit Service 82fcde
   missing arguments, 'optopt' is set to the option letter, and '?' is
Packit Service 82fcde
   returned.
Packit Service 82fcde
Packit Service 82fcde
   The OPTS string is a list of characters which are recognized option
Packit Service 82fcde
   letters, optionally followed by colons, specifying that that letter
Packit Service 82fcde
   takes an argument, to be placed in 'optarg'.
Packit Service 82fcde
Packit Service 82fcde
   If a letter in OPTS is followed by two colons, its argument is
Packit Service 82fcde
   optional.  This behavior is specific to the GNU 'getopt'.
Packit Service 82fcde
Packit Service 82fcde
   The argument '--' causes premature termination of argument
Packit Service 82fcde
   scanning, explicitly telling 'getopt' that there are no more
Packit Service 82fcde
   options.
Packit Service 82fcde
Packit Service 82fcde
   If OPTS begins with '-', then non-option arguments are treated as
Packit Service 82fcde
   arguments to the option '\1'.  This behavior is specific to the GNU
Packit Service 82fcde
   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
Packit Service 82fcde
   the environment, then do not permute arguments.
Packit Service 82fcde
Packit Service 82fcde
   For standards compliance, the 'argv' argument has the type
Packit Service 82fcde
   char *const *, but this is inaccurate; if argument permutation is
Packit Service 82fcde
   enabled, the argv array (not the strings it points to) must be
Packit Service 82fcde
   writable.  */
Packit Service 82fcde
Packit Service 82fcde
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
Packit Service 82fcde
       __THROW __nonnull ((2, 3));
Packit Service 82fcde
Packit Service 82fcde
__END_DECLS
Packit Service 82fcde
Packit Service 82fcde
#endif /* getopt_core.h */