baum

diff actions.c @ 15:e2048e569891

insertLast returns now new inserted node; very dumb implementation for action_times
author meillo@marmaro.de
date Wed, 13 Feb 2008 09:57:07 +0100
parents 15e11eea1c66
children b62288419c1c
line diff
     1.1 --- a/actions.c	Wed Feb 13 09:16:01 2008 +0100
     1.2 +++ b/actions.c	Wed Feb 13 09:57:07 2008 +0100
     1.3 @@ -85,10 +85,16 @@
     1.4  
     1.5  unsigned char action_times(struct Node* node) {
     1.6  	struct Node* tp;
     1.7 +	struct Node* last;
     1.8  	unsigned char i;
     1.9  	tp = node->down;
    1.10  	for (i = 0; i < node->value; i++) {
    1.11  		/* deep copy */
    1.12 +		last = insertLast(node, newNode(tp->name, tp->value));
    1.13 +		if (tp->down != NULL) {
    1.14 +			last->down = newNode(tp->down->name, tp->down->value);
    1.15 +		}
    1.16 +
    1.17  	}
    1.18  	return 0;
    1.19  }