The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
arg_parse.h File Reference

Command line option parser. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ap_option
 A single parsable command line option. More...
 
struct  ap_section
 A set of options organized and parsed together. More...
 
struct  ap_settings
 A complete command line option parsing setup. More...
 

Enumerations

enum  ap_event_key { AP_KEY_INIT = 1 << 14, AP_KEY_FINI, AP_KEY_INIT = 1 << 14, AP_KEY_FINI }
 The special events keys passed to command line parsing functions. More...
 

Functions

void arg_parse_run (struct ap_settings *ap_s, char **argv)
 Parses the command line options. More...
 
const char * arg_parse_program_name (void)
 Gets the program name. More...
 
void arg_parse_error (const char *fmt,...)
 Prints a parsing related error message and exits with a bad exit code. More...
 

Detailed Description

Command line option parser.

A command line option parser mimicking a subset of GNU argp features.

Definition in file arg_parse.h.

Enumeration Type Documentation

◆ ap_event_key

The special events keys passed to command line parsing functions.

Enumerator
AP_KEY_INIT 

Signals the start of the parsing process.

AP_KEY_FINI 

Signals the end of the parsing process.

Definition at line 29 of file arg_parse.h.

Function Documentation

◆ arg_parse_error()

void arg_parse_error ( const char *  fmt,
  ... 
)

Prints a parsing related error message and exits with a bad exit code.

Parameters
fmtthe printf-style format string
...the arguments required to fill in the format string

Definition at line 432 of file arg_parse.c.

+ Here is the caller graph for this function:

◆ arg_parse_program_name()

const char* arg_parse_program_name ( void  )

Gets the program name.

Returns
a C string containing the program name, or NULL if arg_parse_run hasn't been called yet.

Definition at line 422 of file arg_parse.c.

◆ arg_parse_run()

void arg_parse_run ( struct ap_settings ap_s,
char **  argv 
)

Parses the command line options.

Parameters
ap_sthe parsing settings (see struct ap_settings for more info)
argvthe NULL terminated array of C strings from the command line

Definition at line 382 of file arg_parse.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: