comparison actions.c @ 46:22305a6e128d

added deep copy and fixed so node times
author meillo@marmaro.de
date Sun, 02 Mar 2008 10:29:55 +0100
parents 0b82169d4129
children c31b5bb6d493
comparison
equal deleted inserted replaced
45:0b82169d4129 46:22305a6e128d
85 return 0; 85 return 0;
86 } 86 }
87 87
88 88
89 unsigned char action_times(struct Node* node) { 89 unsigned char action_times(struct Node* node) {
90 struct Node* tp;
91 struct Node* last;
92 unsigned char i; 90 unsigned char i;
93 tp = node->down;
94 for (i = 0; i < node->value; i++) { 91 for (i = 0; i < node->value; i++) {
95 /* FIXME deep copy */ 92 insertLast(node, copyTree(node->down));
96 last = insertLast(node, newNode(tp->name, tp->value));
97 if (tp->down != NULL) {
98 last->down = newNode(tp->down->name, tp->down->value);
99 }
100
101 } 93 }
102 return 0; 94 return 0;
103 } 95 }