update argtable lib, fix #73

This commit is contained in:
virusdefender 2023-09-06 10:25:02 +08:00
parent 016653cedb
commit b980c77170
2 changed files with 6294 additions and 5322 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,305 +1,273 @@
/******************************************************************************* /*******************************************************************************
* This file is part of the argtable3 library. * argtable3: Declares the main interfaces of the library
* *
* Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann * This file is part of the argtable3 library.
* <sheitmann@users.sourceforge.net> *
* All rights reserved. * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
* * <sheitmann@users.sourceforge.net>
* Redistribution and use in source and binary forms, with or without * All rights reserved.
* modification, are permitted provided that the following conditions are met: *
* * Redistributions of source code must retain the above copyright * Redistribution and use in source and binary forms, with or without
* notice, this list of conditions and the following disclaimer. * modification, are permitted provided that the following conditions are met:
* * Redistributions in binary form must reproduce the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer.
* documentation and/or other materials provided with the distribution. * * Redistributions in binary form must reproduce the above copyright
* * Neither the name of STEWART HEITMANN nor the names of its contributors * notice, this list of conditions and the following disclaimer in the
* may be used to endorse or promote products derived from this software * documentation and/or other materials provided with the distribution.
* without specific prior written permission. * * Neither the name of STEWART HEITMANN nor the names of its contributors
* * may be used to endorse or promote products derived from this software
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * without specific prior written permission.
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* ARE DISCLAIMED. IN NO EVENT SHALL STEWART HEITMANN BE LIABLE FOR ANY DIRECT, * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * ARE DISCLAIMED. IN NO EVENT SHALL STEWART HEITMANN BE LIABLE FOR ANY DIRECT,
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
******************************************************************************/ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ARGTABLE3 ******************************************************************************/
#define ARGTABLE3
#ifndef ARGTABLE3
#include <stdio.h> /* FILE */ #define ARGTABLE3
#include <time.h> /* struct tm */
#include <stdio.h> /* FILE */
#ifdef __cplusplus #include <time.h> /* struct tm */
extern "C" {
#endif #ifdef __cplusplus
extern "C" {
#define ARG_REX_ICASE 1 #endif
/* bit masks for arg_hdr.flag */ #define ARG_REX_ICASE 1
enum #define ARG_DSTR_SIZE 200
{ #define ARG_CMD_NAME_LEN 100
ARG_TERMINATOR=0x1, #define ARG_CMD_DESCRIPTION_LEN 256
ARG_HASVALUE=0x2,
ARG_HASOPTVALUE=0x4 #ifndef ARG_REPLACE_GETOPT
}; #define ARG_REPLACE_GETOPT 1 /* use the embedded getopt as the system getopt(3) */
#endif /* ARG_REPLACE_GETOPT */
typedef void (arg_resetfn)(void *parent);
typedef int (arg_scanfn)(void *parent, const char *argval); /* bit masks for arg_hdr.flag */
typedef int (arg_checkfn)(void *parent); enum { ARG_TERMINATOR = 0x1, ARG_HASVALUE = 0x2, ARG_HASOPTVALUE = 0x4 };
typedef void (arg_errorfn)(void *parent, FILE *fp, int error, const char *argval, const char *progname);
#if defined(_WIN32)
#if defined(argtable3_EXPORTS)
/* #define ARG_EXTERN __declspec(dllexport)
* The arg_hdr struct defines properties that are common to all arg_xxx structs. #elif defined(argtable3_IMPORTS)
* The argtable library requires each arg_xxx struct to have an arg_hdr #define ARG_EXTERN __declspec(dllimport)
* struct as its first data member. #else
* The argtable library functions then use this data to identify the #define ARG_EXTERN
* properties of the command line option, such as its option tags, #endif
* datatype string, and glossary strings, and so on. #else
* Moreover, the arg_hdr struct contains pointers to custom functions that #define ARG_EXTERN
* are provided by each arg_xxx struct which perform the tasks of parsing #endif
* that particular arg_xxx arguments, performing post-parse checks, and
* reporting errors. typedef struct _internal_arg_dstr* arg_dstr_t;
* These functions are private to the individual arg_xxx source code typedef void* arg_cmd_itr_t;
* and are the pointer to them are initiliased by that arg_xxx struct's
* constructor function. The user could alter them after construction typedef void(arg_resetfn)(void* parent);
* if desired, but the original intention is for them to be set by the typedef int(arg_scanfn)(void* parent, const char* argval);
* constructor and left unaltered. typedef int(arg_checkfn)(void* parent);
*/ typedef void(arg_errorfn)(void* parent, arg_dstr_t ds, int error, const char* argval, const char* progname);
struct arg_hdr typedef void(arg_dstr_freefn)(char* buf);
{ typedef int(arg_cmdfn)(int argc, char* argv[], arg_dstr_t res);
char flag; /* Modifier flags: ARG_TERMINATOR, ARG_HASVALUE. */ typedef int(arg_comparefn)(const void* k1, const void* k2);
const char *shortopts; /* String defining the short options */
const char *longopts; /* String defiing the long options */ /*
const char *datatype; /* Description of the argument data type */ * The arg_hdr struct defines properties that are common to all arg_xxx structs.
const char *glossary; /* Description of the option as shown by arg_print_glossary function */ * The argtable library requires each arg_xxx struct to have an arg_hdr
int mincount; /* Minimum number of occurences of this option accepted */ * struct as its first data member.
int maxcount; /* Maximum number of occurences if this option accepted */ * The argtable library functions then use this data to identify the
void *parent; /* Pointer to parent arg_xxx struct */ * properties of the command line option, such as its option tags,
arg_resetfn *resetfn; /* Pointer to parent arg_xxx reset function */ * datatype string, and glossary strings, and so on.
arg_scanfn *scanfn; /* Pointer to parent arg_xxx scan function */ * Moreover, the arg_hdr struct contains pointers to custom functions that
arg_checkfn *checkfn; /* Pointer to parent arg_xxx check function */ * are provided by each arg_xxx struct which perform the tasks of parsing
arg_errorfn *errorfn; /* Pointer to parent arg_xxx error function */ * that particular arg_xxx arguments, performing post-parse checks, and
void *priv; /* Pointer to private header data for use by arg_xxx functions */ * reporting errors.
}; * These functions are private to the individual arg_xxx source code
* and are the pointer to them are initiliased by that arg_xxx struct's
struct arg_rem * constructor function. The user could alter them after construction
{ * if desired, but the original intention is for them to be set by the
struct arg_hdr hdr; /* The mandatory argtable header struct */ * constructor and left unaltered.
}; */
typedef struct arg_hdr {
struct arg_lit char flag; /* Modifier flags: ARG_TERMINATOR, ARG_HASVALUE. */
{ const char* shortopts; /* String defining the short options */
struct arg_hdr hdr; /* The mandatory argtable header struct */ const char* longopts; /* String defiing the long options */
int count; /* Number of matching command line args */ const char* datatype; /* Description of the argument data type */
}; const char* glossary; /* Description of the option as shown by arg_print_glossary function */
int mincount; /* Minimum number of occurences of this option accepted */
struct arg_int int maxcount; /* Maximum number of occurences if this option accepted */
{ void* parent; /* Pointer to parent arg_xxx struct */
struct arg_hdr hdr; /* The mandatory argtable header struct */ arg_resetfn* resetfn; /* Pointer to parent arg_xxx reset function */
int count; /* Number of matching command line args */ arg_scanfn* scanfn; /* Pointer to parent arg_xxx scan function */
int *ival; /* Array of parsed argument values */ arg_checkfn* checkfn; /* Pointer to parent arg_xxx check function */
}; arg_errorfn* errorfn; /* Pointer to parent arg_xxx error function */
void* priv; /* Pointer to private header data for use by arg_xxx functions */
struct arg_dbl } arg_hdr_t;
{
struct arg_hdr hdr; /* The mandatory argtable header struct */ typedef struct arg_rem {
int count; /* Number of matching command line args */ struct arg_hdr hdr; /* The mandatory argtable header struct */
double *dval; /* Array of parsed argument values */ } arg_rem_t;
};
typedef struct arg_lit {
struct arg_str struct arg_hdr hdr; /* The mandatory argtable header struct */
{ int count; /* Number of matching command line args */
struct arg_hdr hdr; /* The mandatory argtable header struct */ } arg_lit_t;
int count; /* Number of matching command line args */
const char **sval; /* Array of parsed argument values */ typedef struct arg_int {
}; struct arg_hdr hdr; /* The mandatory argtable header struct */
int count; /* Number of matching command line args */
struct arg_rex int* ival; /* Array of parsed argument values */
{ } arg_int_t;
struct arg_hdr hdr; /* The mandatory argtable header struct */
int count; /* Number of matching command line args */ typedef struct arg_dbl {
const char **sval; /* Array of parsed argument values */ struct arg_hdr hdr; /* The mandatory argtable header struct */
}; int count; /* Number of matching command line args */
double* dval; /* Array of parsed argument values */
struct arg_file } arg_dbl_t;
{
struct arg_hdr hdr; /* The mandatory argtable header struct */ typedef struct arg_str {
int count; /* Number of matching command line args*/ struct arg_hdr hdr; /* The mandatory argtable header struct */
const char **filename; /* Array of parsed filenames (eg: /home/foo.bar) */ int count; /* Number of matching command line args */
const char **basename; /* Array of parsed basenames (eg: foo.bar) */ const char** sval; /* Array of parsed argument values */
const char **extension; /* Array of parsed extensions (eg: .bar) */ } arg_str_t;
};
typedef struct arg_rex {
struct arg_date struct arg_hdr hdr; /* The mandatory argtable header struct */
{ int count; /* Number of matching command line args */
struct arg_hdr hdr; /* The mandatory argtable header struct */ const char** sval; /* Array of parsed argument values */
const char *format; /* strptime format string used to parse the date */ } arg_rex_t;
int count; /* Number of matching command line args */
struct tm *tmval; /* Array of parsed time values */ typedef struct arg_file {
}; struct arg_hdr hdr; /* The mandatory argtable header struct */
int count; /* Number of matching command line args*/
enum {ARG_ELIMIT=1, ARG_EMALLOC, ARG_ENOMATCH, ARG_ELONGOPT, ARG_EMISSARG}; const char** filename; /* Array of parsed filenames (eg: /home/foo.bar) */
struct arg_end const char** basename; /* Array of parsed basenames (eg: foo.bar) */
{ const char** extension; /* Array of parsed extensions (eg: .bar) */
struct arg_hdr hdr; /* The mandatory argtable header struct */ } arg_file_t;
int count; /* Number of errors encountered */
int *error; /* Array of error codes */ typedef struct arg_date {
void **parent; /* Array of pointers to offending arg_xxx struct */ struct arg_hdr hdr; /* The mandatory argtable header struct */
const char **argval; /* Array of pointers to offending argv[] string */ const char* format; /* strptime format string used to parse the date */
}; int count; /* Number of matching command line args */
struct tm* tmval; /* Array of parsed time values */
} arg_date_t;
/**** arg_xxx constructor functions *********************************/
enum { ARG_ELIMIT = 1, ARG_EMALLOC, ARG_ENOMATCH, ARG_ELONGOPT, ARG_EMISSARG };
struct arg_rem* arg_rem(const char* datatype, const char* glossary); typedef struct arg_end {
struct arg_hdr hdr; /* The mandatory argtable header struct */
struct arg_lit* arg_lit0(const char* shortopts, int count; /* Number of errors encountered */
const char* longopts, int* error; /* Array of error codes */
const char* glossary); void** parent; /* Array of pointers to offending arg_xxx struct */
struct arg_lit* arg_lit1(const char* shortopts, const char** argval; /* Array of pointers to offending argv[] string */
const char* longopts, } arg_end_t;
const char *glossary);
struct arg_lit* arg_litn(const char* shortopts, typedef struct arg_cmd_info {
const char* longopts, char name[ARG_CMD_NAME_LEN];
int mincount, char description[ARG_CMD_DESCRIPTION_LEN];
int maxcount, arg_cmdfn* proc;
const char *glossary); } arg_cmd_info_t;
struct arg_key* arg_key0(const char* keyword, /**** arg_xxx constructor functions *********************************/
int flags,
const char* glossary); ARG_EXTERN struct arg_rem* arg_rem(const char* datatype, const char* glossary);
struct arg_key* arg_key1(const char* keyword,
int flags, ARG_EXTERN struct arg_lit* arg_lit0(const char* shortopts, const char* longopts, const char* glossary);
const char* glossary); ARG_EXTERN struct arg_lit* arg_lit1(const char* shortopts, const char* longopts, const char* glossary);
struct arg_key* arg_keyn(const char* keyword, ARG_EXTERN struct arg_lit* arg_litn(const char* shortopts, const char* longopts, int mincount, int maxcount, const char* glossary);
int flags,
int mincount, ARG_EXTERN struct arg_int* arg_int0(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
int maxcount, ARG_EXTERN struct arg_int* arg_int1(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* glossary); ARG_EXTERN struct arg_int* arg_intn(const char* shortopts, const char* longopts, const char* datatype, int mincount, int maxcount, const char* glossary);
struct arg_int* arg_int0(const char* shortopts, ARG_EXTERN struct arg_dbl* arg_dbl0(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* longopts, ARG_EXTERN struct arg_dbl* arg_dbl1(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* datatype, ARG_EXTERN struct arg_dbl* arg_dbln(const char* shortopts, const char* longopts, const char* datatype, int mincount, int maxcount, const char* glossary);
const char* glossary);
struct arg_int* arg_int1(const char* shortopts, ARG_EXTERN struct arg_str* arg_str0(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* longopts, ARG_EXTERN struct arg_str* arg_str1(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* datatype, ARG_EXTERN struct arg_str* arg_strn(const char* shortopts, const char* longopts, const char* datatype, int mincount, int maxcount, const char* glossary);
const char *glossary);
struct arg_int* arg_intn(const char* shortopts, ARG_EXTERN struct arg_rex* arg_rex0(const char* shortopts, const char* longopts, const char* pattern, const char* datatype, int flags, const char* glossary);
const char* longopts, ARG_EXTERN struct arg_rex* arg_rex1(const char* shortopts, const char* longopts, const char* pattern, const char* datatype, int flags, const char* glossary);
const char *datatype, ARG_EXTERN struct arg_rex* arg_rexn(const char* shortopts,
int mincount, const char* longopts,
int maxcount, const char* pattern,
const char *glossary); const char* datatype,
int mincount,
struct arg_dbl* arg_dbl0(const char* shortopts, int maxcount,
const char* longopts, int flags,
const char* datatype, const char* glossary);
const char* glossary);
struct arg_dbl* arg_dbl1(const char* shortopts, ARG_EXTERN struct arg_file* arg_file0(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* longopts, ARG_EXTERN struct arg_file* arg_file1(const char* shortopts, const char* longopts, const char* datatype, const char* glossary);
const char* datatype, ARG_EXTERN struct arg_file* arg_filen(const char* shortopts, const char* longopts, const char* datatype, int mincount, int maxcount, const char* glossary);
const char *glossary);
struct arg_dbl* arg_dbln(const char* shortopts, ARG_EXTERN struct arg_date* arg_date0(const char* shortopts, const char* longopts, const char* format, const char* datatype, const char* glossary);
const char* longopts, ARG_EXTERN struct arg_date* arg_date1(const char* shortopts, const char* longopts, const char* format, const char* datatype, const char* glossary);
const char *datatype, ARG_EXTERN struct arg_date* arg_daten(const char* shortopts, const char* longopts, const char* format, const char* datatype, int mincount, int maxcount, const char* glossary);
int mincount,
int maxcount, ARG_EXTERN struct arg_end* arg_end(int maxcount);
const char *glossary);
#define ARG_DSTR_STATIC ((arg_dstr_freefn*)0)
struct arg_str* arg_str0(const char* shortopts, #define ARG_DSTR_VOLATILE ((arg_dstr_freefn*)1)
const char* longopts, #define ARG_DSTR_DYNAMIC ((arg_dstr_freefn*)3)
const char* datatype,
const char* glossary); /**** other functions *******************************************/
struct arg_str* arg_str1(const char* shortopts, ARG_EXTERN int arg_nullcheck(void** argtable);
const char* longopts, ARG_EXTERN int arg_parse(int argc, char** argv, void** argtable);
const char* datatype, ARG_EXTERN void arg_print_option(FILE* fp, const char* shortopts, const char* longopts, const char* datatype, const char* suffix);
const char *glossary); ARG_EXTERN void arg_print_syntax(FILE* fp, void** argtable, const char* suffix);
struct arg_str* arg_strn(const char* shortopts, ARG_EXTERN void arg_print_syntaxv(FILE* fp, void** argtable, const char* suffix);
const char* longopts, ARG_EXTERN void arg_print_glossary(FILE* fp, void** argtable, const char* format);
const char* datatype, ARG_EXTERN void arg_print_glossary_gnu(FILE* fp, void** argtable);
int mincount, ARG_EXTERN void arg_print_errors(FILE* fp, struct arg_end* end, const char* progname);
int maxcount, ARG_EXTERN void arg_print_option_ds(arg_dstr_t ds, const char* shortopts, const char* longopts, const char* datatype, const char* suffix);
const char *glossary); ARG_EXTERN void arg_print_syntax_ds(arg_dstr_t ds, void** argtable, const char* suffix);
ARG_EXTERN void arg_print_syntaxv_ds(arg_dstr_t ds, void** argtable, const char* suffix);
struct arg_rex* arg_rex0(const char* shortopts, ARG_EXTERN void arg_print_glossary_ds(arg_dstr_t ds, void** argtable, const char* format);
const char* longopts, ARG_EXTERN void arg_print_glossary_gnu_ds(arg_dstr_t ds, void** argtable);
const char* pattern, ARG_EXTERN void arg_print_errors_ds(arg_dstr_t ds, struct arg_end* end, const char* progname);
const char* datatype, ARG_EXTERN void arg_freetable(void** argtable, size_t n);
int flags,
const char* glossary); ARG_EXTERN arg_dstr_t arg_dstr_create(void);
struct arg_rex* arg_rex1(const char* shortopts, ARG_EXTERN void arg_dstr_destroy(arg_dstr_t ds);
const char* longopts, ARG_EXTERN void arg_dstr_reset(arg_dstr_t ds);
const char* pattern, ARG_EXTERN void arg_dstr_free(arg_dstr_t ds);
const char* datatype, ARG_EXTERN void arg_dstr_set(arg_dstr_t ds, char* str, arg_dstr_freefn* free_proc);
int flags, ARG_EXTERN void arg_dstr_cat(arg_dstr_t ds, const char* str);
const char *glossary); ARG_EXTERN void arg_dstr_catc(arg_dstr_t ds, char c);
struct arg_rex* arg_rexn(const char* shortopts, ARG_EXTERN void arg_dstr_catf(arg_dstr_t ds, const char* fmt, ...);
const char* longopts, ARG_EXTERN char* arg_dstr_cstr(arg_dstr_t ds);
const char* pattern,
const char* datatype, ARG_EXTERN void arg_cmd_init(void);
int mincount, ARG_EXTERN void arg_cmd_uninit(void);
int maxcount, ARG_EXTERN void arg_cmd_register(const char* name, arg_cmdfn* proc, const char* description);
int flags, ARG_EXTERN void arg_cmd_unregister(const char* name);
const char *glossary); ARG_EXTERN int arg_cmd_dispatch(const char* name, int argc, char* argv[], arg_dstr_t res);
ARG_EXTERN unsigned int arg_cmd_count(void);
struct arg_file* arg_file0(const char* shortopts, ARG_EXTERN arg_cmd_info_t* arg_cmd_info(const char* name);
const char* longopts, ARG_EXTERN arg_cmd_itr_t arg_cmd_itr_create(void);
const char* datatype, ARG_EXTERN void arg_cmd_itr_destroy(arg_cmd_itr_t itr);
const char* glossary); ARG_EXTERN int arg_cmd_itr_advance(arg_cmd_itr_t itr);
struct arg_file* arg_file1(const char* shortopts, ARG_EXTERN char* arg_cmd_itr_key(arg_cmd_itr_t itr);
const char* longopts, ARG_EXTERN arg_cmd_info_t* arg_cmd_itr_value(arg_cmd_itr_t itr);
const char* datatype, ARG_EXTERN int arg_cmd_itr_search(arg_cmd_itr_t itr, void* k);
const char *glossary); ARG_EXTERN void arg_mgsort(void* data, int size, int esize, int i, int k, arg_comparefn* comparefn);
struct arg_file* arg_filen(const char* shortopts, ARG_EXTERN void arg_make_get_help_msg(arg_dstr_t res);
const char* longopts, ARG_EXTERN void arg_make_help_msg(arg_dstr_t ds, char* cmd_name, void** argtable);
const char* datatype, ARG_EXTERN void arg_make_syntax_err_msg(arg_dstr_t ds, void** argtable, struct arg_end* end);
int mincount, ARG_EXTERN int arg_make_syntax_err_help_msg(arg_dstr_t ds, char* name, int help, int nerrors, void** argtable, struct arg_end* end, int* exitcode);
int maxcount, ARG_EXTERN void arg_set_module_name(const char* name);
const char *glossary); ARG_EXTERN void arg_set_module_version(int major, int minor, int patch, const char* tag);
struct arg_date* arg_date0(const char* shortopts, /**** deprecated functions, for back-compatibility only ********/
const char* longopts, ARG_EXTERN void arg_free(void** argtable);
const char* format,
const char* datatype, #ifdef __cplusplus
const char* glossary); }
struct arg_date* arg_date1(const char* shortopts, #endif
const char* longopts, #endif
const char* format,
const char* datatype,
const char *glossary);
struct arg_date* arg_daten(const char* shortopts,
const char* longopts,
const char* format,
const char* datatype,
int mincount,
int maxcount,
const char *glossary);
struct arg_end* arg_end(int maxerrors);
/**** other functions *******************************************/
int arg_nullcheck(void **argtable);
int arg_parse(int argc, char **argv, void **argtable);
void arg_print_option(FILE *fp, const char *shortopts, const char *longopts, const char *datatype, const char *suffix);
void arg_print_syntax(FILE *fp, void **argtable, const char *suffix);
void arg_print_syntaxv(FILE *fp, void **argtable, const char *suffix);
void arg_print_glossary(FILE *fp, void **argtable, const char *format);
void arg_print_glossary_gnu(FILE *fp, void **argtable);
void arg_print_errors(FILE* fp, struct arg_end* end, const char* progname);
void arg_freetable(void **argtable, size_t n);
/**** deprecated functions, for back-compatibility only ********/
void arg_free(void **argtable);
#ifdef __cplusplus
}
#endif
#endif