]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - phantasia/gamesupport.c
sprinkle static
[bsdgames-darwin.git] / phantasia / gamesupport.c
index dbb3f0fdade59bc36bd323748299bfa9bb86f961..b05f1ff5746b3a9ad49b9796b7dd2cf879f24c9e 100644 (file)
@@ -1,14 +1,15 @@
-/*     $NetBSD: gamesupport.c,v 1.5 1999/09/08 21:17:53 jsm Exp $      */
+/*     $NetBSD: gamesupport.c,v 1.10 2009/05/25 23:08:45 dholland Exp $        */
 
 /*
  * gamesupport.c - auxiliary routines for support of Phantasia
  */
 
 #include "include.h"
+#undef bool
+#include <curses.h>
 
 void
-changestats(ingameflag)
-       bool    ingameflag;
+changestats(phbool ingameflag)
 {
        static char flag[2] =   /* for printing values of bools */
        {'F', 'T'};
@@ -20,7 +21,7 @@ changestats(ingameflag)
        long    loc;            /* location in player file */
        time_t  now;            /* time now */
        double  dtemp;          /* temporary variable */
-       bool   *bptr;           /* pointer to bool item to change */
+       phbool *bptr;           /* pointer to bool item to change */
        double *dptr;           /* pointer to double item to change */
        short  *sptr;           /* pointer to short item to change */
 
@@ -438,12 +439,12 @@ BALTER:
 }
 
 void
-monstlist()
+monstlist(void)
 {
        int     count = 0;      /* count in file */
 
        puts(" #)  Name                 Str  Brain  Quick  Energy  Exper  Treas  Type  Flock%\n");
-       fseek(Monstfp, 0L, 0);
+       fseek(Monstfp, 0L, SEEK_SET);
        while (fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp) == 1)
                printf("%2d)  %-20.20s%4.0f   %4.0f     %2.0f   %5.0f  %5.0f     %2d    %2d     %3.0f\n", count++,
                    Curmonster.m_name, Curmonster.m_strength, Curmonster.m_brains,
@@ -452,7 +453,7 @@ monstlist()
 }
 
 void
-scorelist()
+scorelist(void)
 {
        struct scoreboard sbuf; /* for reading entries */
        FILE   *fp;             /* to open the file */
@@ -466,9 +467,9 @@ scorelist()
 }
 
 void
-activelist()
+activelist(void)
 {
-       fseek(Playersfp, 0L, 0);
+       fseek(Playersfp, 0L, SEEK_SET);
        printf("Current characters on file are:\n\n");
 
        while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
@@ -480,7 +481,7 @@ activelist()
 }
 
 void
-purgeoldplayers()
+purgeoldplayers(void)
 {
        int     today;          /* day of year for today */
        int     daysold;        /* how many days since the character has been
@@ -492,7 +493,7 @@ purgeoldplayers()
        today = localtime(&ltime)->tm_yday;
 
        for (;;) {
-               fseek(Playersfp, loc, 0);
+               fseek(Playersfp, loc, SEEK_SET);
                if (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) != 1)
                        break;
 
@@ -509,7 +510,7 @@ purgeoldplayers()
 }
 
 void
-enterscore()
+enterscore(void)
 {
        struct scoreboard sbuf; /* buffer to read in scoreboard entries */
        FILE   *fp;             /* to open scoreboard file */
@@ -543,7 +544,7 @@ enterscore()
                strcpy(sbuf.sb_type, descrtype(&Player, TRUE));
        }
        /* update entry */
-       fseek(fp, loc, 0);
+       fseek(fp, loc, SEEK_SET);
        fwrite((char *) &sbuf, SZ_SCORESTRUCT, 1, fp);
        fclose(fp);
 }