Fork me on GitHub
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
cmdline.h File Reference

The header file for the command line option parser generated by GNU Gengetopt version 2.23 http://www.gnu.org/software/gengetopt. DO NOT modify this file, since it can be overwritten. More...

#include <stdio.h>
Include dependency graph for cmdline.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gengetopt_args_info
 Where the command line options are stored. More...
 
struct  cmdline_parser_params
 The additional parameters to pass to parser functions. More...
 

Macros

#define CMDLINE_PARSER_PACKAGE   "janus"
 the program name (used for printing errors)
 
#define CMDLINE_PARSER_PACKAGE_NAME   "janus"
 the complete program name (used for help and version)
 
#define CMDLINE_PARSER_VERSION   "1.0.0"
 the program version
 

Functions

int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 
int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 
int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
 
int cmdline_parser_dump (FILE *outfile, struct gengetopt_args_info *args_info)
 
int cmdline_parser_file_save (const char *filename, struct gengetopt_args_info *args_info)
 
void cmdline_parser_print_help (void)
 
void cmdline_parser_print_version (void)
 
void cmdline_parser_params_init (struct cmdline_parser_params *params)
 
struct cmdline_parser_paramscmdline_parser_params_create (void)
 
void cmdline_parser_init (struct gengetopt_args_info *args_info)
 
void cmdline_parser_free (struct gengetopt_args_info *args_info)
 
int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 

Variables

const char * gengetopt_args_info_purpose
 the purpose string of the program
 
const char * gengetopt_args_info_usage
 the usage string of the program
 
const char * gengetopt_args_info_description
 the description string of the program
 
const char * gengetopt_args_info_help []
 all the lines making the help output
 

Detailed Description

The header file for the command line option parser generated by GNU Gengetopt version 2.23 http://www.gnu.org/software/gengetopt. DO NOT modify this file, since it can be overwritten.

Author
GNU Gengetopt

Macro Definition Documentation

◆ CMDLINE_PARSER_PACKAGE

#define CMDLINE_PARSER_PACKAGE   "janus"

the program name (used for printing errors)

◆ CMDLINE_PARSER_PACKAGE_NAME

#define CMDLINE_PARSER_PACKAGE_NAME   "janus"

the complete program name (used for help and version)

◆ CMDLINE_PARSER_VERSION

#define CMDLINE_PARSER_VERSION   "1.0.0"

the program version

Function Documentation

◆ cmdline_parser()

int cmdline_parser ( int  argc,
char **  argv,
struct gengetopt_args_info args_info 
)

The command line parser

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser2()

int cmdline_parser2 ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
int  override,
int  initialize,
int  check_required 
)

The command line parser (version with additional parameters - deprecated)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
overridewhether to override possibly already present options
initializewhether to initialize the option structure my_args_info
check_requiredwhether to check that all required options were provided
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_dump()

int cmdline_parser_dump ( FILE *  outfile,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into an already open FILE stream.

Parameters
outfilethe stream where to dump options
args_infothe option struct to dump
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_ext()

int cmdline_parser_ext ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
struct cmdline_parser_params params 
)

The command line parser (version with additional parameters)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
paramsadditional parameters for the parser
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_file_save()

int cmdline_parser_file_save ( const char *  filename,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into a (text) file. This file can be read by the config file parser (if generated by gengetopt)

Parameters
filenamethe file where to save
args_infothe option struct to save
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_free()

void cmdline_parser_free ( struct gengetopt_args_info args_info)

Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the structure itself)

Parameters
args_infothe structure to deallocate

◆ cmdline_parser_init()

void cmdline_parser_init ( struct gengetopt_args_info args_info)

Initializes the passed gengetopt_args_info structure's fields (also set default values for options that have a default)

Parameters
args_infothe structure to initialize

◆ cmdline_parser_params_create()

struct cmdline_parser_params * cmdline_parser_params_create ( void  )

Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their default values

Returns
the created and initialized cmdline_parser_params structure

◆ cmdline_parser_params_init()

void cmdline_parser_params_init ( struct cmdline_parser_params params)

Initializes all the fields a cmdline_parser_params structure to their default values

Parameters
paramsthe structure to initialize

◆ cmdline_parser_print_help()

void cmdline_parser_print_help ( void  )

Print the help

◆ cmdline_parser_print_version()

void cmdline_parser_print_version ( void  )

Print the version

◆ cmdline_parser_required()

int cmdline_parser_required ( struct gengetopt_args_info args_info,
const char *  prog_name 
)

Checks that all the required options were specified

Parameters
args_infothe structure to check
prog_namethe name of the program that will be used to print possible errors
Returns

Variable Documentation

◆ gengetopt_args_info_description

const char* gengetopt_args_info_description
extern

the description string of the program

◆ gengetopt_args_info_help

const char* gengetopt_args_info_help[]
extern

all the lines making the help output

◆ gengetopt_args_info_purpose

const char* gengetopt_args_info_purpose
extern

the purpose string of the program

◆ gengetopt_args_info_usage

const char* gengetopt_args_info_usage
extern

the usage string of the program