home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuch40.zip / gnuchess-4.0.pl79 / src / gnuchess.h < prev    next >
C/C++ Source or Header  |  1999-01-16  |  19KB  |  582 lines

  1. /*
  2.  * gnuchess.h - Header file for GNU CHESS
  3.  *
  4.  * Copyright (c) 1985-1996 Stuart Cracraft, John Stanback,
  5.  *                         Daryl Baker, Conor McCarthy,
  6.  *                         Mike McGann, Chua Kong Sian
  7.  * Copyright (c) 1985-1996 Free Software Foundation
  8.  *
  9.  * This file is part of GNU CHESS.
  10.  *
  11.  * GNU Chess is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2, or (at your option)
  14.  * any later version.
  15.  *
  16.  * GNU Chess is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with GNU Chess; see the file COPYING.  If not, write to
  23.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  */
  25.  
  26. #if SIZEOF_LONG == 8
  27. #define LONG64 1
  28. #endif
  29.  
  30. #ifdef WIN32
  31. #define HASHFILE "gnuchess.has"
  32. #define BINBOOK "gnuchess.dat"
  33. #define BINECO "gnuchess.eco"
  34. #define PGNECO "eco.pgn"
  35. #define LANGFILE "gnuchess.lan"
  36. #define SRCLANGFILE "..\\misc\\gnuchess.lang"
  37. #define stat _stat
  38. #define close _close
  39. #define lseek _lseek
  40. #define open _open
  41. #define read _read
  42. #define write _write
  43. #endif
  44.  
  45. #if !defined(__STDC__) && !defined(MSDOS)
  46. #define const
  47. #endif
  48.  
  49. #ifndef MSDOS
  50. #define huge
  51. #endif
  52. #include <stdio.h>
  53. #ifdef HAVE_MEMSET
  54. #include <memory.h>
  55. #endif
  56. #ifdef SIGNCHAR
  57. typedef signed char CHAR;
  58. #else
  59. typedef char CHAR;
  60. #endif
  61. typedef unsigned char UCHAR;
  62. typedef short tshort;
  63. typedef unsigned short utshort;
  64. #ifdef USEINT
  65. typedef  int SHORT;
  66. typedef  unsigned int UTSHORT;
  67. #else
  68. typedef unsigned short UTSHORT;
  69. typedef short SHORT;
  70. #endif
  71.  
  72.  
  73. #ifndef SEEK_SET
  74. #define SEEK_SET 0
  75. #define SEEK_END 2
  76. #endif
  77.  
  78. #ifdef DEBUG
  79. void
  80. ShowDBLine (CHAR *, SHORT, SHORT,
  81.         SHORT, SHORT, SHORT,
  82.         utshort *);
  83.      extern FILE *debugfd;
  84.      extern SHORT debuglevel;
  85.  
  86. #endif /* DEBUG */
  87.  
  88. #include <ctype.h>
  89. #include <string.h>
  90. #include <stdlib.h>
  91.  
  92. #if defined(MSDOS) || defined(WIN32)
  93. #ifdef __EMX__
  94. #define kbhit() _read_kbd(0,0,0)
  95. #endif
  96. #define HAVE_TIME_H
  97. #include <malloc.h>
  98. #define RWA_ACC "r+b"
  99. #define WA_ACC "w+b"
  100. #define printz printf
  101. #define scanz scanf
  102. #else
  103. #define RWA_ACC "r+"
  104. #define WA_ACC "w+"
  105. #ifndef Think_C
  106. #include <sys/param.h>
  107. #include <sys/types.h>
  108. #ifndef AMIGADOS
  109. #include <sys/times.h>
  110. #endif
  111. #endif /* Think_C */
  112. #ifdef NONDSP
  113. #define printz printf
  114. #define scanz scanf
  115. #else
  116. #ifdef __EMX__
  117. #undef HZ
  118. #endif
  119. #ifdef DOSLIKE_ANSI_DISPLAY
  120. #define printz printf
  121. #define scanz scanf
  122. #else
  123. #include <curses.h>
  124. #define scanz fflush(stdout),scanw
  125. #define printz printw
  126. #endif
  127. #endif /* NONDSP */
  128. #endif /* MSDOS */
  129.  
  130. #ifdef HAVE_TIME_H
  131. #include <time.h>
  132. #endif
  133.  
  134. /* Magic for those compilers that can't handle "huge" static structures... */
  135. /* Be sure to also invoke Initialize_mem() if you use this */
  136. #ifdef Think_C
  137. #define ALLOCATE(ms) if (!(_##ms=malloc(sizeof(ms)))) \
  138.         {perror(#ms);exit(1);}\
  139.         else printf("Allocate %s @ %ld, %ld bytes.\n", #ms, _##ms, sizeof(ms));
  140. /* #define etab (*_etab) */
  141. #define nextpos (*_nextpos)
  142. #define nextdir (*_nextdir)
  143. #define history (*_history)
  144. #define Tree (*_Tree)
  145. #endif /* Think_C */
  146.  
  147. /* Piece values */
  148. #define valueP 100
  149. #define valueN 350
  150. #define valueB 355
  151. #define valueR 550
  152. #define valueQ 1100
  153. #define valueK 1200
  154. /* masks into upper 8 bits of ataks array */
  155. #define ctlP 0x4000
  156. #define ctlN 0x2800
  157. #define ctlB 0x1800
  158. #define ctlR 0x0400
  159. #define ctlQ 0x0200
  160. #define ctlK 0x0100
  161. #define ctlBQ 0x1200
  162. #define ctlBN 0x0800
  163. #define ctlRQ 0x0600
  164. #define ctlNN 0x2000
  165. /* attack functions */
  166. #define Patak(c, u) (atak[c][u] > ctlP)
  167. #define Anyatak(c, u) (atak[c][u] > 0)
  168. /* distance function */
  169. #define taxicab(a,b) taxidata[a][b]
  170. /* king positions */
  171. #define wking PieceList[white][0]
  172. #define bking PieceList[black][0]
  173. #define EnemyKing PieceList[c2][0]
  174. /* constants */
  175. /* castle moves */
  176. #define BLACKCASTLE    0x3C3E
  177. #define WHITECASTLE    0x0406
  178. #define LONGBLACKCASTLE    0x3C3A
  179. #define LONGWHITECASTLE    0x0402
  180. /* truth values */
  181. #define false 0
  182. #define true 1
  183. /* colors */
  184. #define white 0
  185. #define black 1
  186. #define neutral 2
  187. /* piece code defines */
  188. #define no_piece 0
  189. #define pawn 1
  190. #define knight 2
  191. #define bishop 3
  192. #define rook 4
  193. #define queen 5
  194. #define king 6
  195. #define bpawn 7
  196. /* node flags */
  197. #define pmask 0x0007
  198. #define promote 0x0008
  199. #define cstlmask 0x0010
  200. #define epmask 0x0020
  201. #define exact 0x0040
  202. #define pwnthrt 0x0080
  203. #define check 0x0100
  204. #define capture 0x0200
  205. #define draw 0x0400
  206. #define book 0x1000
  207. /* move symbols */
  208. #define pxx (CP[2])
  209. #define qxx (CP[1])
  210. #define rxx (CP[4])
  211. #define cxx (CP[3])
  212. /* for everything that can't use the above */
  213. #define Qxx " pnbrqk"
  214. #define Pxx " PNBRQK"
  215. #define Cxx "abcdefgh"
  216. #define Rxx "12345678"
  217. /***************************************************************************/
  218. /***************** Table limits ********************************************/
  219. #define TREE 1500        /* max number of tree entries */
  220. #define MAXDEPTH 35        /* max depth a search can be carried */
  221. #define MINDEPTH 2        /* min search depth =1 (no hint), >1 hint */
  222. #define MAXMOVES 400        /* max number of half moves in a game */
  223. #define NMOVELIMIT 20
  224. #define XCLIMIT 5        /* number of different Time inputs */
  225. #ifndef BOOKSIZE
  226. #if defined MSDOS
  227. #define BOOKSIZE 10000        /* Number of unique position/move combinations allowed */
  228. #else
  229. #define BOOKSIZE 250000        /* Number of unique position/move combinations allowed */
  230. #endif
  231. #endif
  232. #define CPSIZE 235        /* size of lang file max */
  233. #define DEFETABLE 18001        /* static eval cache */
  234. #ifdef ECO
  235. #define ECOCNT  5
  236. #endif
  237. /***************** tuning paramaters **********************************************/
  238. #define NMOVEINIT { 75,75,60,55,55,55,55,58,55,56,60,64,68,72,76,80,84,88,90,94,98,98,98,98,99,99,99}
  239. #define MINGAMEIN 4
  240. #define MINMOVES 15
  241. #define FBEYOND 5
  242. #define SBEYOND 9
  243. #define TBEYOND 11
  244. #define HASHDEPTH 2        /* depth above which to use HashFile */
  245. #define HASHMOVELIMIT 40    /* Use HashFile only for this many moves */
  246. #define PTVALUE 0            /* material value below which pawn threats at 5 & 3 are used */
  247. #define ZDELTA 40        /* score delta per ply to cause extra time to be given */
  248. #define QBLOCK false        /* if true cache quiescent positions */
  249. #define BESTDELTA 90
  250. /* about 1/2 second worth of nodes for your machine */
  251. #ifdef Think_C
  252. #define ZNODES 500              /* check the time every ZNODES positions */
  253. #else /* Think_C */
  254. #define ZNODES 4000             /* check the time every ZNODES positions */
  255. #endif /* Think_C */
  256. #define MAXTCCOUNTX  5        /* max number of time clicks per search to complete ply*/
  257. #define MAXTCCOUNTR 6        /* max number of time clicks per search extensions*/
  258. #define HISTORYLIM 4096        /* Max value of history killer */
  259. #define WAWNDW 50        /* alpha window when computer white*/
  260. #define WBWNDW 50        /* beta window when computer white*/
  261. #define BAWNDW 50        /* alpha window when computer black*/
  262. #define BBWNDW 50        /* beta window when computer black*/
  263. #define BXWNDW 50        /* window to force position scoring at lower */
  264. #define WXWNDW 50        /* window to force position scoring at lower */
  265. #ifdef SMALLRANDY
  266. #define DITHER 2        /* max amount random can alter a pos value */
  267. #else
  268. #define DITHER 5
  269. #endif
  270. #define BBONUS 2        /* points per stage value of B increases */
  271. #define RBONUS 6        /* points per stage value of R increases */
  272. #define PCRASHS    5
  273. #define PCRASHV 5
  274. #define PCENTERS 5
  275. #define PCENTERV 5
  276. #define KINGPOSLIMIT  -1    /* King positional scoring limit */
  277. #define KINGSAFETY  40
  278. #define NULLMOVELIM valueQ    /* below this total material on board don't use null move */
  279. #define DEPTHMARGIN 2
  280. #define THRSTAGE    6
  281. #define CHECKSTAGE  8
  282.  
  283. /************************* parameters for Opening Book *********************************/
  284. #define BOOKFAIL 8        /* if no book move found for BOOKFAIL turns stop using book */
  285. #define BOOKMAXPLY 100        /* Max plys to keep in book database */
  286. #define BOOKPOCKET 64
  287. #define BOOKRAND 1000        /* used to select an opening move from a list */
  288. #define BOOKENDPCT 950        /* 5 % chance a BOOKEND will stop the book */
  289. #define DONTUSE -32000        /* flag move as don't use */
  290. /*************************** Book access defines ****************************************/
  291. #define LASTMOVE 0x4000        /* means this is the last move of an opening */
  292. #define BADMOVE 0x8000        /* means this is a bad move in this position */
  293. /****************************************************************************************/
  294.  
  295.      struct leaf
  296.      {
  297.            tshort f;
  298.     tshort t;
  299.     tshort  score;
  300.     tshort  reply;
  301.     tshort  width;
  302.            utshort flags;
  303.      };
  304.      struct GameRec
  305.      {
  306.        utshort gmove;    /* this move */
  307.        tshort score;        /* score after this move */
  308.        tshort depth;        /* search depth this move */
  309.        long time;               /* search time this move */
  310.        tshort piece;        /* piece captured */
  311.        tshort color;        /* color */
  312.        tshort flags;        /* move flags capture, promote, castle */
  313.        tshort Game50;        /* flag for repetition */
  314.        long nodes;        /* nodes searched for this move */
  315.        unsigned long hashkey, hashbd;    /* board key before this move */
  316.        tshort epssq;        /* epssquare before this move */
  317. #ifdef DEBUG40
  318.        UTSHORT d1[7];
  319. #endif
  320.      };
  321.      struct TimeControlRec
  322.      {
  323.        SHORT moves[2];
  324.        long clock[2];
  325.      };
  326.  
  327.      struct flags
  328.      {
  329.        SHORT mate;        /* the game is over */
  330.        SHORT post;        /* show principle variation */
  331.        SHORT quit;        /* quit/exit */
  332.        SHORT regularstart;    /* did the game start from standard
  333.                  * initial board ? */
  334.        SHORT reverse;        /* reverse board display */
  335.        SHORT bothsides;        /* computer plays both sides */
  336.        SHORT hash;        /* enable/disable transposition table */
  337.        SHORT force;        /* enter moves */
  338.        SHORT easy;        /* disable thinking on opponents time */
  339.        SHORT beep;        /* enable/disable beep */
  340.        SHORT timeout;        /* time to make a move */
  341.        SHORT musttimeout;    /* time to make a move */
  342.        SHORT back;        /* time to make a move */
  343.        SHORT rcptr;        /* enable/disable recapture heuristics */
  344.        SHORT rv;        /* reverse video */
  345.        SHORT stars;        /* add stars to uxdsp screen */
  346.        SHORT coords;        /* add coords to visual screen */
  347.        SHORT shade;
  348.        SHORT material;        /* draw on lack of material */
  349.        SHORT illegal;        /* illegal position */
  350.        SHORT onemove;        /* timing is onemove */
  351.        SHORT gamein;        /* timing is gamein */
  352.        SHORT autolist;        /* list games */
  353.        SHORT threat;            /* Enable threats, tom@izf.tno.nl */
  354.        SHORT nonull;            /* Disable nullmoves, tom@izf.tno.nl */
  355.        SHORT deepnull;          /* Enable deep nullmoves, tom@izf.tno.nl */
  356.        SHORT verydeep;          /* Enable very deep nullmoves, tom@izf.tno.nl */
  357.        SHORT pvs;               /* Enable PVS, tom@izf.tno.nl */
  358.        SHORT neweval;           /* Enable new eval, tom@izf.tno.nl */
  359.        SHORT noscore;           /* Enable no score heuristic, tom@izf.tno.nl */
  360. #ifdef DEBUG
  361.     SHORT nott;
  362.     SHORT noft;
  363.     SHORT nocache;
  364. #endif
  365.      };
  366. #ifdef DEBUG
  367.      extern FILE *debugfile;
  368.  
  369. #endif /* DEBUG */
  370. #ifdef HISTORY
  371.      extern UTSHORT history[32768];
  372. #endif
  373.      extern CHAR *ColorStr[2];
  374.      extern UTSHORT MV[MAXDEPTH+1];
  375.      extern SHORT PCRASH,PCENTER;
  376.      extern int MSCORE;
  377.      extern int mycnt1, mycnt2;
  378.      extern SHORT ahead;
  379.      extern SHORT chesstool;
  380.      extern struct leaf Tree[TREE], *root,rootnode;
  381.      extern CHAR savefile[], listfile[];
  382.      extern SHORT TrPnt[];
  383.      extern SHORT board[], color[];
  384.      extern SHORT PieceList[2][64], PawnCnt[2][8];
  385.      extern SHORT castld[], Mvboard[];
  386.      extern tshort svalue[64];
  387.      extern struct flags flag;
  388.      extern SHORT opponent, computer, INCscore;
  389.      extern tshort WAwindow, BAwindow, WBwindow, BBwindow;
  390.      extern SHORT dither, player;
  391.      extern tshort xwndw, contempt;
  392.      extern SHORT epsquare;
  393.      extern long ResponseTime, ExtraTime, MaxResponseTime, et, et0, time0, ft;
  394.      extern long reminus, replus;
  395.      extern unsigned long GenCnt, NodeCnt, ETnodes, EvalNodes;
  396.      extern tshort HashDepth, HashMoveLimit;
  397.      extern struct GameRec GameList[];
  398.      extern SHORT GameCnt, Game50;
  399.      extern SHORT Sdepth, MaxSearchDepth;
  400.      extern int Book;
  401.      extern struct TimeControlRec TimeControl;
  402.      extern int TCadd;
  403.      extern SHORT TCflag, TCmoves, TCminutes, TCseconds, OperatorTime;
  404.      extern int timecomp[MINGAMEIN], timeopp[MINGAMEIN];
  405.      extern int compptr,oppptr;
  406.      extern SHORT XCmore,XCadd[], XCmoves[], XCminutes[], XCseconds[], XC;
  407.      extern const SHORT otherside[];
  408.      extern const SHORT Stboard[];
  409.      extern const SHORT Stcolor[];
  410.      extern SHORT hint;
  411.      extern SHORT TOflag;
  412.      extern SHORT stage, stage2, Developed[];
  413.      extern SHORT ChkFlag[], CptrFlag[], PawnThreat[];
  414.      extern SHORT QueenCheck[];  /* tom@izf.tno.nl */
  415.      extern SHORT NMoves[];  /* tom@izf.tno.nl */
  416.      extern SHORT Threat[];  /* tom@izf.tno.nl */
  417.      extern SHORT ThreatSave[];  /* tom@izf.tno.nl */
  418.      extern SHORT Pscore[], Tscore[];
  419.      extern SHORT mtl[], pmtl[], hung[], emtl[];
  420.      extern SHORT Pindex[];
  421.      extern SHORT PieceCnt[];
  422.      extern SHORT FROMsquare, TOsquare;
  423.      extern SHORT HasKnight[], HasBishop[], HasRook[], HasQueen[];
  424.      extern const SHORT qrook[];
  425.      extern const SHORT krook[];
  426.      extern const SHORT kingP[];
  427.      extern const SHORT rank7[];
  428.      extern const SHORT sweep[];
  429.      extern const SHORT epmove1[], epmove2[];
  430.      extern UTSHORT killr0[], killr1[];
  431.      extern UTSHORT killr2[], killr3[];
  432.      extern UTSHORT PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit;
  433.      extern tshort killt[0x4000];
  434.      extern SHORT mtl[2], pmtl[2], hung[2];
  435.      extern const SHORT value[];
  436.      extern const SHORT control[];
  437.      extern UCHAR nextpos[8][64][64];
  438.      extern UCHAR nextdir[8][64][64];
  439.      extern const SHORT ptype[2][8];
  440.      extern unsigned int starttime;
  441.      extern SHORT distdata[64][64], taxidata[64][64];
  442.      extern CHAR mvstr[5][7];
  443. #ifndef AMIGADOS
  444.      extern union U admin;
  445. #endif
  446.      extern UTSHORT bookmaxply;
  447.      extern unsigned long bookcount;
  448.      extern unsigned long booksize;
  449.      extern CHAR *CP[];
  450. #ifdef QUIETBACKGROUND
  451.      extern SHORT background;
  452. #endif /* QUIETBACKGROUND */
  453.  
  454.      extern CHAR *DRAW;
  455.  
  456. #define distance(a,b) distdata[a][b]
  457. #define row(a) ((a) >> 3)
  458. #define column(a) ((a) & 7)
  459. #define locn(a,b) (((a) << 3) | (b))
  460.      extern SHORT distdata[64][64];
  461.  
  462. /* init external functions */
  463.      extern void InitConst (CHAR *lang);
  464.      extern void Initialize_dist (void);
  465.      extern void NewGame (void);
  466.      extern int parse (FILE * fd, UTSHORT *mv, SHORT side, CHAR *opening);
  467.      extern void GetOpenings (void);
  468.      extern int OpeningBook (SHORT *hint, SHORT side);
  469.      extern int GOpeningBook (SHORT *hint, SHORT side, CHAR *mv);
  470.      extern void SelectMove (SHORT side, SHORT iop);
  471.      extern int
  472.       search (SHORT side,
  473.            SHORT ply,
  474.            SHORT depth,
  475.                SHORT ext,
  476.            SHORT alpha,
  477.            SHORT beta,
  478.            UTSHORT *bstline,
  479.            SHORT *rpt,
  480.            SHORT SAVEHT,
  481.            SHORT didnull );
  482.      extern void Initialize_moves (void);
  483.      extern void MoveList (SHORT side, SHORT ply);
  484.      extern void CaptureList (SHORT side, SHORT ply);
  485.      extern int castle (SHORT side, SHORT kf, SHORT kt, SHORT iop);
  486.      extern void ataks (SHORT side, SHORT *a);
  487.      extern void
  488.       MakeMove (SHORT side,
  489.          struct leaf * node,
  490.          SHORT *tempb,
  491.          SHORT *tempc,
  492.          SHORT *tempsf,
  493.          SHORT *tempst);
  494.      extern void
  495.       UnmakeMove (SHORT side,
  496.            struct leaf * node,
  497.            SHORT *tempb,
  498.            SHORT *tempc,
  499.            SHORT *tempsf,
  500.            SHORT *tempst);
  501.      extern void InitializeStats (void);
  502.      extern int
  503.       evaluate (SHORT side,
  504.          SHORT ply,
  505.          SHORT depth,
  506.          SHORT ext,
  507.          SHORT alpha,
  508.          SHORT beta,
  509.              SHORT *terminal,
  510.          SHORT *InChk);
  511.      extern SHORT ScorePosition (SHORT side);
  512.      extern void ExaminePosition (void);
  513.      extern void UpdateWeights (void);
  514.      extern void Initialize (void);
  515.      extern void InputCommand (void);
  516.      extern void ExitChess (void);
  517.      extern void ClrScreen (void);
  518.      extern void SetTimeControl (void);
  519.      extern void SelectLevel (CHAR *sx);
  520.      extern void
  521.       UpdateDisplay (SHORT f,
  522.               SHORT t,
  523.               SHORT flag,
  524.               SHORT iscastle);
  525.      extern void ElapsedTime (SHORT iop);
  526.      extern void ShowSidetoMove (void);
  527.      extern void SearchStartStuff (SHORT side);
  528.      extern void ShowDepth (CHAR ch);
  529.      extern void TerminateSearch (int);
  530.      extern void
  531.       ShowResults (SHORT score,
  532.             UTSHORT *bstline,
  533.             CHAR ch);
  534.      extern void PromptForMove (void);
  535.      extern void SetupBoard (void);
  536.      extern void algbr (SHORT f, SHORT t, SHORT flag);
  537.      extern void OutputMove (SHORT score);
  538.      extern void ShowCurrentMove (SHORT pnt, SHORT f, SHORT t);
  539.      extern void ListGame (void);
  540.      extern void ShowMessage (CHAR *s);
  541.      extern void ClrScreen (void);
  542.      extern void gotoXY (SHORT x, SHORT y);
  543.      extern void ClrEoln (void);
  544.      extern void DrawPiece (SHORT sq);
  545.      extern void UpdateClocks (void);
  546.      extern void DoDebug (void);
  547.      extern void DoTable (SHORT table[64]);
  548.      extern void ShowPostnValues (void);
  549.      extern void ChangeXwindow (void);
  550.      extern void SetContempt (void);
  551.      extern void ChangeHashDepth (void);
  552.      extern void ChangeBetaWindow (void);
  553.      extern void ChangeAlphaWindow (void);
  554.      extern void GiveHint (void);
  555.      extern void ShowPrompt (void);
  556.      extern void EditBoard (void);
  557.      extern void help (void);
  558.      extern void ChangeSearchDepth (void);
  559.      extern void skip (void);
  560.      extern void skipb (void);
  561.      extern void EnPassant (SHORT xside, SHORT f, SHORT t, SHORT iop);
  562.      extern void ShowNodeCnt (long int NodeCnt);
  563.      extern void ShowLine (UTSHORT *bstline);
  564.      extern int pick (SHORT p1, SHORT p2);
  565.      extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
  566.      extern void VMoveList (SHORT side, register SHORT ply);
  567. #if !defined(AMIGADOS)
  568.      extern struct gdxadmin B;
  569. #endif
  570.  
  571. #if defined(AMIGADOS)  &&  !defined(XBOARD)
  572. #define exit(retcode) CleanExit(retcode)
  573. #endif
  574. /* Take care of MEMSET once and for all... */
  575. #if (!defined(HAVE_MEMSET) || defined(MSDOS)) && !defined(__GNUC__)
  576. #define memset(s,c,l) {\
  577.   unsigned long j; \
  578.     for (j = 0; j < (l); j++) \
  579.       ((CHAR *)s)[j] = (c);}
  580. #endif /* MEMSET */
  581.  
  582.