comparison m_config.h @ 17471:63909962d3fc

Profiles support.
author albeu
date Tue, 24 Jan 2006 11:16:13 +0000
parents 5dea9e3618ba
children 96568be4bfdc
comparison
equal deleted inserted replaced
17470:21123e349463 17471:63909962d3fc
1 #ifndef _M_CONFIG_H 1 #ifndef _M_CONFIG_H
2 #define _M_CONFIG_H 2 #define _M_CONFIG_H
3 3
4 typedef struct m_config_option m_config_option_t; 4 typedef struct m_config_option m_config_option_t;
5 typedef struct m_config_save_slot m_config_save_slot_t; 5 typedef struct m_config_save_slot m_config_save_slot_t;
6 typedef struct m_profile m_profile_t;
6 struct m_option; 7 struct m_option;
7 struct m_option_type; 8 struct m_option_type;
8 9
9 struct m_config_save_slot { 10 struct m_config_save_slot {
10 m_config_save_slot_t* prev; 11 m_config_save_slot_t* prev;
20 struct m_option* opt; 21 struct m_option* opt;
21 m_config_save_slot_t* slots; 22 m_config_save_slot_t* slots;
22 unsigned int flags; // currently it only tell if the option was set 23 unsigned int flags; // currently it only tell if the option was set
23 }; 24 };
24 25
26 struct m_profile {
27 m_profile_t* next;
28 char* name;
29 char* desc;
30 int num_opts;
31 char** opts;
32 };
33
25 typedef struct m_config { 34 typedef struct m_config {
26 m_config_option_t* opts; 35 m_config_option_t* opts;
27 int lvl; // Current stack level 36 int lvl; // Current stack level
28 int mode; 37 int mode;
38 m_profile_t* profiles;
39 int profile_depth;
40 struct m_option* self_opts;
29 } m_config_t; 41 } m_config_t;
30 42
31 #define M_CFG_OPT_SET (1<<0) 43 #define M_CFG_OPT_SET (1<<0)
32 #define M_CFG_OPT_ALIAS (1<<1) 44 #define M_CFG_OPT_ALIAS (1<<1)
33 45
59 m_config_get_option(m_config_t *config, char* arg); 71 m_config_get_option(m_config_t *config, char* arg);
60 72
61 void 73 void
62 m_config_print_option_list(m_config_t *config); 74 m_config_print_option_list(m_config_t *config);
63 75
76 m_profile_t*
77 m_config_get_profile(m_config_t* config, char* name);
78
79 m_profile_t*
80 m_config_add_profile(m_config_t* config, char* name);
81
82 void
83 m_profile_set_desc(m_profile_t* p, char* desc);
84
85 int
86 m_config_set_profile_option(m_config_t* config, m_profile_t* p,
87 char* name, char* val);
88
64 #endif /* _M_CONFIG_H */ 89 #endif /* _M_CONFIG_H */