libcfe  0.12.1
some useful C-functions
getparam.h File Reference
#include <stddef.h>
Include dependency graph for getparam.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  option_t
 

Macros

#define PARAM_OPTION_ARG_YES   16
 
#define PARAM_OPTION_ARG_MAYBE   (8 + PARAM_OPTION_ARG_YES)
 
#define PARAM_OPTION_BOOL   (1 + PARAM_OPTION_ARG_MAYBE)
 
#define ARG_TYPE_INT   (2 + PARAM_OPTION_ARG_YES)
 
#define ARG_TYPE_STR   (4 + PARAM_OPTION_ARG_YES)
 
#define ARG_TYPE_DOUBLE   (ARG_TYPE_INT | ARG_TYPE_STR)
 
#define PARAM_ACTION_FUNC   64
 
#define PARAM_ACTION_VAR   32
 
#define FAIL_ON_UNKNOWN   1 << 0
 

Typedefs

typedef int(* option_func_t) (option_t, void *, option_t **)
 

Functions

void print_options_help (option_t *o)
 
void print_options_config (option_t *o)
 
size_t add_config_options (option_t **o_in, option_t add[])
 
int getparam (option_t **o, int argc, char **argv)
 
int readconfig (option_t **o, const char *file, int options)
 

Macro Definition Documentation

◆ ARG_TYPE_DOUBLE

#define ARG_TYPE_DOUBLE   (ARG_TYPE_INT | ARG_TYPE_STR)

Definition at line 13 of file getparam.h.

◆ ARG_TYPE_INT

#define ARG_TYPE_INT   (2 + PARAM_OPTION_ARG_YES)

Definition at line 11 of file getparam.h.

◆ ARG_TYPE_STR

#define ARG_TYPE_STR   (4 + PARAM_OPTION_ARG_YES)

Definition at line 12 of file getparam.h.

◆ FAIL_ON_UNKNOWN

#define FAIL_ON_UNKNOWN   1 << 0

Definition at line 19 of file getparam.h.

◆ PARAM_ACTION_FUNC

#define PARAM_ACTION_FUNC   64

Definition at line 15 of file getparam.h.

◆ PARAM_ACTION_VAR

#define PARAM_ACTION_VAR   32

Definition at line 16 of file getparam.h.

◆ PARAM_OPTION_ARG_MAYBE

#define PARAM_OPTION_ARG_MAYBE   (8 + PARAM_OPTION_ARG_YES)

Definition at line 8 of file getparam.h.

◆ PARAM_OPTION_ARG_YES

#define PARAM_OPTION_ARG_YES   16

Definition at line 7 of file getparam.h.

◆ PARAM_OPTION_BOOL

#define PARAM_OPTION_BOOL   (1 + PARAM_OPTION_ARG_MAYBE)

Definition at line 10 of file getparam.h.

Typedef Documentation

◆ option_func_t

typedef int(* option_func_t) (option_t, void *, option_t **)

Definition at line 32 of file getparam.h.

Function Documentation

◆ add_config_options()

size_t add_config_options ( option_t **  o_in,
option_t  add[] 
)

Definition at line 126 of file getparam.c.

◆ getparam()

int getparam ( option_t **  o,
int  argc,
char **  argv 
)

Definition at line 243 of file getparam.c.

Here is the call graph for this function:

◆ print_options_config()

void print_options_config ( option_t o)

Definition at line 104 of file getparam.c.

◆ print_options_help()

void print_options_help ( option_t o)

Definition at line 76 of file getparam.c.

◆ readconfig()

int readconfig ( option_t **  o,
const char *  file,
int  options 
)

Definition at line 395 of file getparam.c.

Here is the call graph for this function: