Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Data Structures | Macros | Typedefs | Enumerations | Functions
emutools_config.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xemutools_config_st
 
struct  xemutools_configdef_bool_st
 
struct  xemutools_configdef_str_st
 
struct  xemutools_configdef_num_st
 
struct  xemutools_configdef_float_st
 
struct  xemutools_configdef_proc_st
 
struct  xemutools_configdef_switch_st
 

Macros

#define CONFIG_FILE_MAX_SIZE   0x10000
 
#define CONFIG_VALUE_MAX_LENGTH   256
 
#define OPT_NAME_MAX_LENGTH   16
 
#define CONFIG_FILE_TEMPL_NAME   "@%s-template.cfg"
 
#define CONFIG_FILE_USE_NAME   "@%s-default.cfg"
 
#define EMUCFG_PARSER_CALLBACK_RET_TYPE   const char*
 
#define EMUCFG_PARSER_CALLBACK_ARG_LIST   struct xemutools_config_st *opt, const char *optname, const char *optvalue
 
#define EMUCFG_PARSER_CALLBACK(name)   EMUCFG_PARSER_CALLBACK_RET_TYPE name ( EMUCFG_PARSER_CALLBACK_ARG_LIST )
 
#define XEMUCFG_FLAG_CLI_ONLY   1
 
#define XEMUCFG_FLAG_FIRST_ONLY   2
 
#define XEMUCFG_FLAG_DUMMY   4
 
#define XEMUCFG_FLAG_FILE_ONLY   8
 
#define XEMUCFG_DEFINE_BOOL_OPTIONS(...)   xemucfg_define_bool_option_multi( (const struct xemutools_configdef_bool_st []) { __VA_ARGS__ , {NULL} } )
 
#define XEMUCFG_DEFINE_STR_OPTIONS(...)   xemucfg_define_str_option_multi( (const struct xemutools_configdef_str_st []) { __VA_ARGS__ , {NULL} } )
 
#define XEMUCFG_DEFINE_NUM_OPTIONS(...)   xemucfg_define_num_option_multi( (const struct xemutools_configdef_num_st []) { __VA_ARGS__ , {NULL} } )
 
#define XEMUCFG_DEFINE_FLOAT_OPTIONS(...)   xemucfg_define_float_option_multi( (const struct xemutools_configdef_float_st []) { __VA_ARGS__ , {NULL} } )
 
#define XEMUCFG_DEFINE_PROC_OPTIONS(...)   xemucfg_define_proc_option_multi( (const struct xemutools_configdef_proc_st []) { __VA_ARGS__ , {NULL} } )
 
#define XEMUCFG_DEFINE_SWITCH_OPTIONS(...)   xemucfg_define_switch_option_multi((const struct xemutools_configdef_switch_st[]) { __VA_ARGS__ , {NULL} } )
 

Typedefs

typedef EMUCFG_PARSER_CALLBACK_RET_TYPE(* xemucfg_parser_callback_func_t) (EMUCFG_PARSER_CALLBACK_ARG_LIST)
 

Enumerations

enum  xemutools_option_type {
  XEMUCFG_OPT_STR, XEMUCFG_OPT_BOOL, XEMUCFG_OPT_NUM, XEMUCFG_OPT_FLOAT,
  XEMUCFG_OPT_PROC
}
 

Functions

void xemucfg_define_bool_option_multi (const struct xemutools_configdef_bool_st p[])
 
void xemucfg_define_str_option_multi (const struct xemutools_configdef_str_st p[])
 
void xemucfg_define_num_option_multi (const struct xemutools_configdef_num_st p[])
 
void xemucfg_define_float_option_multi (const struct xemutools_configdef_float_st p[])
 
void xemucfg_define_proc_option_multi (const struct xemutools_configdef_proc_st p[])
 
void xemucfg_define_switch_option_multi (const struct xemutools_configdef_switch_st p[])
 
void xemucfg_define_bool_option (const char *optname, const int defval, const char *help, int *storage)
 
void xemucfg_define_str_option (const char *optname, const char *defval, const char *help, char **storage)
 
void xemucfg_define_num_option (const char *optname, const int defval, const char *help, int *storage, int min, int max)
 
void xemucfg_define_float_option (const char *optname, const double defval, const char *help, double *storage, double min, double max)
 
void xemucfg_define_switch_option (const char *optname, const char *help, int *storage)
 
void xemucfg_define_proc_option (const char *optname, xemucfg_parser_callback_func_t cb, const char *help)
 
int xemucfg_parse_all (int argc, char **argv)
 
int xemucfg_save_config_file (const char *filename, const char *initial_part, const char *cry)
 
