summaryrefslogtreecommitdiffstats
path: root/bin/csh/func.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/csh/func.c')
-rw-r--r--bin/csh/func.c105
1 files changed, 54 insertions, 51 deletions
diff --git a/bin/csh/func.c b/bin/csh/func.c
index 2d2a7fb..d3b4714 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: func.c,v 1.7 1997/02/22 14:01:55 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -72,8 +75,8 @@ struct biltins *
isbfunc(t)
struct command *t;
{
- register Char *cp = t->t_dcom[0];
- register struct biltins *bp, *bp1, *bp2;
+ Char *cp = t->t_dcom[0];
+ struct biltins *bp, *bp1, *bp2;
static struct biltins label = {"", dozip, 0, 0};
static struct biltins foregnd = {"%job", dofg1, 0, 0};
static struct biltins backgnd = {"%job &", dobg1, 0, 0};
@@ -96,7 +99,7 @@ isbfunc(t)
* one past the end.
*/
for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) {
- register i;
+ int i;
bp = bp1 + ((bp2 - bp1) >> 1);
if ((i = *cp - *bp->bname) == 0 &&
@@ -112,8 +115,8 @@ isbfunc(t)
void
func(t, bp)
- register struct command *t;
- register struct biltins *bp;
+ struct command *t;
+ struct biltins *bp;
{
int i;
@@ -133,8 +136,8 @@ doonintr(v, t)
Char **v;
struct command *t;
{
- register Char *cp;
- register Char *vv = v[1];
+ Char *cp;
+ Char *vv = v[1];
if (parintr == SIG_IGN)
return;
@@ -194,8 +197,8 @@ doalias(v, t)
Char **v;
struct command *t;
{
- register struct varent *vp;
- register Char *p;
+ struct varent *vp;
+ Char *p;
v++;
p = *v++;
@@ -265,8 +268,8 @@ doif(v, kp)
Char **v;
struct command *kp;
{
- register int i;
- register Char **vv;
+ int i;
+ Char **vv;
v++;
i = expr(&v);
@@ -302,7 +305,7 @@ doif(v, kp)
*/
static void
reexecute(kp)
- register struct command *kp;
+ struct command *kp;
{
kp->t_dflg &= F_SAVE;
kp->t_dflg |= F_REPEAT;
@@ -339,7 +342,7 @@ void
gotolab(lab)
Char *lab;
{
- register struct whyle *wp;
+ struct whyle *wp;
/*
* While we still can, locate any unknown ends of existing loops. This
* obscure code is the WORST result of the fact that we don't really parse.
@@ -365,7 +368,7 @@ doswitch(v, t)
Char **v;
struct command *t;
{
- register Char *cp, *lp;
+ Char *cp, *lp;
v++;
if (!*v || *(*v++) != '(')
@@ -419,8 +422,8 @@ doforeach(v, t)
Char **v;
struct command *t;
{
- register Char *cp, *sp;
- register struct whyle *nwp;
+ Char *cp, *sp;
+ struct whyle *nwp;
v++;
sp = cp = strip(*v);
@@ -463,8 +466,8 @@ dowhile(v, t)
Char **v;
struct command *t;
{
- register int status;
- register bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
+ int status;
+ bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
whyles->w_fename == 0;
v++;
@@ -479,7 +482,7 @@ dowhile(v, t)
if (*v)
stderror(ERR_NAME | ERR_EXPRESSION);
if (!again) {
- register struct whyle *nwp =
+ struct whyle *nwp =
(struct whyle *) xcalloc(1, sizeof(*nwp));
nwp->w_start = lineloc;
@@ -564,8 +567,8 @@ dorepeat(v, kp)
Char **v;
struct command *kp;
{
- register int i;
- register sigset_t omask = 0;
+ int i;
+ sigset_t omask = 0;
i = getn(v[1]);
if (setintr)
@@ -593,10 +596,10 @@ doswbrk(v, t)
int
srchx(cp)
- register Char *cp;
+ Char *cp;
{
- register struct srch *sp, *sp1, *sp2;
- register i;
+ struct srch *sp, *sp1, *sp2;
+ int i;
/*
* Binary search Sp1 is the beginning of the current search range. Sp2 is
@@ -622,12 +625,12 @@ static Char *Sgoal;
static void
search(type, level, goal)
int type;
- register int level;
+ int level;
Char *goal;
{
Char wordbuf[BUFSIZ];
- register Char *aword = wordbuf;
- register Char *cp;
+ Char *aword = wordbuf;
+ Char *cp;
Stype = type;
Sgoal = goal;
@@ -722,10 +725,10 @@ search(type, level, goal)
static int
getword(wp)
- register Char *wp;
+ Char *wp;
{
- register int found = 0;
- register int c, d;
+ int found = 0;
+ int c, d;
int kwd = 0;
Char *owp = wp;
@@ -851,7 +854,7 @@ wfree()
btell(&o);
for (; whyles; whyles = nwp) {
- register struct whyle *wp = whyles;
+ struct whyle *wp = whyles;
nwp = wp->w_next;
/*
@@ -901,9 +904,9 @@ doglob(v, t)
static void
xecho(sep, v)
int sep;
- register Char **v;
+ Char **v;
{
- register Char *cp;
+ Char *cp;
int nonl = 0;
if (setintr)
@@ -924,7 +927,7 @@ xecho(sep, v)
if (sep == ' ' && *v && eq(*v, STRmn))
nonl++, v++;
while ((cp = *v++) != NULL) {
- register int c;
+ int c;
while ((c = *cp++) != '\0')
(void) vis_fputc(c | QUOTE, cshout);
@@ -952,7 +955,7 @@ dosetenv(v, t)
v++;
if ((vp = *v++) == 0) {
- register Char **ep;
+ Char **ep;
if (setintr)
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
@@ -1045,8 +1048,8 @@ void
Setenv(name, val)
Char *name, *val;
{
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ Char *cp, *dp;
Char *blk[2];
Char **oep = ep;
@@ -1078,8 +1081,8 @@ static void
Unsetenv(name)
Char *name;
{
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ Char *cp, *dp;
Char **oep = ep;
for (; *ep; ep++) {
@@ -1104,8 +1107,8 @@ doumask(v, t)
Char **v;
struct command *t;
{
- register Char *cp = v[1];
- register int i;
+ Char *cp = v[1];
+ int i;
if (cp == 0) {
i = umask(0);
@@ -1151,7 +1154,7 @@ static struct limits *
findlim(cp)
Char *cp;
{
- register struct limits *lp, *res;
+ struct limits *lp, *res;
res = (struct limits *) NULL;
for (lp = limits; lp->limconst >= 0; lp++)
@@ -1173,8 +1176,8 @@ dolimit(v, t)
Char **v;
struct command *t;
{
- register struct limits *lp;
- register RLIM_TYPE limit;
+ struct limits *lp;
+ RLIM_TYPE limit;
char hard = 0;
v++;
@@ -1199,10 +1202,10 @@ dolimit(v, t)
static RLIM_TYPE
getval(lp, v)
- register struct limits *lp;
+ struct limits *lp;
Char **v;
{
- register float f;
+ float f;
double atof();
Char *cp = *v++;
@@ -1283,7 +1286,7 @@ limtail(cp, str)
/*ARGSUSED*/
static void
plim(lp, hard)
- register struct limits *lp;
+ struct limits *lp;
Char hard;
{
struct rlimit rlim;
@@ -1310,7 +1313,7 @@ dounlimit(v, t)
Char **v;
struct command *t;
{
- register struct limits *lp;
+ struct limits *lp;
int lerr = 0;
Char hard = 0;
@@ -1336,7 +1339,7 @@ dounlimit(v, t)
static int
setlim(lp, hard, limit)
- register struct limits *lp;
+ struct limits *lp;
Char hard;
RLIM_TYPE limit;
{
OpenPOWER on IntegriCloud