unicode cleanliness mods, no unicode yet until I work it out with DOS
authorDavid Griffith <dave@661.org>
Mon, 9 Jul 2012 08:07:36 +0000 (01:07 -0700)
committerDavid Griffith <dave@661.org>
Mon, 9 Jul 2012 08:07:36 +0000 (01:07 -0700)
src/common/err.c
src/common/frotz.h
src/curses/ux_init.c

index 49cb13bd10352f28a3449ed35e90db9855e78f84..040bc1172c0d23a60e347633e66187eedf6e0fac 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #include "frotz.h"
-f_setup_t f_setup;
+/*f_setup_t f_setup; */
 
 /* Define stuff for stricter Z-code error checking, for the generic
    Unix/DOS/etc terminal-window interface. Feel free to change the way
index f8ae19da7b58571f8ebfa33ede5fdcbbb021c59c..fd5d781d9a7d49914ed45c2c8baf0146eae733ad 100644 (file)
@@ -35,6 +35,12 @@ typedef int bool;
 typedef unsigned char zbyte;
 typedef unsigned short zword;
 
+#ifdef MSDOS_16BIT
+typedef unsigned char zchar;
+#else
+typedef unsigned short zchar;
+#endif
+
 enum story {
     BEYOND_ZORK,
     SHERLOCK,
@@ -72,8 +78,6 @@ typedef struct {
 
 #include "setup.h"
 
-typedef unsigned char zchar;
-
 /*** Constants that may be set at compile time ***/
 
 #ifndef MAX_UNDO_SLOTS
index e185bcb0fa2b96f8d97104c45de525703e163c5e..5e0584ef31fd3ed38e0e1172439970bea928c54b 100644 (file)
 #include <curses.h>
 #endif
 
+#ifndef WIN32
 #include <termios.h>
+#endif
 
 #include "ux_frotz.h"
+#include "ux_blorb.h"
 
 f_setup_t f_setup;
 u_setup_t u_setup;
@@ -140,12 +143,20 @@ void os_process_arguments (int argc, char *argv[])
     char *home;
     char configfile[FILENAME_MAX + 1];
 
+#ifndef WIN32
     if ((getuid() == 0) || (geteuid() == 0)) {
         printf("I won't run as root!\n");
         exit(1);
     }
+#endif
+
+#ifdef WIN32
+#define HOMEDIR "USERPROFILE"
+#else
+#define HOMEDIR "HOME"
+#endif
 
-    if ((home = getenv("HOME")) == NULL) {
+    if ((home = getenv(HOMEDIR)) == NULL) {
         printf("Hard drive on fire!\n");
         exit(1);
     }