diff --git a/src/ktkProgram.c b/src/ktkProgram.c index 2dfa096..fd181f2 100644 --- a/src/ktkProgram.c +++ b/src/ktkProgram.c @@ -238,7 +238,8 @@ struct ktkLive *ktk_buildStructure(struct ktkProgram *program, struct ktkLive *l } int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live, struct ktkLive *new_live, struct ktkMap *orig_map) { - struct ktkLive *parent_live = NULL; + //struct ktkLive *parent_live = NULL; + struct ktkLive *parent_live = new_live; // *** step 1. get our structure and check for pathing struct ktkStructure *structure; if ((structure = ktk_getStructure(program, live->name)) != NULL) { @@ -457,7 +458,7 @@ int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live, struct } } } - if (parent_live == NULL) { + /*if (parent_live == NULL) { parent_live = malloc(sizeof(struct ktkLive)); *parent_live = ktk_LIVE_DEFAULT; if (live->name == NULL) { @@ -467,7 +468,7 @@ int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live, struct memcpy(parent_live->name, live->name, strlen(live->name)+1); } ktk_addLiveChild(new_live, parent_live); - } + }*/ // *** step int i; for (i = 0; i < live->child_count; i++) { diff --git a/src/ktkStructure.c b/src/ktkStructure.c index dd9e931..8ccd57e 100644 --- a/src/ktkStructure.c +++ b/src/ktkStructure.c @@ -274,9 +274,11 @@ int ktk_deleteLive(struct ktkLive *live) { } int ktk_addLiveChild(struct ktkLive *parent, struct ktkLive *child) { + printf("%d\n", parent->child_count); parent->child_count++; parent->children = realloc(parent->children, parent->child_count*sizeof(struct ktkLive*)); parent->children[parent->child_count-1] = child; + child->parent = parent; return 0; }