gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20255 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r20255 - in gnunet/src: include util
Date: Sun, 4 Mar 2012 23:26:15 +0100

Author: grothoff
Date: 2012-03-04 23:26:15 +0100 (Sun, 04 Mar 2012)
New Revision: 20255

Modified:
   gnunet/src/include/gnunet_configuration_lib.h
   gnunet/src/util/configuration.c
Log:
-adding GNUNET_CONFIGURATION_load_from

Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h       2012-03-04 22:16:30 UTC 
(rev 20254)
+++ gnunet/src/include/gnunet_configuration_lib.h       2012-03-04 22:26:15 UTC 
(rev 20255)
@@ -87,6 +87,19 @@
 
 
 /**
+ * Load default configuration.  This function will parse the
+ * defaults from the given defaults_d directory.
+ *
+ * @param cfg configuration to update
+ * @param defaults_d directory with the defaults
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+int
+GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
+                               const char *defaults_d);
+
+
+/**
  * Parse a configuration file, add all of the options in the
  * file to the configuration environment.
  *

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2012-03-04 22:16:30 UTC (rev 20254)
+++ gnunet/src/util/configuration.c     2012-03-04 22:26:15 UTC (rev 20255)
@@ -1236,6 +1236,25 @@
 
 
 /**
+ * Load default configuration.  This function will parse the
+ * defaults from the given defaults_d directory.
+ *
+ * @param cfg configuration to update
+ * @param defaults_d directory with the defaults
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+int
+GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
+                               const char *defaults_d)
+{
+  if (GNUNET_SYSERR ==
+      GNUNET_DISK_directory_scan (defaults_d, &parse_configuration_file, cfg))
+    return GNUNET_SYSERR;       /* no configuration at all found */
+  return GNUNET_OK;
+}
+
+
+/**
  * Load configuration (starts with defaults, then loads
  * system-specific configuration).
  *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]