1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: libconfig.h Source File</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
55 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
56 | </ul> |
---|
57 | </div> |
---|
58 | <div class="tabs"> |
---|
59 | <ul> |
---|
60 | <li><a href="files.html"><span>File List</span></a></li> |
---|
61 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
62 | </ul> |
---|
63 | </div> |
---|
64 | <h1>libconfig.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ----------------------------------------------------------------------------</span> |
---|
65 | <a name="l00002"></a>00002 <span class="comment"> libconfig - A library for processing structured configuration files</span> |
---|
66 | <a name="l00003"></a>00003 <span class="comment"> Copyright (C) 2005-2008 Mark A Lindner</span> |
---|
67 | <a name="l00004"></a>00004 <span class="comment"> </span> |
---|
68 | <a name="l00005"></a>00005 <span class="comment"> This file is part of libconfig.</span> |
---|
69 | <a name="l00006"></a>00006 <span class="comment"> </span> |
---|
70 | <a name="l00007"></a>00007 <span class="comment"> This library is free software; you can redistribute it and/or</span> |
---|
71 | <a name="l00008"></a>00008 <span class="comment"> modify it under the terms of the GNU Lesser General Public License</span> |
---|
72 | <a name="l00009"></a>00009 <span class="comment"> as published by the Free Software Foundation; either version 2.1 of</span> |
---|
73 | <a name="l00010"></a>00010 <span class="comment"> the License, or (at your option) any later version.</span> |
---|
74 | <a name="l00011"></a>00011 <span class="comment"> </span> |
---|
75 | <a name="l00012"></a>00012 <span class="comment"> This library is distributed in the hope that it will be useful, but</span> |
---|
76 | <a name="l00013"></a>00013 <span class="comment"> WITHOUT ANY WARRANTY; without even the implied warranty of</span> |
---|
77 | <a name="l00014"></a>00014 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> |
---|
78 | <a name="l00015"></a>00015 <span class="comment"> Lesser General Public License for more details.</span> |
---|
79 | <a name="l00016"></a>00016 <span class="comment"> </span> |
---|
80 | <a name="l00017"></a>00017 <span class="comment"> You should have received a copy of the GNU Library General Public</span> |
---|
81 | <a name="l00018"></a>00018 <span class="comment"> License along with this library; if not, see</span> |
---|
82 | <a name="l00019"></a>00019 <span class="comment"> <http://www.gnu.org/licenses/>.</span> |
---|
83 | <a name="l00020"></a>00020 <span class="comment"> ----------------------------------------------------------------------------</span> |
---|
84 | <a name="l00021"></a>00021 <span class="comment">*/</span> |
---|
85 | <a name="l00022"></a>00022 |
---|
86 | <a name="l00023"></a>00023 <span class="preprocessor">#ifndef __libconfig_h</span> |
---|
87 | <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __libconfig_h</span> |
---|
88 | <a name="l00025"></a>00025 <span class="preprocessor"></span> |
---|
89 | <a name="l00026"></a>00026 <span class="preprocessor">#ifdef __cplusplus</span> |
---|
90 | <a name="l00027"></a>00027 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { |
---|
91 | <a name="l00028"></a>00028 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> |
---|
92 | <a name="l00029"></a>00029 |
---|
93 | <a name="l00030"></a>00030 <span class="preprocessor">#define LIBCONFIG_API</span> |
---|
94 | <a name="l00031"></a>00031 <span class="preprocessor"></span> |
---|
95 | <a name="l00032"></a>00032 <span class="preprocessor">#include <stdio.h></span> |
---|
96 | <a name="l00033"></a>00033 |
---|
97 | <a name="l00034"></a>00034 <span class="preprocessor">#define CONFIG_TYPE_NONE 0</span> |
---|
98 | <a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_GROUP 1</span> |
---|
99 | <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_INT 2</span> |
---|
100 | <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_INT64 3</span> |
---|
101 | <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_FLOAT 4</span> |
---|
102 | <a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_STRING 5</span> |
---|
103 | <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_BOOL 6</span> |
---|
104 | <a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_ARRAY 7</span> |
---|
105 | <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_TYPE_LIST 8</span> |
---|
106 | <a name="l00043"></a>00043 <span class="preprocessor"></span> |
---|
107 | <a name="l00044"></a>00044 <span class="preprocessor">#define CONFIG_FORMAT_DEFAULT 0</span> |
---|
108 | <a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_FORMAT_HEX 1</span> |
---|
109 | <a name="l00046"></a>00046 <span class="preprocessor"></span> |
---|
110 | <a name="l00047"></a>00047 <span class="preprocessor">#define CONFIG_OPTION_AUTOCONVERT 0x01</span> |
---|
111 | <a name="l00048"></a>00048 <span class="preprocessor"></span> |
---|
112 | <a name="l00049"></a>00049 <span class="preprocessor">#define CONFIG_TRUE (1)</span> |
---|
113 | <a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define CONFIG_FALSE (0)</span> |
---|
114 | <a name="l00051"></a>00051 <span class="preprocessor"></span> |
---|
115 | <a name="l00052"></a>00052 <span class="keyword">typedef</span> <span class="keyword">union </span>config_value_t |
---|
116 | <a name="l00053"></a>00053 { |
---|
117 | <a name="l00054"></a>00054 <span class="keywordtype">long</span> ival; |
---|
118 | <a name="l00055"></a>00055 <span class="keywordtype">long</span> <span class="keywordtype">long</span> llval; |
---|
119 | <a name="l00056"></a>00056 <span class="keywordtype">double</span> fval; |
---|
120 | <a name="l00057"></a>00057 <span class="keywordtype">char</span> *sval; |
---|
121 | <a name="l00058"></a>00058 <span class="keyword">struct </span>config_list_t *list; |
---|
122 | <a name="l00059"></a>00059 } config_value_t; |
---|
123 | <a name="l00060"></a>00060 |
---|
124 | <a name="l00061"></a>00061 <span class="keyword">typedef</span> <span class="keyword">struct </span>config_setting_t |
---|
125 | <a name="l00062"></a>00062 { |
---|
126 | <a name="l00063"></a>00063 <span class="keywordtype">char</span> *name; |
---|
127 | <a name="l00064"></a>00064 <span class="keywordtype">short</span> type; |
---|
128 | <a name="l00065"></a>00065 <span class="keywordtype">short</span> format; |
---|
129 | <a name="l00066"></a>00066 config_value_t value; |
---|
130 | <a name="l00067"></a>00067 <span class="keyword">struct </span>config_setting_t *parent; |
---|
131 | <a name="l00068"></a>00068 <span class="keyword">struct </span>config_t *config; |
---|
132 | <a name="l00069"></a>00069 <span class="keywordtype">void</span> *hook; |
---|
133 | <a name="l00070"></a>00070 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> line; |
---|
134 | <a name="l00071"></a>00071 } config_setting_t; |
---|
135 | <a name="l00072"></a>00072 |
---|
136 | <a name="l00073"></a>00073 <span class="keyword">typedef</span> <span class="keyword">struct </span>config_list_t |
---|
137 | <a name="l00074"></a>00074 { |
---|
138 | <a name="l00075"></a>00075 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length; |
---|
139 | <a name="l00076"></a>00076 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> capacity; |
---|
140 | <a name="l00077"></a>00077 config_setting_t **elements; |
---|
141 | <a name="l00078"></a>00078 } config_list_t; |
---|
142 | <a name="l00079"></a>00079 |
---|
143 | <a name="l00080"></a>00080 <span class="keyword">typedef</span> <span class="keyword">struct </span>config_t |
---|
144 | <a name="l00081"></a>00081 { |
---|
145 | <a name="l00082"></a>00082 config_setting_t *root; |
---|
146 | <a name="l00083"></a>00083 void (*destructor)(<span class="keywordtype">void</span> *); |
---|
147 | <a name="l00084"></a>00084 <span class="keywordtype">int</span> flags; |
---|
148 | <a name="l00085"></a>00085 <span class="keyword">const</span> <span class="keywordtype">char</span> *error_text; |
---|
149 | <a name="l00086"></a>00086 <span class="keywordtype">int</span> error_line; |
---|
150 | <a name="l00087"></a>00087 } config_t; |
---|
151 | <a name="l00088"></a>00088 |
---|
152 | <a name="l00089"></a>00089 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_read(config_t *config, FILE *stream); |
---|
153 | <a name="l00090"></a>00090 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_write(<span class="keyword">const</span> config_t *config, FILE *stream); |
---|
154 | <a name="l00091"></a>00091 |
---|
155 | <a name="l00092"></a>00092 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_set_auto_convert(config_t *config, <span class="keywordtype">int</span> flag); |
---|
156 | <a name="l00093"></a>00093 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_get_auto_convert(<span class="keyword">const</span> config_t *config); |
---|
157 | <a name="l00094"></a>00094 |
---|
158 | <a name="l00095"></a>00095 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_read_file(config_t *config, |
---|
159 | <a name="l00096"></a>00096 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename); |
---|
160 | <a name="l00097"></a>00097 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_write_file(config_t *config, |
---|
161 | <a name="l00098"></a>00098 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename); |
---|
162 | <a name="l00099"></a>00099 |
---|
163 | <a name="l00100"></a>00100 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_set_destructor(config_t *config, |
---|
164 | <a name="l00101"></a>00101 <span class="keywordtype">void</span> (*destructor)(<span class="keywordtype">void</span> *)); |
---|
165 | <a name="l00102"></a>00102 |
---|
166 | <a name="l00103"></a>00103 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_init(config_t *config); |
---|
167 | <a name="l00104"></a>00104 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_destroy(config_t *config); |
---|
168 | <a name="l00105"></a>00105 |
---|
169 | <a name="l00106"></a>00106 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> config_setting_get_int( |
---|
170 | <a name="l00107"></a>00107 <span class="keyword">const</span> config_setting_t *setting); |
---|
171 | <a name="l00108"></a>00108 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> <span class="keywordtype">long</span> config_setting_get_int64( |
---|
172 | <a name="l00109"></a>00109 <span class="keyword">const</span> config_setting_t *setting); |
---|
173 | <a name="l00110"></a>00110 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">double</span> config_setting_get_float( |
---|
174 | <a name="l00111"></a>00111 <span class="keyword">const</span> config_setting_t *setting); |
---|
175 | <a name="l00112"></a>00112 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_get_bool( |
---|
176 | <a name="l00113"></a>00113 <span class="keyword">const</span> config_setting_t *setting); |
---|
177 | <a name="l00114"></a>00114 <span class="keyword">extern</span> LIBCONFIG_API <span class="keyword">const</span> <span class="keywordtype">char</span> *config_setting_get_string( |
---|
178 | <a name="l00115"></a>00115 <span class="keyword">const</span> config_setting_t *setting); |
---|
179 | <a name="l00116"></a>00116 |
---|
180 | <a name="l00117"></a>00117 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_int(config_setting_t *setting, |
---|
181 | <a name="l00118"></a>00118 <span class="keywordtype">long</span> value); |
---|
182 | <a name="l00119"></a>00119 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_int64(config_setting_t *setting, |
---|
183 | <a name="l00120"></a>00120 <span class="keywordtype">long</span> <span class="keywordtype">long</span> value); |
---|
184 | <a name="l00121"></a>00121 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_float(config_setting_t *setting, |
---|
185 | <a name="l00122"></a>00122 <span class="keywordtype">double</span> value); |
---|
186 | <a name="l00123"></a>00123 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_bool(config_setting_t *setting, |
---|
187 | <a name="l00124"></a>00124 <span class="keywordtype">int</span> value); |
---|
188 | <a name="l00125"></a>00125 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_string(config_setting_t *setting, |
---|
189 | <a name="l00126"></a>00126 <span class="keyword">const</span> <span class="keywordtype">char</span> *value); |
---|
190 | <a name="l00127"></a>00127 |
---|
191 | <a name="l00128"></a>00128 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_set_format(config_setting_t *setting, |
---|
192 | <a name="l00129"></a>00129 <span class="keywordtype">short</span> format); |
---|
193 | <a name="l00130"></a>00130 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">short</span> config_setting_get_format(config_setting_t *setting); |
---|
194 | <a name="l00131"></a>00131 |
---|
195 | <a name="l00132"></a>00132 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> config_setting_get_int_elem( |
---|
196 | <a name="l00133"></a>00133 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">int</span> idx); |
---|
197 | <a name="l00134"></a>00134 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> <span class="keywordtype">long</span> config_setting_get_int64_elem( |
---|
198 | <a name="l00135"></a>00135 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">int</span> idx); |
---|
199 | <a name="l00136"></a>00136 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">double</span> config_setting_get_float_elem( |
---|
200 | <a name="l00137"></a>00137 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">int</span> idx); |
---|
201 | <a name="l00138"></a>00138 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_get_bool_elem( |
---|
202 | <a name="l00139"></a>00139 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">int</span> idx); |
---|
203 | <a name="l00140"></a>00140 <span class="keyword">extern</span> LIBCONFIG_API <span class="keyword">const</span> <span class="keywordtype">char</span> *config_setting_get_string_elem( |
---|
204 | <a name="l00141"></a>00141 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">int</span> idx); |
---|
205 | <a name="l00142"></a>00142 |
---|
206 | <a name="l00143"></a>00143 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_set_int_elem( |
---|
207 | <a name="l00144"></a>00144 config_setting_t *setting, <span class="keywordtype">int</span> idx, <span class="keywordtype">long</span> value); |
---|
208 | <a name="l00145"></a>00145 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_set_int64_elem( |
---|
209 | <a name="l00146"></a>00146 config_setting_t *setting, <span class="keywordtype">int</span> idx, <span class="keywordtype">long</span> <span class="keywordtype">long</span> value); |
---|
210 | <a name="l00147"></a>00147 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_set_float_elem( |
---|
211 | <a name="l00148"></a>00148 config_setting_t *setting, <span class="keywordtype">int</span> idx, <span class="keywordtype">double</span> value); |
---|
212 | <a name="l00149"></a>00149 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_set_bool_elem( |
---|
213 | <a name="l00150"></a>00150 config_setting_t *setting, <span class="keywordtype">int</span> idx, <span class="keywordtype">int</span> value); |
---|
214 | <a name="l00151"></a>00151 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_set_string_elem( |
---|
215 | <a name="l00152"></a>00152 config_setting_t *setting, <span class="keywordtype">int</span> idx, <span class="keyword">const</span> <span class="keywordtype">char</span> *value); |
---|
216 | <a name="l00153"></a>00153 |
---|
217 | <a name="l00154"></a>00154 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_type(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
218 | <a name="l00155"></a>00155 ((S)->type) |
---|
219 | <a name="l00156"></a>00156 |
---|
220 | <a name="l00157"></a>00157 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_group(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
221 | <a name="l00158"></a>00158 ((S)->type == CONFIG_TYPE_GROUP) |
---|
222 | <a name="l00159"></a>00159 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_array(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
223 | <a name="l00160"></a>00160 ((S)->type == CONFIG_TYPE_ARRAY) |
---|
224 | <a name="l00161"></a>00161 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_list(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
225 | <a name="l00162"></a>00162 ((S)->type == CONFIG_TYPE_LIST) |
---|
226 | <a name="l00163"></a>00163 |
---|
227 | <a name="l00164"></a>00164 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_aggregate( \ |
---|
228 | <a name="l00165"></a>00165 <span class="comment">/* const config_setting_t * */</span> S) \ |
---|
229 | <a name="l00166"></a>00166 (((S)->type == CONFIG_TYPE_GROUP) || ((S)->type == CONFIG_TYPE_LIST) \ |
---|
230 | <a name="l00167"></a>00167 || ((S)->type == CONFIG_TYPE_ARRAY)) |
---|
231 | <a name="l00168"></a>00168 |
---|
232 | <a name="l00169"></a>00169 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_number(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
233 | <a name="l00170"></a>00170 (((S)->type == CONFIG_TYPE_INT) \ |
---|
234 | <a name="l00171"></a>00171 || ((S)->type == CONFIG_TYPE_INT64) \ |
---|
235 | <a name="l00172"></a>00172 || ((S)->type == CONFIG_TYPE_FLOAT)) |
---|
236 | <a name="l00173"></a>00173 |
---|
237 | <a name="l00174"></a>00174 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_scalar(<span class="comment">/* const config_setting_t * */</span> S) \ |
---|
238 | <a name="l00175"></a>00175 (((S)->type == CONFIG_TYPE_BOOL) || ((S)->type == CONFIG_TYPE_STRING) \ |
---|
239 | <a name="l00176"></a>00176 || config_setting_is_number(S)) |
---|
240 | <a name="l00177"></a>00177 |
---|
241 | <a name="l00178"></a>00178 <span class="preprocessor">#define </span><span class="comment">/* const char * */</span> config_setting_name( \ |
---|
242 | <a name="l00179"></a>00179 <span class="comment">/* const config_setting_t * */</span> S) \ |
---|
243 | <a name="l00180"></a>00180 ((S)->name) |
---|
244 | <a name="l00181"></a>00181 |
---|
245 | <a name="l00182"></a>00182 <span class="preprocessor">#define </span><span class="comment">/* config_setting_t * */</span> config_setting_parent( \ |
---|
246 | <a name="l00183"></a>00183 <span class="comment">/* const config_setting_t * */</span> S) \ |
---|
247 | <a name="l00184"></a>00184 ((S)->parent) |
---|
248 | <a name="l00185"></a>00185 |
---|
249 | <a name="l00186"></a>00186 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_setting_is_root( \ |
---|
250 | <a name="l00187"></a>00187 <span class="comment">/* const config_setting_t * */</span> S) \ |
---|
251 | <a name="l00188"></a>00188 ((S)->parent ? CONFIG_FALSE : CONFIG_TRUE) |
---|
252 | <a name="l00189"></a>00189 |
---|
253 | <a name="l00190"></a>00190 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_index(<span class="keyword">const</span> config_setting_t *setting); |
---|
254 | <a name="l00191"></a>00191 |
---|
255 | <a name="l00192"></a>00192 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_length( |
---|
256 | <a name="l00193"></a>00193 <span class="keyword">const</span> config_setting_t *setting); |
---|
257 | <a name="l00194"></a>00194 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_get_elem( |
---|
258 | <a name="l00195"></a>00195 <span class="keyword">const</span> config_setting_t *setting, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx); |
---|
259 | <a name="l00196"></a>00196 |
---|
260 | <a name="l00197"></a>00197 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_get_member( |
---|
261 | <a name="l00198"></a>00198 <span class="keyword">const</span> config_setting_t *setting, <span class="keyword">const</span> <span class="keywordtype">char</span> *name); |
---|
262 | <a name="l00199"></a>00199 |
---|
263 | <a name="l00200"></a>00200 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_setting_add( |
---|
264 | <a name="l00201"></a>00201 config_setting_t *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> type); |
---|
265 | <a name="l00202"></a>00202 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_remove(config_setting_t *parent, |
---|
266 | <a name="l00203"></a>00203 <span class="keyword">const</span> <span class="keywordtype">char</span> *name); |
---|
267 | <a name="l00204"></a>00204 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_setting_remove_elem(config_setting_t *parent, |
---|
268 | <a name="l00205"></a>00205 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx); |
---|
269 | <a name="l00206"></a>00206 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">void</span> config_setting_set_hook(config_setting_t *setting, |
---|
270 | <a name="l00207"></a>00207 <span class="keywordtype">void</span> *hook); |
---|
271 | <a name="l00208"></a>00208 |
---|
272 | <a name="l00209"></a>00209 <span class="preprocessor">#define config_setting_get_hook(S) ((S)->hook)</span> |
---|
273 | <a name="l00210"></a>00210 <span class="preprocessor"></span> |
---|
274 | <a name="l00211"></a>00211 <span class="keyword">extern</span> LIBCONFIG_API config_setting_t *config_lookup(<span class="keyword">const</span> config_t *config, |
---|
275 | <a name="l00212"></a>00212 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
276 | <a name="l00213"></a>00213 |
---|
277 | <a name="l00214"></a>00214 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> config_lookup_int(<span class="keyword">const</span> config_t *config, |
---|
278 | <a name="l00215"></a>00215 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
279 | <a name="l00216"></a>00216 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">long</span> <span class="keywordtype">long</span> config_lookup_int64(<span class="keyword">const</span> config_t *config, |
---|
280 | <a name="l00217"></a>00217 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
281 | <a name="l00218"></a>00218 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">double</span> config_lookup_float(<span class="keyword">const</span> config_t *config, |
---|
282 | <a name="l00219"></a>00219 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
283 | <a name="l00220"></a>00220 <span class="keyword">extern</span> LIBCONFIG_API <span class="keywordtype">int</span> config_lookup_bool(<span class="keyword">const</span> config_t *config, |
---|
284 | <a name="l00221"></a>00221 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
285 | <a name="l00222"></a>00222 <span class="keyword">extern</span> LIBCONFIG_API <span class="keyword">const</span> <span class="keywordtype">char</span> *config_lookup_string(<span class="keyword">const</span> config_t *config, |
---|
286 | <a name="l00223"></a>00223 <span class="keyword">const</span> <span class="keywordtype">char</span> *path); |
---|
287 | <a name="l00224"></a>00224 |
---|
288 | <a name="l00225"></a>00225 <span class="preprocessor">#define </span><span class="comment">/* config_setting_t * */</span> config_root_setting( \ |
---|
289 | <a name="l00226"></a>00226 <span class="comment">/* const config_t * */</span> C) \ |
---|
290 | <a name="l00227"></a>00227 ((C)->root) |
---|
291 | <a name="l00228"></a>00228 |
---|
292 | <a name="l00229"></a>00229 <span class="preprocessor">#define </span><span class="comment">/* unsigned short */</span> config_setting_source_line( \ |
---|
293 | <a name="l00230"></a>00230 <span class="comment">/* const config_t */</span> C) \ |
---|
294 | <a name="l00231"></a>00231 ((C)->line) |
---|
295 | <a name="l00232"></a>00232 |
---|
296 | <a name="l00233"></a>00233 <span class="preprocessor">#define </span><span class="comment">/* const char * */</span> config_error_text(<span class="comment">/* const config_t * */</span> C) \ |
---|
297 | <a name="l00234"></a>00234 ((C)->error_text) |
---|
298 | <a name="l00235"></a>00235 |
---|
299 | <a name="l00236"></a>00236 <span class="preprocessor">#define </span><span class="comment">/* int */</span> config_error_line(<span class="comment">/* const config_t * */</span> C) \ |
---|
300 | <a name="l00237"></a>00237 ((C)->error_line) |
---|
301 | <a name="l00238"></a>00238 |
---|
302 | <a name="l00239"></a>00239 <span class="preprocessor">#ifdef __cplusplus</span> |
---|
303 | <a name="l00240"></a>00240 <span class="preprocessor"></span>} |
---|
304 | <a name="l00241"></a>00241 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> |
---|
305 | <a name="l00242"></a>00242 |
---|
306 | <a name="l00243"></a>00243 <span class="preprocessor">#endif </span><span class="comment">/* __libconfig_h */</span> |
---|
307 | </pre></div></div> |
---|
308 | <hr size="1"><address style="text-align: right;"><small>Generated on Sat Aug 15 17:40:58 2009 for mixpp by |
---|
309 | <a href="http://www.doxygen.org/index.html"> |
---|
310 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
311 | </body> |
---|
312 | </html> |
---|