home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / SRC / larn.t.Z / larn.t / config.c < prev    next >
C/C++ Source or Header  |  1988-11-13  |  3KB  |  103 lines

  1. /*
  2.  *    config.c    --    This defines the installation dependent variables.
  3.  *                  Some strings are modified later.  ANSI C would
  4.  *                  allow compile time string concatenation, we must
  5.  *                  do runtime concatenation, in main.
  6.  *
  7.  *        Larn is copyrighted 1986 by Noah Morgan.
  8.  */
  9. #include "header.h"
  10.  
  11. #ifndef LARNHOME
  12. # ifndef OSK
  13. #define LARNHOME "/usr/games/larn/"        /* normally supplied by a Makefile */
  14. # else OSK
  15. # define LARNHOME "/h0/USR/GAMES/LIB/LARN/"
  16. # endif OSK
  17. #endif
  18.  
  19. #ifndef WIZID
  20. #define WIZID    0
  21. #endif
  22.  
  23. /*
  24.  *    All these strings will be appended to in main() to be complete filenames
  25.  */
  26.  
  27. # ifndef OSK
  28.         /* the game save filename   */
  29. char savefilename[SAVEFILENAMESIZE] =                     LARNHOME;
  30.  
  31.         /* the score file            */
  32. char scorefile[sizeof(LARNHOME)+sizeof(SCORENAME)] =    LARNHOME;
  33.  
  34.         /* the logging file         */
  35. char logfile[sizeof(LARNHOME)+sizeof(LOGFNAME)]  =        LARNHOME;
  36.  
  37.         /* the help text file        */
  38. char helpfile[sizeof(LARNHOME)+sizeof(HELPNAME)] =         LARNHOME;
  39.  
  40.         /* the maze data file        */
  41. char larnlevels[sizeof(LARNHOME)+sizeof(LEVELSNAME)] =     LARNHOME;
  42.  
  43.         /* the fortune data file    */
  44. char fortfile[sizeof(LARNHOME)+sizeof(FORTSNAME)] =        LARNHOME;
  45.  
  46.         /* the .larnopts filename */
  47. char optsfile[128] ="/.larnopts";                /* the option file            */
  48.  
  49.         /* the player id datafile name */
  50. char playerids[sizeof(LARNHOME)+sizeof(PLAYERIDS)] =    LARNHOME;
  51.  
  52.         /* the holiday datafile */
  53. char holifile[sizeof(LARNHOME)+sizeof(HOLIFILE)] =        LARNHOME;
  54. # else OSK
  55. char savefilename[200];
  56. char scorefile[200];
  57. char logfile[200];
  58. char helpfile[200];
  59. char larnlevels[200];
  60. char fortfile[200];
  61. char optsfile[200];
  62. char playerids[200];
  63. char holifile[200];
  64.  
  65. void
  66. do_config ()
  67. {
  68.     char    larnhome[200];
  69.  
  70.     if (info_str ("GAMES.LIB", larnhome, 160)) {
  71.         if (larnhome[strlen (larnhome) - 1] != '/')
  72.             strcat (larnhome, "/");
  73.         strcat (larnhome, "LARN/");
  74.     } else
  75.         strcpy (larnhome, LARNHOME);
  76.     strcpy (savefilename, larnhome);
  77.     strcpy (scorefile, larnhome);
  78.     strcpy (logfile, larnhome);
  79.     strcpy (helpfile, larnhome);
  80.     strcpy (larnlevels, larnhome);
  81.     strcpy (fortfile, larnhome);
  82.     strcpy (optsfile, "/.larnopts");
  83.     strcpy (playerids, larnhome);
  84.     strcpy (holifile, larnhome);
  85.     do_data ();
  86.     do_store ();
  87. }
  88. # endif OSK
  89.  
  90. char diagfile[] ="Diagfile";                    /* the diagnostic filename    */
  91. char ckpfile[] ="Larn12.0.ckp";                    /* the checkpoint filename    */
  92. # ifndef OSK
  93. char *password ="pvnert(x)";                    /* the wizards password <=32*/
  94. # else OSK
  95. char *password ="Orcus";
  96. # endif OSK
  97. #if WIZID == -1
  98. int wisid=0;            /* the user id of the only person who can be wizard */
  99. #else
  100. int wisid=WIZID;        /* the user id of the only person who can be wizard */
  101. #endif
  102. char psname[PSNAMESIZE]="larn";                        /* the process name        */
  103.