xref: /csrg-svn/bin/sh/eval.h (revision 69272)
147113Sbostic /*-
260698Sbostic  * Copyright (c) 1991, 1993
360698Sbostic  *	The Regents of the University of California.  All rights reserved.
447113Sbostic  *
547113Sbostic  * This code is derived from software contributed to Berkeley by
647113Sbostic  * Kenneth Almquist.
747113Sbostic  *
847113Sbostic  * %sccs.include.redist.c%
947113Sbostic  *
10*69272Schristos  *	@(#)eval.h	8.2 (Berkeley) 05/04/95
1147113Sbostic  */
1247113Sbostic 
1347113Sbostic extern char *commandname;	/* currently executing command */
1447113Sbostic extern int exitstatus;		/* exit status of last command */
1547113Sbostic extern struct strlist *cmdenviron;  /* environment for builtin command */
1647113Sbostic 
1747113Sbostic 
1847113Sbostic struct backcmd {		/* result of evalbackcmd */
1947113Sbostic 	int fd;			/* file descriptor to read from */
2047113Sbostic 	char *buf;		/* buffer */
2147113Sbostic 	int nleft;		/* number of chars in buffer */
2247113Sbostic 	struct job *jp;		/* job structure for command */
2347113Sbostic };
2447113Sbostic 
25*69272Schristos int evalcmd __P((int, char **));
26*69272Schristos void evalstring __P((char *));
2747979Smarc union node;	/* BLETCH for ansi C */
28*69272Schristos void evaltree __P((union node *, int));
29*69272Schristos void evalbackcmd __P((union node *, struct backcmd *));
30*69272Schristos int bltincmd __P((int, char **));
31*69272Schristos int breakcmd __P((int, char **));
32*69272Schristos int returncmd __P((int, char **));
33*69272Schristos int falsecmd __P((int, char **));
34*69272Schristos int truecmd __P((int, char **));
35*69272Schristos int execcmd __P((int, char **));
3647113Sbostic 
3747113Sbostic /* in_function returns nonzero if we are currently evaluating a function */
3847113Sbostic #define in_function()	funcnest
3947113Sbostic extern int funcnest;
40