xref: /original-bsd/bin/sh/parser.h (revision 14054b48)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Kenneth Almquist.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)parser.h	5.1 (Berkeley) 03/07/91
11  */
12 
13 /* control characters in argument strings */
14 #define CTLESC '\201'
15 #define CTLVAR '\202'
16 #define CTLENDVAR '\203'
17 #define CTLBACKQ '\204'
18 #define CTLQUOTE 01		/* ored with CTLBACKQ code if in quotes */
19 
20 /* variable substitution byte (follows CTLVAR) */
21 #define VSTYPE 07		/* type of variable substitution */
22 #define VSNUL 040		/* colon--treat the empty string as unset */
23 #define VSQUOTE 0100		/* inside double quotes--suppress splitting */
24 
25 /* values of VSTYPE field */
26 #define VSNORMAL 1		/* normal variable:  $var or ${var} */
27 #define VSMINUS 2		/* ${var-text} */
28 #define VSPLUS 3		/* ${var+text} */
29 #define VSQUESTION 4		/* ${var?message} */
30 #define VSASSIGN 5		/* ${var=text} */
31 
32 
33 /*
34  * NEOF is returned by parsecmd when it encounters an end of file.  It
35  * must be distinct from NULL, so we use the address of a variable that
36  * happens to be handy.
37  */
38 extern int tokpushback;
39 #define NEOF ((union node *)&tokpushback)
40 
41 
42 #ifdef __STDC__
43 union node *parsecmd(int);
44 int goodname(char *);
45 #else
46 union node *parsecmd();
47 int goodname();
48 #endif
49