diff options
Diffstat (limited to 'usr.bin/tn3270/distribution/utilities/cross.c')
-rw-r--r-- | usr.bin/tn3270/distribution/utilities/cross.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/usr.bin/tn3270/distribution/utilities/cross.c b/usr.bin/tn3270/distribution/utilities/cross.c deleted file mode 100644 index 191aac0..0000000 --- a/usr.bin/tn3270/distribution/utilities/cross.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - This program is, essentially, a cross product generator. It takes - an input file which is said to consist of a number of lines, and - expands each line. A line like - (a,b)(c,d) - will be expanded to lines like - ac - ad - bc - bd - (without regard for the ORDER of the output; ie: the lines can appear - in any order). - - Parenthesis can be nested, so - (a,b)(c(d,e),f) - will produce - acd - ace - af - bcd - bce - bf - */ - - -#include <stdio.h> - -char leftParen, /* The left parenthesis character */ - rightParen; /* The right parenthesis character */ - - -/* Finds next occurrence of 'character' at this level of nesting. - Returns 0 if no such character found. - */ - -char * -ThisLevel(string, character) -char *string, character; -{ - int level; /* Level 0 is OUR level */ - - level = 0; - - while (*string != '\0') { - if (*string == leftParen) - level++; - else if (*string == rightParen) { - level--; - if (level < 0) - return(0); - } - if ((level == 0) && (*string == character)) - return(string); - string++; - } |