4 typedef struct m_config_option m_config_option_t
;
5 typedef struct m_config_save_slot m_config_save_slot_t
;
9 struct m_config_save_slot
{
10 m_config_save_slot_t
* prev
;
12 // we have to store other datatypes in this as well,
13 // so make sure we get properly aligned addresses
14 unsigned char data
[0] __attribute__ ((aligned (8)));
17 struct m_config_option
{
18 m_config_option_t
* next
;
19 char* name
; // Full name (ie option:subopt)
21 m_config_save_slot_t
* slots
;
22 unsigned int flags
; // currently it only tell if the option was set
25 typedef struct m_config
{
26 m_config_option_t
* opts
;
27 int lvl
; // Current stack level
31 #define M_CFG_OPT_SET (1<<0)
32 #define M_CFG_OPT_ALIAS (1<<1)
35 //////////////////////////// Functions ///////////////////////////////////
41 m_config_free(m_config_t
* config
);
44 m_config_push(m_config_t
* config
);
47 m_config_pop(m_config_t
* config
);
50 m_config_register_options(m_config_t
*config
, struct m_option
*args
);
53 m_config_set_option(m_config_t
*config
, char* arg
, char* param
);
56 m_config_check_option(m_config_t
*config
, char* arg
, char* param
);
59 m_config_get_option(m_config_t
*config
, char* arg
);
62 m_config_print_option_list(m_config_t
*config
);
64 #endif /* _M_CONFIG_H */