1 /* Copyright (c) 2016. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include <xbt/config.h>
11 #include <xbt/config.hpp>
16 static void callCallback(const char* name, void* data)
18 (*(std::function<void(const char*)>*) data)(name);
21 static void freeCallback(void* data)
23 delete (std::function<void(const char*)>*) data;
26 void registerConfig(const char* name, const char* description,
27 e_xbt_cfgelm_type_t type,
28 std::function<void(const char*)> callback)
30 std::function<void(const char*)>* code
31 = new std::function<void(const char*)>(std::move(callback));
32 xbt_cfg_register_ext(name, description, type,
33 callCallback, code, freeCallback);