Mercurial > baum
comparison actions.c @ 52:201b4603671a
documented "if" and "while" in the man page; new error code 7
author | meillo@marmaro.de |
---|---|
date | Sun, 02 Mar 2008 16:26:06 +0100 |
parents | 7d7abe88e71b |
children | 036779d5da75 |
comparison
equal
deleted
inserted
replaced
51:7d7abe88e71b | 52:201b4603671a |
---|---|
113 char return1; | 113 char return1; |
114 char return2; | 114 char return2; |
115 | 115 |
116 if (node->down == NULL || node->down->right == NULL) { | 116 if (node->down == NULL || node->down->right == NULL) { |
117 fprintf(stderr, "error: while requires two sons"); | 117 fprintf(stderr, "error: while requires two sons"); |
118 exit(1); /* FIXME other error code */ | 118 exit(7); |
119 } | 119 } |
120 | 120 |
121 return1 = action(node->down); | 121 return1 = action(node->down); |
122 return2 = action(node->down->right); | 122 return2 = action(node->down->right); |
123 | 123 |
143 | 143 |
144 | 144 |
145 unsigned char action_while(struct Node* node) { | 145 unsigned char action_while(struct Node* node) { |
146 if (node->down == NULL || node->down->right == NULL) { | 146 if (node->down == NULL || node->down->right == NULL) { |
147 fprintf(stderr, "error: while requires two sons"); | 147 fprintf(stderr, "error: while requires two sons"); |
148 exit(1); /* FIXME other error code */ | 148 exit(7); |
149 } | 149 } |
150 while (action(node->down)) { | 150 while (action(node->down)) { |
151 action(node->down->right); | 151 action(node->down->right); |
152 } | 152 } |
153 return 0; | 153 return 0; |