baum

diff baum.c @ 41:1ad3d7305e5d

reduced output; cleanups
author meillo@marmaro.de
date Sat, 01 Mar 2008 20:35:00 +0100
parents 5c13e29bc6fd
children 233ac9bea4f1
line diff
     1.1 --- a/baum.c	Sat Mar 01 20:15:20 2008 +0100
     1.2 +++ b/baum.c	Sat Mar 01 20:35:00 2008 +0100
     1.3 @@ -17,16 +17,22 @@
     1.4  #define VERSION "0.3"
     1.5  
     1.6  
     1.7 -struct Node* root = 0;
     1.8 -struct Stackitem* stack = NULL;
     1.9 -
    1.10 -
    1.11  void printNode(struct Node* node, int level);
    1.12  void printTree(struct Node* root, int level);
    1.13  struct Node* lastNode(struct Node* node);
    1.14  void delete(struct Node* node);
    1.15  
    1.16  
    1.17 +struct Stackitem {
    1.18 +	struct Node* node;
    1.19 +	struct Stackitem* next;
    1.20 +};
    1.21 +
    1.22 +
    1.23 +
    1.24 +struct Node* root = 0;
    1.25 +struct Stackitem* stack = NULL;
    1.26 +
    1.27  
    1.28  void logit(char* text) {
    1.29  	if (option_verbose) {
    1.30 @@ -260,6 +266,7 @@
    1.31  	read_input(argv[0]);
    1.32  
    1.33  	if (option_verbose) {
    1.34 +		fprintf(stderr, "\n\ntree read from input\n(should be the same without comments and empty lines)\n\n");
    1.35  		printTree(root, 0);
    1.36  	}
    1.37  
    1.38 @@ -267,6 +274,7 @@
    1.39  	fflush(stdout);
    1.40  
    1.41  	if (option_verbose) {
    1.42 +		fprintf(stderr, "\n\ntree after execution of the program\n\n");
    1.43  		printTree(root, 0);
    1.44  	}
    1.45