ANSI
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 1 Mar 1991 07:03:06 +0000 (23:03 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 1 Mar 1991 07:03:06 +0000 (23:03 -0800)
SCCS-vsn: games/larn/create.c 5.2
SCCS-vsn: games/larn/display.c 5.2
SCCS-vsn: games/larn/fortune.c 5.3
SCCS-vsn: games/larn/main.c 5.5
SCCS-vsn: games/larn/monster.c 5.2
SCCS-vsn: games/larn/moreobj.c 5.2
SCCS-vsn: games/larn/signal.c 5.2
SCCS-vsn: games/larn/store.c 5.3
SCCS-vsn: games/mille/mille.c 5.5
SCCS-vsn: games/monop/execute.c 5.5
SCCS-vsn: games/monop/getinp.c 5.4
SCCS-vsn: games/monop/misc.c 5.5
SCCS-vsn: games/morse/morse.c 5.3
SCCS-vsn: games/number/number.c 5.1
SCCS-vsn: games/pom/pom.c 5.3
SCCS-vsn: games/quiz/quiz.c 4.7
SCCS-vsn: games/rain/rain.c 5.6
SCCS-vsn: games/robots/main.c 5.5
SCCS-vsn: games/robots/move_robs.c 5.5
SCCS-vsn: games/robots/robots.h 5.6
SCCS-vsn: games/rogue/init.c 5.4
SCCS-vsn: games/rogue/machdep.c 5.7
SCCS-vsn: games/rogue/rogue.h 5.6
SCCS-vsn: games/sail/lo_main.c 5.7
SCCS-vsn: games/sail/pl_1.c 5.5
SCCS-vsn: games/sail/pl_7.c 5.7
SCCS-vsn: games/sail/pl_main.c 5.5
SCCS-vsn: games/snake/snake/move.c 5.8
SCCS-vsn: games/snake/snake/snake.c 5.9

29 files changed:
usr/src/games/larn/create.c
usr/src/games/larn/display.c
usr/src/games/larn/fortune.c
usr/src/games/larn/main.c
usr/src/games/larn/monster.c
usr/src/games/larn/moreobj.c
usr/src/games/larn/signal.c
usr/src/games/larn/store.c
usr/src/games/mille/mille.c
usr/src/games/monop/execute.c
usr/src/games/monop/getinp.c
usr/src/games/monop/misc.c
usr/src/games/morse/morse.c
usr/src/games/number/number.c
usr/src/games/pom/pom.c
usr/src/games/quiz/quiz.c
usr/src/games/rain/rain.c
usr/src/games/robots/main.c
usr/src/games/robots/move_robs.c
usr/src/games/robots/robots.h
usr/src/games/rogue/init.c
usr/src/games/rogue/machdep.c
usr/src/games/rogue/rogue.h
usr/src/games/sail/lo_main.c
usr/src/games/sail/pl_1.c
usr/src/games/sail/pl_7.c
usr/src/games/sail/pl_main.c
usr/src/games/snake/snake/move.c
usr/src/games/snake/snake/snake.c

index 7004a1b..46c09c9 100644 (file)
@@ -276,6 +276,8 @@ troom(lv,xsize,ysize,tx,ty,glyph)
        playerx=tp1;  playery=tp2;
        }
 \f
        playerx=tp1;  playery=tp2;
        }
 \f
+static void fillroom();
+
 /*
        ***********
        MAKE_OBJECT
 /*
        ***********
        MAKE_OBJECT
@@ -386,7 +388,8 @@ froom(n,itm,arg)
        subroutine to put an object into an empty room
  *     uses a random walk
  */
        subroutine to put an object into an empty room
  *     uses a random walk
  */
-static fillroom(what,arg)
+static void
+fillroom(what,arg)
        int arg;
        char what;
        {
        int arg;
        char what;
        {
index 26cff9a..b49de50 100644 (file)
@@ -23,6 +23,8 @@ bottomdo()
        if (bot3f) { bot3f=0; bot_spellx(); }
        }
 
        if (bot3f) { bot3f=0; bot_spellx(); }
        }
 
+static void botsub();
+
 bot_linex()
        {
        register int i;
 bot_linex()
        {
        register int i;
@@ -144,7 +146,8 @@ botside()
        always=0;
        }
 
        always=0;
        }
 
