Convert more stuff from #ifdef to dspwrappers: GetString.
[gnushogi.git] / gnushogi / commondsp.c
index 1ed6e1b..53efa2b 100644 (file)
@@ -42,7 +42,6 @@
 #include <sys/types.h>
 #include <sys/file.h>
 
-#include <curses.h>
 #include "gnushogi.h"
 
 char mvstr[4][6];
@@ -298,20 +297,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv)
         if (SqAttacked(PieceList[opponent][0], computer, &blocked))
         {
             UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
-
-            if (NOT_CURSES)
-            {
-                /* Illegal move in check */
-                printf(CP[77], s);
-                printf("\n");
-            }
-            else
-            {
-                /* Illegal move in check */
-                sprintf(buffer, CP[77], s);
-                ShowMessage(buffer);
-            }
-
+            AlwaysShowMessage(CP[77], s);
             return false;
         }
         else
@@ -353,17 +339,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv)
         }
     }
 
-    if (NOT_CURSES)
-    {
-        /* Illegal move */
-        printf (CP[75], s);
-    }
-    else /* Curses. */
-    {
-        /* Illegal move */
-        sprintf(buffer, CP[76], s);
-        ShowMessage(buffer);
-    }
+    AlwaysShowMessage(CP[76], s);
 
     if (!barebones && (cnt > 1))
     {
@@ -1664,23 +1640,12 @@ InputCommand(char *command)
         have_shown_prompt = false;
 #endif /* QUIETBACKGROUND */
 
-        if (command == NULL)
-        {
+        if (command == NULL) {
             if (NOT_CURSES)
-            {
-                s[0] = sx[0] = '\0';
+                s[0] = '\0';
 
-                while(!eof && !sx[0])
-                    eof = (fgets(sx, 80, stdin) == NULL);
-            }
-            else
-            {
-                fflush(stdout);
-                eof = (getstr(sx) == ERR);
-            }
-        }
-        else
-        {
+            eof = GetString(sx);
+        } else {
             strcpy(sx, command);
             done = true;
         }