OSDN Git Service

untabify
[jnethack/source.git] / win / tty / termcap.c
index 262c89a..fe941ab 100644 (file)
@@ -1,5 +1,6 @@
-/* NetHack 3.6 termcap.c       $NHDT-Date: 1447234979 2015/11/11 09:42:59 $  $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */
+/* NetHack 3.6 termcap.c       $NHDT-Date: 1456907853 2016/03/02 08:37:33 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.24 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/*-Copyright (c) Pasi Kallinen, 2018. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #include "hack.h"
@@ -582,7 +583,10 @@ xputc(c)
     char c;
 #endif
 {
+/*JP
     (void) putchar(c);
+*/
+    (void) cputchar(c);
 }
 
 void
@@ -590,6 +594,9 @@ xputs(s)
 const char *s;
 {
 #ifndef TERMLIB
+#if 1 /*JP*/
+    (void) jputchar('\0');
+#endif
     (void) fputs(s, stdout);
 #else
 #if defined(NHSTDC) || defined(ULTRIX_PROTO)
@@ -706,7 +713,11 @@ tty_nhbell()
 {
     if (flags.silent)
         return;
+#if 0 /*JP*/
     (void) putchar('\007'); /* curx does not change */
+#else
+    (void) cputchar('\007'); /* curx does not change */
+#endif
     (void) fflush(stdout);
 }
 
@@ -756,10 +767,17 @@ tty_delay_output()
 #endif
 #if defined(MICRO)
     /* simulate the delay with "cursor here" */
+#if 1 /*JP*//*JPTB need?*/
+    {
+        register int i;
+#endif
     for (i = 0; i < 3; i++) {
         cmov(ttyDisplay->curx, ttyDisplay->cury);
         (void) fflush(stdout);
     }
+#if 1 /*JP*/
+    }
+#endif
 #else /* MICRO */
     /* BUG: if the padding character is visible, as it is on the 5620
        then this looks terrible. */
@@ -1171,6 +1189,7 @@ int n;
     case ATR_ULINE:
         if (nh_US)
             return nh_US;
+        /*FALLTHRU*/
     case ATR_BOLD:
     case ATR_BLINK:
 #if defined(TERMLIB) && defined(TEXTCOLOR)
@@ -1192,6 +1211,7 @@ int n;
     case ATR_ULINE:
         if (nh_UE)
             return nh_UE;
+        /*FALLTHRU*/
     case ATR_BOLD:
     case ATR_BLINK:
         return nh_HE;
@@ -1246,6 +1266,7 @@ int color;
     xputs(hilites[color]);
 }
 
+/* not to be confused with has_colors() in unixtty.c */
 int
 has_color(color)
 int color;
@@ -1253,23 +1274,24 @@ int color;
 #ifdef X11_GRAPHICS
     /* XXX has_color() should be added to windowprocs */
     if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "X11"))
-        return TRUE;
+        return 1;
 #endif
 #ifdef GEM_GRAPHICS
     /* XXX has_color() should be added to windowprocs */
     if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Gem"))
-        return TRUE;
+        return 1;
 #endif
 #ifdef QT_GRAPHICS
     /* XXX has_color() should be added to windowprocs */
     if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Qt"))
-        return TRUE;
+        return 1;
 #endif
 #ifdef AMII_GRAPHICS
     /* hilites[] not used */
-    return iflags.use_color;
-#endif
+    return iflags.use_color ? 1 : 0;
+#else
     return hilites[color] != (char *) 0;
+#endif
 }
 
 #endif /* TEXTCOLOR */