-static botsub(idx,str)
+static void
+botsub(idx,str)
        register int idx;
        char *str;
        {
        register int idx;
        char *str;
        {
index ac5ae25..f410375 100644 (file)
@@ -1,12 +1,7 @@
 /* fortune.c            Larn is copyrighted 1986 by Noah Morgan. */
 #include <sys/types.h>
 #include <sys/stat.h>
 /* fortune.c            Larn is copyrighted 1986 by Noah Morgan. */
 #include <sys/types.h>
 #include <sys/stat.h>
-
-#ifndef BSD4.1
 #include <fcntl.h>
 #include <fcntl.h>
-#else
-#define O_RDONLY 0
-#endif
 
 #include "header.h"
 /*
 
 #include "header.h"
 /*
index d942539..dbe0c89 100644 (file)
@@ -40,7 +40,7 @@ main(argc,argv)
        register int i,j;
        int hard;
        char *ptr=0,*ttype;
        register int i,j;
        int hard;
        char *ptr=0,*ttype;
-       struct passwd *pwe,*getpwuid();
+       struct passwd *pwe;
 
 /*
  *     first task is to identify the player
 
 /*
  *     first task is to identify the player
index e3d7b74..6ec0865 100644 (file)
@@ -216,6 +216,8 @@ cast()
        bottomline();
        }
 
        bottomline();
        }
 
+static int dirsub();
+
 /*
  *     speldamage(x)           Function to perform spell functions cast by the player
  *             int x;
 /*
  *     speldamage(x)           Function to perform spell functions cast by the player
  *             int x;
@@ -729,7 +731,8 @@ omnidirect(spnum,dam,str)
  *     Enter with the origination coordinates in (x,y).
  *     Returns index into diroffx[] (0-8).
  */
  *     Enter with the origination coordinates in (x,y).
  *     Returns index into diroffx[] (0-8).
  */
-static dirsub(x,y)
+static int
+dirsub(x,y)
        int *x,*y;
        {
        register int i;
        int *x,*y;
        {
        register int i;
index 65f8059..f834b1a 100644 (file)
@@ -9,6 +9,8 @@
  */
 #include "header.h"
 
  */
 #include "header.h"
 
+static void ohear();
+
 /*
  *     ******
  *     OALTAR
 /*
  *     ******
  *     OALTAR
@@ -98,7 +100,8 @@ oaltar()
 /*
        function to cast a +3 protection on the player
  */
 /*
        function to cast a +3 protection on the player
  */
-static ohear()
+static void
+ohear()
        {
        lprcat("\nYou have been heard!");
        if (c[ALTPRO]==0) c[MOREDEFENSES]+=3;
        {
        lprcat("\nYou have been heard!");
        if (c[ALTPRO]==0) c[MOREDEFENSES]+=3;
@@ -298,6 +301,23 @@ ofountain()
                }
        }
 
                }
        }
 
+/*
+       ***
+       FCH
+       ***
+
+       subroutine to process an up/down of a character attribute for ofountain
+ */
+static void
+fch(how,x)
+       int how;
+       long *x;
+       {
+       if (how < 0)     { lprcat(" went down by one!");        --(*x); }
+               else             { lprcat(" went up by one!");  (*x)++; }
+       bottomline();
+       }
+
 /*
        a subroutine to raise or lower character levels
        if x > 0 they are raised   if x < 0 they are lowered
 /*
        a subroutine to raise or lower character levels
        if x > 0 they are raised   if x < 0 they are lowered
@@ -350,19 +370,3 @@ fntchange(how)
                }
        cursors();
        }
                }
        cursors();
        }
-
-/*
-       ***
-       FCH
-       ***
-
-       subroutine to process an up/down of a character attribute for ofountain
- */
-static fch(how,x)
-       int how;
-       long *x;
-       {
-       if (how < 0)     { lprcat(" went down by one!");        --(*x); }
-               else             { lprcat(" went up by one!");  (*x)++; }
-       bottomline();
-       }
index 1ad2c5c..60bd6ce 100644 (file)
@@ -8,7 +8,8 @@ static s2choose()       /* text to be displayed if ^C during intro screen */
        lprcat(" to continue: ");   lflush(); 
        }
 
        lprcat(" to continue: ");   lflush(); 
        }
 
