diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-04 22:26:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-04 22:26:15 +0000 |
commit | 5f7a1f1f2f20f07706275c9270f2f4ed0eb61d7a (patch) | |
tree | c5b661da3bd3dd07face32df7e68c37a9334cc53 /src/util/configuration.c | |
parent | 826d0b5c3deef513a4053342382a149ff844d004 (diff) | |
download | gnunet-5f7a1f1f2f20f07706275c9270f2f4ed0eb61d7a.tar.gz gnunet-5f7a1f1f2f20f07706275c9270f2f4ed0eb61d7a.zip |
-adding GNUNET_CONFIGURATION_load_from
Diffstat (limited to 'src/util/configuration.c')
-rw-r--r-- | src/util/configuration.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/configuration.c b/src/util/configuration.c index f24b2c2c6..6ec9a7183 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -1236,6 +1236,25 @@ parse_configuration_file (void *cls, const char *filename) | |||
1236 | 1236 | ||
1237 | 1237 | ||
1238 | /** | 1238 | /** |
1239 | * Load default configuration. This function will parse the | ||
1240 | * defaults from the given defaults_d directory. | ||
1241 | * | ||
1242 | * @param cfg configuration to update | ||
1243 | * @param defaults_d directory with the defaults | ||
1244 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
1245 | */ | ||
1246 | int | ||
1247 | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1248 | const char *defaults_d) | ||
1249 | { | ||
1250 | if (GNUNET_SYSERR == | ||
1251 | GNUNET_DISK_directory_scan (defaults_d, &parse_configuration_file, cfg)) | ||
1252 | return GNUNET_SYSERR; /* no configuration at all found */ | ||
1253 | return GNUNET_OK; | ||
1254 | } | ||
1255 | |||
1256 | |||
1257 | /** | ||
1239 | * Load configuration (starts with defaults, then loads | 1258 | * Load configuration (starts with defaults, then loads |
1240 | * system-specific configuration). | 1259 | * system-specific configuration). |
1241 | * | 1260 | * |