From: Martin Quinson Date: Thu, 7 Apr 2016 06:38:32 +0000 (+0200) Subject: config: kill unused functions X-Git-Tag: v3_13~142 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d6b51bdf75f6c7eefae99d73fdd701febeb04db1 config: kill unused functions --- diff --git a/include/xbt/config.h b/include/xbt/config.h index 2d0e359bc2..cd805e2cee 100644 --- a/include/xbt/config.h +++ b/include/xbt/config.h @@ -175,12 +175,6 @@ XBT_PUBLIC(int) xbt_cfg_get_int(const char *name); XBT_PUBLIC(double) xbt_cfg_get_double(const char *name); XBT_PUBLIC(char *) xbt_cfg_get_string(const char *name); XBT_PUBLIC(int) xbt_cfg_get_boolean(const char *name); -XBT_PUBLIC(xbt_dynar_t) xbt_cfg_get_dynar(const char *name); - -XBT_PUBLIC(int) xbt_cfg_get_int_at(xbt_cfg_t cfg, const char *name, int pos); -XBT_PUBLIC(double) xbt_cfg_get_double_at(xbt_cfg_t cfg, const char *name, int pos); -XBT_PUBLIC(char *) xbt_cfg_get_string_at(xbt_cfg_t cfg, const char *name, int pos); -XBT_PUBLIC(int) xbt_cfg_get_boolean_at(xbt_cfg_t cfg, const char *name, int pos); /** @} */ diff --git a/src/include/simgrid/sg_config.h b/src/include/simgrid/sg_config.h index 6f61086e22..70007cce78 100644 --- a/src/include/simgrid/sg_config.h +++ b/src/include/simgrid/sg_config.h @@ -17,7 +17,6 @@ XBT_PUBLIC(int) sg_cfg_get_int(const char* name); XBT_PUBLIC(double) sg_cfg_get_double(const char* name); XBT_PUBLIC(char*) sg_cfg_get_string(const char* name); XBT_PUBLIC(int) sg_cfg_get_boolean(const char* name); -XBT_PUBLIC(xbt_dynar_t) sg_cfg_get_dynar(const char* name); XBT_PUBLIC(void) sg_config_init(int *argc, char **argv); XBT_PUBLIC(void) sg_config_finalize(void); diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 4bee5be40e..b69dd5fc41 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -344,7 +344,7 @@ static void _sg_cfg_cb__test_sleep(const char *name, int pos){ /* callback of the inclusion path */ static void _sg_cfg_cb__surf_path(const char *name, int pos) { - char *path = xbt_strdup(xbt_cfg_get_string_at(simgrid_config, name, pos)); + char *path = xbt_strdup(xbt_cfg_get_string(name)); if (path[0]) // ignore "" xbt_dynar_push(surf_path, &path); } @@ -734,7 +734,3 @@ int sg_cfg_get_boolean(const char* name) return xbt_cfg_get_boolean(name); } -xbt_dynar_t sg_cfg_get_dynar(const char* name) -{ - return xbt_cfg_get_dynar(name); -} diff --git a/src/xbt/config.c b/src/xbt/config.c index c13411c732..488ba63e31 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -865,61 +865,6 @@ int xbt_cfg_get_boolean(const char *name) return xbt_dynar_get_as(variable->content, 0, int); } -/** @brief Retrieve the dynar of all the values stored in a variable - * - * @param cfg where to search in - * @param name what to search for - * - * Get the data stored in the config set. - * - * \warning the returned value is the actual content of the config set - */ -xbt_dynar_t xbt_cfg_get_dynar(const char *name) -{ - xbt_cfgelm_t variable = NULL; - xbt_ex_t e; - - TRY { - variable = xbt_dict_get((xbt_dict_t) simgrid_config, name); - } CATCH(e) { - if (e.category == not_found_error) { - xbt_ex_free(e); - THROWF(not_found_error, 0, "No registered variable %s in this config set", name); - } - RETHROW; - } - - return variable->content; -} - -/** @brief Retrieve one of the integer value of a variable */ -int xbt_cfg_get_int_at(xbt_cfg_t cfg, const char *name, int pos) -{ - xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int); - return xbt_dynar_get_as(variable->content, pos, int); -} - -/** @brief Retrieve one of the double value of a variable */ -double xbt_cfg_get_double_at(xbt_cfg_t cfg, const char *name, int pos) -{ - xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double); - return xbt_dynar_get_as(variable->content, pos, double); -} - -/** @brief Retrieve one of the string value of a variable */ -char *xbt_cfg_get_string_at(xbt_cfg_t cfg, const char *name, int pos) -{ - xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string); - return xbt_dynar_get_as(variable->content, pos, char *); -} - -/** @brief Retrieve one of the boolean value of a variable */ -int xbt_cfg_get_boolean_at(xbt_cfg_t cfg, const char *name, int pos) -{ - xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_boolean); - return xbt_dynar_get_as(variable->content, pos, int); -} - #ifdef SIMGRID_TEST #include "xbt.h" #include "xbt/ex.h"