-static cntlc() /* what to do for a ^C */
+static void
+cntlc()        /* what to do for a ^C */
        {
        if (nosignal) return;   /* don't do anything if inhibited */
        signal(SIGQUIT,SIG_IGN);        signal(SIGINT,SIG_IGN);
        {
        if (nosignal) return;   /* don't do anything if inhibited */
        signal(SIGQUIT,SIG_IGN);        signal(SIGINT,SIG_IGN);
@@ -20,13 +21,15 @@ static cntlc()      /* what to do for a ^C */
 /*
  *     subroutine to save the game if a hangup signal
  */
 /*
  *     subroutine to save the game if a hangup signal
  */
-static sgam()
+static void
+sgam()
        {
        savegame(savefilename);  wizard=1;  died(-257); /* hangup signal */
        }
 
 #ifdef SIGTSTP
        {
        savegame(savefilename);  wizard=1;  died(-257); /* hangup signal */
        }
 
 #ifdef SIGTSTP
-static tstop() /* control Y    */
+static void
+tstop() /* control Y   */
        {
        if (nosignal)   return;  /* nothing if inhibited */
        lcreat((char*)0);  clearvt100();        lflush();         signal(SIGTSTP,SIG_DFL);
        {
        if (nosignal)   return;  /* nothing if inhibited */
        lcreat((char*)0);  clearvt100();        lflush();         signal(SIGTSTP,SIG_DFL);
@@ -45,11 +48,17 @@ static tstop() /* control Y */
 /*
  *     subroutine to issue the needed signal traps  called from main()
  */
 /*
  *     subroutine to issue the needed signal traps  called from main()
  */
-static sigill()  { sigpanic(SIGILL); }  static sigtrap() { sigpanic(SIGTRAP); }
-static sigiot()  { sigpanic(SIGIOT); }   static sigemt()  { sigpanic(SIGEMT); }
-static sigfpe()  { sigpanic(SIGFPE); }   static sigbus()  { sigpanic(SIGBUS); }
-static sigsegv() { sigpanic(SIGSEGV); }  static sigsys()  { sigpanic(SIGSYS); }
-static sigpipe() { sigpanic(SIGPIPE); }  static sigterm() { sigpanic(SIGTERM); }
+static void sigpanic();
+static void sigill()   { sigpanic(SIGILL); }
+static void sigtrap()  { sigpanic(SIGTRAP); }
+static void sigiot()   { sigpanic(SIGIOT); }
+static void sigemt()   { sigpanic(SIGEMT); }
+static void sigfpe()   { sigpanic(SIGFPE); }
+static void sigbus()   { sigpanic(SIGBUS); }
+static void sigsegv()  { sigpanic(SIGSEGV); }
+static void sigsys()   { sigpanic(SIGSYS); }
+static void sigpipe()  { sigpanic(SIGPIPE); }
+static void sigterm()  { sigpanic(SIGTERM); }
 sigsetup()
        {
        signal(SIGQUIT, cntlc);                 signal(SIGINT,  cntlc); 
 sigsetup()
        {
        signal(SIGQUIT, cntlc);                 signal(SIGINT,  cntlc); 
@@ -125,7 +134,8 @@ static char *signame[NSIG] = { "",
 /*
  *     routine to process a fatal error signal
  */
 /*
  *     routine to process a fatal error signal
  */
-static sigpanic(sig)
+static void
+sigpanic(sig)
        int sig;
        {
        char buf[128];
        int sig;
        {
        char buf[128];
index b3b19f1..5755816 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)store.c    5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)store.c    5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 /*     store.c         Larn is copyrighted 1986 by Noah Morgan. */
 #endif /* not lint */
 
 /*     store.c         Larn is copyrighted 1986 by Noah Morgan. */
@@ -152,6 +152,8 @@ dnd_2hed()
        lprcat("Also be advised, if you break 'em, you pay for 'em.");
        }
 
        lprcat("Also be advised, if you break 'em, you pay for 'em.");
        }
 
+static void dnditem();
+
 dnd_hed()
        {
        register int i;
 dnd_hed()
        {
        register int i;
@@ -159,6 +161,29 @@ dnd_hed()
        cursor(50,18); lprcat("You have ");
        }
 
        cursor(50,18); lprcat("You have ");
        }
 
+static void
+handsfull()
+{
+       lprcat("\nYou can't carry anything more!");
+       lflush();
+       nap(2200);
+}
+
+static void
+outofstock()
+{
+       lprcat("\nSorry, but we are out of that item.");
+       lflush();
+       nap(2200);
+}
+
+static void nogold()
+{
+       lprcat("\nYou don't have enough gold to pay for that!");
+       lflush();
+       nap(2200);
+}
+
 dndstore()
   {
   register int i;
 dndstore()
   {
   register int i;
@@ -214,22 +239,13 @@ dndstore()
        }
   }
 
        }
   }
 
-/*
-       function for the players hands are full
- */
-static handsfull()
-       { lprcat("\nYou can't carry anything more!"); lflush(); nap(2200); }
-static outofstock()
-       { lprcat("\nSorry, but we are out of that item."); lflush(); nap(2200); }
-static nogold()
-       { lprcat("\nYou don't have enough gold to pay for that!"); lflush(); nap(2200); }
-
 /*
        dnditem(index)
 
        to print the item list;  used in dndstore() enter with the index into itm
  */
 /*
        dnditem(index)
 
        to print the item list;  used in dndstore() enter with the index into itm
  */
-static dnditem(i)
+static void
+dnditem(i)
        register int i;
        {
        register int j,k;
        register int i;
        {
        register int j,k;
@@ -371,6 +387,8 @@ oschool()
  *     for the first national bank of Larn
  */
 int lasttime=0;        /* last time he was in bank */
  *     for the first national bank of Larn
  */
 int lasttime=0;        /* last time he was in bank */
+static void banktitle();
+
 obank()
        {
        banktitle("    Welcome to the First National Bank of Larn.");
 obank()
        {
        banktitle("    Welcome to the First National Bank of Larn.");
@@ -379,7 +397,8 @@ obank2()
        {
        banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
        }
        {
        banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
        }
-static banktitle(str)
+static void
+banktitle(str)
        char *str;
        {
        nosignal = 1; /* disable signals */
        char *str;
        {
        nosignal = 1; /* disable signals */
index f32c588..a4846a5 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)mille.c    5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)mille.c    5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      "mille.h"
 #endif /* not lint */
 
 # include      "mille.h"
@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)mille.c   5.4 (Berkeley) %G%";
  * @(#)mille.c 1.3 (Berkeley) 5/10/83
  */
 
  * @(#)mille.c 1.3 (Berkeley) 5/10/83
  */
 
-int    rub();
+void   rub();
 
 main(ac, av)
 reg int                ac;
 
 main(ac, av)
 reg int                ac;
@@ -120,6 +120,7 @@ reg char    *av[]; {
  *     Routine to trap rubouts, and make sure they really want to
  * quit.
  */
  *     Routine to trap rubouts, and make sure they really want to
  * quit.
  */
+void
 rub() {
 
        (void)signal(SIGINT, SIG_IGN);
 rub() {
 
        (void)signal(SIGINT, SIG_IGN);
index 1206a0d..dc38d40 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)execute.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)execute.c  5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      "monop.ext"
 #endif /* not lint */
 
 # include      "monop.ext"
@@ -137,11 +137,11 @@ save() {
 
        reg char        *sp;
        reg int         outf, num;
 
        reg char        *sp;
        reg int         outf, num;
-       TIME            tme, *tp;
-       int             *dat_end, junk[18];
+       time_t          t;
+       int             *dat_end;
+       struct stat     sb;
        unsgn           start, end;
 
        unsgn           start, end;
 
-       tp = &tme;
        printf("Which file do you wish to save it in? ");
        sp = buf;
        while ((*sp++=getchar()) != '\n')
        printf("Which file do you wish to save it in? ");
        sp = buf;
        while ((*sp++=getchar()) != '\n')
@@ -152,7 +152,7 @@ save() {
         * check for existing files, and confirm overwrite if needed
         */
 
         * check for existing files, and confirm overwrite if needed
         */
 
-       if (stat(buf, junk) > -1
+       if (stat(buf, &sb) > -1
            && getyn("File exists.  Do you wish to overwrite? ", yn_only) > 0)
                return;
 
            && getyn("File exists.  Do you wish to overwrite? ", yn_only) > 0)
                return;
 
@@ -161,8 +161,8 @@ save() {
                return;
        }
        printf("\"%s\" ", buf);
                return;
        }
        printf("\"%s\" ", buf);
-       time(tp);                       /* get current time             */
-       strcpy(buf, ctime(tp));
+       time(&t);                       /* get current time             */
+       strcpy(buf, ctime(&t));
        for (sp = buf; *sp != '\n'; sp++)
                continue;
        *sp = '\0';
        for (sp = buf; *sp != '\n'; sp++)
                continue;
        *sp = '\0';
@@ -227,7 +227,7 @@ reg char    *file; {
                start += num;
        }
        close(inf);
                start += num;
        }
        close(inf);
-       strcpy(buf, ctime(sbuf.st_mtime));
+       strcpy(buf, ctime(&sbuf.st_mtime));
        for (sp = buf; *sp != '\n'; sp++)
                continue;
        *sp = '\0';
        for (sp = buf; *sp != '\n'; sp++)
                continue;
        *sp = '\0';
index a90c6d4..a0631d9 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)getinp.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)getinp.c   5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      <stdio.h>
 #endif /* not lint */
 
 # include      <stdio.h>
@@ -24,7 +24,7 @@ char  *prompt, *list[]; {
        reg int i, n_match, match;
        char    *sp;
        int     plen;
        reg int i, n_match, match;
        char    *sp;
        int     plen;
-
+       static int comp();
 
        for (;;) {
 inter:
 
        for (;;) {
 inter:
index 3aa518a..e98b0fc 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      "monop.ext"
 #endif /* not lint */
 
 # include      "monop.ext"
@@ -247,12 +247,13 @@ list_all() {
 /*
  *     This routine gives the players a chance before it exits.
  */
 /*
  *     This routine gives the players a chance before it exits.
  */
+void
 quit() {
 
        putchar('\n');
        if (getyn("Do you all really want to quit? ", yn) == 0)
                exit(0);
 quit() {
 
        putchar('\n');
        if (getyn("Do you all really want to quit? ", yn) == 0)
                exit(0);
-       signal(2, quit);
+       signal(SIGINT, quit);
 }
 /*
  *     This routine copies one structure to another
 }
 /*
  *     This routine copies one structure to another
@@ -274,7 +275,7 @@ shell_out() {
        printline();
        if (shell == NULL)
                shell = shell_in();
        printline();
        if (shell == NULL)
                shell = shell_in();
-       fflush();
+       fflush(stdout);
        if (!fork()) {
                signal(SIGINT, SIG_DFL);
                execsh(shell);
        if (!fork()) {
                signal(SIGINT, SIG_DFL);
                execsh(shell);
@@ -291,8 +292,6 @@ shell_out() {
 # include      <sys/types.h>
 # include      <pwd.h>
 
 # include      <sys/types.h>
 # include      <pwd.h>
 
-struct passwd  *getpwuid();
-
 char           *getenv();
 
 char *
 char           *getenv();
 
 char *
@@ -330,5 +329,5 @@ resetsigs() {
 
        for (i = 0; i < NSIG; i++)
                signal(i, SIG_DFL);
 
        for (i = 0; i < NSIG; i++)
                signal(i, SIG_DFL);
-       signal(2, quit);
+       signal(SIGINT, quit);
 }
 }
index 88509db..a8f0448 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)morse.c    5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)morse.c    5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdio.h>
 #endif /* not lint */
 
 #include <stdio.h>
@@ -93,7 +93,6 @@ main(argc, argv)
                morse(ch);
 }
 
                morse(ch);
 }
 
-static
 morse(c)
        register int c;
 {
 morse(c)
        register int c;
 {
@@ -109,7 +108,6 @@ morse(c)
                show(" ...\n");
 }
 
                show(" ...\n");
 }
 
-static
 show(s)
        register char *s;
 {
 show(s)
        register char *s;
 {
index bdccf1b..7809fc6 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)number.c   4.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)number.c   5.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdio.h>
 #endif /* not lint */
 
 #include <stdio.h>
@@ -65,7 +65,6 @@ main(argc,argv)
        exit(0);
 }
 
        exit(0);
 }
 
-static
 convert(line)
        char    *line;
 {
 convert(line)
        char    *line;
 {
@@ -119,7 +118,6 @@ convert(line)
                puts("zero.");
 }
 
                puts("zero.");
 }
 
-static
 unit(len,C)
        register int    len;
        register char   *C;
 unit(len,C)
        register int    len;
        register char   *C;
@@ -153,7 +151,6 @@ unit(len,C)
        return(ret);
 }
 
        return(ret);
 }
 
-static
 number(C,len)
        register char   *C;
        int     len;
 number(C,len)
        register char   *C;
        int     len;
@@ -193,7 +190,6 @@ number(C,len)
        return(ret);
 }
 
        return(ret);
 }
 
-static
 pfract(len)
        register int    len;
 {
 pfract(len)
        register int    len;
 {
@@ -211,7 +207,6 @@ pfract(len)
        }
 }
 
        }
 }
 
-static
 usage(toobig)
        int     toobig;
 {
 usage(toobig)
        int     toobig;
 {
index 0045888..1779123 100644 (file)
@@ -14,7 +14,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)pom.c      5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)pom.c      5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -41,13 +41,15 @@ static char sccsid[] = "@(#)pom.c   5.2 (Berkeley) %G%";
 #define        Pzero     192.917585    /* lunar mean long of perigee at EPOCH */
 #define        Nzero     55.204723     /* lunar mean long of node at EPOCH */
 
 #define        Pzero     192.917585    /* lunar mean long of perigee at EPOCH */
 #define        Nzero     55.204723     /* lunar mean long of node at EPOCH */
 
+double dtor(), potm(), adj360();
+
 main()
 {
        extern int errno;
        struct timeval tp;
        struct timezone tzp;
        struct tm *GMT, *gmtime();
 main()
 {
        extern int errno;
        struct timeval tp;
        struct timezone tzp;
        struct tm *GMT, *gmtime();
-       double days, today, tomorrow, dtor(), adj360(), potm();
+       double days, today, tomorrow;
        int cnt;
        char *strerror();
 
        int cnt;
        char *strerror();
 
index 2f30f1e..e93706c 100644 (file)
@@ -1,5 +1,5 @@
 
 
-static char sccsid[] = "       quiz.c  4.6     91/02/04        ";
+static char sccsid[] = "       quiz.c  4.7     91/02/28        ";
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <stdio.h>
 #include <signal.h>
@@ -301,6 +301,8 @@ talloc()
                tmp[i] = malloc(SL);
 }
 
                tmp[i] = malloc(SL);
 }
 
+void done();
+
 main(argc,argv)
 char *argv[];
 {
 main(argc,argv)
 char *argv[];
 {
@@ -311,7 +313,6 @@ char *argv[];
        char *info;
        int tvec[2];
        char *t;
        char *info;
        int tvec[2];
        char *t;
-       extern done();
        int count;
        info = _PATH_INDEX;
        time(tvec);
        int count;
        info = _PATH_INDEX;
        time(tvec);
@@ -424,6 +425,7 @@ next()
        return(ptr);
 }
 
        return(ptr);
 }
 
+void
 done()
 {
        if (rights + wrongs) {
 done()
 {
        if (rights + wrongs) {
@@ -435,6 +437,7 @@ done()
        exit(0);
 }
 instruct(info)
        exit(0);
 }
 instruct(info)
+       char *info;
 {
        char *t;
        int i, n;
 {
        char *t;
        int i, n;
index 520ad0e..6693caa 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)rain.c     5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)rain.c     5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -51,7 +51,8 @@ main(argc, argv)
        char *TI, *tcp, *mp, tcb[100],
                *malloc(), *getenv(), *strcpy(), *tgetstr();
        long cols, lines, random();
        char *TI, *tcp, *mp, tcb[100],
                *malloc(), *getenv(), *strcpy(), *tgetstr();
        long cols, lines, random();
-       int xpos[5], ypos[5], onsig();
+       int xpos[5], ypos[5];
+       static void onsig();
 
        if (!(term = getenv("TERM"))) {
                fprintf(stderr, "%s: TERM: parameter not set\n", *argv);
 
        if (!(term = getenv("TERM"))) {
                fprintf(stderr, "%s: TERM: parameter not set\n", *argv);
@@ -195,7 +196,7 @@ main(argc, argv)
        }
 }
 
        }
 }
 
-static
+static void
 onsig()
 {
        tputs(LL, 1, fputchar);
 onsig()
 {
        tputs(LL, 1, fputchar);
index 99559eb..722a70d 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      "robots.h"
 #endif /* not lint */
 
 # include      "robots.h"
@@ -28,7 +28,7 @@ char  **av;
        register bool   show_only;
        extern char     *Scorefile;
        extern int      Max_per_uid;
        register bool   show_only;
        extern char     *Scorefile;
        extern int      Max_per_uid;
-       extern char     *rindex();
+       void quit();
 
        show_only = FALSE;
        if (ac > 1) {
 
        show_only = FALSE;
        if (ac > 1) {
@@ -96,7 +96,8 @@ char  **av;
        if (LINES != Y_SIZE || COLS != X_SIZE) {
                if (LINES < Y_SIZE || COLS < X_SIZE) {
                        endwin();
        if (LINES != Y_SIZE || COLS != X_SIZE) {
                if (LINES < Y_SIZE || COLS < X_SIZE) {
                        endwin();
-                       printf("Need at least a %dx%d screen\n", Y_SIZE, X_SIZE);
+                       printf("Need at least a %dx%d screen\n",
+                           Y_SIZE, X_SIZE);
                        exit(1);
                }
                delwin(stdscr);
                        exit(1);
                }
                delwin(stdscr);
@@ -124,6 +125,7 @@ char        **av;
  * quit:
  *     Leave the program elegantly.
  */
  * quit:
  *     Leave the program elegantly.
  */
+void
 quit()
 {
        extern int      _putchar();
 quit()
 {
        extern int      _putchar();
index 97a9c84..4461aa2 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)move_robs.c        5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)move_robs.c        5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      "robots.h"
 #endif /* not lint */
 
 # include      "robots.h"
@@ -16,6 +16,7 @@ static char sccsid[] = "@(#)move_robs.c       5.4 (Berkeley) %G%";
  * move_robots:
  *     Move the robots around
  */
  * move_robots:
  *     Move the robots around
  */
+void
 move_robots(was_sig)
 bool   was_sig;
 {
 move_robots(was_sig)
 bool   was_sig;
 {
@@ -82,7 +83,7 @@ bool  was_sig;
        if (was_sig) {
                refresh();
                if (Dead || Num_robots <= 0)
        if (was_sig) {
                refresh();
                if (Dead || Num_robots <= 0)
-                       longjmp(End_move);
+                       longjmp(End_move, 0);
        }
 
 # ifdef DEBUG
        }
 
 # ifdef DEBUG
index 04b6699..454f561 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)robots.h    5.5 (Berkeley) %G%
+ *     @(#)robots.h    5.6 (Berkeley) %G%
  */
 
 # include      <curses.h>
  */
 
 # include      <curses.h>
@@ -78,6 +78,7 @@ extern jmp_buf        End_move;
  * functions types
  */
 
  * functions types
  */
 
-int    quit(), cmp_sc(), move_robots();
+int    cmp_sc();
+void   move_robots();
 
 COORD  *rnd_pos();
 
 COORD  *rnd_pos();
index d463027..656a203 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)init.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)init.c     5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -175,6 +175,7 @@ stop_window()
        md_control_keybord(1);
 }
 
        md_control_keybord(1);
 }
 
+void
 byebye()
 {
        md_ignore_signals();
 byebye()
 {
        md_ignore_signals();
@@ -186,6 +187,7 @@ byebye()
        md_heed_signals();
 }
 
        md_heed_signals();
 }
 
+void
 onintr()
 {
        md_ignore_signals();
 onintr()
 {
        md_ignore_signals();
@@ -198,6 +200,7 @@ onintr()
        md_heed_signals();
 }
 
        md_heed_signals();
 }
 
+void
 error_save()
 {
        save_is_interactive = 0;
 error_save()
 {
        save_is_interactive = 0;
index 6551e05..18a71bd 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)machdep.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)machdep.c  5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -354,7 +354,7 @@ char *fname;
 char *
 md_gln()
 {
 char *
 md_gln()
 {
-       struct passwd *p, *getpwuid();
+       struct passwd *p;
 
        if (!(p = getpwuid(getuid())))
                return((char *)NULL);
 
        if (!(p = getpwuid(getuid())))
                return((char *)NULL);
index 8094f69..9603792 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)rogue.h     5.5 (Berkeley) %G%
+ *     @(#)rogue.h     5.6 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -434,7 +434,7 @@ unsigned short gr_what_is();
 long rrandom();
 long lget_number();
 long xxx();
 long rrandom();
 long lget_number();
 long xxx();
-int byebye(), onintr(), error_save();
+void byebye(), onintr(), error_save();
 
 struct rogue_time {
        short year;             /* >= 1987 */
 
 struct rogue_time {
        short year;             /* >= 1987 */
index 29776d4..99b1fda 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lo_main.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)lo_main.c  5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -30,7 +30,7 @@ lo_main()
        FILE *fp;
        char sbuf[32];
        int n = 0, people;
        FILE *fp;
        char sbuf[32];
        int n = 0, people;
-       struct passwd *getpwuid(), *pass;
+       struct passwd *pass;
        struct logs log;
        struct ship *ship;
 
        struct logs log;
        struct ship *ship;
 
index 1a2fc7a..5e9d1c5 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pl_1.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)pl_1.c     5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "player.h"
 #endif /* not lint */
 
 #include "player.h"
@@ -87,11 +87,13 @@ int conditions;
        exit(0);
 }
 
        exit(0);
 }
 
+void
 choke()
 {
        leave(LEAVE_QUIT);
 }
 
 choke()
 {
        leave(LEAVE_QUIT);
 }
 
+void
 child()
 {
        union wait status;
 child()
 {
        union wait status;
@@ -99,7 +101,7 @@ child()
 
        (void) signal(SIGCHLD, SIG_IGN);
        do {
 
        (void) signal(SIGCHLD, SIG_IGN);
        do {
-               pid = wait3(&status, WNOHANG, (struct rusage *)0);
+               pid = wait3((int *)&status, WNOHANG, (struct rusage *)0);
                if (pid < 0 || pid > 0 && !WIFSTOPPED(status))
                        hasdriver = 0;
        } while (pid > 0);
                if (pid < 0 || pid > 0 && !WIFSTOPPED(status))
                        hasdriver = 0;
        } while (pid > 0);
index cb457ce..d812245 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pl_7.c     5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)pl_7.c     5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "player.h"
 #endif /* not lint */
 
 #include "player.h"
@@ -35,7 +35,7 @@ initscreen()
        (void) leaveok(turn_w, 1);
 #ifdef SIGTSTP
        {
        (void) leaveok(turn_w, 1);
 #ifdef SIGTSTP
        {
-               int susp();
+               void susp();
                (void) signal(SIGTSTP, susp);
        }
 #endif
                (void) signal(SIGTSTP, susp);
        }
 #endif
@@ -54,6 +54,7 @@ cleanupscreen()
        }
 }
 
        }
 }
 
+void
 newturn()
 {
        repaired = loaded = fired = changed = 0;
 newturn()
 {
        repaired = loaded = fired = changed = 0;
@@ -443,6 +444,7 @@ adjustview()
 }
 
 #ifdef SIGTSTP
 }
 
 #ifdef SIGTSTP
+void
 susp()
 {
        blockalarm();
 susp()
 {
        blockalarm();
index ca132b2..689bd71 100644 (file)
@@ -6,14 +6,14 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pl_main.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)pl_main.c  5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "player.h"
 #include <sys/types.h>
 #include <sys/wait.h>
 
 #endif /* not lint */
 
 #include "player.h"
 #include <sys/types.h>
 #include <sys/wait.h>
 
-int choke(), child();
+void choke(), child();
 
 /*ARGSUSED*/
 pl_main()
 
 /*ARGSUSED*/
 pl_main()
index 0c804a8..c4a04c4 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)move.c     5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)move.c     5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /*************************************************************************
 #endif /* not lint */
 
 /*************************************************************************
@@ -32,9 +32,9 @@ static char sccsid[] = "@(#)move.c    5.7 (Berkeley) %G%";
  *             home()          home.
  *             ll()            move to lower left corner of screen.
  *             cr()            carriage return (no line feed).
  *             home()          home.
  *             ll()            move to lower left corner of screen.
  *             cr()            carriage return (no line feed).
- *             printf()        just like standard printf, but keeps track
+ *             pr()            just like standard printf, but keeps track
  *                             of cursor position. (Uses pstring).
  *                             of cursor position. (Uses pstring).
- *             aprintf()       same as printf, but first argument is &point.
+ *             apr()           same as printf, but first argument is &point.
  *                             (Uses pstring).
  *             pstring(s)      output the string of printing characters.
  *                             However, '\r' is interpreted to mean return
  *                             (Uses pstring).
  *             pstring(s)      output the string of printing characters.
  *                             However, '\r' is interpreted to mean return
@@ -65,6 +65,7 @@ static char sccsid[] = "@(#)move.c    5.7 (Berkeley) %G%";
  *
  ******************************************************************************/
 
  *
  ******************************************************************************/
 
+#include <stdarg.h>
 #include "snake.h"
 
 int CMlength;
 #include "snake.h"
 
 int CMlength;
@@ -83,7 +84,7 @@ struct point *sp;
        struct point z;
 
        if (sp->line <0 || sp->col <0 || sp->col > COLUMNS){
        struct point z;
 
        if (sp->line <0 || sp->col <0 || sp->col > COLUMNS){
-               printf("move to [%d,%d]?",sp->line,sp->col);
+               pr("move to [%d,%d]?",sp->line,sp->col);
                return;
        }
        if (sp->line >= LINES){
                return;
        }
        if (sp->line >= LINES){
@@ -133,7 +134,8 @@ struct point *sp;
                distance = sp->col - cursor.col;
                distance = distance > 0 ?
                        distance*NDlength : -distance * BSlength;
                distance = sp->col - cursor.col;
                distance = distance > 0 ?
                        distance*NDlength : -distance * BSlength;
-if(distance < 0)printf("ERROR: distance is negative: %d",distance);
+               if (distance < 0)
+                       pr("ERROR: distance is negative: %d",distance);
                distance += abs(sp->line - cursor.line);
                if(distance >= CMlength){
                        putpad(cmstr);
                distance += abs(sp->line - cursor.line);
                if(distance >= CMlength){
                        putpad(cmstr);
@@ -158,11 +160,11 @@ struct point *sp;
 
        if (cursor.line > LINES || cursor.line <0 ||
            cursor.col <0 || cursor.col > COLUMNS)
 
        if (cursor.line > LINES || cursor.line <0 ||
            cursor.col <0 || cursor.col > COLUMNS)
-               printf("ERROR: cursor is at %d,%d\n",
+               pr("ERROR: cursor is at %d,%d\n",
                        cursor.line,cursor.col);
        if (sp->line > LINES || sp->line <0 ||
            sp->col <0 || sp->col >  COLUMNS)
                        cursor.line,cursor.col);
        if (sp->line > LINES || sp->line <0 ||
            sp->col <0 || sp->col >  COLUMNS)
-               printf("ERROR: target is %d,%d\n",sp->line,sp->col);
+               pr("ERROR: target is %d,%d\n",sp->line,sp->col);
        tfield = (sp->col) >> 3;
        if (sp->line == cursor.line){
                if (sp->col > cursor.col)right(sp);
        tfield = (sp->col) >> 3;
        if (sp->line == cursor.line){
                if (sp->col > cursor.col)right(sp);
@@ -225,7 +227,7 @@ struct point *sp;
        int tabcol,strlength;
 
        if (sp->col < cursor.col)
        int tabcol,strlength;
 
        if (sp->col < cursor.col)
-               printf("ERROR:right() can't move left\n");
+               pr("ERROR:right() can't move left\n");
        if(TA){         /* If No Tabs: can't send tabs because ttydrive
                         * loses count with control characters.
                         */
        if(TA){         /* If No Tabs: can't send tabs because ttydrive
                         * loses count with control characters.
                         */
@@ -358,25 +360,29 @@ pch(c)
        }
 }
 
        }
 }
 
-aprintf(ps,st,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9)
-struct point *ps;
-char *st;
-int v0,v1,v2,v3,v4,v5,v6,v7,v8,v9;
-
+apr(ps, fmt)
+       struct point *ps;
+       char *fmt;
 {
        struct point p;
 {
        struct point p;
+       va_list ap;
 
        p.line = ps->line+1; p.col = ps->col+1;
        move(&p);
 
        p.line = ps->line+1; p.col = ps->col+1;
        move(&p);
-       (void)sprintf(str,st,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9);
+       va_start(ap, fmt);
+       (void)vsprintf(str, fmt, ap);
+       va_end(ap);
        pstring(str);
 }
 
        pstring(str);
 }
 
-printf(st,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9)
-char *st;
-int v0,v1,v2,v3,v4,v5,v6,v7,v8,v9;
+pr(fmt)
+       char *fmt;
 {
 {
-       (void)sprintf(str,st,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9);
+       va_list ap;
+
+       va_start(ap, fmt);
+       (void)vsprintf(str, fmt, ap);
+       va_end(ap);
        pstring(str);
 }
 
        pstring(str);
 }
 
@@ -519,7 +525,7 @@ getcap()
        char *term;
        char *xPC;
        struct point z;
        char *term;
        char *xPC;
        struct point z;
-       int stop();
+       void stop();
 
        term = getenv("TERM");
        if (term==0) {
 
        term = getenv("TERM");
        if (term==0) {
index d0e64d2..e99ba60 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)snake.c    5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)snake.c    5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -71,7 +71,7 @@ char **argv;
        int ch, i, j, k;
        time_t time();
        long atol();
        int ch, i, j, k;
        time_t time();
        long atol();
-       int stop();
+       void stop();
 
        (void)time(&tv);
        srandom((int)tv);
 
        (void)time(&tv);
        srandom((int)tv);
@@ -101,7 +101,7 @@ char **argv;
        i = MIN(lcnt, ccnt);
        if (i < 4) {
                cook();
        i = MIN(lcnt, ccnt);
        if (i < 4) {
                cook();
-               printf("snake: screen too small for a fair game.\n");
+               pr("snake: screen too small for a fair game.\n");
                exit(1);
        }
 
                exit(1);
        }
 
@@ -344,7 +344,7 @@ mainloop()
                                win(&finish);
                                ll();
                                cook();
                                win(&finish);
                                ll();
                                cook();
-                               printf("You have won with $%d.\n",cashvalue);
+                               pr("You have won with $%d.\n",cashvalue);
                                fflush(stdout);
                                logit("won");
                                post(cashvalue,0);
                                fflush(stdout);
                                logit("won");
                                post(cashvalue,0);
@@ -438,7 +438,7 @@ int iscore, flag;
        short   uid;
        short   oldbest=0;
        short   allbwho=0, allbscore=0;
        short   uid;
        short   oldbest=0;
        short   allbwho=0, allbscore=0;
-       struct  passwd *p, *getpwuid();
+       struct  passwd *p;
 
        /*
         * Neg uid, 0, and 1 cannot have scores recorded.
 
        /*
         * Neg uid, 0, and 1 cannot have scores recorded.
@@ -455,9 +455,9 @@ int iscore, flag;
                if (score > oldbest) {
                        lseek(rawscores, ((long)uid)*sizeof(short), 0);
                        write(rawscores, &score, sizeof(short));
                if (score > oldbest) {
                        lseek(rawscores, ((long)uid)*sizeof(short), 0);
                        write(rawscores, &score, sizeof(short));
-                       printf("You bettered your previous best of $%d\n", oldbest);
+                       pr("You bettered your previous best of $%d\n", oldbest);
                } else
                } else
-                       printf("Your best to date is $%d\n", oldbest);
+                       pr("Your best to date is $%d\n", oldbest);
 
                /* See if we have a new champ */
                p = getpwuid(allbwho);
 
                /* See if we have a new champ */
                p = getpwuid(allbwho);
@@ -466,15 +466,17 @@ int       iscore, flag;
                        write(rawscores, &score, sizeof(short));
                        write(rawscores, &uid, sizeof(short));
                        if (p != NULL)
                        write(rawscores, &score, sizeof(short));
                        write(rawscores, &uid, sizeof(short));
                        if (p != NULL)
-                               printf("You beat %s's old record of $%d!\n", p->pw_name, allbscore);
+                               pr("You beat %s's old record of $%d!\n",
+                                   p->pw_name, allbscore);
                        else
                        else
-                               printf("You set a new record!\n");
+                               pr("You set a new record!\n");
                } else
                } else
-                       printf("The highest is %s with $%d\n", p->pw_name, allbscore);
+                       pr("The highest is %s with $%d\n",
+                           p->pw_name, allbscore);
                close(rawscores);
        } else
                if (!flag)
                close(rawscores);
        } else
                if (!flag)
-                       printf("Unable to post score.\n");
+                       pr("Unable to post score.\n");
        return (1);
 }
 
        return (1);
 }
 
