xref: /csrg-svn/bin/test/operators.c (revision 66643)
159573Sbostic /*-
2*66643Spendry  * Copyright (c) 1993, 1994
360726Sbostic  *	The Regents of the University of California.  All rights reserved.
459573Sbostic  *
559573Sbostic  * %sccs.include.redist.c%
659573Sbostic  */
759573Sbostic 
859573Sbostic #ifndef lint
9*66643Spendry static char sccsid[] = "@(#)operators.c	8.3 (Berkeley) 04/02/94";
1059573Sbostic #endif /* not lint */
1159573Sbostic 
1259573Sbostic /*
1359573Sbostic  * Operators used in the test command.
1459573Sbostic  */
1559573Sbostic 
1659573Sbostic #include <stdio.h>
1759573Sbostic 
1859573Sbostic #include "operators.h"
1959573Sbostic 
2066565Spendry const char *const unary_op[] = {
2159573Sbostic       "!",
2259573Sbostic       "-b",
2359573Sbostic       "-c",
2459573Sbostic       "-d",
2559573Sbostic       "-e",
2659573Sbostic       "-f",
2759573Sbostic       "-g",
2860597Sbostic       "-h",
2959573Sbostic       "-k",
3059573Sbostic       "-n",
3159573Sbostic       "-p",
3259573Sbostic       "-r",
3359573Sbostic       "-s",
3459573Sbostic       "-t",
3559573Sbostic       "-u",
3659573Sbostic       "-w",
3759573Sbostic       "-x",
3859573Sbostic       "-z",
3959573Sbostic       NULL
4059573Sbostic };
4159573Sbostic 
4266565Spendry const char *const binary_op[] = {
4359573Sbostic       "-o",
4459573Sbostic       "|",
4559573Sbostic       "-a",
4659573Sbostic       "&",
4759573Sbostic       "=",
4859573Sbostic       "!=",
4959573Sbostic       "-eq",
5059573Sbostic       "-ne",
5159573Sbostic       "-gt",
5259573Sbostic       "-lt",
5359573Sbostic       "-le",
5459573Sbostic       "-ge",
5559573Sbostic       NULL
5659573Sbostic };
5759573Sbostic 
5859573Sbostic const char op_priority[] = {
5959573Sbostic       3,
6059573Sbostic       12,
6159573Sbostic       12,
6259573Sbostic       12,
6359573Sbostic       12,
6459573Sbostic       12,
6559573Sbostic       12,
6659573Sbostic       12,
6759573Sbostic       12,
6859573Sbostic       12,
6959573Sbostic       12,
7059573Sbostic       12,
7159573Sbostic       12,
7259573Sbostic       12,
7359573Sbostic       12,
7459573Sbostic       12,
7559573Sbostic       12,
7660597Sbostic       12,
7759573Sbostic       1,
7859573Sbostic       1,
7959573Sbostic       2,
8059573Sbostic       2,
8159573Sbostic       4,
8259573Sbostic       4,
8359573Sbostic       4,
8459573Sbostic       4,
8559573Sbostic       4,
8659573Sbostic       4,
8759573Sbostic       4,
8859573Sbostic       4,
8959573Sbostic };
9059573Sbostic 
9159573Sbostic const char op_argflag[] = {
9259573Sbostic       0,
9359573Sbostic       OP_FILE,
9459573Sbostic       OP_FILE,
9559573Sbostic       OP_FILE,
9659573Sbostic       OP_FILE,
9759573Sbostic       OP_FILE,
9859573Sbostic       OP_FILE,
9959573Sbostic       OP_FILE,
10060597Sbostic       OP_FILE,
10159573Sbostic       OP_STRING,
10259573Sbostic       OP_FILE,
10359573Sbostic       OP_FILE,
10459573Sbostic       OP_FILE,
10559573Sbostic       OP_INT,
10659573Sbostic       OP_FILE,
10759573Sbostic       OP_FILE,
10859573Sbostic       OP_FILE,
10959573Sbostic       OP_STRING,
11059573Sbostic       0,
11159573Sbostic       0,
11259573Sbostic       0,
11359573Sbostic       0,
11459573Sbostic       OP_STRING,
11559573Sbostic       OP_STRING,
11659573Sbostic       OP_INT,
11759573Sbostic       OP_INT,
11859573Sbostic       OP_INT,
11959573Sbostic       OP_INT,
12059573Sbostic       OP_INT,
12159573Sbostic       OP_INT,
12259573Sbostic };
123