return ret;
}
+char *getVariableTypeIdByName (const char *name, type_t father)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ type_t type;
+ char *key;
+ xbt_dict_foreach(father->children, cursor, key, type) {
+ if (strcmp (name, type->name) == 0) return type->id;
+ }
+ return NULL;
+}
+
type_t getLinkType (const char *typename, type_t father, type_t source, type_t dest)
{
//FIXME should check using source and dest here and not by the typename (g5k example)
return (container_t)xbt_dict_get (allContainers, name);
}
+char *getContainerIdByName (const char *name)
+{
+ return getContainerByName(name)->id;
+}
+
container_t getRootContainer ()
{
return rootContainer;
container = NULL;
}
+static void recursiveDestroyContainer (container_t container)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ container_t child;
+ char *child_name;
+ xbt_dict_foreach(container->children, cursor, child_name, child) {
+ recursiveDestroyContainer (child);
+ }
+ destroyContainer (container);
+}
+
+static void recursiveDestroyType (type_t type)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ type_t child;
+ char *child_name;
+ xbt_dict_foreach(type->children, cursor, child_name, child) {
+ recursiveDestroyType (child);
+ }
+ xbt_free (type->name);
+ xbt_free (type->id);
+ xbt_free (type->children);
+ xbt_free (type);
+ type = NULL;
+}
+
+void destroyAllContainers ()
+{
+ if (getRootContainer()) recursiveDestroyContainer (getRootContainer());
+ if (getRootType()) recursiveDestroyType (getRootType());
+ rootContainer = NULL;
+ rootType = NULL;
+}
+
#endif /* HAVE_TRACING */