summaryrefslogtreecommitdiffstats
path: root/src/cmd/rc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/rc')
-rw-r--r--src/cmd/rc/exec.c18
-rw-r--r--src/cmd/rc/exec.h10
-rw-r--r--src/cmd/rc/io.h2
-rw-r--r--src/cmd/rc/rc.h24
4 files changed, 36 insertions, 18 deletions
diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c
index 0320976a..94d3321a 100644
--- a/src/cmd/rc/exec.c
+++ b/src/cmd/rc/exec.c
@@ -8,6 +8,24 @@
*/
char *argv0="rc";
+thread *runq;
+code *codebuf; /* compiler output */
+int ntrap; /* number of outstanding traps */
+int trap[NSIG]; /* number of outstanding traps per type */
+int eflagok; /* kludge flag so that -e doesn't exit in startup */
+tree *cmdtree;
+char *promptstr;
+char tok[NTOK];
+var *gvar[NVAR]; /* hash for globals */
+int mypid;
+char **argp;
+char **args;
+int nerror; /* number of errors encountered during compilation */
+int ndot;
+int lastc;
+int kidpid;
+io *err;
+
void
start(code *c, int pc, var *local)
{
diff --git a/src/cmd/rc/exec.h b/src/cmd/rc/exec.h
index 06cfd64e..f9a9dfb0 100644
--- a/src/cmd/rc/exec.h
+++ b/src/cmd/rc/exec.h
@@ -56,17 +56,17 @@ struct thread{
tree *treenodes; /* tree nodes created by this process */
thread *ret; /* who continues when this finishes */
};
-thread *runq;
+extern thread *runq;
code *codecopy(code*);
-code *codebuf; /* compiler output */
-int ntrap; /* number of outstanding traps */
-int trap[NSIG]; /* number of outstanding traps per type */
+extern code *codebuf; /* compiler output */
+extern int ntrap; /* number of outstanding traps */
+extern int trap[NSIG]; /* number of outstanding traps per type */
struct builtin{
char *name;
void (*fnc)(void);
};
extern struct builtin Builtin[];
-int eflagok; /* kludge flag so that -e doesn't exit in startup */
+extern int eflagok; /* kludge flag so that -e doesn't exit in startup */
extern int havefork;
void execcd(void), execwhatis(void), execeval(void), execexec(void);
diff --git a/src/cmd/rc/io.h b/src/cmd/rc/io.h
index 6c75cc5b..c970132f 100644
--- a/src/cmd/rc/io.h
+++ b/src/cmd/rc/io.h
@@ -10,7 +10,7 @@ struct io{
int fd;
char *bufp, *ebuf, *strp, buf[NBUF];
};
-io *err;
+extern io *err;
io *openfd(int), *openstr(void), *opencore(char *, int);
int emptybuf(io*);
void pchr(io*, int);
diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h
index 2fd6758b..dd8b064c 100644
--- a/src/cmd/rc/rc.h
+++ b/src/cmd/rc/rc.h
@@ -65,7 +65,7 @@ tree *mung1(tree*, tree*), *mung2(tree*, tree*, tree*);
tree *mung3(tree*, tree*, tree*, tree*), *epimung(tree*, tree*);
tree *simplemung(tree*), *heredoc(tree*);
void freetree(tree*);
-tree *cmdtree;
+extern tree *cmdtree;
/*
* The first word of any code vector is a reference count.
* Always create a new reference to a code vector by calling codecopy(.).
@@ -76,9 +76,9 @@ union code{
int i;
char *s;
};
-char *promptstr;
+extern char *promptstr;
#define NTOK 8192
-char tok[NTOK];
+extern char tok[NTOK];
#define APPEND 1
#define WRITE 2
#define READ 3
@@ -98,7 +98,7 @@ struct var{
};
var *vlook(char*), *gvlook(char*), *newvar(char*, var*);
#define NVAR 521
-var *gvar[NVAR]; /* hash for globals */
+extern var *gvar[NVAR]; /* hash for globals */
#define new(type) ((type *)emalloc(sizeof(type)))
char *emalloc(long);
void *Malloc(ulong);
@@ -109,7 +109,7 @@ struct here{
char *name;
struct here *next;
};
-int mypid;
+extern int mypid;
/*
* Glob character escape in strings:
* In a string, GLOB must be followed by *?[ or GLOB.
@@ -128,9 +128,9 @@ int mypid;
#define threebyte(c) ((c&0xf0)==0xe0)
#define fourbyte(c) ((c&0xf8)==0xf0)
-char **argp;
-char **args;
-int nerror; /* number of errors encountered during compilation */
+extern char **argp;
+extern char **args;
+extern int nerror; /* number of errors encountered during compilation */
extern int doprompt; /* is it time for a prompt? */
/*
* Which fds are the reading/writing end of a pipe?
@@ -146,8 +146,8 @@ extern char *Rcmain(), Fdprefix[];
* How many dot commands have we executed?
* Used to ensure that -v flag doesn't print rcmain.
*/
-int ndot;
+extern int ndot;
char *getstatus(void);
-int lastc;
-int lastword;
-int kidpid;
+extern int lastc;
+extern int lastword;
+extern int kidpid;