2 This file is part of GNUnet.
3 (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file src/util/configuration.c
23 * @brief configuration management
25 * @author Christian Grothoff
29 #include "gnunet_common.h"
30 #include "gnunet_configuration_lib.h"
31 #include "gnunet_crypto_lib.h"
32 #include "gnunet_disk_lib.h"
33 #include "gnunet_os_lib.h"
34 #include "gnunet_strings_lib.h"
38 * @brief configuration entry
44 * This is a linked list.
46 struct ConfigEntry *next;
54 * current, commited value
61 * @brief configuration section
66 * This is a linked list.
68 struct ConfigSection *next;
71 * entries in the section
73 struct ConfigEntry *entries;
83 * @brief configuration data
85 struct GNUNET_CONFIGURATION_Handle
88 * Configuration sections.
90 struct ConfigSection *sections;
93 * Modification indication since last save
94 * GNUNET_NO if clean, GNUNET_YES if dirty,
95 * GNUNET_SYSERR on error (i.e. last save failed)
103 * Used for diffing a configuration object against
108 const struct GNUNET_CONFIGURATION_Handle *cfgDefault;
109 struct GNUNET_CONFIGURATION_Handle *cfgDiff;
115 * Create a GNUNET_CONFIGURATION_Handle.
117 * @return fresh configuration object
119 struct GNUNET_CONFIGURATION_Handle *
120 GNUNET_CONFIGURATION_create ()
122 return GNUNET_malloc (sizeof (struct GNUNET_CONFIGURATION_Handle));
127 * Destroy configuration object.
129 * @param cfg configuration to destroy
132 GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg)
134 struct ConfigSection *sec;
136 while (NULL != (sec = cfg->sections))
137 GNUNET_CONFIGURATION_remove_section (cfg, sec->name);
143 * Parse a configuration file, add all of the options in the
144 * file to the configuration environment.
146 * @param cfg configuration to update
147 * @param filename name of the configuration file
148 * @return GNUNET_OK on success, GNUNET_SYSERR on error
151 GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
152 const char *filename)
166 fn = GNUNET_STRINGS_filename_expand (filename);
168 return GNUNET_SYSERR;
169 dirty = cfg->dirty; /* back up value! */
170 if (NULL == (fp = FOPEN (fn, "r")))
172 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
174 return GNUNET_SYSERR;
178 section = GNUNET_strdup ("");
179 memset (line, 0, 256);
181 while (NULL != fgets (line, 255, fp))
184 for (i = 0; i < 255; i++)
187 if (line[0] == '\n' || line[0] == '#' || line[0] == '%' ||
191 for (i = 0; (i < 255 && line[i] != 0); i++)
192 if (line[i] != ' ' && line[i] != '\n' && line[i] != '\r')
196 /* remove tailing whitespace */
197 for (i = strlen (line) - 1; (i >= 0) && (isspace ( (unsigned char) line[i])); i--)
199 if (1 == sscanf (line, "@INLINE@ %191[^\n]", value))
202 if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value))
203 ret = GNUNET_SYSERR; /* failed to parse included config */
205 else if (1 == sscanf (line, "[%99[^]]]", value))
208 GNUNET_free (section);
209 section = GNUNET_strdup (value);
211 else if (2 == sscanf (line, " %63[^= ] = %191[^\n]", tag, value))
215 i = strlen (value) - 1;
216 while ((i >= 0) && (isspace ( (unsigned char) value[i])))
223 while ((value[i] != '\0') && (value[i] != '"'))
233 GNUNET_CONFIGURATION_set_value_string (cfg,
234 section, tag, &value[i]);
236 else if (1 == sscanf (line, " %63[^= ] =[^\n]", tag))
239 GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, "");
244 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
246 ("Syntax error in configuration file `%s' at line %u.\n"),
252 GNUNET_assert (0 == fclose (fp));
253 /* restore dirty flag - anything we set in the meantime
256 GNUNET_free (section);
262 * Test if there are configuration options that were
263 * changed since the last save.
265 * @param cfg configuration to inspect
266 * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
269 GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg)
276 * Write configuration file.
278 * @param cfg configuration to write
279 * @param filename where to write the configuration
280 * @return GNUNET_OK on success, GNUNET_SYSERR on error
283 GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
284 const char *filename)
286 struct ConfigSection *sec;
287 struct ConfigEntry *ent;
294 fn = GNUNET_STRINGS_filename_expand (filename);
296 return GNUNET_SYSERR;
297 if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn))
300 return GNUNET_SYSERR;
302 if (NULL == (fp = FOPEN (fn, "w")))
304 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
306 return GNUNET_SYSERR;
313 if (0 > fprintf (fp, "[%s]\n", sec->name))
321 if (ent->val != NULL)
323 val = GNUNET_malloc (strlen (ent->val) * 2 + 1);
324 strcpy (val, ent->val);
325 while (NULL != (pos = strstr (val, "\n")))
327 memmove (&pos[2], &pos[1], strlen (&pos[1]));
331 if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
343 if (0 > fprintf (fp, "\n"))
351 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fprintf", filename);
352 GNUNET_assert (0 == fclose (fp));
355 cfg->dirty = GNUNET_SYSERR; /* last write failed */
356 return GNUNET_SYSERR;
358 cfg->dirty = GNUNET_NO; /* last write succeeded */
364 * Iterate over all options in the configuration.
366 * @param cfg configuration to inspect
367 * @param iter function to call on each option
368 * @param iter_cls closure for iter
371 GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
372 GNUNET_CONFIGURATION_Iterator iter,
375 struct ConfigSection *spos;
376 struct ConfigEntry *epos;
378 spos = cfg->sections;
381 epos = spos->entries;
384 iter (iter_cls, spos->name, epos->key, epos->val);
393 * Iterate over all sections in the configuration.
395 * @param cfg configuration to inspect
396 * @param iter function to call on each section
397 * @param iter_cls closure for iter
400 GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg,
401 GNUNET_CONFIGURATION_Section_Iterator iter,
404 struct ConfigSection *spos;
405 struct ConfigSection *next;
407 next = cfg->sections;
412 iter (iter_cls, spos->name);
417 * Remove the given section and all options in it.
419 * @param cfg configuration to inspect
420 * @param section name of the section to remove
422 void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
425 struct ConfigSection *spos;
426 struct ConfigSection *prev;
427 struct ConfigEntry *ent;
430 spos = cfg->sections;
433 if (0 == strcmp (section,
437 cfg->sections = spos->next;
439 prev->next = spos->next;
440 while (NULL != (ent = spos->entries))
442 spos->entries = ent->next;
443 GNUNET_free (ent->key);
444 GNUNET_free_non_null (ent->val);
446 cfg->dirty = GNUNET_YES;
448 GNUNET_free (spos->name);
459 * Copy a configuration value to the given target configuration.
460 * Overwrites existing entries.
462 * @param cls the destination configuration (struct GNUNET_CONFIGURATION_Handle*)
463 * @param section section for the value
464 * @param option option name of the value
465 * @param value value to copy
468 copy_entry (void *cls,
469 const char *section, const char *option, const char *value)
471 struct GNUNET_CONFIGURATION_Handle *dst = cls;
472 GNUNET_CONFIGURATION_set_value_string (dst, section, option, value);
477 * Duplicate an existing configuration object.
479 * @param cfg configuration to duplicate
480 * @return duplicate configuration
482 struct GNUNET_CONFIGURATION_Handle *
483 GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg)
485 struct GNUNET_CONFIGURATION_Handle *ret;
487 ret = GNUNET_CONFIGURATION_create ();
488 GNUNET_CONFIGURATION_iterate (cfg, ©_entry, ret);
497 * @param section FIXME
498 * @return matching entry, NULL if not found
500 static struct ConfigSection *
501 findSection (const struct GNUNET_CONFIGURATION_Handle *cfg,
504 struct ConfigSection *pos;
507 while ((pos != NULL) && (0 != strcasecmp (section, pos->name)))
514 * Find an entry from a configuration.
516 * @param cfg handle to the configuration
517 * @param section section the option is in
518 * @param key the option
519 * @return matching entry, NULL if not found
521 static struct ConfigEntry *
522 findEntry (const struct GNUNET_CONFIGURATION_Handle *cfg,
523 const char *section, const char *key)
525 struct ConfigSection *sec;
526 struct ConfigEntry *pos;
528 sec = findSection (cfg, section);
532 while ((pos != NULL) && (0 != strcasecmp (key, pos->key)))
539 * A callback function, compares entries from two configurations
540 * (default against a new configuration) and write the diffs in a
541 * diff-configuration object (the callback object).
543 * @param cls the diff configuration (struct DiffHandle*)
544 * @param section section for the value (of the default conf.)
545 * @param option option name of the value (of the default conf.)
546 * @param value value to copy (of the default conf.)
549 compareEntries (void *cls,
550 const char *section, const char *option, const char *value)
552 struct DiffHandle *dh = cls;
553 struct ConfigEntry *entNew;
555 entNew = findEntry (dh->cfgDefault, section, option);
556 if ( (entNew != NULL) &&
557 (strcmp (entNew->val, value) == 0) )
559 GNUNET_CONFIGURATION_set_value_string (dh->cfgDiff,
567 * Write only configuration entries that have been changed to configuration file
568 * @param cfgDefault default configuration
569 * @param cfgNew new configuration
570 * @param filename where to write the configuration diff between default and new
571 * @return GNUNET_OK on success, GNUNET_SYSERR on error
574 GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
576 const struct GNUNET_CONFIGURATION_Handle *cfgNew,
577 const char *filename)
580 struct DiffHandle diffHandle;
582 diffHandle.cfgDiff = GNUNET_CONFIGURATION_create ();
583 diffHandle.cfgDefault = cfgDefault;
584 GNUNET_CONFIGURATION_iterate (cfgNew, compareEntries, &diffHandle);
585 ret = GNUNET_CONFIGURATION_write (diffHandle.cfgDiff, filename);
586 GNUNET_CONFIGURATION_destroy (diffHandle.cfgDiff);
592 * Set a configuration value that should be a string.
594 * @param cfg configuration to update
595 * @param section section of interest
596 * @param option option of interest
597 * @param value value to set
600 GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle
603 const char *option, const char *value)
605 struct ConfigSection *sec;
606 struct ConfigEntry *e;
608 e = findEntry (cfg, section, option);
611 GNUNET_free_non_null (e->val);
612 e->val = GNUNET_strdup (value);
615 sec = findSection (cfg, section);
618 sec = GNUNET_malloc (sizeof (struct ConfigSection));
619 sec->name = GNUNET_strdup (section);
620 sec->next = cfg->sections;
623 e = GNUNET_malloc (sizeof (struct ConfigEntry));
624 e->key = GNUNET_strdup (option);
625 e->val = GNUNET_strdup (value);
626 e->next = sec->entries;
632 * Set a configuration value that should be a number.
634 * @param cfg configuration to update
635 * @param section section of interest
636 * @param option option of interest
637 * @param number value to set
640 GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
641 *cfg, const char *section,
643 unsigned long long number)
646 GNUNET_snprintf (s, 64, "%llu", number);
647 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, s);
652 * Get a configuration value that should be a number.
654 * @param cfg configuration to inspect
655 * @param section section of interest
656 * @param option option of interest
657 * @param number where to store the numeric value of the option
658 * @return GNUNET_OK on success, GNUNET_SYSERR on error
661 GNUNET_CONFIGURATION_get_value_number (const struct
662 GNUNET_CONFIGURATION_Handle *cfg,
665 unsigned long long *number)
667 struct ConfigEntry *e;
669 e = findEntry (cfg, section, option);
671 return GNUNET_SYSERR;
672 if (1 != SSCANF (e->val, "%llu", number))
673 return GNUNET_SYSERR;
679 * Get a configuration value that should be a relative time.
681 * @param cfg configuration to inspect
682 * @param section section of interest
683 * @param option option of interest
684 * @param time set to the time value stored in the configuration
685 * @return GNUNET_OK on success, GNUNET_SYSERR on error
688 GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
689 *cfg, const char *section,
691 struct GNUNET_TIME_Relative *time)
693 struct ConfigEntry *e;
694 unsigned long long num;
696 e = findEntry (cfg, section, option);
698 return GNUNET_SYSERR;
699 if ( (0 == strcasecmp (e->val, "infinity")) ||
700 (0 == strcasecmp (e->val, "forever")) )
702 *time = GNUNET_TIME_UNIT_FOREVER_REL;
705 if (1 != SSCANF (e->val, "%llu", &num))
706 return GNUNET_SYSERR;
707 time->rel_value = (uint64_t) num;
713 * Get a configuration value that should be a string.
715 * @param cfg configuration to inspect
716 * @param section section of interest
717 * @param option option of interest
718 * @param value will be set to a freshly allocated configuration
719 * value, or NULL if option is not specified
720 * @return GNUNET_OK on success, GNUNET_SYSERR on error
723 GNUNET_CONFIGURATION_get_value_string (const struct
724 GNUNET_CONFIGURATION_Handle *cfg,
726 const char *option, char **value)
728 struct ConfigEntry *e;
730 e = findEntry (cfg, section, option);
731 if ((e == NULL) || (e->val == NULL))
734 return GNUNET_SYSERR;
736 *value = GNUNET_strdup (e->val);
742 * Get a configuration value that should be in a set of
745 * @param cfg configuration to inspect
746 * @param section section of interest
747 * @param option option of interest
748 * @param choices NULL-terminated list of legal values
749 * @param value will be set to an entry in the legal list,
750 * or NULL if option is not specified and no default given
751 * @return GNUNET_OK on success, GNUNET_SYSERR on error
754 GNUNET_CONFIGURATION_get_value_choice (const struct
755 GNUNET_CONFIGURATION_Handle *cfg,
758 const char **choices,
761 struct ConfigEntry *e;
764 e = findEntry (cfg, section, option);
766 return GNUNET_SYSERR;
768 while (choices[i] != NULL)
770 if (0 == strcasecmp (choices[i], e->val))
774 if (choices[i] == NULL)
776 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
777 _("Configuration value '%s' for '%s'"
778 " in section '%s' is not in set of legal choices\n"),
779 e->val, option, section);
780 return GNUNET_SYSERR;
788 * Test if we have a value for a particular option
789 * @param cfg configuration to inspect
790 * @param section section of interest
791 * @param option option of interest
792 * @return GNUNET_YES if so, GNUNET_NO if not.
795 GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle
796 *cfg, const char *section,
799 struct ConfigEntry *e;
800 if ((NULL == (e = findEntry (cfg, section, option))) || (e->val == NULL))
807 * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
808 * where either in the "PATHS" section or the environtment
809 * "FOO" is set to "DIRECTORY".
811 * @param cfg configuration to use for path expansion
812 * @param orig string to $-expand (will be freed!)
813 * @return $-expanded string
816 GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
828 while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0'))
839 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg,
843 if (NULL == (env = getenv (&orig[1])))
845 orig[i] = DIR_SEPARATOR;
848 prefix = GNUNET_strdup (env);
850 result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2);
851 strcpy (result, prefix);
852 if ((strlen (prefix) == 0) ||
853 ((prefix[strlen (prefix) - 1] != DIR_SEPARATOR) && (strlen (post) > 0)))
854 strcat (result, DIR_SEPARATOR_STR);
855 strcat (result, post);
856 GNUNET_free (prefix);
863 * Get a configuration value that should be a string.
865 * @param cfg configuration to inspect
866 * @param section section of interest
867 * @param option option of interest
868 * @param value will be set to a freshly allocated configuration
869 * value, or NULL if option is not specified
870 * @return GNUNET_OK on success, GNUNET_SYSERR on error
873 GNUNET_CONFIGURATION_get_value_filename (const struct
874 GNUNET_CONFIGURATION_Handle *cfg,
876 const char *option, char **value)
881 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &tmp))
884 return GNUNET_SYSERR;
886 tmp = GNUNET_CONFIGURATION_expand_dollar (cfg, tmp);
887 *value = GNUNET_STRINGS_filename_expand (tmp);
890 return GNUNET_SYSERR;
896 * Get a configuration value that should be in a set of
897 * "GNUNET_YES" or "GNUNET_NO".
899 * @param cfg configuration to inspect
900 * @param section section of interest
901 * @param option option of interest
902 * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR
905 GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
906 *cfg, const char *section,
909 static const char *yesno[] = { "YES", "NO", NULL };
913 ret = GNUNET_CONFIGURATION_get_value_choice (cfg,
914 section, option, yesno, &val);
915 if (ret == GNUNET_SYSERR)
924 * Iterate over the set of filenames stored in a configuration value.
926 * @param cfg configuration to inspect
927 * @param section section of interest
928 * @param option option of interest
929 * @param cb function to call on each filename
930 * @param cb_cls closure for cb
931 * @return number of filenames iterated over, -1 on error
934 GNUNET_CONFIGURATION_iterate_value_filenames (const struct
935 GNUNET_CONFIGURATION_Handle
936 *cfg, const char *section,
938 GNUNET_FileNameCallback cb,
948 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
950 GNUNET_assert (list != NULL);
955 while (pos[0] == ' ')
957 if (strlen (pos) == 0)
960 while ((end[0] != ' ') && (end[0] != '\0'))
968 memmove (end, &end[1], strlen (&end[1]) + 1);
970 /* illegal, but just keep it */
973 /* illegal, but just ignore that there was a '/' */
981 if (strlen (pos) > 0)
984 if ((cb != NULL) && (GNUNET_OK != cb (cb_cls, pos)))
1002 * @param value FIXME
1006 escape_name (const char *value)
1012 escaped = GNUNET_malloc (strlen (value) * 2 + 1);
1013 memset (escaped, 0, strlen (value) * 2 + 1);
1016 while (rpos[0] != '\0')
1039 * @param cls string we compare with (const char*)
1040 * @param fn filename we are currently looking at
1041 * @return GNUNET_OK if the names do not match, GNUNET_SYSERR if they do
1044 test_match (void *cls, const char *fn)
1046 const char *of = cls;
1047 return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK;
1052 * Append a filename to a configuration value that
1053 * represents a list of filenames
1055 * @param cfg configuration to update
1056 * @param section section of interest
1057 * @param option option of interest
1058 * @param value filename to append
1059 * @return GNUNET_OK on success,
1060 * GNUNET_NO if the filename already in the list
1061 * GNUNET_SYSERR on error
1064 GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
1066 const char *section,
1075 == GNUNET_CONFIGURATION_iterate_value_filenames (cfg,
1080 return GNUNET_NO; /* already exists */
1082 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &old))
1083 old = GNUNET_strdup ("");
1084 escaped = escape_name (value);
1085 nw = GNUNET_malloc (strlen (old) + strlen (escaped) + 2);
1087 if (strlen (old) > 0)
1089 strcat (nw, escaped);
1090 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, nw);
1093 GNUNET_free (escaped);
1099 * Remove a filename from a configuration value that
1100 * represents a list of filenames
1102 * @param cfg configuration to update
1103 * @param section section of interest
1104 * @param option option of interest
1105 * @param value filename to remove
1106 * @return GNUNET_OK on success,
1107 * GNUNET_NO if the filename is not in the list,
1108 * GNUNET_SYSERR on error
1111 GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
1113 const char *section,
1124 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
1126 match = escape_name (value);
1130 while (pos[0] == ' ')
1132 if (strlen (pos) == 0)
1135 while ((end[0] != ' ') && (end[0] != '\0'))
1146 /* illegal, but just keep it */
1149 /* illegal, but just ignore that there was a '/' */
1157 if (0 == strcmp (pos, match))
1160 memmove (pos, &end[1], strlen (&end[1]) + 1);
1168 GNUNET_CONFIGURATION_set_value_string (cfg,
1169 section, option, list);
1171 GNUNET_free (match);
1180 GNUNET_free (match);
1186 * Load configuration (starts with defaults, then loads
1187 * system-specific configuration).
1189 * @param cfg configuration to update
1190 * @param filename name of the configuration file, NULL to load defaults
1191 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1194 GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
1195 const char *filename)
1200 ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
1202 return GNUNET_SYSERR;
1204 GNUNET_asprintf (&baseconfig,
1205 "%s%s%s", ipath, DIR_SEPARATOR_STR, "defaults.conf");
1206 GNUNET_free (ipath);
1208 GNUNET_CONFIGURATION_parse (cfg, baseconfig)) ||
1209 (!((filename == NULL) ||
1210 (GNUNET_OK == GNUNET_CONFIGURATION_parse (cfg, filename)))))
1212 GNUNET_free (baseconfig);
1213 return (filename == NULL) ? GNUNET_OK : GNUNET_SYSERR;
1215 GNUNET_free (baseconfig);
1216 if ( ((GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg,
1218 "DEFAULTCONFIG"))) &&
1219 (filename != NULL) )
1220 GNUNET_CONFIGURATION_set_value_string (cfg,
1224 if ((GNUNET_YES == GNUNET_CONFIGURATION_have_value (cfg,
1227 (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg,
1230 GNUNET_CRYPTO_random_disable_entropy_gathering ();
1236 /* end of configuration.c */