baum
changeset 41:1ad3d7305e5d
reduced output; cleanups
author | meillo@marmaro.de |
---|---|
date | Sat, 01 Mar 2008 20:35:00 +0100 |
parents | 5c13e29bc6fd |
children | 233ac9bea4f1 |
files | actions.c baum.c baum.h |
diffstat | 3 files changed, 12 insertions(+), 13 deletions(-) [+] |
line diff
1.1 --- a/actions.c Sat Mar 01 20:15:20 2008 +0100 1.2 +++ b/actions.c Sat Mar 01 20:35:00 2008 +0100 1.3 @@ -20,8 +20,6 @@ 1.4 return 0; 1.5 } 1.6 1.7 - logit(node->name); 1.8 - 1.9 if (strcmp(node->name, "print") == 0) { 1.10 return action_print(node); 1.11
2.1 --- a/baum.c Sat Mar 01 20:15:20 2008 +0100 2.2 +++ b/baum.c Sat Mar 01 20:35:00 2008 +0100 2.3 @@ -17,16 +17,22 @@ 2.4 #define VERSION "0.3" 2.5 2.6 2.7 -struct Node* root = 0; 2.8 -struct Stackitem* stack = NULL; 2.9 - 2.10 - 2.11 void printNode(struct Node* node, int level); 2.12 void printTree(struct Node* root, int level); 2.13 struct Node* lastNode(struct Node* node); 2.14 void delete(struct Node* node); 2.15 2.16 2.17 +struct Stackitem { 2.18 + struct Node* node; 2.19 + struct Stackitem* next; 2.20 +}; 2.21 + 2.22 + 2.23 + 2.24 +struct Node* root = 0; 2.25 +struct Stackitem* stack = NULL; 2.26 + 2.27 2.28 void logit(char* text) { 2.29 if (option_verbose) { 2.30 @@ -260,6 +266,7 @@ 2.31 read_input(argv[0]); 2.32 2.33 if (option_verbose) { 2.34 + fprintf(stderr, "\n\ntree read from input\n(should be the same without comments and empty lines)\n\n"); 2.35 printTree(root, 0); 2.36 } 2.37 2.38 @@ -267,6 +274,7 @@ 2.39 fflush(stdout); 2.40 2.41 if (option_verbose) { 2.42 + fprintf(stderr, "\n\ntree after execution of the program\n\n"); 2.43 printTree(root, 0); 2.44 } 2.45
3.1 --- a/baum.h Sat Mar 01 20:15:20 2008 +0100 3.2 +++ b/baum.h Sat Mar 01 20:35:00 2008 +0100 3.3 @@ -1,7 +1,5 @@ 3.4 int option_verbose; 3.5 3.6 -void logit(char* text); 3.7 - 3.8 struct Node* newNode(char* name, unsigned char value); 3.9 struct Node* insertLast(struct Node* node, struct Node* insert); 3.10 3.11 @@ -13,8 +11,3 @@ 3.12 struct Node* down; 3.13 struct Node* right; 3.14 }; 3.15 - 3.16 -struct Stackitem { 3.17 - struct Node* node; 3.18 - struct Stackitem* next; 3.19 -};