@@ -547,7 +549,7 @@ struct point *sp, *np;
                else
                        vp -= wt[i];
        if (i==8) {
                else
                        vp -= wt[i];
        if (i==8) {
-               printf("failure\n"); 
+               pr("failure\n"); 
                i=0;
                while (wt[i]==0) i++;
        }
                i=0;
                while (wt[i]==0) i++;
        }
@@ -578,7 +580,7 @@ int w;{
        for(j=0;j<3;j++){
                clear();
                delay(5);
        for(j=0;j<3;j++){
                clear();
                delay(5);
-               aprintf(&p,str);
+               apr(&p,str);
                delay(10);
        }
        setup();
                delay(10);
        }
        setup();
@@ -604,19 +606,19 @@ snap()
        if (! stretch(&money)) if (! stretch(&finish)) delay(10);
        if(you.line < 3){
                point(&p,you.col,0);
        if (! stretch(&money)) if (! stretch(&finish)) delay(10);
        if(you.line < 3){
                point(&p,you.col,0);
-               remove(&p);
+               chk(&p);
        }
        if(you.line > lcnt-4){
                point(&p,you.col,lcnt-1);
        }
        if(you.line > lcnt-4){
                point(&p,you.col,lcnt-1);
-               remove(&p);
+               chk(&p);
        }
        if(you.col < 10){
                point(&p,0,you.line);
        }
        if(you.col < 10){
                point(&p,0,you.line);
-               remove(&p);
+               chk(&p);
        }
        if(you.col > ccnt-10){
                point(&p,ccnt-1,you.line);
        }
        if(you.col > ccnt-10){
                point(&p,ccnt-1,you.line);
-               remove(&p);
+               chk(&p);
        }
        fflush(stdout);
 }
        }
        fflush(stdout);
 }
