annotate cfgparser.h @ 7153:56cef6e35f51

Explain why putting [PATCH] in the subject is important.
author diego
date Fri, 30 Aug 2002 00:53:11 +0000
parents 79187bd813a6
children 22beff6edf75
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
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
5 #ifndef __CONFIG_H
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
6 #define __CONFIG_H
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
7
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
8 #define CONF_TYPE_FLAG 0
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
9 #define CONF_TYPE_INT 1
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
10 #define CONF_TYPE_FLOAT 2
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
11 #define CONF_TYPE_STRING 3
150
2f3e01a1fd87 cfgparse fixes
szabii
parents: 147
diff changeset
12 #define CONF_TYPE_FUNC 4
151
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
13 #define CONF_TYPE_FUNC_PARAM 5
152
372a9a836e86 cfgparser fix
szabii
parents: 151
diff changeset
14 #define CONF_TYPE_PRINT 6
1536
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
15 #define CONF_TYPE_FUNC_FULL 7
2617
b97a9e3fdb63 added subconfig type
alex
parents: 1629
diff changeset
16 #define CONF_TYPE_SUBCONFIG 8
5215
f2896a466e26 New string list option type
albeu
parents: 4292
diff changeset
17 #define CONF_TYPE_STRING_LIST 9
7114
79187bd813a6 64-bit -sb offsets patch by Andy Goth <unununium@openverse.com>
alex
parents: 5215
diff changeset
18 #define CONF_TYPE_POSITION 10
2617
b97a9e3fdb63 added subconfig type
alex
parents: 1629
diff changeset
19
1536
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
20
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
21 #define ERR_NOT_AN_OPTION -1
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
22 #define ERR_MISSING_PARAM -2
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
23 #define ERR_OUT_OF_RANGE -3
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
24 #define ERR_FUNC_ERR -4
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
25
e89233dab4da New feature for option processing: CONF_TYPE_FUNC_FULL
folke
parents: 153
diff changeset
26
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
27
153
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
28 #define CONF_MIN (1<<0)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
29 #define CONF_MAX (1<<1)
8e55121885b2 new configfile/cmdline parser
arpi_esp
parents: 152
diff changeset
30 #define CONF_RANGE (CONF_MIN|CONF_MAX)
151
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
31 #define CONF_NOCFG (1<<2)
9708d4b2765b cfgparser fix
szabii
parents: 150
diff changeset
32 #define CONF_NOCMD (1<<3)
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
33 #define CONF_GLOBAL (1<<4)
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
34 #define CONF_NOSAVE (1<<5)
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
35
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
36
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
37 typedef struct config config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
38 typedef struct m_config m_config_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
39 typedef struct config_save config_save_t;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
40
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
41 #include "playtree.h"
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
42
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
43 typedef void (*cfg_default_func_t)(config_t *, char*);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
44
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
45 struct config {
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
46 char *name;
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
47 void *p;
3559
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
48 unsigned int type;
f61dcc63be5f exchanged return with goto out in subconfig parsing and fixed error messages
alex
parents: 2617
diff changeset
49 unsigned int flags;
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
50 float min,max;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
51 /* 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
52 assigned to your option */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
53 cfg_default_func_t default_func;
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
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
56
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
57
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
58 struct m_config {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
59 config_t** opt_list;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
60 config_save_t** config_stack;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
61 int cs_level;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
62 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
63 int flags;
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
64 char* sub_conf; // When we save a subconfig
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
65 play_tree_t* pt; // play tree we use for playlist option, etc
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
66 play_tree_t* last_entry; // last added entry
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
67 play_tree_t* last_parent; // if last_entry is NULL we must create child of this
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
68 int recursion_depth;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
69 };
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
70
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
71 struct config_save {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
72 config_t* opt;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
73 union {
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
74 int as_int;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
75 float as_float;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
76 void* as_pointer;
7114
79187bd813a6 64-bit -sb offsets patch by Andy Goth <unununium@openverse.com>
alex
parents: 5215
diff changeset
77 off_t* as_off_t;
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
78 } param;
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
79 char* opt_name;
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
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
82
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
83 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
84 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
85 typedef int (*cfg_func_t)(config_t *);
150
2f3e01a1fd87 cfgparse fixes
szabii
parents: 147
diff changeset
86
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
87 /* parse_config_file returns:
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
88 * -1 on error (can't malloc, invalid option...)
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
89 * 0 if can't open configfile
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
90 * 1 on success
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
91 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
92 int m_config_parse_config_file(m_config_t *config, char *conffile);
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
93
1629
13aeaa05ac5e multifile support in config parser
arpi
parents: 1536
diff changeset
94 /* parse_command_line returns:
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
95 * -1 on error (invalid option...)
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
96 * 1 otherwise
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
97 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
98 int m_config_parse_command_line(m_config_t* config, int argc, char **argv, char **envp);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
99
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
100 m_config_t* m_config_new(play_tree_t* pt);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
101
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
102 void m_config_free(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
103
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
104 void m_config_push(m_config_t* config);
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
105
4292
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
106 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
107 * 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
108 */
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 3559
diff changeset
109 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
110
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
111 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
112 * 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
113 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
114 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
115
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 * 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
118 * 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
119 * 'channel'
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 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
123 * 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
124 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
125 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
126
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
127 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
128 * 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
129 * Return NULL on error
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 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
132
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 * 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
135 * Return NULL on error
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 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
138
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 * 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
141 * 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
142 * Otherwise 0 or 1
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 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
145
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 * 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
148 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
149 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
150
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
151 /*
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
152 * 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
153 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
154 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
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 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
158 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
159 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
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 * 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
163 * 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
164 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
165 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
166 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
167
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 * 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
170 * 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
171 * 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
172 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
173 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
174 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
175
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 * 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
178 * 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
179 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
180 int
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
181 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
182
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
183
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 * 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
186 * 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
187 * 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
188 */
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
189 float
1cee88ee8db5 Bug fix for subconfig option. A -tv option containing the on parameter
albeu
parents: 4268
diff changeset
190 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
191
147
0a0d7dd8fb51 new command line/config file parser
szabii
parents:
diff changeset
192 #endif /* __CONFIG_H */