ocssw
V2022
|
argpar.h
Go to the documentation of this file.
330 #define ARGPAR_KEY_HELP_EXTRA -7 /* After all other documentation; text is NULL for this key. */
459 int argpar_parse_args(argpar *p, unsigned argc, char *argv[], unsigned flags, unsigned *end_index, void *input);
int * argpar_split_int(char *str, const char *delim)
Splits a string on a delimiter, returning a NULL_INT-terminated list of ints.
Definition: argpar.c:785
Master structure containing options, document strings, child parsers, and text filters....
Definition: argpar.h:398
double argv_as_dbl
value part of key=value pair, parsed as a double, if OPTION_DBL was used.
Definition: argpar.h:251
int(* argpar_parser)(int key, char *argv, argpar_state *state)
Pointer to a callback function to call for each argument and option parsed.
Definition: argpar.h:360
int argpar_usage(argpar_state *state)
Print usage summary, called within a argpar_parser.
Definition: argpar-help.c:506
const argpar_option * options
Array of option structures, terminated by an empty entry (IE: {0}).
Definition: argpar.h:400
unsigned parfile_buffer_count
Used internally to store the number of parfiles parsed. Initialize to zero.
Definition: argpar.h:417
const char * argpar_program_version
Used as the program version string. If set, a version=1 option is automatically added....
Definition: leveltwo2csv-main.c:98
int argpar_usage_default_json(argpar *argpar)
Print the default usage summary with all available sections, in a format more suitable for automated ...
Definition: argpar-json.c:417
unsigned next
The index in ARGV of the next arg that to be parsed. May be modified.
Definition: argpar.h:206
int argpar_usage_json(argpar_state *state)
Print usage summary, called within a argpar_parser, in a format more suitable for automated parsing.
Definition: argpar-json.c:414
int argv_as_int_err
Error state of integer casting, if OPTION_INT was used; 1 otherwise.
Definition: argpar.h:248
argpar_parser parser
Parser function handed all options and arguments, as well as various ARGPAR_KEY_ keys for events such...
Definition: argpar.h:403
FILE * argpar_ostream
Used as the stream for printing help and usage messages. Defaults to STDERR.
Definition: argpar.h:190
unsigned flags
This should probably be the flags passed to the parser and help functions, but is currently unused....
Definition: argpar.h:383
char * name
The name used when printing messages. This is initialized to ARGV[0], or PROGRAM_INVOCATION_NAME if t...
Definition: argpar.h:233
const char * doc
A (generally short) description of an option. In case of a documentation option, this may be as lengt...
Definition: argpar.h:103
const char * args_doc
A string defining the desired arguments to the program, printed as part of the usage documentation.
Definition: argpar.h:406
char ** argpar_split_str(char *str, const char *delim)
Splits a string on a delimiter, returning a NULL-terminated list of strings.
Definition: argpar.c:744
const char * argpar_program_name
Used as a default for the program's invocation name if one is not found.
Definition: argpar.h:187
int state(double tjdTDB, JPLIntUtilType *util, double posvel[13][6], double *pnut)
int argpar_usage_default(argpar *argpar)
Print the default usage summary with all available sections.
Definition: argpar-help.c:509
int argpar_parse_file(argpar *p, const char *path, unsigned flags, void *input)
Parse a key=value store file.
Definition: argpar.c:730
int flags
Modify the behavior of the argument by OR'ing one or more OPTION_ macros.
Definition: argpar.h:100
long argv_as_int
value part of key=value pair, parsed as a long, if OPTION_INT was used.
Definition: argpar.h:246
void ** child_inputs
Values to pass to child parsers, same length as the number of child parsers for the current parser.
Definition: argpar.h:222
int argpar_parse_args(argpar *p, unsigned argc, char *argv[], unsigned flags, unsigned *end_index, void *input)
Parse an array of key=value pairs and/or key arguments.
Definition: argpar.c:679
void * input
Arbitrary pointer given by the user, generally to store parsed arguments.
Definition: argpar.h:218
const char * header
If non-NULL, don't merge this child's options with the the parent's. If header length is non-zero,...
Definition: argpar.h:387
unsigned argc
Total number of arguments being parsed by a call of argpar_parse_args.
Definition: argpar.h:201
double * argpar_split_dbl(char *str, const char *delim)
Splits a string on a delimiter, returning a NAN-terminated list of doubles.
Definition: argpar.c:809
int argpar_help(argpar *argpar, FILE *stream, unsigned flags, char *name)
Print the default usage summary with all available sections.
Definition: argpar-help.c:512
const char * argpar_version()
Returns the source code version and the implemented API version.
Definition: argpar.c:740
State variable to be filled before each call to the parser callback.
Definition: argpar.h:196
int argpar_help_json(argpar *argpar, FILE *stream, unsigned flags, char *name)
Print the default usage summary with all available sections, in a format more suitable for automated ...
Definition: argpar-json.c:420
const argpar_child * children
Array of argpar_child structures containing parsers to nest within this one. All options and argument...
Definition: argpar.h:413
char ** argpar_split_trim(char *str, const char *delim)
Splits a string on a delimiter, returning a NULL-terminated list of strings, trimming left and right ...
Definition: argpar.c:769
const char * parfile
The name of the parfile being parsed, or NULL if the argument comes from the command line.
Definition: argpar.h:229
int argv_as_dbl_err
Error state of double casting, if OPTION_DBL was used; 1 otherwise.
Definition: argpar.h:253
const char * doc
A string printed before and/or after the options. To display text after options, use a vertical-tab (...
Definition: argpar.h:409
void(* argpar_program_version_hook)(FILE *stream, argpar_state *state)
Called to print the version string. If set, a version=1 option is automatically added.
Definition: argpar.c:20
const char * arg
What to display as the right side of the argument in the usage statement.
Definition: argpar.h:98
int key
The value to pass to the parser callback. Must be a positive and non-zero.
Definition: argpar.h:91
const char * arg_name
key part of key=value pair. When an alias is used, this is the name of the actual option,...
Definition: argpar.h:237
int group
The group associated with this option. If 0 and a documentation option, it is auto-incremented.
Definition: argpar.h:111
char ** parfile_buffer
Used internally to store the parfiles. Initialize to NULL.
Definition: argpar.h:419