prettyness police
[unix-history] / usr / src / bin / test / operators.c
CommitLineData
5e857066 1/*-
fb0e8371
KB
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
5e857066
KB
4 *
5 * %sccs.include.redist.c%
6 */
7
8#ifndef lint
706c0358 9static char sccsid[] = "@(#)operators.c 8.2 (Berkeley) %G%";
5e857066
KB
10#endif /* not lint */
11
12/*
13 * Operators used in the test command.
14 */
15
16#include <stdio.h>
17
18#include "operators.h"
19
706c0358 20const char *const unary_op[] = {
5e857066
KB
21 "!",
22 "-b",
23 "-c",
24 "-d",
25 "-e",
26 "-f",
27 "-g",
fce331a7 28 "-h",
5e857066
KB
29 "-k",
30 "-n",
31 "-p",
32 "-r",
33 "-s",
34 "-t",
35 "-u",
36 "-w",
37 "-x",
38 "-z",
39 NULL
40};
41
706c0358 42const char *const binary_op[] = {
5e857066
KB
43 "-o",
44 "|",
45 "-a",
46 "&",
47 "=",
48 "!=",
49 "-eq",
50 "-ne",
51 "-gt",
52 "-lt",
53 "-le",
54 "-ge",
55 NULL
56};
57
58const char op_priority[] = {
59 3,
60 12,
61 12,
62 12,
63 12,
64 12,
65 12,
66 12,
67 12,
68 12,
69 12,
70 12,
71 12,
72 12,
73 12,
74 12,
75 12,
fce331a7 76 12,
5e857066
KB
77 1,
78 1,
79 2,
80 2,
81 4,
82 4,
83 4,
84 4,
85 4,
86 4,
87 4,
88 4,
89};
90
91const char op_argflag[] = {
92 0,
93 OP_FILE,
94 OP_FILE,
95 OP_FILE,
96 OP_FILE,
97 OP_FILE,
98 OP_FILE,
99 OP_FILE,
fce331a7 100 OP_FILE,
5e857066
KB
101 OP_STRING,
102 OP_FILE,
103 OP_FILE,
104 OP_FILE,
105 OP_INT,
106 OP_FILE,
107 OP_FILE,
108 OP_FILE,
109 OP_STRING,
110 0,
111 0,
112 0,
113 0,
114 OP_STRING,
115 OP_STRING,
116 OP_INT,
117 OP_INT,
118 OP_INT,
119 OP_INT,
120 OP_INT,
121 OP_INT,
122};