-extern std::map<std::string, simgrid::surf::StorageType*> storage_types;
-
-#include <simgrid/plugins/dvfs.h> // FIXME: this plug-in should not be linked to the core
-#include <simgrid/plugins/energy.h> // FIXME: this plug-in should not be linked to the core
-#include <simgrid/plugins/load.h> // FIXME: this plug-in should not be linked to the core
-
-s_surf_model_description_t surf_plugin_description[] = {
- {"host_energy", "Cpu energy consumption.", &sg_host_energy_plugin_init},
- {"link_energy", "Link energy consumption.", &sg_link_energy_plugin_init},
- {"host_dvfs", "Dvfs support", &sg_host_dvfs_plugin_init},
- {"host_load", "Cpu load.", &sg_host_load_plugin_init},
- {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
+extern std::map<std::string, simgrid::kernel::resource::StorageType*> storage_types;
+
+std::vector<surf_model_description_t>* surf_plugin_description = nullptr;
+
+static void XBT_ATTRIB_DESTRUCTOR(800) simgrid_free_plugin_description()
+{
+ delete surf_plugin_description;
+ surf_plugin_description = nullptr;
+}
+
+XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* description, void_f_void_t init_fun)
+{
+ if (not surf_plugin_description)
+ surf_plugin_description = new std::vector<surf_model_description_t>;
+ surf_plugin_description->emplace_back(surf_model_description_t{name, description, init_fun});
+}