static int rlookup(char *n);
static struct wdblock *glob(char *cp, struct wdblock *wb);
static int my_getc(int ec);
-static int subgetc(int ec, int quoted);
+static int subgetc(char ec, int quoted);
static char **makenv(int all, struct wdblock *wb);
static char **eval(char **ap, int f);
static int setstatus(int s);
static int eofc(void);
static int readc(void);
static void unget(int c);
-static void ioecho(int c);
+static void ioecho(char c);
static void prs(const char *s);
static void prn(unsigned u);
static void closef(int i);
DBGPRINTF(("MSH_MAIN: returning.\n"));
}
-static void setdash()
+static void setdash(void)
{
REGISTER char *cp;
REGISTER int c;
setval(lookup("-"), m);
}
-static int newfile(s)
-REGISTER char *s;
+static int newfile(REGISTER char *s)
{
REGISTER int f;
}
-struct op *scantree(head)
-struct op *head;
+struct op *scantree(struct op *head)
{
struct op *dotnode;
}
-static void onecommand()
+static void onecommand(void)
{
REGISTER int i;
jmp_buf m1;
}
}
-static void fail()
+static void fail(void)
{
longjmp(failpt, 1);
/* NOTREACHED */
}
-static void leave()
+static void leave(void)
{
DBGPRINTF(("LEAVE: leave called!\n"));
/* NOTREACHED */
}
-static void warn(s)
-REGISTER char *s;
+static void warn(REGISTER char *s)
{
if (*s) {
prs(s);
leave();
}
-static void err(s)
-char *s;
+static void err(char *s)
{
warn(s);
if (flag['n'])
e.iop = e.iobase = iostack;
}
-static int newenv(f)
-int f;
+static int newenv(int f)
{
REGISTER struct env *ep;
return (0);
}
-static void quitenv()
+static void quitenv(void)
{
REGISTER struct env *ep;
REGISTER int fd;
/*
* Is any character from s1 in s2?
*/
-static int anys(s1, s2)
-REGISTER char *s1, *s2;
+static int anys(REGISTER char *s1, REGISTER char *s2)
{
while (*s1)
if (any(*s1++, s2))
/*
* Is character c in s?
*/
-static int any(c, s)
-REGISTER int c;
-REGISTER char *s;
+static int any(REGISTER int c, REGISTER char *s)
{
while (*s)
if (*s++ == c)
return (0);
}
-static char *putn(n)
-REGISTER int n;
+static char *putn(REGISTER int n)
{
return (itoa(n));
}
-static char *itoa(n)
-REGISTER int n;
+static char *itoa(REGISTER int n)
{
static char s[20];
PUSHIO(afile, f, filechar);
}
-static void onintr(s)
-int s; /* ANSI C requires a parameter */
+static void onintr(int s) /* ANSI C requires a parameter */
{
signal(SIGINT, onintr);
intr = 1;
}
}
-static char *space(n)
-int n;
+static char *space(int n)
{
REGISTER char *cp;
return (cp);
}
-static char *strsave(s, a)
-REGISTER char *s;
-int a;
+static char *strsave(REGISTER char *s, int a)
{
REGISTER char *cp, *xp;
/*
* trap handling
*/
-static void sig(i)
-REGISTER int i;
+static void sig(REGISTER int i)
{
trapset = i;
signal(i, sig);
}
-static void runtrap(i)
-int i;
+static void runtrap(int i)
{
char *trapstr;
* not previously there, enter it now and
* return a null value.
*/
-static struct var *lookup(n)
-REGISTER char *n;
+static struct var *lookup(REGISTER char *n)
{
REGISTER struct var *vp;
REGISTER char *cp;
/*
* give variable at `vp' the value `val'.
*/
-static void setval(vp, val)
-struct var *vp;
-char *val;
+static void setval(struct var *vp, char *val)
{
nameval(vp, val, (char *) NULL);
}
* this is all so that exporting
* values is reasonably painless.
*/
-static void nameval(vp, val, name)
-REGISTER struct var *vp;
-char *val, *name;
+static void nameval(REGISTER struct var *vp, char *val, char *name)
{
REGISTER char *cp, *xp;
char *nv;
vp->status |= fl;
}
-static void export(vp)
-struct var *vp;
+static void export(struct var *vp)
{
vp->status |= EXPORT;
}
-static void ronly(vp)
-struct var *vp;
+static void ronly(struct var *vp)
{
if (isalpha(vp->name[0]) || vp->name[0] == '_') /* not an internal symbol */
vp->status |= RONLY;
}
-static int isassign(s)
-REGISTER char *s;
+static int isassign(REGISTER char *s)
{
DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s));
return (1);
}
-static int assign(s, cf)
-REGISTER char *s;
-int cf;
+static int assign(REGISTER char *s, int cf)
{
REGISTER char *cp;
struct var *vp;
return (1);
}
-static int checkname(cp)
-REGISTER char *cp;
+static int checkname(REGISTER char *cp)
{
DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp));
return (1);
}
-static void putvlist(f, out)
-REGISTER int f, out;
+static void putvlist(REGISTER int f, REGISTER int out)
{
REGISTER struct var *vp;
}
}
-static int eqname(n1, n2)
-REGISTER char *n1, *n2;
+static int eqname(REGISTER char *n1, REGISTER char *n2)
{
for (; *n1 != '=' && *n1 != 0; n1++)
if (*n2++ != *n1)
return (*n2 == 0 || *n2 == '=');
}
-static char *findeq(cp)
-REGISTER char *cp;
+static char *findeq(REGISTER char *cp)
{
while (*cp != '\0' && *cp != '=')
cp++;
#define QMASK (CMASK&~QUOTE)
#define NOT '!' /* might use ^ */
-static int gmatch(s, p)
-REGISTER char *s, *p;
+static int gmatch(REGISTER char *s, REGISTER char *p)
{
REGISTER int sc, pc;
return (*s == 0);
}
-static char *cclass(p, sub)
-REGISTER char *p;
-REGISTER int sub;
+static char *cclass(REGISTER char *p, REGISTER int sub)
{
REGISTER int c, d, not, found;
#define sbrk(X) ({ void * __q = (void *)-1; if (brkaddr + (int)(X) < brktop) { __q = brkaddr; brkaddr+=(int)(X); } __q;})
-static void initarea()
+static void initarea(void)
{
brkaddr = xmalloc(AREASIZE);
brktop = brkaddr + AREASIZE;
areanxt = areabot;
}
-char *getcell(nbytes)
-unsigned nbytes;
+char *getcell(unsigned nbytes)
{
REGISTER int nregio;
REGISTER struct region *p, *q;
return ((char *) (p + 1));
}
-static void freecell(cp)
-char *cp;
+static void freecell(char *cp)
{
REGISTER struct region *p;
}
}
-static void freearea(a)
-REGISTER int a;
+static void freearea(REGISTER int a)
{
REGISTER struct region *p, *top;
p->area = FREE;
}
-static void setarea(cp, a)
-char *cp;
-int a;
+static void setarea(char *cp, int a)
{
REGISTER struct region *p;
(p - 1)->area = a;
}
-int getarea(cp)
-char *cp;
+int getarea(char *cp)
{
return ((struct region *) cp - 1)->area;
}
-static void garbage()
+static void garbage(void)
{
REGISTER struct region *p, *q, *top;
* shell: syntax (C version)
*/
-int yyparse()
+int yyparse(void)
{
DBGPRINTF7(("YYPARSE: enter...\n"));
return (yynerrs != 0);
}
-static struct op *pipeline(cf)
-int cf;
+static struct op *pipeline(int cf)
{
REGISTER struct op *t, *p;
REGISTER int c;
return (t);
}
-static struct op *andor()
+static struct op *andor(void)
{
REGISTER struct op *t, *p;
REGISTER int c;
return (t);
}
-static struct op *c_list()
+static struct op *c_list(void)
{
REGISTER struct op *t, *p;
REGISTER int c;
return (t);
}
-static int synio(cf)
-int cf;
+static int synio(int cf)
{
REGISTER struct ioword *iop;
REGISTER int i;
return (1);
}
-static void musthave(c, cf)
-int c, cf;
+static void musthave(int c, int cf)
{
if ((peeksym = yylex(cf)) != c) {
DBGPRINTF7(("MUSTHAVE: error!\n"));
peeksym = 0;
}
-static struct op *simple()
+static struct op *simple(void)
{
REGISTER struct op *t;
}
}
-static struct op *nested(type, mark)
-int type, mark;
+static struct op *nested(int type, int mark)
{
REGISTER struct op *t;
return (block(type, t, NOBLOCK, NOWORDS));
}
-static struct op *command(cf)
-int cf;
+static struct op *command(int cf)
{
REGISTER struct op *t;
struct wdblock *iosave;
return (t);
}
-static struct op *dowholefile(type, mark)
-int type;
-int mark;
+static struct op *dowholefile(int type, int mark)
{
REGISTER struct op *t;
return (t);
}
-static struct op *dogroup(onlydone)
-int onlydone;
+static struct op *dogroup(int onlydone)
{
REGISTER int c;
REGISTER struct op *mylist;
return (mylist);
}
-static struct op *thenpart()
+static struct op *thenpart(void)
{
REGISTER int c;
REGISTER struct op *t;
return (t);
}
-static struct op *elsepart()
+static struct op *elsepart(void)
{
REGISTER int c;
REGISTER struct op *t;
}
}
-static struct op *caselist()
+static struct op *caselist(void)
{
REGISTER struct op *t;
return (t);
}
-static struct op *casepart()
+static struct op *casepart(void)
{
REGISTER struct op *t;
return (t);
}
-static char **pattern()
+static char **pattern(void)
{
REGISTER int c, cf;
return (copyw());
}
-static char **wordlist()
+static char **wordlist(void)
{
REGISTER int c;
/*
* supporting functions
*/
-static struct op *list(t1, t2)
-REGISTER struct op *t1, *t2;
+static struct op *list(REGISTER struct op *t1, REGISTER struct op *t2)
{
DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2));
return (block(TLIST, t1, t2, NOWORDS));
}
-static struct op *block(type, t1, t2, wp)
-int type;
-struct op *t1, *t2;
-char **wp;
+static struct op *block(int type, struct op *t1, struct op *t2, char **wp)
{
REGISTER struct op *t;
}
/* See if given string is a shell multiline (FOR, IF, etc) */
-static int rlookup(n)
-REGISTER char *n;
+static int rlookup(REGISTER char *n)
{
REGISTER const struct res *rp;
return (0); /* Not a shell multiline */
}
-static struct op *newtp()
+static struct op *newtp(void)
{
REGISTER struct op *t;
return (t);
}
-static struct op *namelist(t)
-REGISTER struct op *t;
+static struct op *namelist(REGISTER struct op *t)
{
DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t,
return (t);
}
-static char **copyw()
+static char **copyw(void)
{
REGISTER char **wd;
return (wd);
}
-static void word(cp)
-char *cp;
+static void word(char *cp)
{
wdlist = addword(cp, wdlist);
}
-static struct ioword **copyio()
+static struct ioword **copyio(void)
{
REGISTER struct ioword **iop;
return (iop);
}
-static struct ioword *io(u, f, cp)
-int u;
-int f;
-char *cp;
+static struct ioword *io(int u, int f, char *cp)
{
REGISTER struct ioword *iop;
return (iop);
}
-static void zzerr()
+static void zzerr(void)
{
yyerror("syntax error");
}
-static void yyerror(s)
-char *s;
+static void yyerror(char *s)
{
yynerrs++;
if (interactive && e.iop <= iostack) {
fail();
}
-static int yylex(cf)
-int cf;
+static int yylex(int cf)
{
REGISTER int c, c1;
int atstart;
}
-static int collect(c, c1)
-REGISTER int c, c1;
+static int collect(REGISTER int c, REGISTER int c1)
{
char s[2];
/* "multiline commands" helper func */
/* see if next 2 chars form a shell multiline */
-static int dual(c)
-REGISTER int c;
+static int dual(REGISTER int c)
{
char s[3];
REGISTER char *cp = s;
return (c); /* String is multiline, return numeric multiline (restab) code */
}
-static void diag(ec)
-REGISTER int ec;
+static void diag(REGISTER int ec)
{
REGISTER int c;
yylval.i |= IODUP;
}
-static char *tree(size)
-unsigned size;
+static char *tree(unsigned size)
{
REGISTER char *t;
*/
-static int execute(t, pin, pout, act)
-REGISTER struct op *t;
-int *pin, *pout;
-int act;
+static int execute(REGISTER struct op *t, int *pin, int *pout, int act)
{
REGISTER struct op *t1;
volatile int i, rv, a;
* 0< 1> are ignored as required
* within pipelines.
*/
-static int iosetup(iop, pipein, pipeout)
-REGISTER struct ioword *iop;
-int pipein, pipeout;
+static int iosetup(REGISTER struct ioword *iop, int pipein, int pipeout)
{
REGISTER int u = -1;
char *cp = NULL, *msg;
return (0);
}
-static void echo(wp)
-REGISTER char **wp;
+static void echo(REGISTER char **wp)
{
REGISTER int i;
prs("\n");
}
-static struct op **find1case(t, w)
-struct op *t;
-char *w;
+static struct op **find1case(struct op *t, char *w)
{
REGISTER struct op *t1;
struct op **tp;
return ((struct op **) NULL);
}
-static struct op *findcase(t, w)
-struct op *t;
-char *w;
+static struct op *findcase(struct op *t, char *w)
{
REGISTER struct op **tp;
/*
* Enter a new loop level (marked for break/continue).
*/
-static void brkset(bc)
-struct brkcon *bc;
+static void brkset(struct brkcon *bc)
{
bc->nextlev = brklist;
brklist = bc;
* Ignore interrupt signals while waiting
* unless `canintr' is true.
*/
-static int waitfor(lastpid, canintr)
-REGISTER int lastpid;
-int canintr;
+static int waitfor(REGISTER int lastpid, int canintr)
{
REGISTER int pid, rv;
int s;
return (rv);
}
-static int setstatus(s)
-REGISTER int s;
+static int setstatus(REGISTER int s)
{
exstat = s;
setval(lookup("?"), putn(s));
* If getenv("PATH") were kept up-to-date,
* execvp might be used.
*/
-static char *rexecve(c, v, envp)
-char *c, **v, **envp;
+static char *rexecve(char *c, char **v, char **envp)
{
REGISTER int i;
REGISTER char *sp, *tp;
return (0);
}
-static int dochdir(t)
-REGISTER struct op *t;
+static int dochdir(REGISTER struct op *t)
{
REGISTER char *cp, *er;
return (1);
}
-static int doshift(t)
-REGISTER struct op *t;
+static int doshift(REGISTER struct op *t)
{
REGISTER int n;
/*
* execute login and newgrp directly
*/
-static int dologin(t)
-struct op *t;
+static int dologin(struct op *t)
{
REGISTER char *cp;
return (1);
}
-static int doumask(t)
-REGISTER struct op *t;
+static int doumask(REGISTER struct op *t)
{
REGISTER int i, n;
REGISTER char *cp;
return (0);
}
-static int doexec(t)
-REGISTER struct op *t;
+static int doexec(REGISTER struct op *t)
{
REGISTER int i;
jmp_buf ex;
return (1);
}
-static int dodot(t)
-struct op *t;
+static int dodot(struct op *t)
{
REGISTER int i;
REGISTER char *sp, *tp;
return (-1);
}
-static int dowait(t)
-struct op *t;
+static int dowait(struct op *t)
{
REGISTER int i;
REGISTER char *cp;
return (0);
}
-static int doread(t)
-struct op *t;
+static int doread(struct op *t)
{
REGISTER char *cp, **wp;
REGISTER int nb = 0;
return (nb <= 0);
}
-static int doeval(t)
-REGISTER struct op *t;
+static int doeval(REGISTER struct op *t)
{
return (RUN(awordlist, t->words + 1, wdchar));
}
-static int dotrap(t)
-REGISTER struct op *t;
+static int dotrap(REGISTER struct op *t)
{
REGISTER int n, i;
REGISTER int resetsig;
return (0);
}
-static int getsig(s)
-char *s;
+static int getsig(char *s)
{
REGISTER int n;
}
}
-static int getn(as)
-char *as;
+static int getn(char *as)
{
REGISTER char *s;
REGISTER int n, m;
return (n * m);
}
-static int dobreak(t)
-struct op *t;
+static int dobreak(struct op *t)
{
return (brkcontin(t->words[1], 1));
}
-static int docontinue(t)
-struct op *t;
+static int docontinue(struct op *t)
{
return (brkcontin(t->words[1], 0));
}
-static int brkcontin(cp, val)
-REGISTER char *cp;
-int val;
+static int brkcontin(REGISTER char *cp, int val)
{
REGISTER struct brkcon *bc;
REGISTER int nl;
/* NOTREACHED */
}
-static int doexit(t)
-struct op *t;
+static int doexit(struct op *t)
{
REGISTER char *cp;
return (0);
}
-static int doexport(t)
-struct op *t;
+static int doexport(struct op *t)
{
rdexp(t->words + 1, export, EXPORT);
return (0);
}
-static int doreadonly(t)
-struct op *t;
+static int doreadonly(struct op *t)
{
rdexp(t->words + 1, ronly, RONLY);
return (0);
putvlist(key, 1);
}
-static void badid(s)
-REGISTER char *s;
+static void badid(REGISTER char *s)
{
prs(s);
err(": bad identifier");
}
-static int doset(t)
-REGISTER struct op *t;
+static int doset(REGISTER struct op *t)
{
REGISTER struct var *vp;
REGISTER char *cp;
return (0);
}
-static void varput(s, out)
-REGISTER char *s;
-int out;
+static void varput(REGISTER char *s, int out)
{
if (isalnum(*s) || *s == '_') {
write(out, s, strlen(s));
return (getwords(wb));
}
-static char *evalstr(cp, f)
-REGISTER char *cp;
-int f;
+static char *evalstr(REGISTER char *cp, int f)
{
struct wdblock *wb;
/*
* Blank interpretation and quoting
*/
-static char *blank(f)
-int f;
+static char *blank(int f)
{
REGISTER int c, c1;
REGISTER char *sp;
/*
* Get characters, substituting for ` and $
*/
-static int subgetc(ec, quoted)
-REGISTER char ec;
-int quoted;
+static int subgetc(REGISTER char ec, int quoted)
{
REGISTER char c;
/*
* Prepare to generate the string returned by ${} substitution.
*/
-static int dollar(quoted)
-int quoted;
+static int dollar(int quoted)
{
int otask;
struct io *oiop;
* Run the command in `...` and read its output.
*/
-static int grave(quoted)
-int quoted;
+static int grave(int quoted)
{
char *cp;
REGISTER int i;
}
-static char *unquote(as)
-REGISTER char *as;
+static char *unquote(REGISTER char *as)
{
REGISTER char *s;
static struct wdblock *cl, *nl;
static char spcl[] = "[?*";
-static struct wdblock *glob(cp, wb)
-char *cp;
-struct wdblock *wb;
+static struct wdblock *glob(char *cp, struct wdblock *wb)
{
REGISTER int i;
REGISTER char *pp;
return (wb);
}
-static void globname(we, pp)
-char *we;
-REGISTER char *pp;
+static void globname(char *we, REGISTER char *pp)
{
REGISTER char *np, *cp;
char *name, *gp, *dp;
* start..end1 / middle end
* the slashes come for free
*/
-static char *generate(start1, end1, middle, end)
-char *start1;
-REGISTER char *end1;
-char *middle, *end;
+static char *generate(char *start1, REGISTER char *end1, char *middle, char *end)
{
char *p;
REGISTER char *op, *xp;
return (p);
}
-static int anyspcl(wb)
-REGISTER struct wdblock *wb;
+static int anyspcl(REGISTER struct wdblock *wb)
{
REGISTER int i;
REGISTER char **wd;
return (0);
}
-static int xstrcmp(p1, p2)
-char *p1, *p2;
+static int xstrcmp(char *p1, char *p2)
{
return (strcmp(*(char **) p1, *(char **) p2));
}
/* -------- word.c -------- */
-static struct wdblock *newword(nw)
-REGISTER int nw;
+static struct wdblock *newword(REGISTER int nw)
{
REGISTER struct wdblock *wb;
return (wb);
}
-static struct wdblock *addword(wd, wb)
-char *wd;
-REGISTER struct wdblock *wb;
+static struct wdblock *addword(char *wd, REGISTER struct wdblock *wb)
{
REGISTER struct wdblock *wb2;
REGISTER int nw;
}
static
-char **getwords(wb)
-REGISTER struct wdblock *wb;
+char **getwords(REGISTER struct wdblock *wb)
{
REGISTER char **wd;
REGISTER int nb;
static int (*func) (char *, char *);
static int globv;
-static void glob0(a0, a1, a2, a3)
-char *a0;
-unsigned a1;
-int a2;
-int (*a3) (char *, char *);
+static void glob0(char *a0, unsigned a1, int a2, int (*a3) (char *, char *))
{
func = a3;
globv = a2;
glob1(a0, a0 + a1 * a2);
}
-static void glob1(base, lim)
-char *base, *lim;
+static void glob1(char *base, char *lim)
{
REGISTER char *i, *j;
int v2;
}
}
-static void glob2(i, j)
-char *i, *j;
+static void glob2(char *i, char *j)
{
REGISTER char *index1, *index2, c;
int m;
} while (--m);
}
-static void glob3(i, j, k)
-char *i, *j, *k;
+static void glob3(char *i, char *j, char *k)
{
REGISTER char *index1, *index2, *index3;
int c;
return (c);
}
-static void unget(c)
-int c;
+static void unget(int c)
{
if (e.iop >= e.iobase)
e.iop->peekc = c;
}
-static int eofc()
+static int eofc(void)
{
return e.iop < e.iobase || (e.iop->peekc == 0 && e.iop->prev == 0);
}
-static int readc()
+static int readc(void)
{
REGISTER int c;
return (0);
}
-static void ioecho(c)
-char c;
+static void ioecho(char c)
{
if (flag['v'])
write(2, &c, sizeof c);
return;
}
-static struct io *setbase(ip)
-struct io *ip;
+static struct io *setbase(struct io *ip)
{
REGISTER struct io *xp;
/*
* Produce the characters of a string, then a newline, then EOF.
*/
-static int nlchar(ap)
-REGISTER struct ioarg *ap;
+static int nlchar(REGISTER struct ioarg *ap)
{
REGISTER int c;
* Given a list of words, produce the characters
* in them, with a space after each word.
*/
-static int wdchar(ap)
-REGISTER struct ioarg *ap;
+static int wdchar(REGISTER struct ioarg *ap)
{
REGISTER char c;
REGISTER char **wl;
* Return the characters of a list of words,
* producing a space between them.
*/
-static int dolchar(ap)
-REGISTER struct ioarg *ap;
+static int dolchar(REGISTER struct ioarg *ap)
{
REGISTER char *wp;
return (0);
}
-static int xxchar(ap)
-REGISTER struct ioarg *ap;
+static int xxchar(REGISTER struct ioarg *ap)
{
REGISTER int c;
/*
* Produce the characters from a single word (string).
*/
-static int strchar(ap)
-REGISTER struct ioarg *ap;
+static int strchar(REGISTER struct ioarg *ap)
{
REGISTER int c;
/*
* Produce quoted characters from a single word (string).
*/
-static int qstrchar(ap)
-REGISTER struct ioarg *ap;
+static int qstrchar(REGISTER struct ioarg *ap)
{
REGISTER int c;
/*
* Return the characters from a file.
*/
-static int filechar(ap)
-REGISTER struct ioarg *ap;
+static int filechar(REGISTER struct ioarg *ap)
{
REGISTER int i;
char c;
/*
* Return the characters from a here temp file.
*/
-static int herechar(ap)
-REGISTER struct ioarg *ap;
+static int herechar(REGISTER struct ioarg *ap)
{
char c;
* Return the characters produced by a process (`...`).
* Quote them if required, and remove any trailing newline characters.
*/
-static int gravechar(ap, iop)
-struct ioarg *ap;
-struct io *iop;
+static int gravechar(struct ioarg *ap, struct io *iop)
{
REGISTER int c;
return (c);
}
-static int qgravechar(ap, iop)
-REGISTER struct ioarg *ap;
-struct io *iop;
+static int qgravechar(REGISTER struct ioarg *ap, struct io *iop)
{
REGISTER int c;
/*
* Return a single command (usually the first line) from a file.
*/
-static int linechar(ap)
-REGISTER struct ioarg *ap;
+static int linechar(REGISTER struct ioarg *ap)
{
REGISTER int c;
return (c);
}
-static void prs(s)
-REGISTER const char *s;
+static void prs(REGISTER const char *s)
{
if (*s)
write(2, s, strlen(s));
}
-static void prn(u)
-unsigned u;
+static void prn(unsigned u)
{
prs(itoa(u));
}
-static void closef(i)
-REGISTER int i;
+static void closef(REGISTER int i)
{
if (i > 2)
close(i);
}
-static void closeall()
+static void closeall(void)
{
REGISTER int u;
/*
* remap fd into Shell's fd space
*/
-static int remap(fd)
-REGISTER int fd;
+static int remap(REGISTER int fd)
{
REGISTER int i;
int map[NOFILE];
return (fd);
}
-static int openpipe(pv)
-REGISTER int *pv;
+static int openpipe(REGISTER int *pv)
{
REGISTER int i;
return (i);
}
-static void closepipe(pv)
-REGISTER int *pv;
+static void closepipe(REGISTER int *pv)
{
if (pv != NULL) {
close(*pv++);
* here documents
*/
-static void markhere(s, iop)
-REGISTER char *s;
-struct ioword *iop;
+static void markhere(REGISTER char *s, struct ioword *iop)
{
REGISTER struct here *h, *lh;
h->h_dosub = iop->io_flag & IOXHERE;
}
-static void gethere()
+static void gethere(void)
{
REGISTER struct here *h, *hp;
}
}
-static void readhere(name, s, ec)
-char **name;
-REGISTER char *s;
-int ec;
+static void readhere(char **name, REGISTER char *s, int ec)
{
int tf;
char tname[30] = ".msh_XXXXXX";
* open here temp file.
* if unquoted here, expand here temp file into second temp file.
*/
-static int herein(hname, xdoll)
-char *hname;
-int xdoll;
+static int herein(char *hname, int xdoll)
{
REGISTER int hf;
int tf;
return (hf);
}
-static void scraphere()
+static void scraphere(void)
{
REGISTER struct here *h;
}
/* unlink here temp files before a freearea(area) */
-static void freehere(area)
-int area;
+static void freehere(int area)
{
REGISTER struct here *h, *hl;