10l fix by Jindrich Makovicka
[mplayer/greg.git] / m_config.h
blob7fb82fd8f115020cbb9d8ee6adab5cdada8d71f3
1 #ifndef _M_CONFIG_H
2 #define _M_CONFIG_H
4 typedef struct m_config_option m_config_option_t;
5 typedef struct m_config_save_slot m_config_save_slot_t;
6 struct m_option;
7 struct m_option_type;
9 struct m_config_save_slot {
10 m_config_save_slot_t* prev;
11 int lvl;
12 unsigned char data[0];
15 struct m_config_option {
16 m_config_option_t* next;
17 char* name; // Full name (ie option:subopt)
18 struct m_option* opt;
19 m_config_save_slot_t* slots;
20 unsigned int flags; // currently it only tell if the option was set
23 typedef struct m_config {
24 m_config_option_t* opts;
25 int lvl; // Current stack level
26 int mode;
27 } m_config_t;
29 #define M_CFG_OPT_SET (1<<0)
30 #define M_CFG_OPT_ALIAS (1<<1)
33 //////////////////////////// Functions ///////////////////////////////////
35 m_config_t*
36 m_config_new(void);
38 void
39 m_config_free(m_config_t* config);
41 void
42 m_config_push(m_config_t* config);
44 void
45 m_config_pop(m_config_t* config);
47 int
48 m_config_register_options(m_config_t *config, struct m_option *args);
50 int
51 m_config_set_option(m_config_t *config, char* arg, char* param);
53 int
54 m_config_check_option(m_config_t *config, char* arg, char* param);
56 struct m_option*
57 m_config_get_option(m_config_t *config, char* arg);
59 void
60 m_config_print_option_list(m_config_t *config);
62 #endif /* _M_CONFIG_H */