@@ -631,13 +633,13 @@ struct point *ps;{
                                pchar(&p,'v');
                        delay(10);
                        for (;p.line > you.line;p.line--)
                                pchar(&p,'v');
                        delay(10);
                        for (;p.line > you.line;p.line--)
-                               remove(&p);
+                               chk(&p);
                } else {
                        for (p.line = you.line-1;p.line >= ps->line;p.line--)
                                pchar(&p,'^');
                        delay(10);
                        for (;p.line < you.line;p.line++)
                } else {
                        for (p.line = you.line-1;p.line >= ps->line;p.line--)
                                pchar(&p,'^');
                        delay(10);
                        for (;p.line < you.line;p.line++)
-                               remove(&p);
+                               chk(&p);
                }
                return(1);
        } else if(abs(ps->line-you.line) < 3){
                }
                return(1);
        } else if(abs(ps->line-you.line) < 3){
@@ -647,13 +649,13 @@ struct point *ps;{
                                pchar(&p,'>');
                        delay(10);
                        for (;p.col > you.col;p.col--)
                                pchar(&p,'>');
                        delay(10);
                        for (;p.col > you.col;p.col--)
-                               remove(&p);
+                               chk(&p);
                } else {
                        for (p.col = you.col-1;p.col >= ps->col;p.col--)
                                pchar(&p,'<');
                        delay(10);
                        for (;p.col < you.col;p.col++)
                } else {
                        for (p.col = you.col-1;p.col >= ps->col;p.col--)
                                pchar(&p,'<');
                        delay(10);
                        for (;p.col < you.col;p.col++)
-                               remove(&p);
+                               chk(&p);
                }
                return(1);
        }
                }
                return(1);
        }
