# HG changeset patch # User meillo@marmaro.de # Date 1204471566 -3600 # Node ID 201b4603671a97a650df8dd0c415d08a0ab8e357 # Parent 7d7abe88e71bcd34d8b3efac709c5ede4e12c96c documented "if" and "while" in the man page; new error code 7 diff -r 7d7abe88e71b -r 201b4603671a actions.c --- a/actions.c Sun Mar 02 16:17:18 2008 +0100 +++ b/actions.c Sun Mar 02 16:26:06 2008 +0100 @@ -115,7 +115,7 @@ if (node->down == NULL || node->down->right == NULL) { fprintf(stderr, "error: while requires two sons"); - exit(1); /* FIXME other error code */ + exit(7); } return1 = action(node->down); @@ -145,7 +145,7 @@ unsigned char action_while(struct Node* node) { if (node->down == NULL || node->down->right == NULL) { fprintf(stderr, "error: while requires two sons"); - exit(1); /* FIXME other error code */ + exit(7); } while (action(node->down)) { action(node->down->right); diff -r 7d7abe88e71b -r 201b4603671a baum.1 --- a/baum.1 Sun Mar 02 16:17:18 2008 +0100 +++ b/baum.1 Sun Mar 02 16:26:06 2008 +0100 @@ -78,6 +78,10 @@ Creates a new number node as last brother. The value of the new node is ether read from standard input (if the node has no son), or the return value of the first son. Returns 0 always. .TP +.B if +Compares return value of first son and second son. The internal value defines how the comparation is done. 33 (`!') means not equal; 60 (`<') less than; 62 (`>') greater than; and everything else stands for equal. Requires two sons. Returns 1 for true and 0 for false. + +.TP .B number Executes it's leftmost son. Returns the internal value. @@ -93,6 +97,11 @@ .B times Copies everything below the node and pastes it as last brother(s). Returns 0 always. +.TP +.B while +Executes it's second son as long the first son returns a logical true (not `0'). Requires two sons. Returns 0 always; + + @@ -123,6 +132,10 @@ node name too long, or no value given .TP +.BI 7 +a node has not the required amount of sons + +.TP .BI 126 invalid command line options