int xemucfg_parse_config_file (const char *filename_in, const char *open_fail_msg)
 
const char * xemucfg_get_default_config_file_name (void)
 
void xemucfg_set_str (char **ptr, const char *value)
 
int xemucfg_integer_list_from_string (const char *value, int *result, int maxitems, const char *delims)
 
int xemucfg_str2int (const char *s, int *result)
 
int xemucfg_str2double (const char *s, double *result)
 
int xemucfg_str2bool (const char *s, int *result)
 
void xemucfg_get_cli_info (const char **exec_name_ptr, int *argc_ptr, char ***argv_ptr)
 
void xemucfg_dump_db (const char *msg)
 

Macro Definition Documentation

◆ CONFIG_FILE_MAX_SIZE

#define CONFIG_FILE_MAX_SIZE   0x10000

Definition at line 21 of file emutools_config.h.

◆ CONFIG_FILE_TEMPL_NAME

#define CONFIG_FILE_TEMPL_NAME   "@%s-template.cfg"

Definition at line 25 of file emutools_config.h.

◆ CONFIG_FILE_USE_NAME

#define CONFIG_FILE_USE_NAME   "@%s-default.cfg"

Definition at line 26 of file emutools_config.h.

◆ CONFIG_VALUE_MAX_LENGTH

#define CONFIG_VALUE_MAX_LENGTH   256

Definition at line 22 of file emutools_config.h.

◆ EMUCFG_PARSER_CALLBACK

#define EMUCFG_PARSER_CALLBACK (   name)    EMUCFG_PARSER_CALLBACK_RET_TYPE name ( EMUCFG_PARSER_CALLBACK_ARG_LIST )

Definition at line 36 of file emutools_config.h.

◆ EMUCFG_PARSER_CALLBACK_ARG_LIST

#define EMUCFG_PARSER_CALLBACK_ARG_LIST   struct xemutools_config_st *opt, const char *optname, const char *optvalue

Definition at line 35 of file emutools_config.h.

◆ EMUCFG_PARSER_CALLBACK_RET_TYPE

#define EMUCFG_PARSER_CALLBACK_RET_TYPE   const char*

Definition at line 34 of file emutools_config.h.

◆ OPT_NAME_MAX_LENGTH

#define OPT_NAME_MAX_LENGTH   16

Definition at line 23 of file emutools_config.h.

◆ XEMUCFG_DEFINE_BOOL_OPTIONS

#define XEMUCFG_DEFINE_BOOL_OPTIONS (   ...)    xemucfg_define_bool_option_multi( (const struct xemutools_configdef_bool_st []) { __VA_ARGS__ , {NULL} } )

Definition at line 118 of file emutools_config.h.

◆ XEMUCFG_DEFINE_FLOAT_OPTIONS

#define XEMUCFG_DEFINE_FLOAT_OPTIONS (   ...)    xemucfg_define_float_option_multi( (const struct xemutools_configdef_float_st []) { __VA_ARGS__ , {NULL} } )

Definition at line 121 of file emutools_config.h.

◆ XEMUCFG_DEFINE_NUM_OPTIONS

#define XEMUCFG_DEFINE_NUM_OPTIONS (   ...)    xemucfg_define_num_option_multi( (const struct xemutools_configdef_num_st []) { __VA_ARGS__ , {NULL} } )

Definition at line 120 of file emutools_config.h.

◆ XEMUCFG_DEFINE_PROC_OPTIONS

#define XEMUCFG_DEFINE_PROC_OPTIONS (   ...)    xemucfg_define_proc_option_multi( (const struct xemutools_configdef_proc_st []) { __VA_ARGS__ , {NULL} } )

Definition at line 122 of file emutools_config.h.

◆ XEMUCFG_DEFINE_STR_OPTIONS

#define XEMUCFG_DEFINE_STR_OPTIONS (   ...)    xemucfg_define_str_option_multi( (const struct xemutools_configdef_str_st []) { __VA_ARGS__ , {NULL} } )

Definition at line 119 of file emutools_config.h.

◆ XEMUCFG_DEFINE_SWITCH_OPTIONS

#define XEMUCFG_DEFINE_SWITCH_OPTIONS (   ...)    xemucfg_define_switch_option_multi((const struct xemutools_configdef_switch_st[]) { __VA_ARGS__ , {NULL} } )

Definition at line 123 of file emutools_config.h.

◆ XEMUCFG_FLAG_CLI_ONLY

#define XEMUCFG_FLAG_CLI_ONLY   1

Definition at line 39 of file emutools_config.h.

◆ XEMUCFG_FLAG_DUMMY

