annotate m_config.h @ 12226:5a1e0b3c1ca5

sync
author paszczi
date Sat, 17 Apr 2004 20:37:36 +0000
parents 57bdcdb061d7
children 5dea9e3618ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10594
57bdcdb061d7 Removed the historic cfgparser and switched full to the new config parser (altought some macros still remain for compatibility). As a side effect 90% of the warning messages are gone from the core. Things should be cleaner now and less confusing for newbies.
alex
parents: 10582
diff changeset
1 #ifndef _M_CONFIG_H
57bdcdb061d7 Removed the historic cfgparser and switched full to the new config parser (altought some macros still remain for compatibility). As a side effect 90% of the warning messages are gone from the core. Things should be cleaner now and less confusing for newbies.
alex
parents: 10582
diff changeset
2 #define _M_CONFIG_H
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
3
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
4 typedef struct m_config_option m_config_option_t;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
5 typedef struct m_config_save_slot m_config_save_slot_t;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
6 struct m_option;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
7 struct m_option_type;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
8
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
9 struct m_config_save_slot {
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
10 m_config_save_slot_t* prev;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
11 int lvl;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
12 unsigned char data[0];
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
13 };
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
14
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
15 struct m_config_option {
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
16 m_config_option_t* next;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
17 char* name; // Full name (ie option:subopt)
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
18 struct m_option* opt;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
19 m_config_save_slot_t* slots;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
20 unsigned int flags; // currently it only tell if the option was set
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
21 };
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
22
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
23 typedef struct m_config {
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
24 m_config_option_t* opts;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
25 int lvl; // Current stack level
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
26 int mode;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
27 } m_config_t;
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
28
9912
39444d65c4cb Don't save restore all options wich point to the same variable.
albeu
parents: 8168
diff changeset
29 #define M_CFG_OPT_SET (1<<0)
39444d65c4cb Don't save restore all options wich point to the same variable.
albeu
parents: 8168
diff changeset
30 #define M_CFG_OPT_ALIAS (1<<1)
39444d65c4cb Don't save restore all options wich point to the same variable.
albeu
parents: 8168
diff changeset
31
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
32
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
33 //////////////////////////// Functions ///////////////////////////////////
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
34
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
35 m_config_t*
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
36 m_config_new(void);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
37
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
38 void
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
39 m_config_free(m_config_t* config);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
40
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
41 void
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
42 m_config_push(m_config_t* config);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
43
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
44 void
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
45 m_config_pop(m_config_t* config);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
46
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
47 int
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
48 m_config_register_options(m_config_t *config, struct m_option *args);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
49
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
50 int
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
51 m_config_set_option(m_config_t *config, char* arg, char* param);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
52
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
53 int
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
54 m_config_check_option(m_config_t *config, char* arg, char* param);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
55
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
56 struct m_option*
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
57 m_config_get_option(m_config_t *config, char* arg);
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents:
diff changeset
58
8168
ff6a98628e6c Fix the Gui with NEW_CONFIG
albeu
parents: 8164
diff changeset
59 void
ff6a98628e6c Fix the Gui with NEW_CONFIG
albeu
parents: 8164
diff changeset
60 m_config_print_option_list(m_config_t *config);
ff6a98628e6c Fix the Gui with NEW_CONFIG
albeu
parents: 8164
diff changeset
61
10594
57bdcdb061d7 Removed the historic cfgparser and switched full to the new config parser (altought some macros still remain for compatibility). As a side effect 90% of the warning messages are gone from the core. Things should be cleaner now and less confusing for newbies.
alex
parents: 10582
diff changeset
62 #endif /* _M_CONFIG_H */