aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_configuration_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_configuration_lib.h')
-rw-r--r--src/include/gnunet_configuration_lib.h138
1 files changed, 74 insertions, 64 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 3384c6d45..3b9be5849 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -19,6 +19,10 @@
19 */ 19 */
20 20
21/** 21/**
22 * @addtogroup libgnunetutil
23 * Multi-function utilities library for GNUnet programs
24 * @{
25 *
22 * @author Christian Grothoff 26 * @author Christian Grothoff
23 * 27 *
24 * @file 28 * @file
@@ -31,6 +35,7 @@
31#ifndef GNUNET_CONFIGURATION_LIB_H 35#ifndef GNUNET_CONFIGURATION_LIB_H
32#define GNUNET_CONFIGURATION_LIB_H 36#define GNUNET_CONFIGURATION_LIB_H
33 37
38
34#include "gnunet_time_lib.h" 39#include "gnunet_time_lib.h"
35 40
36#ifdef __cplusplus 41#ifdef __cplusplus
@@ -160,8 +165,8 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
160 * present. This memory should be freed by the caller 165 * present. This memory should be freed by the caller
161 */ 166 */
162char * 167char *
163GNUNET_CONFIGURATION_serialize_diagnostics (const struct 168GNUNET_CONFIGURATION_serialize_diagnostics (
164 GNUNET_CONFIGURATION_Handle *cfg); 169 const struct GNUNET_CONFIGURATION_Handle *cfg);
165 170
166/** 171/**
167 * De-serializes configuration 172 * De-serializes configuration
@@ -170,7 +175,7 @@ GNUNET_CONFIGURATION_serialize_diagnostics (const struct
170 * @param mem the memory block of serialized configuration 175 * @param mem the memory block of serialized configuration
171 * @param size the size of the memory block 176 * @param size the size of the memory block
172 * @param source_filename source filename, will be used 177 * @param source_filename source filename, will be used
173 * to resolve relative @INLINE@ statements 178 * to resolve relative \@INLINE\@ statements
174 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 179 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
175 */ 180 */
176enum GNUNET_GenericReturnValue 181enum GNUNET_GenericReturnValue
@@ -266,8 +271,8 @@ GNUNET_CONFIGURATION_parse_and_run (const char *filename,
266 * @param cfg configuration handle 271 * @param cfg configuration handle
267 */ 272 */
268void 273void
269GNUNET_CONFIGURATION_enable_diagnostics (struct 274GNUNET_CONFIGURATION_enable_diagnostics (
270 GNUNET_CONFIGURATION_Handle *cfg); 275 struct GNUNET_CONFIGURATION_Handle *cfg);
271 276
272 277
273/** 278/**
@@ -292,8 +297,8 @@ typedef void
292 * @param section name of the section 297 * @param section name of the section
293 */ 298 */
294typedef void 299typedef void
295(*GNUNET_CONFIGURATION_Section_Iterator) (void *cls, 300(*GNUNET_CONFIGURATION_SectionIterator) (void *cls,
296 const char *section); 301 const char *section);
297 302
298 303
299/** 304/**
@@ -319,7 +324,7 @@ GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
319void 324void
320GNUNET_CONFIGURATION_iterate_sections ( 325GNUNET_CONFIGURATION_iterate_sections (
321 const struct GNUNET_CONFIGURATION_Handle *cfg, 326 const struct GNUNET_CONFIGURATION_Handle *cfg,
322 GNUNET_CONFIGURATION_Section_Iterator iter, 327 GNUNET_CONFIGURATION_SectionIterator iter,
323 void *iter_cls); 328 void *iter_cls);
324 329
325 330
@@ -344,11 +349,11 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
344 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 349 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
345 */ 350 */
346enum GNUNET_GenericReturnValue 351enum GNUNET_GenericReturnValue
347GNUNET_CONFIGURATION_get_value_number (const struct 352GNUNET_CONFIGURATION_get_value_number (
348 GNUNET_CONFIGURATION_Handle *cfg, 353 const struct GNUNET_CONFIGURATION_Handle *cfg,
349 const char *section, 354 const char *section,
350 const char *option, 355 const char *option,
351 unsigned long long *number); 356 unsigned long long *number);
352 357
353 358
354/** 359/**
@@ -361,11 +366,11 @@ GNUNET_CONFIGURATION_get_value_number (const struct
361 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 366 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
362 */ 367 */
363enum GNUNET_GenericReturnValue 368enum GNUNET_GenericReturnValue
364GNUNET_CONFIGURATION_get_value_float (const struct 369GNUNET_CONFIGURATION_get_value_float (
365 GNUNET_CONFIGURATION_Handle *cfg, 370 const struct GNUNET_CONFIGURATION_Handle *cfg,
366 const char *section, 371 const char *section,
367 const char *option, 372 const char *option,
368 float *number); 373 float *number);
369 374
370 375
371/** 376/**
@@ -378,11 +383,11 @@ GNUNET_CONFIGURATION_get_value_float (const struct
378 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 383 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
379 */ 384 */
380enum GNUNET_GenericReturnValue 385enum GNUNET_GenericReturnValue
381GNUNET_CONFIGURATION_get_value_time (const struct 386GNUNET_CONFIGURATION_get_value_time (
382 GNUNET_CONFIGURATION_Handle *cfg, 387 const struct GNUNET_CONFIGURATION_Handle *cfg,
383 const char *section, 388 const char *section,
384 const char *option, 389 const char *option,
385 struct GNUNET_TIME_Relative *time); 390 struct GNUNET_TIME_Relative *time);
386 391
387 392
388/** 393/**
@@ -395,11 +400,11 @@ GNUNET_CONFIGURATION_get_value_time (const struct
395 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 400 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
396 */ 401 */
397enum GNUNET_GenericReturnValue 402enum GNUNET_GenericReturnValue
398GNUNET_CONFIGURATION_get_value_size (const struct 403GNUNET_CONFIGURATION_get_value_size (
399 GNUNET_CONFIGURATION_Handle *cfg, 404 const struct GNUNET_CONFIGURATION_Handle *cfg,
400 const char *section, 405 const char *section,
401 const char *option, 406 const char *option,
402 unsigned long long *size); 407 unsigned long long *size);
403 408
404 409
405/** 410/**
@@ -446,11 +451,11 @@ GNUNET_CONFIGURATION_get_value_string (
446 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 451 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
447 */ 452 */
448enum GNUNET_GenericReturnValue 453enum GNUNET_GenericReturnValue
449GNUNET_CONFIGURATION_get_value_filename (const struct 454GNUNET_CONFIGURATION_get_value_filename (
450 GNUNET_CONFIGURATION_Handle *cfg, 455 const struct GNUNET_CONFIGURATION_Handle *cfg,
451 const char *section, 456 const char *section,
452 const char *option, 457 const char *option,
453 char **value); 458 char **value);
454 459
455 460
456/** 461/**
@@ -464,12 +469,13 @@ GNUNET_CONFIGURATION_get_value_filename (const struct
464 * @return number of filenames iterated over, -1 on error 469 * @return number of filenames iterated over, -1 on error
465 */ 470 */
466int 471int
467GNUNET_CONFIGURATION_iterate_value_filenames (const struct 472GNUNET_CONFIGURATION_iterate_value_filenames (
468 GNUNET_CONFIGURATION_Handle *cfg, 473 const struct GNUNET_CONFIGURATION_Handle *cfg,
469 const char *section, 474 const char *section,
470 const char *option, 475 const char *option,
471 GNUNET_FileNameCallback cb, 476 GNUNET_FileNameCallback cb,
472 void *cb_cls); 477 void *cb_cls);
478
473 479
474/** 480/**
475 * Iterate over values of a section in the configuration. 481 * Iterate over values of a section in the configuration.
@@ -480,11 +486,12 @@ GNUNET_CONFIGURATION_iterate_value_filenames (const struct
480 * @param iter_cls closure for @a iter 486 * @param iter_cls closure for @a iter
481 */ 487 */
482void 488void
483GNUNET_CONFIGURATION_iterate_section_values (const struct 489GNUNET_CONFIGURATION_iterate_section_values (
484 GNUNET_CONFIGURATION_Handle *cfg, 490 const struct GNUNET_CONFIGURATION_Handle *cfg,
485 const char *section, 491 const char *section,
486 GNUNET_CONFIGURATION_Iterator iter, 492 GNUNET_CONFIGURATION_Iterator iter,
487 void *iter_cls); 493 void *iter_cls);
494
488 495
489/** 496/**
490 * Get a configuration value that should be in a set of 497 * Get a configuration value that should be in a set of
@@ -499,12 +506,13 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct
499 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 506 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
500 */ 507 */
501enum GNUNET_GenericReturnValue 508enum GNUNET_GenericReturnValue
502GNUNET_CONFIGURATION_get_value_choice (const struct 509GNUNET_CONFIGURATION_get_value_choice (
503 GNUNET_CONFIGURATION_Handle *cfg, 510 const struct GNUNET_CONFIGURATION_Handle *cfg,
504 const char *section, 511 const char *section,
505 const char *option, 512 const char *option,
506 const char *const *choices, 513 const char *const *choices,
507 const char **value); 514 const char **value);
515
508 516
509/** 517/**
510 * Get a configuration value that should be in a set of 518 * Get a configuration value that should be in a set of
@@ -516,10 +524,10 @@ GNUNET_CONFIGURATION_get_value_choice (const struct
516 * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR 524 * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR
517 */ 525 */
518enum GNUNET_GenericReturnValue 526enum GNUNET_GenericReturnValue
519GNUNET_CONFIGURATION_get_value_yesno (const struct 527GNUNET_CONFIGURATION_get_value_yesno (
520 GNUNET_CONFIGURATION_Handle *cfg, 528 const struct GNUNET_CONFIGURATION_Handle *cfg,
521 const char *section, 529 const char *section,
522 const char *option); 530 const char *option);
523 531
524 532
525/** 533/**
@@ -606,11 +614,11 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
606 * #GNUNET_SYSERR if the filename is not in the list 614 * #GNUNET_SYSERR if the filename is not in the list
607 */ 615 */
608enum GNUNET_GenericReturnValue 616enum GNUNET_GenericReturnValue
609GNUNET_CONFIGURATION_remove_value_filename (struct 617GNUNET_CONFIGURATION_remove_value_filename (
610 GNUNET_CONFIGURATION_Handle *cfg, 618 struct GNUNET_CONFIGURATION_Handle *cfg,
611 const char *section, 619 const char *section,
612 const char *option, 620 const char *option,
613 const char *value); 621 const char *value);
614 622
615 623
616/** 624/**
@@ -625,11 +633,11 @@ GNUNET_CONFIGURATION_remove_value_filename (struct
625 * #GNUNET_SYSERR if the filename already in the list 633 * #GNUNET_SYSERR if the filename already in the list
626 */ 634 */
627enum GNUNET_GenericReturnValue 635enum GNUNET_GenericReturnValue
628GNUNET_CONFIGURATION_append_value_filename (struct 636GNUNET_CONFIGURATION_append_value_filename (
629 GNUNET_CONFIGURATION_Handle *cfg, 637 struct GNUNET_CONFIGURATION_Handle *cfg,
630 const char *section, 638 const char *section,
631 const char *option, 639 const char *option,
632 const char *value); 640 const char *value);
633 641
634 642
635/** 643/**
@@ -792,3 +800,5 @@ GNUNET_CONFIGURATION_config_tool_run (
792#endif 800#endif
793 801
794/** @} */ /* end of group configuration */ 802/** @} */ /* end of group configuration */
803
804/** @} */ /* end of group addition */