+ if (rootType) recursiveDestroyType (rootType);
+}
+
+/*
+ * user categories support
+ */
+static void recursiveNewUserVariableType (const char *new_typename, const char *color, type_t root)
+{
+ if (!strcmp (root->name, "HOST") || !strcmp (root->name, "LINK")){
+ newVariableType(new_typename, TYPE_VARIABLE, color, root);
+ }
+ xbt_dict_cursor_t cursor = NULL;
+ type_t child_type;
+ char *name;
+ xbt_dict_foreach(root->children, cursor, name, child_type) {
+ recursiveNewUserVariableType (new_typename, color, child_type);
+ }
+}
+
+void instr_new_user_variable_type (const char *new_typename, const char *color)
+{
+ recursiveNewUserVariableType (new_typename, color, rootType);
+}
+
+static void recursiveNewUserLinkVariableType (const char *new_typename, const char *color, type_t root)
+{
+ if (!strcmp (root->name, "LINK")){
+ newVariableType(new_typename, TYPE_VARIABLE, color, root);
+ }
+ xbt_dict_cursor_t cursor = NULL;
+ type_t child_type;
+ char *name;
+ xbt_dict_foreach(root->children, cursor, name, child_type) {
+ recursiveNewUserLinkVariableType (new_typename, color, child_type);
+ }
+}
+
+void instr_new_user_link_variable_type (const char *new_typename, const char *color)
+{
+ recursiveNewUserLinkVariableType (new_typename, color, rootType);
+}
+
+
+static void recursiveNewUserHostVariableType (const char *new_typename, const char *color, type_t root)
+{
+ if (!strcmp (root->name, "HOST")){
+ newVariableType(new_typename, TYPE_VARIABLE, color, root);
+ }
+ xbt_dict_cursor_t cursor = NULL;
+ type_t child_type;
+ char *name;
+ xbt_dict_foreach(root->children, cursor, name, child_type) {
+ recursiveNewUserHostVariableType (new_typename, color, child_type);
+ }
+}
+
+void instr_new_user_host_variable_type (const char *new_typename, const char *color)
+{
+ recursiveNewUserHostVariableType (new_typename, color, rootType);