- return getValue (valuename, NULL, father);
-}
-
-static type_t newType (const char *typename, const char *key, const char *color, e_entity_types kind, type_t father)
-{
- type_t ret = xbt_new0(s_type_t, 1);
- ret->name = xbt_strdup (typename);
- ret->father = father;
- ret->kind = kind;
- ret->children = xbt_dict_new_homogeneous(NULL);
- ret->values = xbt_dict_new_homogeneous(NULL);
- ret->color = xbt_strdup (color);
-
- char str_id[INSTR_DEFAULT_STR_SIZE];
- snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", new_type_id());
- ret->id = xbt_strdup (str_id);
-
- if (father != NULL){
- xbt_dict_set (father->children, key, ret, NULL);
- XBT_DEBUG("new type %s, child of %s", typename, father->name);
- }
- return ret;
-}
-
-type_t getRootType ()
-{
- return rootType;
-}
-
-type_t getContainerType (const char *typename, type_t father)
-{
- type_t ret;
- if (father == NULL){
- ret = newType (typename, typename, NULL, TYPE_CONTAINER, father);
- if (father) new_pajeDefineContainerType (ret);
- rootType = ret;
- }else{
- //check if my father type already has my typename
- ret = (type_t)xbt_dict_get_or_null (father->children, typename);
- if (ret == NULL){
- ret = newType (typename, typename, NULL, TYPE_CONTAINER, father);
- new_pajeDefineContainerType (ret);
- }
- }
- return ret;
-}
-
-type_t getEventType (const char *typename, const char *color, type_t father)
-{
- type_t ret = xbt_dict_get_or_null (father->children, typename);
- if (ret == NULL){
- char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
- if (!color){
- ret = newType (typename, typename, white, TYPE_EVENT, father);
- }else{
- ret = newType (typename, typename, color, TYPE_EVENT, father);
- }
- XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
- new_pajeDefineEventType(ret);
- }
- return ret;
-}
-
-type_t getVariableType (const char *typename, const char *color, type_t father)
-{
- type_t ret = xbt_dict_get_or_null (father->children, typename);
- if (ret == NULL){
- char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
- if (!color){
- ret = newType (typename, typename, white, TYPE_VARIABLE, father);
- }else{
- ret = newType (typename, typename, color, TYPE_VARIABLE, father);
- }
- XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
- new_pajeDefineVariableType (ret);
- }
- 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)
-{
- char key[INSTR_DEFAULT_STR_SIZE];
- snprintf (key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", typename, source->id, dest->id);
- type_t ret = xbt_dict_get_or_null (father->children, key);
- if (ret == NULL){
- ret = newType (typename, key, NULL, TYPE_LINK, father);
- XBT_DEBUG("LinkType %s(%s), child of %s(%s) %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id, source->name, source->id, dest->name, dest->id);
- new_pajeDefineLinkType(ret, source, dest);
- }
- return ret;
-}
-
-type_t getStateType (const char *typename, type_t father)
-{
- type_t ret = xbt_dict_get_or_null (father->children, typename);
- if (ret == NULL){
- ret = newType (typename, typename, NULL, TYPE_STATE, father);
- XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
- new_pajeDefineStateType(ret);
- }
- return ret;