|
Packit |
6bd9ab |
/*
|
|
Packit |
6bd9ab |
getopt_long.h - definition of getopt_long() for systems that lack it
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
Copyright (C) 2001, 2002, 2008, 2010, 2012 Arthur de Jong
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
This library is free software; you can redistribute it and/or
|
|
Packit |
6bd9ab |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
License as published by the Free Software Foundation; either
|
|
Packit |
6bd9ab |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
This library is distributed in the hope that it will be useful,
|
|
Packit |
6bd9ab |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6bd9ab |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6bd9ab |
Lesser General Public License for more details.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
License along with this library; if not, write to the Free Software
|
|
Packit |
6bd9ab |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit |
6bd9ab |
02110-1301 USA
|
|
Packit |
6bd9ab |
*/
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#ifndef COMPAT__GETOPT_LONG_H
|
|
Packit |
6bd9ab |
#define COMPAT__GETOPT_LONG_H 1
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#ifndef HAVE_GETOPT_LONG
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#define no_argument 0
|
|
Packit |
6bd9ab |
#define required_argument 1
|
|
Packit |
6bd9ab |
#define optional_argument 2
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
struct option {
|
|
Packit |
6bd9ab |
const char *name;
|
|
Packit |
6bd9ab |
int has_arg;
|
|
Packit |
6bd9ab |
int *flag;
|
|
Packit |
6bd9ab |
int val;
|
|
Packit |
6bd9ab |
};
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* this is a (poor) getopt_long() replacement for systems that don't have it
|
|
Packit |
6bd9ab |
(this is generaly a GNU extention)
|
|
Packit |
6bd9ab |
this implementation is by no meens flawless, especialy the optional arguments
|
|
Packit |
6bd9ab |
to options and options following filenames is not quite right, allso
|
|
Packit |
6bd9ab |
minimal error checking
|
|
Packit |
6bd9ab |
*/
|
|
Packit |
6bd9ab |
int getopt_long(int argc, char *const argv[],
|
|
Packit |
6bd9ab |
const char *optstring,
|
|
Packit |
6bd9ab |
const struct option *longopts, int *longindex);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#endif /* not HAVE_GETOPT_LONG */
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#endif /* COMPAT__GETOPT_LONG_H */
|