xref: /titanic_44/usr/src/lib/libshell/common/include/test.h (revision ee5416c9d7e449233197d5d20bc6b81e4ff091b2)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *           Copyright (c) 1982-2007 AT&T Knowledge Ventures            *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                      by AT&T Knowledge Ventures                      *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                  David Korn <dgk@research.att.com>                   *
18 *                                                                      *
19 ***********************************************************************/
20 #pragma prototyped
21 #ifndef TEST_ARITH
22 /*
23  *	UNIX shell
24  *	David Korn
25  *	AT&T Labs
26  *
27  */
28 
29 #include	"FEATURE/options"
30 #include	"shtable.h"
31 /*
32  *  These are the valid test operators
33  */
34 
35 #define TEST_ARITH	040	/* arithmetic operators */
36 #define TEST_BINOP	0200	/* binary operator */
37 #define TEST_PATTERN	0100	/* turn off bit for pattern compares */
38 
39 #define TEST_NE		(TEST_ARITH|9)
40 #define TEST_EQ		(TEST_ARITH|4)
41 #define TEST_GE		(TEST_ARITH|5)
42 #define TEST_GT		(TEST_ARITH|6)
43 #define TEST_LE		(TEST_ARITH|7)
44 #define TEST_LT		(TEST_ARITH|8)
45 #define TEST_OR		(TEST_BINOP|1)
46 #define TEST_AND	(TEST_BINOP|2)
47 #define TEST_SNE	(TEST_PATTERN|1)
48 #define TEST_SEQ	(TEST_PATTERN|14)
49 #define TEST_PNE	1
50 #define TEST_PEQ	14
51 #define TEST_EF		3
52 #define TEST_NT		10
53 #define TEST_OT		12
54 #define TEST_SLT	15
55 #define TEST_SGT	16
56 #define TEST_END	8
57 #define TEST_REP	20
58 
59 extern int test_unop(int, const char*);
60 extern int test_inode(const char*, const char*);
61 extern int test_binop(int, const char*, const char*);
62 
63 extern const char	sh_opttest[];
64 extern const char	test_opchars[];
65 extern const char	e_argument[];
66 extern const char	e_missing[];
67 extern const char	e_badop[];
68 extern const char	e_tstbegin[];
69 extern const char	e_tstend[];
70 
71 #endif /* TEST_ARITH */
72