summaryrefslogtreecommitdiff
path: root/bin/csh/func.c
diff options
context:
space:
mode:
authorJason Peel <jsyn@cvs.openbsd.org>2003-05-12 23:26:17 +0000
committerJason Peel <jsyn@cvs.openbsd.org>2003-05-12 23:26:17 +0000
commit6744300471fa5d2bba164abc274ed399e7cd2db4 (patch)
tree56ebe73990003e93188601a66758b8f12e759e73 /bin/csh/func.c
parent7eec008f4d88d2df26525bff1140297214df962b (diff)
ansify functions, eliminating prototype declaration warnings; ok deraadt@
Diffstat (limited to 'bin/csh/func.c')
-rw-r--r--bin/csh/func.c181
1 files changed, 49 insertions, 132 deletions
diff --git a/bin/csh/func.c b/bin/csh/func.c
index c76c8bcc6c7..c76cdf3e312 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: func.c,v 1.15 2002/06/09 05:47:27 todd Exp $ */
+/* $OpenBSD: func.c,v 1.16 2003/05/12 23:26:16 jsyn Exp $ */
/* $NetBSD: func.c,v 1.11 1996/02/09 02:28:29 christos Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: func.c,v 1.15 2002/06/09 05:47:27 todd Exp $";
+static char rcsid[] = "$OpenBSD: func.c,v 1.16 2003/05/12 23:26:16 jsyn Exp $";
#endif
#endif /* not lint */
@@ -70,8 +70,7 @@ static void xecho(int, Char **);
static void Unsetenv(Char *);
struct biltins *
-isbfunc(t)
- struct command *t;
+isbfunc(struct command *t)
{
register Char *cp = t->t_dcom[0];
register struct biltins *bp, *bp1, *bp2;
@@ -112,9 +111,7 @@ isbfunc(t)
}
void
-func(t, bp)
- register struct command *t;
- register struct biltins *bp;
+func(register struct command *t, register struct biltins *bp)
{
int i;
@@ -130,9 +127,7 @@ func(t, bp)
void
/*ARGSUSED*/
-doonintr(v, t)
- Char **v;
- struct command *t;
+doonintr(Char **v, struct command *t)
{
register Char *cp;
register Char *vv = v[1];
@@ -166,9 +161,7 @@ doonintr(v, t)
void
/*ARGSUSED*/
-donohup(v, t)
- Char **v;
- struct command *t;
+donohup(Char **v, struct command *t)
{
if (intty)
stderror(ERR_NAME | ERR_TERMINAL);
@@ -179,9 +172,7 @@ donohup(v, t)
void
/*ARGSUSED*/
-dozip(v, t)
- Char **v;
- struct command *t;
+dozip(Char **v, struct command *t)
{
;
}
@@ -194,9 +185,7 @@ prvars()
void
/*ARGSUSED*/
-doalias(v, t)
- Char **v;
- struct command *t;
+doalias(Char **v, struct command *t)
{
register struct varent *vp;
register Char *p;
@@ -223,18 +212,14 @@ doalias(v, t)
void
/*ARGSUSED*/
-unalias(v, t)
- Char **v;
- struct command *t;
+unalias(Char **v, struct command *t)
{
unset1(v, &aliases);
}
void
/*ARGSUSED*/
-dologout(v, t)
- Char **v;
- struct command *t;
+dologout(Char **v, struct command *t)
{
islogin();
goodbye();
@@ -242,9 +227,7 @@ dologout(v, t)
void
/*ARGSUSED*/
-dologin(v, t)
- Char **v;
- struct command *t;
+dologin(Char **v, struct command *t)
{
islogin();
rechist();
@@ -265,9 +248,7 @@ islogin()
}
void
-doif(v, kp)
- Char **v;
- struct command *kp;
+doif(Char **v, struct command *kp)
{
register int i;
register Char **vv;
@@ -305,8 +286,7 @@ doif(v, kp)
* to redo i/o redirection, which is already set up.
*/
static void
-reexecute(kp)
- register struct command *kp;
+reexecute(register struct command *kp)
{
kp->t_dflg &= F_SAVE;
kp->t_dflg |= F_REPEAT;
@@ -320,18 +300,14 @@ reexecute(kp)
void
/*ARGSUSED*/
-doelse(v, t)
- Char **v;
- struct command *t;
+doelse(Char **v, struct command *t)
{
search(T_ELSE, 0, NULL);
}
void
/*ARGSUSED*/
-dogoto(v, t)
- Char **v;
- struct command *t;
+dogoto(Char **v, struct command *t)
{
Char *lp;
@@ -340,8 +316,7 @@ dogoto(v, t)
}
void
-gotolab(lab)
- Char *lab;
+gotolab(Char *lab)
{
register struct whyle *wp;
/*
@@ -365,9 +340,7 @@ gotolab(lab)
void
/*ARGSUSED*/
-doswitch(v, t)
- Char **v;
- struct command *t;
+doswitch(Char **v, struct command *t)
{
register Char *cp, *lp;
@@ -385,9 +358,7 @@ doswitch(v, t)
void
/*ARGSUSED*/
-dobreak(v, t)
- Char **v;
- struct command *t;
+dobreak(Char **v, struct command *t)
{
if (whyles)
toend();
@@ -397,9 +368,7 @@ dobreak(v, t)
void
/*ARGSUSED*/
-doexit(v, t)
- Char **v;
- struct command *t;
+doexit(Char **v, struct command *t)
{
if (chkstop == 0 && (intty || intact) && evalvec == 0)
panystop(0);
@@ -419,9 +388,7 @@ doexit(v, t)
void
/*ARGSUSED*/
-doforeach(v, t)
- Char **v;
- struct command *t;
+doforeach(Char **v, struct command *t)
{
register Char *cp, *sp;
register struct whyle *nwp;
@@ -463,9 +430,7 @@ doforeach(v, t)
void
/*ARGSUSED*/
-dowhile(v, t)
- Char **v;
- struct command *t;
+dowhile(Char **v, struct command *t)
{
register int status;
register bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
@@ -526,9 +491,7 @@ preread()
void
/*ARGSUSED*/
-doend(v, t)
- Char **v;
- struct command *t;
+doend(Char **v, struct command *t)
{
if (!whyles)
stderror(ERR_NAME | ERR_NOTWHILE);
@@ -538,9 +501,7 @@ doend(v, t)
void
/*ARGSUSED*/
-docontin(v, t)
- Char **v;
- struct command *t;
+docontin(Char **v, struct command *t)
{
if (!whyles)
stderror(ERR_NAME | ERR_NOTWHILE);
@@ -569,9 +530,7 @@ doagain()
}
void
-dorepeat(v, kp)
- Char **v;
- struct command *kp;
+dorepeat(Char **v, struct command *kp)
{
register int i;
sigset_t sigset;
@@ -596,16 +555,13 @@ dorepeat(v, kp)
void
/*ARGSUSED*/
-doswbrk(v, t)
- Char **v;
- struct command *t;
+doswbrk(Char **v, struct command *t)
{
search(T_BRKSW, 0, NULL);
}
int
-srchx(cp)
- register Char *cp;
+srchx(register Char *cp)
{
register struct srch *sp, *sp1, *sp2;
register int i;
@@ -632,10 +588,7 @@ static Char *Sgoal;
/*VARARGS2*/
static void
-search(type, level, goal)
- int type;
- register int level;
- Char *goal;
+search(int type, register int level, Char *goal)
{
Char wordbuf[BUFSIZ];
register Char *aword = wordbuf;
@@ -733,8 +686,7 @@ search(type, level, goal)
}
static int
-getword(wp)
- register Char *wp;
+getword(register Char *wp)
{
register int found = 0;
register int c, d;
@@ -825,8 +777,7 @@ past:
*/
static int
-keyword(wp)
- Char *wp;
+keyword(Char *wp)
{
static Char STRif[] = {'i', 'f', '\0'};
static Char STRwhile[] = {'w', 'h', 'i', 'l', 'e', '\0'};
@@ -894,27 +845,21 @@ wfree()
void
/*ARGSUSED*/
-doecho(v, t)
- Char **v;
- struct command *t;
+doecho(Char **v, struct command *t)
{
xecho(' ', v);
}
void
/*ARGSUSED*/
-doglob(v, t)
- Char **v;
- struct command *t;
+doglob(Char **v, struct command *t)
{
xecho(0, v);
(void) fflush(cshout);
}
static void
-xecho(sep, v)
- int sep;
- register Char **v;
+xecho(int sep, register Char **v)
{
register Char *cp;
int nonl = 0;
@@ -961,9 +906,7 @@ xecho(sep, v)
void
/*ARGSUSED*/
-dosetenv(v, t)
- Char **v;
- struct command *t;
+dosetenv(Char **v, struct command *t)
{
Char *vp, *lp;
sigset_t sigset;
@@ -1005,9 +948,7 @@ dosetenv(v, t)
void
/*ARGSUSED*/
-dounsetenv(v, t)
- Char **v;
- struct command *t;
+dounsetenv(Char **v, struct command *t)
{
Char **ep, *p, *n;
int i, maxi;
@@ -1060,15 +1001,13 @@ dounsetenv(v, t)
}
void
-Setenv(name, val)
- Char *name, *val;
+Setenv(Char *name, Char *val)
{
register Char **ep = STR_environ;
register Char *cp, *dp;
Char *blk[2];
Char **oep = ep;
-
for (; *ep; ep++) {
for (cp = name, dp = *ep; *cp && *cp == *dp; cp++, dp++)
continue;
@@ -1093,8 +1032,7 @@ Setenv(name, val)
}
static void
-Unsetenv(name)
- Char *name;
+Unsetenv(Char *name)
{
register Char **ep = STR_environ;
register Char *cp, *dp;
@@ -1118,9 +1056,7 @@ Unsetenv(name)
void
/*ARGSUSED*/
-doumask(v, t)
- Char **v;
- struct command *t;
+doumask(Char **v, struct command *t)
{
register Char *cp = v[1];
register int i;
@@ -1166,8 +1102,7 @@ static void plim(struct limits *, Char);
static int setlim(struct limits *, Char, RLIM_TYPE);
static struct limits *
-findlim(cp)
- Char *cp;
+findlim(Char *cp)
{
register struct limits *lp, *res;
@@ -1187,9 +1122,7 @@ findlim(cp)
void
/*ARGSUSED*/
-dolimit(v, t)
- Char **v;
- struct command *t;
+dolimit(Char **v, struct command *t)
{
register struct limits *lp;
register RLIM_TYPE limit;
@@ -1216,9 +1149,7 @@ dolimit(v, t)
}
static RLIM_TYPE
-getval(lp, v)
- register struct limits *lp;
- Char **v;
+getval(register struct limits *lp, Char **v)
{
register float f;
double atof();
@@ -1287,9 +1218,7 @@ badscal:
}
static void
-limtail(cp, str)
- Char *cp;
- char *str;
+limtail(Char *cp, char *str)
{
while (*cp && *cp == *str)
cp++, str++;
@@ -1297,12 +1226,9 @@ limtail(cp, str)
stderror(ERR_BADSCALE, str);
}
-
/*ARGSUSED*/
static void
-plim(lp, hard)
- register struct limits *lp;
- Char hard;
+plim(register struct limits *lp, Char hard)
{
struct rlimit rlim;
RLIM_TYPE limit;
@@ -1324,9 +1250,7 @@ plim(lp, hard)
void
/*ARGSUSED*/
-dounlimit(v, t)
- Char **v;
- struct command *t;
+dounlimit(Char **v, struct command *t)
{
register struct limits *lp;
int lerr = 0;
@@ -1353,10 +1277,7 @@ dounlimit(v, t)
}
static int
-setlim(lp, hard, limit)
- register struct limits *lp;
- Char hard;
- RLIM_TYPE limit;
+setlim(register struct limits *lp, Char hard, RLIM_TYPE limit)
{
struct rlimit rlim;
@@ -1380,9 +1301,7 @@ setlim(lp, hard, limit)
void
/*ARGSUSED*/
-dosuspend(v, t)
- Char **v;
- struct command *t;
+dosuspend(Char **v, struct command *t)
{
int ctpgrp;
@@ -1423,12 +1342,12 @@ retry:
* Otherwise, under stty tostop, processes will stop in the wrong
* pgrp, with no way for the shell to get them going again. -IAN!
*/
+
static Char **gv = NULL;
+
void
/*ARGSUSED*/
-doeval(v, t)
- Char **v;
- struct command *t;
+doeval(Char **v, struct command *t)
{
Char **oevalvec;
Char *oevalp;
@@ -1505,9 +1424,7 @@ doeval(v, t)
void
/*ARGSUSED*/
-doprintf(v, t)
- Char **v;
- struct command *t;
+doprintf(Char **v, struct command *t)
{
Char **newv;
char **c;