changes from H.G. Muller; version 4.3.13
[xboard.git] / frontend.h
index f3556e6..dacd12a 100644 (file)
-/*
- * frontend.h -- Interface exported by all XBoard front ends
- * $Id: frontend.h,v 2.2 2003/11/06 07:22:14 mann Exp $
- *
- * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
- * Enhancements Copyright 1992-95 Free Software Foundation, Inc.
- *
- * The following terms apply to Digital Equipment Corporation's copyright
- * interest in XBoard:
- * ------------------------------------------------------------------------
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * ------------------------------------------------------------------------
- *
- * The following terms apply to the enhanced version of XBoard distributed
- * by the Free Software Foundation:
- * ------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ------------------------------------------------------------------------
- */
-
-#ifndef _FRONTEND
-#define _FRONTEND
-
-#include <stdio.h>
-
-typedef VOIDSTAR ProcRef;
-#define NoProc ((ProcRef) 0)
-typedef VOIDSTAR InputSourceRef;
-
-void ModeHighlight P((void));
-void SetICSMode P((void));
-void SetGNUMode P((void));
-void SetNCPMode P((void));
-void SetCmailMode P((void));
-void SetTrainingModeOn P((void));
-void SetTrainingModeOff P((void));
-void SetUserThinkingEnables P((void));
-void SetMachineThinkingEnables P((void));
-void DisplayTitle P((String title));
-void DisplayMessage P((String message, String extMessage));
-void DisplayError P((String message, int error));
-void DisplayMoveError P((String message));
-
-/* If status == 0, we are exiting with a benign message, not an error */
-void DisplayFatalError P((String message, int error, int status));
-
-void DisplayInformation P((String message));
-void DisplayNote P((String message));
-void AskQuestion P((String title, String question, String replyPrefix,
-                   ProcRef pr));
-void DisplayIcsInteractionTitle P((String title));
-void DrawPosition P((int fullRedraw, Board board));
-void ResetFrontEnd P((void));
-void CommentPopUp P((String title, String comment));
-void CommentPopDown P((void));
-void EditCommentPopUp P((int index, String title, String text));
-
-void RingBell P((void));
-void PlayIcsWinSound P((void));
-void PlayIcsLossSound P((void));
-void PlayIcsDrawSound P((void));
-void PlayIcsUnfinishedSound P((void));
-void PlayAlarmSound P((void));
-void EchoOn P((void));
-void EchoOff P((void));
-void Raw P((void));
-void Colorize P((ColorClass cc, int continuation));
-
-char *UserName P((void));
-char *HostName P((void));
-
-int ClockTimerRunning P((void));
-int StopClockTimer P((void));
-void StartClockTimer P((long millisec));
-void DisplayWhiteClock P((long timeRemaining, int highlight));
-void DisplayBlackClock P((long timeRemaining, int highlight));
-
-int LoadGameTimerRunning P((void));
-int StopLoadGameTimer P((void));
-void StartLoadGameTimer P((long millisec));
-void AutoSaveGame P((void));
-
-typedef void (*DelayedEventCallback) P((void));
-void ScheduleDelayedEvent P((DelayedEventCallback cb, long millisec));
-DelayedEventCallback GetDelayedEvent P((void));
-void CancelDelayedEvent P((void));
-
-int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));
-void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));
-void InterruptChildProcess P((ProcRef pr));
-
-int OpenTelnet P((char *host, char *port, ProcRef *pr));
-int OpenTCP P((char *host, char *port, ProcRef *pr));
-int OpenCommPort P((char *name, ProcRef *pr));
-int OpenLoopback P((ProcRef *pr));
-int OpenRcmd P((char *host, char *user, char *cmd, ProcRef *pr));
-
-typedef void (*InputCallback) P((InputSourceRef isr, VOIDSTAR closure,
-                                char *buf, int count, int error));
-/* pr == NoProc means the local keyboard */
-InputSourceRef AddInputSource P((ProcRef pr, int lineByLine,
-                                InputCallback func, VOIDSTAR closure));
-void RemoveInputSource P((InputSourceRef isr));
-
-/* pr == NoProc means the local display */
-int OutputToProcess P((ProcRef pr, char *message, int count, int *outError));
-int OutputToProcessDelayed P((ProcRef pr, char *message, int count,
-                             int *outError, long msdelay));
-
-void CmailSigHandlerCallBack P((InputSourceRef isr, VOIDSTAR closure,
-                               char *buf, int count, int error));
-
-extern ProcRef cmailPR;
-
-/* these are in wgamelist.c */
-void GameListPopUp P((FILE *fp, char *filename));
-void GameListPopDown P((void));
-void GameListHighlight P((int index));
-void GameListDestroy P((void));
-
-/* these are in wedittags.c */
-void EditTagsPopUp P((char *tags));
-void TagsPopUp P((char *tags, char *msg));
-void TagsPopDown P((void));
-
-void ICSInitScript P((void));
-void StartAnalysisClock P((void));
-void AnalysisPopUp P((char *title, char *label));
-void AnalysisPopDown P((void));
-
-void SetHighlights P((int fromX, int fromY, int toX, int toY));
-void ClearHighlights P((void));
-void SetPremoveHighlights P((int fromX, int fromY, int toX, int toY));
-void ClearPremoveHighlights P((void));
-
-void ShutDownFrontEnd P((void));
-void BoardToTop P((void));
-void AnimateMove P((Board board, int fromX, int fromY, int toX, int toY));
-void HistorySet P((char movelist[][2*MOVE_LEN], int first, int last, int current));
-void FreezeUI P((void));
-void ThawUI P((void));
-extern char *programName;
-
-typedef struct FrontEndProgramStats_TAG {
-    int which;
-    int depth;
-    unsigned long nodes;
-    int score;
-    int time;
-    char * pv;
-    char * hint;
-    int an_move_index;
-    int an_move_count;
-} FrontEndProgramStats;
-
-void SetProgramStats P(( FrontEndProgramStats * stats )); /* [AS] */
-
-#endif
+/*\r
+ * frontend.h -- Interface exported by all XBoard front ends\r
+ * $Id: frontend.h,v 2.2 2003/11/06 07:22:14 mann Exp $\r
+ *\r
+ * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.\r
+ * Enhancements Copyright 1992-95 Free Software Foundation, Inc.\r
+ *\r
+ * The following terms apply to Digital Equipment Corporation's copyright\r
+ * interest in XBoard:\r
+ * ------------------------------------------------------------------------\r
+ * All Rights Reserved\r
+ *\r
+ * Permission to use, copy, modify, and distribute this software and its\r
+ * documentation for any purpose and without fee is hereby granted,\r
+ * provided that the above copyright notice appear in all copies and that\r
+ * both that copyright notice and this permission notice appear in\r
+ * supporting documentation, and that the name of Digital not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission.\r
+ *\r
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\r
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\r
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\r
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\r
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\r
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\r
+ * SOFTWARE.\r
+ * ------------------------------------------------------------------------\r
+ *\r
+ * The following terms apply to the enhanced version of XBoard distributed\r
+ * by the Free Software Foundation:\r
+ * ------------------------------------------------------------------------\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\r
+ * ------------------------------------------------------------------------\r
+ */\r
+\r
+#ifndef _FRONTEND\r
+#define _FRONTEND\r
+\r
+#include <stdio.h>\r
+\r
+typedef VOIDSTAR ProcRef;\r
+#define NoProc ((ProcRef) 0)\r
+typedef VOIDSTAR InputSourceRef;\r
+\r
+void ModeHighlight P((void));\r
+void SetICSMode P((void));\r
+void SetGNUMode P((void));\r
+void SetNCPMode P((void));\r
+void SetCmailMode P((void));\r
+void SetTrainingModeOn P((void));\r
+void SetTrainingModeOff P((void));\r
+void SetUserThinkingEnables P((void));\r
+void SetMachineThinkingEnables P((void));\r
+void DisplayTitle P((String title));\r
+void DisplayMessage P((String message, String extMessage));\r
+void DisplayError P((String message, int error));\r
+void DisplayMoveError P((String message));\r
+\r
+/* If status == 0, we are exiting with a benign message, not an error */\r
+void DisplayFatalError P((String message, int error, int status));\r
+\r
+void DisplayInformation P((String message));\r
+void DisplayNote P((String message));\r
+void AskQuestion P((String title, String question, String replyPrefix,\r
+                   ProcRef pr));\r
+void DisplayIcsInteractionTitle P((String title));\r
+void DrawPosition P((int fullRedraw, Board board));\r
+void ResetFrontEnd P((void));\r
+void CommentPopUp P((String title, String comment));\r
+void CommentPopDown P((void));\r
+void EditCommentPopUp P((int index, String title, String text));\r
+\r
+void RingBell P((void));\r
+void PlayIcsWinSound P((void));\r
+void PlayIcsLossSound P((void));\r
+void PlayIcsDrawSound P((void));\r
+void PlayIcsUnfinishedSound P((void));\r
+void PlayAlarmSound P((void));\r
+void EchoOn P((void));\r
+void EchoOff P((void));\r
+void Raw P((void));\r
+void Colorize P((ColorClass cc, int continuation));\r
+\r
+char *UserName P((void));\r
+char *HostName P((void));\r
+\r
+int ClockTimerRunning P((void));\r
+int StopClockTimer P((void));\r
+void StartClockTimer P((long millisec));\r
+void DisplayWhiteClock P((long timeRemaining, int highlight));\r
+void DisplayBlackClock P((long timeRemaining, int highlight));\r
+\r
+int LoadGameTimerRunning P((void));\r
+int StopLoadGameTimer P((void));\r
+void StartLoadGameTimer P((long millisec));\r
+void AutoSaveGame P((void));\r
+\r
+typedef void (*DelayedEventCallback) P((void));\r
+void ScheduleDelayedEvent P((DelayedEventCallback cb, long millisec));\r
+DelayedEventCallback GetDelayedEvent P((void));\r
+void CancelDelayedEvent P((void));\r
+\r
+int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));\r
+void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));\r
+void InterruptChildProcess P((ProcRef pr));\r
+\r
+int OpenTelnet P((char *host, char *port, ProcRef *pr));\r
+int OpenTCP P((char *host, char *port, ProcRef *pr));\r
+int OpenCommPort P((char *name, ProcRef *pr));\r
+int OpenLoopback P((ProcRef *pr));\r
+int OpenRcmd P((char *host, char *user, char *cmd, ProcRef *pr));\r
+\r
+typedef void (*InputCallback) P((InputSourceRef isr, VOIDSTAR closure,\r
+                                char *buf, int count, int error));\r
+/* pr == NoProc means the local keyboard */\r
+InputSourceRef AddInputSource P((ProcRef pr, int lineByLine,\r
+                                InputCallback func, VOIDSTAR closure));\r
+void RemoveInputSource P((InputSourceRef isr));\r
+\r
+/* pr == NoProc means the local display */\r
+int OutputToProcess P((ProcRef pr, char *message, int count, int *outError));\r
+int OutputToProcessDelayed P((ProcRef pr, char *message, int count,\r
+                             int *outError, long msdelay));\r
+\r
+void CmailSigHandlerCallBack P((InputSourceRef isr, VOIDSTAR closure,\r
+                               char *buf, int count, int error));\r
+\r
+extern ProcRef cmailPR;\r
+\r
+/* these are in wgamelist.c */\r
+void GameListPopUp P((FILE *fp, char *filename));\r
+void GameListPopDown P((void));\r
+void GameListHighlight P((int index));\r
+void GameListDestroy P((void));\r
+\r
+/* these are in wedittags.c */\r
+void EditTagsPopUp P((char *tags));\r
+void TagsPopUp P((char *tags, char *msg));\r
+void TagsPopDown P((void));\r
+\r
+void ICSInitScript P((void));\r
+void StartAnalysisClock P((void));\r
+void AnalysisPopUp P((char *title, char *label));\r
+void AnalysisPopDown P((void));\r
+\r
+void SetHighlights P((int fromX, int fromY, int toX, int toY));\r
+void ClearHighlights P((void));\r
+void SetPremoveHighlights P((int fromX, int fromY, int toX, int toY));\r
+void ClearPremoveHighlights P((void));\r
+\r
+void ShutDownFrontEnd P((void));\r
+void BoardToTop P((void));\r
+void AnimateMove P((Board board, int fromX, int fromY, int toX, int toY));\r
+void HistorySet P((char movelist[][2*MOVE_LEN], int first, int last, int current));\r
+void FreezeUI P((void));\r
+void ThawUI P((void));\r
+extern char *programName;\r
+\r
+typedef struct FrontEndProgramStats_TAG {\r
+    int which;\r
+    int depth;\r
+    unsigned long nodes;\r
+    int score;\r
+    int time;\r
+    char * pv;\r
+    char * hint;\r
+    int an_move_index;\r
+    int an_move_count;\r
+} FrontEndProgramStats;\r
+\r
+void SetProgramStats P(( FrontEndProgramStats * stats )); /* [AS] */\r
+\r
+#endif\r