2 * Definitions used in the interpreter
4 extern void Xappend(void), Xasync(void), Xbackq(void), Xbang(void), Xclose(void);
5 extern void Xconc(void), Xcount(void), Xdelfn(void), Xdol(void), Xqw(void), Xdup(void);
6 extern void Xexit(void), Xfalse(void), Xfn(void), Xfor(void), Xglob(void);
7 extern void Xjump(void), Xmark(void), Xmatch(void), Xpipe(void), Xread(void);
8 extern void Xrdwr(void), Xsrcline(void), Xsrcfile(void);
9 extern void Xrdfn(void), Xunredir(void), Xstar(void), Xreturn(void), Xsubshell(void);
10 extern void Xtrue(void), Xword(void), Xglobs(void), Xwrite(void), Xpipefd(void), Xcase(void);
11 extern void Xlocal(void), Xunlocal(void), Xassign(void), Xsimple(void), Xpopm(void);
12 extern void Xrdcmds(void), Xwastrue(void), Xif(void), Xifnot(void), Xpipewait(void);
13 extern void Xdelhere(void), Xpopredir(void), Xsub(void), Xeflag(void), Xsettrue(void);
14 extern void Xerror(char*);
15 extern void Xerror1(char*);
17 * word lists are in correct order,
18 * i.e. word0->word1->word2->word3->0
23 int glob; /* Globsize(word) */
29 word *newword(char *, word *), *copywords(word *, word *);
31 char type; /* what to do */
32 short from, to; /* what to do it to */
33 redir *next; /* what else to do (reverse order) */
35 #define NSTATUS ERRMAX /* length of status (from plan 9) */
39 #define ROPEN 1 /* dup2(from, to); close(from); */
40 #define RDUP 2 /* dup2(from, to); */
41 #define RCLOSE 3 /* close(from); */
43 code *code; /* code for this thread */
44 int pc; /* code[pc] is the next instruction */
45 int line; /* source code line */
46 list *argv; /* argument stack */
47 redir *redir; /* redirection stack */
48 redir *startredir; /* redir inheritance point */
49 var *local; /* list of local variables */
50 char *cmdfile; /* file name in Xrdcmd */
51 io *cmdfd; /* file descriptor for Xrdcmd */
52 int lexline; /* file descriptor line */
53 int iflast; /* static `if not' checking */
54 int eof; /* is cmdfd at eof? */
55 int iflag; /* interactive? */
56 int lineno; /* linenumber */
57 int pid; /* process for Xpipewait to wait for */
58 char status[NSTATUS]; /* status for Xpipewait */
59 tree *treenodes; /* tree nodes created by this process */
60 thread *ret; /* who continues when this finishes */
63 code *codecopy(code*);
64 code *codebuf; /* compiler output */
65 int ntrap; /* number of outstanding traps */
66 int trap[NSIG]; /* number of outstanding traps per type */
71 extern struct builtin Builtin[];
72 int eflagok; /* kludge flag so that -e doesn't exit in startup */
74 void execcd(void), execwhatis(void), execeval(void), execexec(void);
75 int execforkexec(void);
76 void execexit(void), execshift(void);
77 void execwait(void), execumask(void), execdot(void), execflag(void);
78 void execfunc(var*), execcmds(io *);
79 char *curfile(thread*);