33typedef struct Clp_ParserState Clp_ParserState;
59#define Clp_ValString 1
61#define Clp_ValStringNotOption 2
77#define Clp_ValUnsigned 5
86#define Clp_ValUnsignedLong 7
88#define Clp_ValDouble 8
91#define Clp_ValStringDashTerimnated 9
93#define Clp_ValFirstUser 10
101#define Clp_Mandatory (1<<0)
107#define Clp_Optional (1<<1)
109#define Clp_Negate (1<<2)
113#define Clp_OnlyNegated (1<<3)
119#define Clp_PreferredMatch (1<<4)
130#define Clp_Short (1<<0)
132#define Clp_Long (1<<1)
134#define Clp_ShortNegated (1<<2)
136#define Clp_LongNegated (1<<3)
138#define Clp_LongImplicit (1<<4)
143#define Clp_NotOption 0
147#define Clp_BadOption -2
152#define Clp_ValSize 40
154#define Clp_ValIntSize 10
166 int complain,
void *user_data);
197#ifdef HAVE_INT64_TYPES
212 struct Clp_Internal *internal;
217# define CLP_SENTINEL __attribute__((sentinel))
261#define Clp_DisallowOptions (1<<0)
265#define Clp_DashTerminated (1<<1)
272#define Clp_AllowNumbers (1<<0)
276#define Clp_StringListLong (1<<1)
281 int nstrs,
const char *
const *strs,
314 const
char* format, va_list val);
#define Clp_ValIntSize
Minimum size of the Clp_Parser val.is field.
Definition clp.h:154
int Clp_SetOptions(Clp_Parser *clp, int nopt, const Clp_Option *opt)
Set clp's option definitions.
Definition clp.c:783
void Clp_SetArguments(Clp_Parser *clp, int argc, const char *const *argv)
Set clp's arguments.
Definition clp.c:869
int Clp_OptionChar(Clp_Parser *clp, int c)
Return clp's treatment of character c.
Definition clp.c:650
int Clp_vfprintf(Clp_Parser *clp, FILE *f, const char *format, va_list val)
Print a message.
Definition clp.c:2318
Clp_Parser * Clp_NewParser(int argc, const char *const *argv, int nopt, const Clp_Option *opt)
Create a new Clp_Parser.
Definition clp.c:501
void Clp_RestoreParser(Clp_Parser *clp, const Clp_ParserState *state)
Restore parser state from state into clp.
Definition clp.c:1517
int Clp_AddStringListType(Clp_Parser *clp, int val_type, int flags,...) CLP_SENTINEL
Define a new string list value type for clp.
Definition clp.c:1287
void(* Clp_ErrorHandler)(Clp_Parser *clp, const char *message)
A function for reporting option errors.
Definition clp.h:172
int Clp_SetOptionProcessing(Clp_Parser *clp, int on)
Set whether clp is searching for options.
Definition clp.c:892
#define Clp_ValSize
Minimum size of the Clp_Parser val.cs field.
Definition clp.h:152
const char * Clp_SetProgramName(Clp_Parser *clp, const char *name)
Set clp's program name.
Definition clp.c:1422
int Clp_SetOptionChar(Clp_Parser *clp, int c, int type)
Set clp's treatment of character c.
Definition clp.c:708
int Clp_OptionError(Clp_Parser *clp, const char *format,...)
Report a parser error.
Definition clp.c:2269
int Clp_AddStringListTypeVec(Clp_Parser *clp, int val_type, int flags, int nstrs, const char *const *strs, const int *vals)
Define a new string list value type for clp.
Definition clp.c:1376
const char * Clp_CurOptionName(Clp_Parser *clp)
Extract the current option as a string.
Definition clp.c:2468
const char * Clp_Shift(Clp_Parser *clp, int allow_options)
Return the next argument from clp without option parsing.
Definition clp.c:1988
int Clp_CurOptionNameBuf(Clp_Parser *clp, char *buf, int len)
Extract the current option as a string.
Definition clp.c:2430
void Clp_SaveParser(const Clp_Parser *clp, Clp_ParserState *state)
Save clp's current state in state.
Definition clp.c:1484
int Clp_IsShort(Clp_Parser *clp, int short_name)
Test if the current option had short name name.
Definition clp.c:2484
int Clp_AddType(Clp_Parser *clp, int val_type, int flags, Clp_ValParseFunc parser, void *user_data)
Define a new value type for clp.
Definition clp.c:1041
const char * Clp_ProgramName(Clp_Parser *clp)
Return clp's program name.
Definition clp.c:1410
int(* Clp_ValParseFunc)(Clp_Parser *clp, const char *vstr, int complain, void *user_data)
A value parsing function.
Definition clp.h:165
int Clp_Next(Clp_Parser *clp)
Parse and return the next argument from clp.
Definition clp.c:1840
Clp_ParserState * Clp_NewParserState(void)
Create a new Clp_ParserState.
Definition clp.c:1450
int Clp_fprintf(Clp_Parser *clp, FILE *f, const char *format,...)
Print a message.
Definition clp.c:2293
void Clp_DeleteParserState(Clp_ParserState *state)
Destroy a Clp_ParserState object.
Definition clp.c:1474
int Clp_vsnprintf(Clp_Parser *clp, char *str, size_t size, const char *format, va_list val)
Format a message.
Definition clp.c:2344
Clp_ErrorHandler Clp_SetErrorHandler(Clp_Parser *clp, Clp_ErrorHandler errh)
Set clp's error handler function.
int Clp_IsLong(Clp_Parser *clp, const char *long_name)
Test if the current option had long name name.
Definition clp.c:2476
void Clp_DeleteParser(Clp_Parser *clp)
Destroy a Clp_Parser object.
Definition clp.c:577
int Clp_SetUTF8(Clp_Parser *clp, int utf8)
Set clp's UTF-8 mode.
Definition clp.c:633
Option description.
Definition clp.h:41
int val_type
Definition clp.h:48
int flags
Definition clp.h:50
int option_id
Definition clp.h:46
int short_name
Definition clp.h:44
const char * long_name
Definition clp.h:42
Command line parser.
Definition clp.h:180
int have_val
Definition clp.h:185
const char * vstr
Definition clp.h:186
void * user_data
Definition clp.h:209
const Clp_Option * option
Definition clp.h:181
int negated
Definition clp.h:183