Path: blob/devel/elmergrid/src/metis-5.1.0/GKlib/gk_getopt.h
3206 views
/*!1\file gk_getopt.h2\brief This file contains GNU's externs/structs/prototypes34\date Started 3/27/20075\author George6\version\verbatim $Id: gk_getopt.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim7*/89#ifndef _GK_GETOPT_H_10#define _GK_GETOPT_H_111213/* Externals from getopt.c */14extern char *gk_optarg;15extern int gk_optind;16extern int gk_opterr;17extern int gk_optopt;181920/*! \brief The structure that stores the information about the command-line options2122This structure describes a single long option name for the sake of23gk_getopt_long(). The argument <tt>long_options</tt> must be an array24of these structures, one for each long option. Terminate the array with25an element containing all zeros.26*/27struct gk_option {28char *name; /*!< This field is the name of the option. */29int has_arg; /*!< This field says whether the option takes an argument.30It is an integer, and there are three legitimate values:31no_argument, required_argument and optional_argument.32*/33int *flag; /*!< See the discussion on ::gk_option#val */34int val; /*!< These fields control how to report or act on the option35when it occurs.3637If flag is a null pointer, then the val is a value which38identifies this option. Often these values are chosen39to uniquely identify particular long options.4041If flag is not a null pointer, it should be the address42of an int variable which is the flag for this option.43The value in val is the value to store in the flag to44indicate that the option was seen. */45};4647/* Names for the values of the `has_arg' field of `struct gk_option'. */48#define no_argument 049#define required_argument 150#define optional_argument 2515253/* Function prototypes */54#ifndef __MINGW32__55extern int gk_getopt(int __argc, char **__argv, char *__shortopts);56extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,57struct gk_option *__longopts, int *__longind);58extern int gk_getopt_long_only (int __argc, char **__argv,59char *__shortopts, struct gk_option *__longopts, int *__longind);60#endif61626364#endif65666768