@@ -669,7 +671,7 @@ struct point *ps;{
        if(ps->line == 0)ps->line++;
        if(ps->line == LINES -1)ps->line--;
        if(ps->col == COLUMNS -1)ps->col--;
        if(ps->line == 0)ps->line++;
        if(ps->line == LINES -1)ps->line--;
        if(ps->col == COLUMNS -1)ps->col--;
-       aprintf(point(&x,ps->col-1,ps->line-1),"/*\\\r* *\r\\*/");
+       apr(point(&x,ps->col-1,ps->line-1),"/*\\\r* *\r\\*/");
        for (j=0;j<20;j++){
                pchar(ps,'@');
                delay(1);
        for (j=0;j<20;j++){
                pchar(ps,'@');
                delay(1);
@@ -677,12 +679,12 @@ struct point *ps;{
                delay(1);
        }
        if (post(cashvalue,1)) {
                delay(1);
        }
        if (post(cashvalue,1)) {
-               aprintf(point(&x,ps->col-1,ps->line-1),"   \ro.o\r\\_/");
+               apr(point(&x,ps->col-1,ps->line-1),"   \ro.o\r\\_/");
                delay(6);
                delay(6);
-               aprintf(point(&x,ps->col-1,ps->line-1),"   \ro.-\r\\_/");
+               apr(point(&x,ps->col-1,ps->line-1),"   \ro.-\r\\_/");
                delay(6);
        }
                delay(6);
        }
-       aprintf(point(&x,ps->col-1,ps->line-1),"   \ro.o\r\\_/");
+       apr(point(&x,ps->col-1,ps->line-1),"   \ro.o\r\\_/");
 }
 win(ps)
 struct point *ps;
 }
 win(ps)
 struct point *ps;
