}
// [HGM] code borrowed from winboard.c (which should thus go to backend.c!)
-#define HISTORY_SIZE 64\r
-static char *history[HISTORY_SIZE];\r
-int histIn = 0, histP = 0;\r
-\r
-void\r
-SaveInHistory(char *cmd)\r
-{\r
- if (history[histIn] != NULL) {\r
- free(history[histIn]);\r
- history[histIn] = NULL;\r
- }\r
- if (*cmd == NULLCHAR) return;\r
- history[histIn] = StrSave(cmd);\r
- histIn = (histIn + 1) % HISTORY_SIZE;\r
- if (history[histIn] != NULL) {\r
- free(history[histIn]);\r
- history[histIn] = NULL;\r
- }\r
- histP = histIn;\r
-}\r
-\r
-char *\r
-PrevInHistory(char *cmd)\r
-{\r
- int newhp;\r
- if (histP == histIn) {\r
- if (history[histIn] != NULL) free(history[histIn]);\r
- history[histIn] = StrSave(cmd);\r
- }\r
- newhp = (histP - 1 + HISTORY_SIZE) % HISTORY_SIZE;\r
- if (newhp == histIn || history[newhp] == NULL) return NULL;\r
- histP = newhp;\r
- return history[histP];\r
-}\r
-\r
-char *\r
-NextInHistory()\r
-{\r
- if (histP == histIn) return NULL;\r
- histP = (histP + 1) % HISTORY_SIZE;\r
- return history[histP]; \r
-}
-// end of borrowed code\r
-\r
+#define HISTORY_SIZE 64
+static char *history[HISTORY_SIZE];
+int histIn = 0, histP = 0;
+
+void
+SaveInHistory(char *cmd)
+{
+ if (history[histIn] != NULL) {
+ free(history[histIn]);
+ history[histIn] = NULL;
+ }
+ if (*cmd == NULLCHAR) return;
+ history[histIn] = StrSave(cmd);
+ histIn = (histIn + 1) % HISTORY_SIZE;
+ if (history[histIn] != NULL) {
+ free(history[histIn]);
+ history[histIn] = NULL;
+ }
+ histP = histIn;
+}
+
+char *
+PrevInHistory(char *cmd)
+{
+ int newhp;
+ if (histP == histIn) {
+ if (history[histIn] != NULL) free(history[histIn]);
+ history[histIn] = StrSave(cmd);
+ }
+ newhp = (histP - 1 + HISTORY_SIZE) % HISTORY_SIZE;
+ if (newhp == histIn || history[newhp] == NULL) return NULL;
+ histP = newhp;
+ return history[histP];
+}
+
+char *
+NextInHistory()
+{
+ if (histP == histIn) return NULL;
+ histP = (histP + 1) % HISTORY_SIZE;
+ return history[histP];
+}
+// end of borrowed code
+
#define Abs(n) ((n)<0 ? -(n) : (n))
/*
}
break;
case MotionNotify:
- if(SeekGraphClick(Press, event->xbutton.x, event->xbutton.y, 1)) break;\r
+ if(SeekGraphClick(Press, event->xbutton.x, event->xbutton.y, 1)) break;
default:
return;
}