fn = GNUNET_STRINGS_filename_expand (filename);
if (fn == NULL)
return GNUNET_SYSERR;
- GNUNET_DISK_directory_create_for_file (fn);
+ if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn))
+ {
+ GNUNET_free (fn);
+ return GNUNET_SYSERR;
+ }
if (NULL == (fp = FOPEN (fn, "w")))
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
}
+/**
+ * Iterate over all sections in the configuration.
+ *
+ * @param cfg configuration to inspect
+ * @param iter function to call on each section
+ * @param iter_cls closure for iter
+ */
+void
+GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_CONFIGURATION_Section_Iterator iter,
+ void *iter_cls)
+{
+ struct ConfigSection *spos;
+
+ for (spos = cfg->sections; spos != NULL; spos = spos->next)
+ iter (iter_cls, spos->name);
+}
+
+
/**
* Copy a configuration value to the given target configuration.
* Overwrites existing entries.