]> granicus.if.org Git - nethack/commitdiff
SYSCF for VMS (trunk only)
authornethack.rankin <nethack.rankin>
Sat, 23 Apr 2011 01:51:01 +0000 (01:51 +0000)
committernethack.rankin <nethack.rankin>
Sat, 23 Apr 2011 01:51:01 +0000 (01:51 +0000)
     Enable SYSCF_FILE for VMS, and simplify option initialization
in the process.  I still need to put a template into the playground
directory during initial install, and the one in sys/unix/ probably
isn't appropriate.

include/vmsconf.h
src/options.c
sys/unix/unixmain.c
sys/vms/vmsmain.c

index 6f5494931e1ead17fdd2a1aa3d130d871dc4e4b3..8e64f67ec800780accf27537b2b7c546a3d6228e 100644 (file)
 # define WIZARD 1
 # define WIZARD_NAME Local_WIZARD
 #endif
+#ifndef SYSCF
+# define SYSCF
+#endif
 
 /* filenames require punctuation to avoid redirection via logical names */
 #undef RECORD
 #define RECORD "record;1"      /* scoreboard file (retains high scores) */
 #undef LOGFILE
 #define LOGFILE "logfile;0"    /* optional file (records all games) */
+#undef SYSCF_FILE
+#define SYSCF_FILE "sysconf;0"
 
 #define HLOCK  "perm;1"        /* an empty file used for locking purposes */
 
index 39fa10b1d72babeb99e44e19a9f45b7f9e78f896..b212a53608ed845aa7cfadcd225db7316850d61f 100644 (file)
@@ -561,12 +561,17 @@ const char *ev;
                return (char *)0;
 }
 
-/* Split initoptions into 2 parts for SYSCF but don't break anything not
- * using SYSCF. */
+/* process options, possibly including SYSCF */
 void
 initoptions()
 {
        initoptions_init();
+#ifdef SYSCF
+       /* someday there may be other SYSCF alternatives besides text file */
+# ifdef SYSCF_FILE
+       read_config_file(SYSCF_FILE, SET_IN_SYS);
+# endif
+#endif
        initoptions_finish();
 }
 
@@ -660,9 +665,7 @@ initoptions_init()
        if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
 #ifdef LOADSYMSETS
                if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY);
-
                if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET);
-
                switch_symbols(TRUE);
 #endif
 # ifdef TEXTCOLOR
index cf671ee5d3e30c24e09cb53daeed173481cf0506..8caa24b9b1f8c9ea58cf07ec56de01bffe0a79a2 100644 (file)
@@ -136,9 +136,7 @@ char *argv[];
                chdirx(dir,0);
 #endif
 #ifdef SYSCF
-               initoptions_init();
-               read_config_file(SYSCF_FILE, SET_IN_SYS);
-               initoptions_finish();
+               initoptions();
 #endif
 #ifdef PANICTRACE
                ARGV0 = argv[0];        /* save for possible stack trace */
@@ -165,11 +163,7 @@ char *argv[];
 #ifdef __linux__
        check_linux_console();
 #endif
-       initoptions_init();
-#ifdef SYSCF
-       read_config_file(SYSCF_FILE, SET_IN_SYS);
-#endif
-       initoptions_finish();
+       initoptions();
 #ifdef PANICTRACE
        ARGV0 = argv[0];        /* save for possible stack trace */
 # ifndef NO_SIGNAL
index 1b15175a1f987b600df76890b0f4f8e7645c5a25..7992c806c3a0b3ee9f89a7ed3e197dfb9badf1bd 100644 (file)
@@ -91,6 +91,9 @@ char *argv[];
            if (!strncmp(argv[1], "-s", 2)) {
 #ifdef CHDIR
                chdirx(dir, FALSE);
+#endif
+#ifdef SYSCF
+               initoptions();
 #endif
                prscore(argc, argv);
                exit(EXIT_SUCCESS);