@@ -744,7 +746,7 @@ pushsnake()
                        i = (cashvalue) % 10;
                        bonus = ((rand()>>8) & 0377)% 10;
                        ll();
                        i = (cashvalue) % 10;
                        bonus = ((rand()>>8) & 0377)% 10;
                        ll();
-                       printf("%d\n", bonus);
+                       pr("%d\n", bonus);
                        delay(30);
                        if (bonus == i) {
                                spacewarp(1);
                        delay(30);
                        if (bonus == i) {
                                spacewarp(1);
@@ -753,9 +755,11 @@ pushsnake()
                                return(1);
                        }
                        if ( loot >= penalty ){
                                return(1);
                        }
                        if ( loot >= penalty ){
-                               printf("You and your $%d have been eaten\n",cashvalue);
+                               pr("You and your $%d have been eaten\n",
+                                   cashvalue);
                        } else {
                        } else {
-                               printf("The snake ate you.  You owe $%d.\n",-cashvalue);
+                               pr("The snake ate you.  You owe $%d.\n",
+                                   -cashvalue);
                        }
                        logit("eaten");
                        length(moves);
                        }
                        logit("eaten");
                        length(moves);
@@ -765,7 +769,7 @@ pushsnake()
        return(0);
 }
        
        return(0);
 }
        
