xref: /illumos-gate/usr/src/contrib/ast/src/cmd/ksh93/include/test.h (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1982-2011 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                 Eclipse Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *          http://www.eclipse.org/org/documents/epl-v10.html           *
11 *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
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	"defs.h"
31 #include	"shtable.h"
32 /*
33  *  These are the valid test operators
34  */
35 
36 #define TEST_ARITH	040	/* arithmetic operators */
37 #define TEST_BINOP	0200	/* binary operator */
38 #define TEST_PATTERN	0100	/* turn off bit for pattern compares */
39 
40 #define TEST_NE		(TEST_ARITH|9)
41 #define TEST_EQ		(TEST_ARITH|4)
42 #define TEST_GE		(TEST_ARITH|5)
43 #define TEST_GT		(TEST_ARITH|6)
44 #define TEST_LE		(TEST_ARITH|7)
45 #define TEST_LT		(TEST_ARITH|8)
46 #define TEST_OR		(TEST_BINOP|1)
47 #define TEST_AND	(TEST_BINOP|2)
48 #define TEST_SNE	(TEST_PATTERN|1)
49 #define TEST_SEQ	(TEST_PATTERN|14)
50 #define TEST_PNE	1
51 #define TEST_PEQ	14
52 #define TEST_EF		3
53 #define TEST_NT		10
54 #define TEST_OT		12
55 #define TEST_SLT	16
56 #define TEST_SGT	17
57 #define TEST_END	8
58 #define TEST_REP	20
59 
60 extern int test_unop(Shell_t*,int, const char*);
61 extern int test_inode(const char*, const char*);
62 extern int test_binop(Shell_t*,int, const char*, const char*);
63 
64 extern const char	sh_opttest[];
65 extern const char	test_opchars[];
66 extern const char	e_argument[];
67 extern const char	e_missing[];
68 extern const char	e_badop[];
69 extern const char	e_tstbegin[];
70 extern const char	e_tstend[];
71 
72 #endif /* TEST_ARITH */
73