annotate cfgparser.h @ 10462:63ba9a05bb68

sync with HTML
author diego
date Thu, 24 Jul 2003 10:22:43 +0000
parents d054f589ee03
children d46910228a6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
1 /*
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
2 * command line and config file parser
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
3 */
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
4
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
5 #ifdef NEW_CONFIG
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
6 #ifdef MP_DEBUG
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
7 #warning "NEW_CONFIG defined but still using the old cfgparser.h"
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
8 #endif
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
9 #include "m_config.h"
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
10 #include "m_option.h"
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
11 #else
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
12
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
13 #ifndef __CONFIG_H
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
14 #define __CONFIG_H
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
15
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
16 #define CONF_TYPE_FLAG 0
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
17 #define CONF_TYPE_INT 1
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
18 #define CONF_TYPE_FLOAT 2
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
19 #define CONF_TYPE_STRING 3
150
2f3e01a1fd87 cfgparse fixes
szabii
parents: 147
diff changeset
20 #define CONF_TYPE_FUNC 4
151
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
21 #define CONF_TYPE_FUNC_PARAM 5
152
372a9a836e86 cfgparser fix
szabii
parents: 151
diff changeset
22 #define CONF_TYPE_PRINT 6
1536
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
23 #define CONF_TYPE_FUNC_FULL 7
2617
b97a9e3fdb63 added subconfig type
alex
parents: 1629
diff changeset
24 #define CONF_TYPE_SUBCONFIG 8
5215
f2896a466e26 New string list option type
albeu
parents: 4292
diff changeset
25 #define CONF_TYPE_STRING_LIST 9
7114
79187bd813a6 64-bit -sb offsets patch by Andy Goth <unununium@openverse.com>
alex
parents: 5215
diff changeset
26 #define CONF_TYPE_POSITION 10
10371
d054f589ee03 forgot to commit
alex
parents: 8164
diff changeset
27 #define CONF_TYPE_PRINT_INDIRECT 11
2617
b97a9e3fdb63 added subconfig type
alex
parents: 1629
diff changeset
28
1536
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
29
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
30 #define ERR_NOT_AN_OPTION -1
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
31 #define ERR_MISSING_PARAM -2
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
32 #define ERR_OUT_OF_RANGE -3
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
33 #define ERR_FUNC_ERR -4
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
34
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
35
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
36
153
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
37 #define CONF_MIN (1<<0)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
38 #define CONF_MAX (1<<1)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
39 #define CONF_RANGE (CONF_MIN|CONF_MAX)
151
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
40 #define CONF_NOCFG (1<<2)
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
41 #define CONF_NOCMD (1<<3)
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
42 #define CONF_GLOBAL (1<<4)
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
43 #define CONF_NOSAVE (1<<5)
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
44 #define CONF_OLD (1<<6)
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
45
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
46
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
47 typedef struct config config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
48 typedef struct m_config m_config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
49 typedef struct config_save config_save_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
50
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
51 struct play_tree;
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
52
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
53 typedef void (*cfg_default_func_t)(config_t *, char*);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
54
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
55 struct config {
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
56 char *name;
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
57 void *p;
3559
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
58 unsigned int type;
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
59 unsigned int flags;
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
60 float min,max;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
61 /* Use this field when your need to do something before a new value is
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
62 assigned to your option */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
63 cfg_default_func_t default_func;
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
64 };
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
65
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
66
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
67
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
68 struct m_config {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
69 config_t** opt_list;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
70 config_save_t** config_stack;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
71 int cs_level;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
72 int parser_mode; /* COMMAND_LINE or CONFIG_FILE */
4268
83aedfde69f8 Some improvment and make -vcd -dvd options considered as playlist entry
albeu
parents: 4254
diff changeset
73 int flags;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
74 char* sub_conf; // When we save a subconfig
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
75 struct play_tree* pt; // play tree we use for playlist option, etc
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
76 struct play_tree* last_entry; // last added entry
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
77 struct play_tree* last_parent; // if last_entry is NULL we must create child of this
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
78 int recursion_depth;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
79 };
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
80
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
81 struct config_save {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
82 config_t* opt;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
83 union {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
84 int as_int;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
85 float as_float;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
86 void* as_pointer;
7220
e3ecccc7e505 warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 7201
diff changeset
87 off_t as_off_t;
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
88 } param;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
89 char* opt_name;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
90 };
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
91
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
92
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
93 typedef int (*cfg_func_arg_param_t)(config_t *, char *, char *);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
94 typedef int (*cfg_func_param_t)(config_t *, char *);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
95 typedef int (*cfg_func_t)(config_t *);
150
2f3e01a1fd87 cfgparse fixes
szabii
parents: 147
diff changeset
96
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
97 /* parse_config_file returns:
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
98 * -1 on error (can't malloc, invalid option...)
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
99 * 0 if can't open configfile
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
100 * 1 on success
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
101 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
102 int m_config_parse_config_file(m_config_t *config, char *conffile);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
103
1629
13aeaa05ac5e multifile support in config parser
arpi
parents: 1536
diff changeset
104 /* parse_command_line returns:
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
105 * -1 on error (invalid option...)
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
106 * 1 otherwise
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
107 */
7201
22beff6edf75 Improved MacOS X SDL support, enable SDL main() wrapper for Darwin, remove unused envp.
atmos4
parents: 7114
diff changeset
108 int m_config_parse_command_line(m_config_t* config, int argc, char **argv);
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
109
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
110 m_config_t* m_config_new(struct play_tree* pt);
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
111
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
112 void m_config_free(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
113
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
114 void m_config_push(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
115
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
116 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
117 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
118 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
119 int m_config_pop(m_config_t* config);
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
120
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
121 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
122 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
123 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
124 int m_config_register_options(m_config_t *config,config_t *args);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
125
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
126 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
127 * For all the following function when it's a subconfig option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
128 * you must give an option name like 'tv:channel' and not just
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
129 * 'channel'
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
130 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
131
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
132 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
133 * Return 1 on sucess 0 on failure
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
134 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
135 int m_config_set_option(m_config_t *config,char *opt, char *param);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
136
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
137 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
138 * Get the config struct defining an option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
139 * Return NULL on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
140 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
141 config_t* m_config_get_option(m_config_t *config, char* arg);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
142
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
143 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
144 * Get the p field of the struct defining an option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
145 * Return NULL on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
146 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
147 void* m_config_get_option_ptr(m_config_t *config, char* arg);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
148
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
149 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
150 * Tell is an option is alredy set or not
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
151 * Return -1 one error (requested option arg exist)
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
152 * Otherwise 0 or 1
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
153 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
154 int m_config_is_option_set(m_config_t *config, char* arg);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
155
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
156 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
157 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
158 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
159 int m_config_switch_flag(m_config_t *config, char* opt);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
160
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
161 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
162 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
163 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
164 int m_config_set_flag(m_config_t *config, char* opt, int max);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
165
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
166 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
167 * Return the value of a flag (O or 1) and -1 on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
168 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
169 int m_config_get_flag(m_config_t *config, char* opt);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
170
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
171 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
172 * Set the value of an int option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
173 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
174 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
175 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
176 m_config_set_int(m_config_t *config, char* arg,int val);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
177
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
178 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
179 * Get the value of an int option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
180 * Return the option value or -1 on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
181 * If err_ret is not NULL it's set to 1 on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
182 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
183 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
184 m_config_get_int (m_config_t *config, char* arg,int* err_ret);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
185
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
186 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
187 * Set the value of a float option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
188 * Return 0 on error 1 on success
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
189 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
190 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
191 m_config_set_float(m_config_t *config, char* arg,float val);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
192
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
193
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
194 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
195 * Get the value of a float option
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
196 * Return the option value or -1 on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
197 * If err_ret is not NULL it's set to 1 on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
198 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
199 float
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
200 m_config_get_float (m_config_t *config, char* arg,int* err_ret);
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
201
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
202 #endif /* __CONFIG_H */
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
203
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
204 #endif /* NEW_CONFIG */