comparison m_config.h @ 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.
author alex
date Wed, 13 Aug 2003 16:29:32 +0000
parents d46910228a6b
children 5dea9e3618ba
comparison
equal deleted inserted replaced
10593:27711ab2889f 10594:57bdcdb061d7
1 1 #ifndef _M_CONFIG_H
2 #ifndef NEW_CONFIG 2 #define _M_CONFIG_H
3 #warning "Including m_config.h but NEW_CONFIG is disabled"
4 #else
5 3
6 typedef struct m_config_option m_config_option_t; 4 typedef struct m_config_option m_config_option_t;
7 typedef struct m_config_save_slot m_config_save_slot_t; 5 typedef struct m_config_save_slot m_config_save_slot_t;
8 struct m_option; 6 struct m_option;
9 struct m_option_type; 7 struct m_option_type;
59 m_config_get_option(m_config_t *config, char* arg); 57 m_config_get_option(m_config_t *config, char* arg);
60 58
61 void 59 void
62 m_config_print_option_list(m_config_t *config); 60 m_config_print_option_list(m_config_t *config);
63 61
64 ///////////////////////////////////////////////////////////////////////////////////// 62 #endif /* _M_CONFIG_H */
65 /////////////////////////// Backward compat. stuff ////////////////////////////////
66 ////////////////////////////////////////////////////////////////////////////////////
67
68 typedef struct config config_t;
69 struct config {
70 char *name;
71 void *p;
72 struct m_option_type* type;
73 unsigned int flags;
74 double min,max;
75 void* priv;
76 };
77
78
79 #define CONF_MIN (1<<0)
80 #define CONF_MAX (1<<1)
81 #define CONF_RANGE (CONF_MIN|CONF_MAX)
82 #define CONF_NOCFG (1<<2)
83 #define CONF_NOCMD (1<<3)
84 #define CONF_GLOBAL (1<<4)
85 #define CONF_NOSAVE (1<<5)
86 #define CONF_OLD (1<<6)
87
88 #define ERR_NOT_AN_OPTION -1
89 #define ERR_MISSING_PARAM -2
90 #define ERR_OUT_OF_RANGE -3
91 #define ERR_FUNC_ERR -4
92
93 #endif