4 typedef struct m_config_option m_config_option_t
;
5 typedef struct m_config_save_slot m_config_save_slot_t
;
6 typedef struct m_profile m_profile_t
;
10 struct m_config_save_slot
{
11 m_config_save_slot_t
* prev
;
13 // we have to store other datatypes in this as well,
14 // so make sure we get properly aligned addresses
15 unsigned char data
[0] __attribute__ ((aligned (8)));
18 struct m_config_option
{
19 m_config_option_t
* next
;
20 char* name
; // Full name (ie option:subopt)
22 m_config_save_slot_t
* slots
;
23 unsigned int flags
; // currently it only tell if the option was set
34 typedef struct m_config
{
35 m_config_option_t
* opts
;
36 int lvl
; // Current stack level
38 m_profile_t
* profiles
;
40 struct m_option
* self_opts
;
43 #define M_CFG_OPT_SET (1<<0)
44 #define M_CFG_OPT_ALIAS (1<<1)
47 //////////////////////////// Functions ///////////////////////////////////
53 m_config_free(m_config_t
* config
);
56 m_config_push(m_config_t
* config
);
59 m_config_pop(m_config_t
* config
);
62 m_config_register_options(m_config_t
*config
, struct m_option
*args
);
65 m_config_set_option(m_config_t
*config
, char* arg
, char* param
);
68 m_config_check_option(m_config_t
*config
, char* arg
, char* param
);
71 m_config_get_option(m_config_t
*config
, char* arg
);
74 m_config_print_option_list(m_config_t
*config
);
77 m_config_get_profile(m_config_t
* config
, char* name
);
80 m_config_add_profile(m_config_t
* config
, char* name
);
83 m_profile_set_desc(m_profile_t
* p
, char* desc
);
86 m_config_set_profile_option(m_config_t
* config
, m_profile_t
* p
,
87 char* name
, char* val
);
89 #endif /* _M_CONFIG_H */