#define XEMUCFG_FLAG_DUMMY   4

Definition at line 41 of file emutools_config.h.

◆ XEMUCFG_FLAG_FILE_ONLY

#define XEMUCFG_FLAG_FILE_ONLY   8

Definition at line 42 of file emutools_config.h.

◆ XEMUCFG_FLAG_FIRST_ONLY

#define XEMUCFG_FLAG_FIRST_ONLY   2

Definition at line 40 of file emutools_config.h.

Typedef Documentation

◆ xemucfg_parser_callback_func_t

typedef EMUCFG_PARSER_CALLBACK_RET_TYPE(* xemucfg_parser_callback_func_t) (EMUCFG_PARSER_CALLBACK_ARG_LIST)

Definition at line 37 of file emutools_config.h.

Enumeration Type Documentation

◆ xemutools_option_type

Enumerator
XEMUCFG_OPT_STR 
XEMUCFG_OPT_BOOL 
XEMUCFG_OPT_NUM 
XEMUCFG_OPT_FLOAT 
XEMUCFG_OPT_PROC 

Definition at line 28 of file emutools_config.h.

Function Documentation

◆ xemucfg_define_bool_option()

void xemucfg_define_bool_option ( const char *  optname,
const int  defval,
const char *  help,
int *  storage 
)

◆ xemucfg_define_bool_option_multi()

void xemucfg_define_bool_option_multi ( const struct xemutools_configdef_bool_st  p[])

◆ xemucfg_define_float_option()

void xemucfg_define_float_option ( const char *  optname,
const double  defval,
const char *  help,
double *  storage,
double  min,
double  max 
)
Here is the caller graph for this function:

◆ xemucfg_define_float_option_multi()

void xemucfg_define_float_option_multi ( const struct xemutools_configdef_float_st  p[])

◆ xemucfg_define_num_option()

void xemucfg_define_num_option ( const char *  optname,
const int  defval,
const char *  help,
int *  storage,
int  min,
int  max 
)

◆ xemucfg_define_num_option_multi()

void xemucfg_define_num_option_multi ( const struct xemutools_configdef_num_st  p[])

◆ xemucfg_define_proc_option()

void xemucfg_define_proc_option ( const char *  optname,
xemucfg_parser_callback_func_t  cb,
const char *  help 
)
Here is the caller graph for this function:

◆ xemucfg_define_proc_option_multi()

void xemucfg_define_proc_option_multi ( const struct xemutools_configdef_proc_st  p[])

◆ xemucfg_define_str_option()

void xemucfg_define_str_option ( const char *  optname,
const char *  defval,
const char *  help,
char **  storage 
)
Here is the caller graph for this function:

◆ xemucfg_define_str_option_multi()

void xemucfg_define_str_option_multi ( const struct xemutools_configdef_str_st  p[])
Here is the caller graph for this function:

◆ xemucfg_define_switch_option()

void xemucfg_define_switch_option ( const char *  optname,
const char *  help,
int *  storage 
)
Here is the caller graph for this function:

◆ xemucfg_define_switch_option_multi()

void xemucfg_define_switch_option_multi ( const struct xemutools_configdef_switch_st  p[])

◆ xemucfg_dump_db()

void xemucfg_dump_db ( const char *  msg)

◆ xemucfg_get_cli_info()

void xemucfg_get_cli_info ( const char **  exec_name_ptr,
int *  argc_ptr,
char ***  argv_ptr 
)
Here is the caller graph for this function:

◆ xemucfg_get_default_config_file_name()

const char* xemucfg_get_default_config_file_name ( void  )

◆ xemucfg_integer_list_from_string()

int xemucfg_integer_list_from_string ( const char *  value,
int *  result,
int  maxitems,
const char *  delims 
)

◆ xemucfg_parse_all()

int xemucfg_parse_all ( int  argc,
char **  argv 
)
Here is the caller graph for this function:

◆ xemucfg_parse_config_file()

int xemucfg_parse_config_file ( const char *  filename_in,
const char *  open_fail_msg 
)

◆ xemucfg_save_config_file()

int xemucfg_save_config_file ( const char *  filename,
const char *  initial_part,
const char *  cry 
)

◆ xemucfg_set_str()

void xemucfg_set_str ( char **  ptr,
const char *  value 
)

◆ xemucfg_str2bool()

int xemucfg_str2bool ( const char *  s,
int *  result 
)

◆ xemucfg_str2double()

int xemucfg_str2double ( const char *  s,
double *  result 
)

◆ xemucfg_str2int()

int xemucfg_str2int ( const char *  s,
int *  result 
)