diff options
Diffstat (limited to 'src/include/gnunet_configuration_lib.h')
-rw-r--r-- | src/include/gnunet_configuration_lib.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index b4e7f7d8f..ad55c1b9a 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -82,7 +82,7 @@ GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | |||
82 | * @param filename name of the configuration file, NULL to load defaults | 82 | * @param filename name of the configuration file, NULL to load defaults |
83 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 83 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
84 | */ | 84 | */ |
85 | int | 85 | enum GNUNET_GenericReturnValue |
86 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 86 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, |
87 | const char *filename); | 87 | const char *filename); |
88 | 88 | ||
@@ -95,7 +95,7 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
95 | * @param defaults_d directory with the defaults | 95 | * @param defaults_d directory with the defaults |
96 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 96 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
97 | */ | 97 | */ |
98 | int | 98 | enum GNUNET_GenericReturnValue |
99 | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, | 99 | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, |
100 | const char *defaults_d); | 100 | const char *defaults_d); |
101 | 101 | ||
@@ -120,7 +120,7 @@ GNUNET_CONFIGURATION_default (void); | |||
120 | * @param filename name of the configuration file | 120 | * @param filename name of the configuration file |
121 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 121 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
122 | */ | 122 | */ |
123 | int | 123 | enum GNUNET_GenericReturnValue |
124 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | 124 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, |
125 | const char *filename); | 125 | const char *filename); |
126 | 126 | ||
@@ -149,7 +149,7 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
149 | * when we come across them | 149 | * when we come across them |
150 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 150 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
151 | */ | 151 | */ |
152 | int | 152 | enum GNUNET_GenericReturnValue |
153 | GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, | 153 | GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, |
154 | const char *mem, | 154 | const char *mem, |
155 | size_t size, | 155 | size_t size, |
@@ -163,19 +163,20 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
163 | * @param filename where to write the configuration | 163 | * @param filename where to write the configuration |
164 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 164 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
165 | */ | 165 | */ |
166 | int | 166 | enum GNUNET_GenericReturnValue |
167 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | 167 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, |
168 | const char *filename); | 168 | const char *filename); |
169 | 169 | ||
170 | 170 | ||
171 | /** | 171 | /** |
172 | * Write only configuration entries that have been changed to configuration file | 172 | * Write only configuration entries that have been changed to configuration file |
173 | * | ||
173 | * @param cfg_default default configuration | 174 | * @param cfg_default default configuration |
174 | * @param cfg_new new configuration | 175 | * @param cfg_new new configuration |
175 | * @param filename where to write the configuration diff between default and new | 176 | * @param filename where to write the configuration diff between default and new |
176 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 177 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
177 | */ | 178 | */ |
178 | int | 179 | enum GNUNET_GenericReturnValue |
179 | GNUNET_CONFIGURATION_write_diffs (const struct | 180 | GNUNET_CONFIGURATION_write_diffs (const struct |
180 | GNUNET_CONFIGURATION_Handle *cfg_default, | 181 | GNUNET_CONFIGURATION_Handle *cfg_default, |
181 | const struct | 182 | const struct |
@@ -204,7 +205,7 @@ GNUNET_CONFIGURATION_get_diff (const struct | |||
204 | * @param cfg configuration to inspect | 205 | * @param cfg configuration to inspect |
205 | * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed) | 206 | * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed) |
206 | */ | 207 | */ |
207 | int | 208 | enum GNUNET_GenericReturnValue |
208 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); | 209 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); |
209 | 210 | ||
210 | 211 | ||
@@ -215,7 +216,7 @@ GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
215 | * @param cfg the configuration | 216 | * @param cfg the configuration |
216 | * @return status code | 217 | * @return status code |
217 | */ | 218 | */ |
218 | typedef int | 219 | typedef enum GNUNET_GenericReturnValue |
219 | (*GNUNET_CONFIGURATION_Callback)(void *cls, | 220 | (*GNUNET_CONFIGURATION_Callback)(void *cls, |
220 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 221 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
221 | 222 | ||
@@ -231,7 +232,7 @@ typedef int | |||
231 | * @return #GNUNET_SYSERR if parsing the configuration failed, | 232 | * @return #GNUNET_SYSERR if parsing the configuration failed, |
232 | * otherwise return value from @a cb. | 233 | * otherwise return value from @a cb. |
233 | */ | 234 | */ |
234 | int | 235 | enum GNUNET_GenericReturnValue |
235 | GNUNET_CONFIGURATION_parse_and_run (const char *filename, | 236 | GNUNET_CONFIGURATION_parse_and_run (const char *filename, |
236 | GNUNET_CONFIGURATION_Callback cb, | 237 | GNUNET_CONFIGURATION_Callback cb, |
237 | void *cb_cls); | 238 | void *cb_cls); |
@@ -311,7 +312,7 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
311 | * @param number where to store the numeric value of the option | 312 | * @param number where to store the numeric value of the option |
312 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 313 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
313 | */ | 314 | */ |
314 | int | 315 | enum GNUNET_GenericReturnValue |
315 | GNUNET_CONFIGURATION_get_value_number (const struct | 316 | GNUNET_CONFIGURATION_get_value_number (const struct |
316 | GNUNET_CONFIGURATION_Handle *cfg, | 317 | GNUNET_CONFIGURATION_Handle *cfg, |
317 | const char *section, | 318 | const char *section, |
@@ -328,7 +329,7 @@ GNUNET_CONFIGURATION_get_value_number (const struct | |||
328 | * @param number where to store the floating value of the option | 329 | * @param number where to store the floating value of the option |
329 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 330 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
330 | */ | 331 | */ |
331 | int | 332 | enum GNUNET_GenericReturnValue |
332 | GNUNET_CONFIGURATION_get_value_float (const struct | 333 | GNUNET_CONFIGURATION_get_value_float (const struct |
333 | GNUNET_CONFIGURATION_Handle *cfg, | 334 | GNUNET_CONFIGURATION_Handle *cfg, |
334 | const char *section, | 335 | const char *section, |
@@ -345,7 +346,7 @@ GNUNET_CONFIGURATION_get_value_float (const struct | |||
345 | * @param time set to the time value stored in the configuration | 346 | * @param time set to the time value stored in the configuration |
346 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 347 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
347 | */ | 348 | */ |
348 | int | 349 | enum GNUNET_GenericReturnValue |
349 | GNUNET_CONFIGURATION_get_value_time (const struct | 350 | GNUNET_CONFIGURATION_get_value_time (const struct |
350 | GNUNET_CONFIGURATION_Handle *cfg, | 351 | GNUNET_CONFIGURATION_Handle *cfg, |
351 | const char *section, | 352 | const char *section, |
@@ -362,7 +363,7 @@ GNUNET_CONFIGURATION_get_value_time (const struct | |||
362 | * @param size set to the size in bytes as stored in the configuration | 363 | * @param size set to the size in bytes as stored in the configuration |
363 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 364 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
364 | */ | 365 | */ |
365 | int | 366 | enum GNUNET_GenericReturnValue |
366 | GNUNET_CONFIGURATION_get_value_size (const struct | 367 | GNUNET_CONFIGURATION_get_value_size (const struct |
367 | GNUNET_CONFIGURATION_Handle *cfg, | 368 | GNUNET_CONFIGURATION_Handle *cfg, |
368 | const char *section, | 369 | const char *section, |
@@ -378,7 +379,7 @@ GNUNET_CONFIGURATION_get_value_size (const struct | |||
378 | * @param option option of interest | 379 | * @param option option of interest |
379 | * @return #GNUNET_YES if so, #GNUNET_NO if not. | 380 | * @return #GNUNET_YES if so, #GNUNET_NO if not. |
380 | */ | 381 | */ |
381 | int | 382 | enum GNUNET_GenericReturnValue |
382 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | 383 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
383 | const char *section, | 384 | const char *section, |
384 | const char *option); | 385 | const char *option); |
@@ -394,12 +395,12 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
394 | * value, or NULL if option is not specified | 395 | * value, or NULL if option is not specified |
395 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 396 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
396 | */ | 397 | */ |
397 | int | 398 | enum GNUNET_GenericReturnValue |
398 | GNUNET_CONFIGURATION_get_value_string (const struct | 399 | GNUNET_CONFIGURATION_get_value_string ( |
399 | GNUNET_CONFIGURATION_Handle *cfg, | 400 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
400 | const char *section, | 401 | const char *section, |
401 | const char *option, | 402 | const char *option, |
402 | char **value); | 403 | char **value); |
403 | 404 | ||
404 | 405 | ||
405 | /** | 406 | /** |
@@ -413,7 +414,7 @@ GNUNET_CONFIGURATION_get_value_string (const struct | |||
413 | * value, or NULL if option is not specified | 414 | * value, or NULL if option is not specified |
414 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 415 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
415 | */ | 416 | */ |
416 | int | 417 | enum GNUNET_GenericReturnValue |
417 | GNUNET_CONFIGURATION_get_value_filename (const struct | 418 | GNUNET_CONFIGURATION_get_value_filename (const struct |
418 | GNUNET_CONFIGURATION_Handle *cfg, | 419 | GNUNET_CONFIGURATION_Handle *cfg, |
419 | const char *section, | 420 | const char *section, |
@@ -466,7 +467,7 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct | |||
466 | * or NULL if option is not specified and no default given | 467 | * or NULL if option is not specified and no default given |
467 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 468 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
468 | */ | 469 | */ |
469 | int | 470 | enum GNUNET_GenericReturnValue |
470 | GNUNET_CONFIGURATION_get_value_choice (const struct | 471 | GNUNET_CONFIGURATION_get_value_choice (const struct |
471 | GNUNET_CONFIGURATION_Handle *cfg, | 472 | GNUNET_CONFIGURATION_Handle *cfg, |
472 | const char *section, | 473 | const char *section, |
@@ -483,7 +484,7 @@ GNUNET_CONFIGURATION_get_value_choice (const struct | |||
483 | * @param option option of interest | 484 | * @param option option of interest |
484 | * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR | 485 | * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR |
485 | */ | 486 | */ |
486 | int | 487 | enum GNUNET_GenericReturnValue |
487 | GNUNET_CONFIGURATION_get_value_yesno (const struct | 488 | GNUNET_CONFIGURATION_get_value_yesno (const struct |
488 | GNUNET_CONFIGURATION_Handle *cfg, | 489 | GNUNET_CONFIGURATION_Handle *cfg, |
489 | const char *section, | 490 | const char *section, |
@@ -502,7 +503,7 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct | |||
502 | * #GNUNET_NO is the value does not exist | 503 | * #GNUNET_NO is the value does not exist |
503 | * #GNUNET_SYSERR on decoding error | 504 | * #GNUNET_SYSERR on decoding error |
504 | */ | 505 | */ |
505 | int | 506 | enum GNUNET_GenericReturnValue |
506 | GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, | 507 | GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, |
507 | const char *section, | 508 | const char *section, |
508 | const char *option, | 509 | const char *option, |
@@ -527,9 +528,9 @@ GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
527 | * @return $-expanded string | 528 | * @return $-expanded string |
528 | */ | 529 | */ |
529 | char * | 530 | char * |
530 | GNUNET_CONFIGURATION_expand_dollar (const struct | 531 | GNUNET_CONFIGURATION_expand_dollar ( |
531 | GNUNET_CONFIGURATION_Handle *cfg, | 532 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
532 | char *orig); | 533 | char *orig); |
533 | 534 | ||
534 | 535 | ||
535 | /** | 536 | /** |
@@ -573,7 +574,7 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
573 | * @return #GNUNET_OK on success, | 574 | * @return #GNUNET_OK on success, |
574 | * #GNUNET_SYSERR if the filename is not in the list | 575 | * #GNUNET_SYSERR if the filename is not in the list |
575 | */ | 576 | */ |
576 | int | 577 | enum GNUNET_GenericReturnValue |
577 | GNUNET_CONFIGURATION_remove_value_filename (struct | 578 | GNUNET_CONFIGURATION_remove_value_filename (struct |
578 | GNUNET_CONFIGURATION_Handle *cfg, | 579 | GNUNET_CONFIGURATION_Handle *cfg, |
579 | const char *section, | 580 | const char *section, |
@@ -592,7 +593,7 @@ GNUNET_CONFIGURATION_remove_value_filename (struct | |||
592 | * @return #GNUNET_OK on success, | 593 | * @return #GNUNET_OK on success, |
593 | * #GNUNET_SYSERR if the filename already in the list | 594 | * #GNUNET_SYSERR if the filename already in the list |
594 | */ | 595 | */ |
595 | int | 596 | enum GNUNET_GenericReturnValue |
596 | GNUNET_CONFIGURATION_append_value_filename (struct | 597 | GNUNET_CONFIGURATION_append_value_filename (struct |
597 | GNUNET_CONFIGURATION_Handle *cfg, | 598 | GNUNET_CONFIGURATION_Handle *cfg, |
598 | const char *section, | 599 | const char *section, |