aboutsummaryrefslogtreecommitdiff
path: root/src/util/configuration.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/configuration.c')
-rw-r--r--src/util/configuration.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 24b38f933..f61b43d57 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -1694,47 +1694,4 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
1694} 1694}
1695 1695
1696 1696
1697/**
1698 * Load configuration (starts with defaults, then loads
1699 * system-specific configuration).
1700 *
1701 * @param cfg configuration to update
1702 * @param filename name of the configuration file, NULL to load defaults
1703 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1704 */
1705int
1706GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
1707 const char *filename)
1708{
1709 char *baseconfig;
1710 char *ipath;
1711
1712 ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
1713 if (NULL == ipath)
1714 return GNUNET_SYSERR;
1715 baseconfig = NULL;
1716 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
1717 GNUNET_free (ipath);
1718 if (GNUNET_SYSERR ==
1719 GNUNET_DISK_directory_scan (baseconfig, &parse_configuration_file, cfg))
1720 {
1721 GNUNET_free (baseconfig);
1722 return GNUNET_SYSERR; /* no configuration at all found */
1723 }
1724 GNUNET_free (baseconfig);
1725 if ((NULL != filename) &&
1726 (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, filename)))
1727 {
1728 /* specified configuration not found */
1729 return GNUNET_SYSERR;
1730 }
1731 if (((GNUNET_YES !=
1732 GNUNET_CONFIGURATION_have_value (cfg, "PATHS", "DEFAULTCONFIG"))) &&
1733 (filename != NULL))
1734 GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG",
1735 filename);
1736 return GNUNET_OK;
1737}
1738
1739
1740/* end of configuration.c */ 1697/* end of configuration.c */