annotate cfgparser.h @ 9421:4baee69b8e39

subpacket_base_size isnt needed for fixed sized subpackets
author michael
date Fri, 14 Feb 2003 11:37:38 +0000
parents 487cfc28525d
children d054f589ee03
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
2617
b97a9e3fdb63 added subconfig type
alex
parents: 1629
diff changeset
27
1536
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
28
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
29 #define ERR_NOT_AN_OPTION -1
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
30 #define ERR_MISSING_PARAM -2
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
31 #define ERR_OUT_OF_RANGE -3
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
32 #define ERR_FUNC_ERR -4
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
33
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
34
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
35
153
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
36 #define CONF_MIN (1<<0)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
37 #define CONF_MAX (1<<1)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
38 #define CONF_RANGE (CONF_MIN|CONF_MAX)
151
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
39 #define CONF_NOCFG (1<<2)
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
40 #define CONF_NOCMD (1<<3)
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
41 #define CONF_GLOBAL (1<<4)
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
42 #define CONF_NOSAVE (1<<5)
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
43 #define CONF_OLD (1<<6)
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
44
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 typedef struct config config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
47 typedef struct m_config m_config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
48 typedef struct config_save config_save_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
49
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
50 struct play_tree;
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
51
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
52 typedef void (*cfg_default_func_t)(config_t *, char*);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
53
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
54 struct config {
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
55 char *name;
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
56 void *p;
3559
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
57 unsigned int type;
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
58 unsigned int flags;
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
59 float min,max;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
60 /* 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
61 assigned to your option */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
62 cfg_default_func_t default_func;
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
63 };
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
64
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
65
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 struct m_config {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
68 config_t** opt_list;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
69 config_save_t** config_stack;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
70 int cs_level;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
71 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
72 int flags;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
73 char* sub_conf; // When we save a subconfig
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
74 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
75 struct play_tree* last_entry; // last added entry
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
76 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
77 int recursion_depth;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
78 };
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 struct config_save {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
81 config_t* opt;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
82 union {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
83 int as_int;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
84 float as_float;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
85 void* as_pointer;
7220
e3ecccc7e505 warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 7201
diff changeset
86 off_t as_off_t;
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
87 } param;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
88 char* opt_name;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
89 };
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 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
93 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
94 typedef int (*cfg_func_t)(config_t *);
150
2f3e01a1fd87 cfgparse fixes
szabii
parents: 147
diff changeset
95
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
96 /* parse_config_file returns:
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
97 * -1 on error (can't malloc, invalid option...)
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
98 * 0 if can't open configfile
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
99 * 1 on success
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
100 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
101 int m_config_parse_config_file(m_config_t *config, char *conffile);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
102
1629
13aeaa05ac5e multifile support in config parser
arpi
parents: 1536
diff changeset
103 /* parse_command_line returns:
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
104 * -1 on error (invalid option...)
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
105 * 1 otherwise
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
106 */
7201
22beff6edf75 Improved MacOS X SDL support, enable SDL main() wrapper for Darwin, remove unused envp.
atmos4
parents: 7114
diff changeset
107 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
108
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
109 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
110
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
111 void m_config_free(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
112
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
113 void m_config_push(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
114
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
115 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
116 * 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
117 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
118 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
119
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 * 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
122 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
123 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
124
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 * 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
127 * 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
128 * 'channel'
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
129 */
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 * 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
133 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
134 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
135
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 * 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
138 * Return NULL on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
139 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
140 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
141
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 * 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
144 * Return NULL on error
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
145 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
146 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
147
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 * 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
150 * 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
151 * Otherwise 0 or 1
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
152 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
153 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
154
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 * 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
157 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
158 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
159
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 * 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
162 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
163 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
164
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 * 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
167 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
168 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
169
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 * 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
172 * 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
173 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
174 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
175 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
176
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 * 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
179 * 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
180 * 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
181 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
182 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
183 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
184
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 * 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
187 * 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
188 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
189 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
190 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
191
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 * 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
195 * 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
196 * 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
197 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
198 float
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
199 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
200
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
201 #endif /* __CONFIG_H */
8164
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
202
487cfc28525d New config system + cleanup of header inter dependency
albeu
parents: 7220
diff changeset
203 #endif /* NEW_CONFIG */