-remove(sp)
+chk(sp)
 struct point *sp;
 {
        int j;
 struct point *sp;
 {
        int j;
@@ -808,12 +812,13 @@ int won;
        p.line = p.col = 1;
        if(won>0){
                move(&p);
        p.line = p.col = 1;
        if(won>0){
                move(&p);
-               printf("$%d",won);
+               pr("$%d",won);
        }
 }
 
        }
 }
 
+void
 stop(){
 stop(){
-       signal(SIGINT,1);
+       signal(SIGINT,SIG_IGN);
        ll();
        length(moves);
        done();
        ll();
        length(moves);
        done();
@@ -834,7 +839,7 @@ suspend()
 length(num)
 int num;
 {
 length(num)
 int num;
 {
-       printf("You made %d moves.\n",num);
+       pr("You made %d moves.\n",num);
 }
 
 logit(msg)
 }
 
 logit(msg)
@@ -845,7 +850,8 @@ char *msg;
 
        if ((logfile=fopen(_PATH_LOGFILE, "a")) != NULL) {
                time(&t);
 
        if ((logfile=fopen(_PATH_LOGFILE, "a")) != NULL) {
                time(&t);
-               fprintf(logfile, "%s $%d %dx%d %s %s", getlogin(), cashvalue, lcnt, ccnt, msg, ctime(&t));
+               fprintf(logfile, "%s $%d %dx%d %s %s",
+                   getlogin(), cashvalue, lcnt, ccnt, msg, ctime(&t));
                fclose(logfile);
        }
 }
                fclose(logfile);
        }
 }