Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please users
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 10 Jul 2019 14:30:21 +0000 (16:30 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 10 Jul 2019 14:30:21 +0000 (16:30 +0200)
include/xbt/config.h
src/xbt/config.cpp

index e7c566a..486c5f7 100644 (file)
@@ -64,15 +64,19 @@ typedef void* xbt_cfg_t;
 SG_BEGIN_DECL()
 
 /* Set the value of the cell @a name in @a cfg with the provided value.*/
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int> or sg_cfg_set_int") XBT_PUBLIC
     void xbt_cfg_set_int(const char* name, int val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<double>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<double> or sg_cfg_set_double") XBT_PUBLIC
     void xbt_cfg_set_double(const char* name, double val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<bool>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<bool> or sg_cfg_set_boolean") XBT_PUBLIC
     void xbt_cfg_set_boolean(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>or sg_cfg_set_string") XBT_PUBLIC
     void xbt_cfg_set_string(const char* name, const char* val);
 
+XBT_PUBLIC void sg_cfg_set_int(const char* name, int val);
+XBT_PUBLIC void sg_cfg_set_double(const char* name, double val);
+XBT_PUBLIC void sg_cfg_set_boolean(const char* name, const char* val);
+XBT_PUBLIC void sg_cfg_set_string(const char* name, const char* val);
 /* @} */
 
 /** @defgroup XBT_cfg_decl Configuration type declaration and memory management
@@ -99,13 +103,16 @@ typedef void (*xbt_cfg_cb_t)(const char* name);
  *  @{
  */
 
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<int>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<int> or sg_cfg_get_int") XBT_PUBLIC
     int xbt_cfg_get_int(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<double>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<double> or sg_cfg_get_double") XBT_PUBLIC
     double xbt_cfg_get_double(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<bool>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<bool> or sg_cfg_get_boolean") XBT_PUBLIC
     int xbt_cfg_get_boolean(const char* name);
 
+XBT_PUBLIC int sg_cfg_get_int(const char* name);
+XBT_PUBLIC double sg_cfg_get_double(const char* name);
+XBT_PUBLIC int sg_cfg_get_boolean(const char* name);
 /** @} */
 
 SG_END_DECL()
index f70eec1..c50e805 100644 (file)
@@ -495,6 +495,11 @@ void help()
  * @param value the value of the variable
  */
 void xbt_cfg_set_int(const char *key, int value)
+{
+  sg_cfg_set_int(key, value);
+}
+
+void sg_cfg_set_int(const char* key, int value)
 {
   (*simgrid_config)[key].set_value<int>(value);
 }
@@ -505,6 +510,11 @@ void xbt_cfg_set_int(const char *key, int value)
  * @param value the double to set
  */
 void xbt_cfg_set_double(const char *key, double value)
+{
+  sg_cfg_set_double(key, value);
+}
+
+void sg_cfg_set_double(const char* key, double value)
 {
   (*simgrid_config)[key].set_value<double>(value);
 }
@@ -516,6 +526,11 @@ void xbt_cfg_set_double(const char *key, double value)
  *
  */
 void xbt_cfg_set_string(const char* key, const char* value)
+{
+  sg_cfg_set_string(key, value);
+}
+
+void sg_cfg_set_string(const char* key, const char* value)
 {
   (*simgrid_config)[key].set_value<std::string>(value);
 }
@@ -526,6 +541,11 @@ void xbt_cfg_set_string(const char* key, const char* value)
  * @param value the value of the variable
  */
 void xbt_cfg_set_boolean(const char *key, const char *value)
+{
+  sg_cfg_set_boolean(key, value);
+}
+
+void sg_cfg_set_boolean(const char* key, const char* value)
 {
   (*simgrid_config)[key].set_value<bool>(simgrid::config::parse_bool(value));
 }
@@ -538,6 +558,11 @@ void xbt_cfg_set_boolean(const char *key, const char *value)
  * Returns the first value from the config set under the given name.
  */
 int xbt_cfg_get_int(const char *key)
+{
+  return sg_cfg_get_int(key);
+}
+
+int sg_cfg_get_int(const char* key)
 {
   return (*simgrid_config)[key].get_value<int>();
 }
@@ -549,6 +574,11 @@ int xbt_cfg_get_int(const char *key)
  * Returns the first value from the config set under the given name.
  */
 double xbt_cfg_get_double(const char *key)
+{
+  return sg_cfg_get_double(key);
+}
+
+double sg_cfg_get_double(const char* key)
 {
   return (*simgrid_config)[key].get_value<double>();
 }
@@ -561,6 +591,11 @@ double xbt_cfg_get_double(const char *key)
  * If there is more than one value, it will issue a warning.
  */
 int xbt_cfg_get_boolean(const char *key)
+{
+  return sg_cfg_get_boolean(key);
+}
+
+int sg_cfg_get_boolean(const char* key)
 {
   return (*simgrid_config)[key].get_value<bool>() ? 1 : 0;
 }