Updating to version 1.3, release made by Mike Vanier (mvanier@bbb.caltech.edu).
[gnushogi.git] / gnushogi / dspwrappers.c
blob5ae9e653162d34e7c67994652d58106f0dd189ce
1 /*
2 * FILE: dspwrappers.c
4 * Wrapper functions which call analogous functions in rawdsp.c
5 * or cursesdsp.c depending on the interface.
7 * ----------------------------------------------------------------------
8 * Copyright (c) 1993, 1994, 1995 Matthias Mutz
9 * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
11 * GNU SHOGI is based on GNU CHESS
13 * Copyright (c) 1988, 1989, 1990 John Stanback
14 * Copyright (c) 1992 Free Software Foundation
16 * This file is part of GNU SHOGI.
18 * GNU Shogi is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License as published by the
20 * Free Software Foundation; either version 1, or (at your option) any
21 * later version.
23 * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
24 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * for more details.
28 * You should have received a copy of the GNU General Public License along
29 * with GNU Shogi; see the file COPYING. If not, write to the Free
30 * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
31 * ----------------------------------------------------------------------
35 #include "gnushogi.h"
36 #include "dspwrappers.h"
37 #include "rawdsp.h"
38 #include "cursesdsp.h"
41 void
42 ChangeAlphaWindow(void)
44 switch (display_type)
46 case DISPLAY_RAW:
47 case DISPLAY_X:
48 Raw_ChangeAlphaWindow();
49 break;
51 case DISPLAY_CURSES:
52 Curses_ChangeAlphaWindow();
53 break;
58 void
59 ChangeBetaWindow(void)
61 switch (display_type)
63 case DISPLAY_RAW:
64 case DISPLAY_X:
65 Raw_ChangeBetaWindow();
66 break;
68 case DISPLAY_CURSES:
69 Curses_ChangeBetaWindow();
70 break;
75 void
76 ChangeHashDepth(void)
78 switch (display_type)
80 case DISPLAY_RAW:
81 case DISPLAY_X:
82 Raw_ChangeHashDepth();
83 break;
85 case DISPLAY_CURSES:
86 Curses_ChangeHashDepth();
87 break;
92 void
93 ChangeSearchDepth(void)
95 switch (display_type)
97 case DISPLAY_RAW:
98 case DISPLAY_X:
99 Raw_ChangeSearchDepth();
100 break;
102 case DISPLAY_CURSES:
103 Curses_ChangeSearchDepth();
104 break;
109 void
110 ChangeXwindow(void)
112 switch (display_type)
114 case DISPLAY_RAW:
115 case DISPLAY_X:
116 Raw_ChangeXwindow();
117 break;
119 case DISPLAY_CURSES:
120 Curses_ChangeXwindow();
121 break;
126 void
127 ClearScreen(void)
129 switch (display_type)
131 case DISPLAY_RAW:
132 case DISPLAY_X:
133 Raw_ClearScreen();
134 break;
136 case DISPLAY_CURSES:
137 Curses_ClearScreen();
138 break;
143 void
144 DoDebug(void)
146 switch (display_type)
148 case DISPLAY_RAW:
149 case DISPLAY_X:
150 Raw_DoDebug();
151 break;
153 case DISPLAY_CURSES:
154 Curses_DoDebug();
155 break;
160 void
161 DoTable(short table[NO_SQUARES])
163 switch (display_type)
165 case DISPLAY_RAW:
166 case DISPLAY_X:
167 Raw_DoTable(table);
168 break;
170 case DISPLAY_CURSES:
171 Curses_DoTable(table);
172 break;
177 void
178 EditBoard(void)
180 switch (display_type)
182 case DISPLAY_RAW:
183 case DISPLAY_X:
184 Raw_EditBoard();
185 break;
187 case DISPLAY_CURSES:
188 Curses_EditBoard();
189 break;
194 void
195 ExitShogi(void)
197 switch (display_type)
199 case DISPLAY_RAW:
200 case DISPLAY_X:
201 Raw_ExitShogi();
202 break;
204 case DISPLAY_CURSES:
205 Curses_ExitShogi();
206 break;
211 void
212 GiveHint(void)
214 switch (display_type)
216 case DISPLAY_RAW:
217 case DISPLAY_X:
218 Raw_GiveHint();
219 break;
221 case DISPLAY_CURSES:
222 Curses_GiveHint();
223 break;
228 void
229 Initialize(void)
231 switch (display_type)
233 case DISPLAY_RAW:
234 case DISPLAY_X:
235 Raw_Initialize();
236 break;
238 case DISPLAY_CURSES:
239 Curses_Initialize();
240 break;
245 void
246 OutputMove(void)
248 switch (display_type)
250 case DISPLAY_RAW:
251 case DISPLAY_X:
252 Raw_OutputMove();
253 break;
255 case DISPLAY_CURSES:
256 Curses_OutputMove();
257 break;
262 void
263 SetContempt(void)
265 switch (display_type)
267 case DISPLAY_RAW:
268 case DISPLAY_X:
269 Raw_SetContempt();
270 break;
272 case DISPLAY_CURSES:
273 Curses_SetContempt();
274 break;
279 void
280 SearchStartStuff(short side)
282 switch (display_type)
284 case DISPLAY_RAW:
285 case DISPLAY_X:
286 Raw_SearchStartStuff(side);
287 break;
289 case DISPLAY_CURSES:
290 Curses_SearchStartStuff(side);
291 break;
296 void
297 SelectLevel(char *sx)
299 switch (display_type)
301 case DISPLAY_RAW:
302 case DISPLAY_X:
303 Raw_SelectLevel(sx);
304 break;
306 case DISPLAY_CURSES:
307 Curses_SelectLevel(sx);
308 break;
313 void
314 ShowCurrentMove(short pnt, short f, short t)
316 switch (display_type)
318 case DISPLAY_RAW:
319 case DISPLAY_X:
320 Raw_ShowCurrentMove(pnt, f, t);
321 break;
323 case DISPLAY_CURSES:
324 Curses_ShowCurrentMove(pnt, f, t);
325 break;
330 void
331 ShowDepth(char ch)
333 switch (display_type)
335 case DISPLAY_RAW:
336 case DISPLAY_X:
337 Raw_ShowDepth(ch);
338 break;
340 case DISPLAY_CURSES:
341 Curses_ShowDepth(ch);
342 break;
347 void
348 ShowGameType(void)
350 switch (display_type)
352 case DISPLAY_RAW:
353 case DISPLAY_X:
354 Raw_ShowGameType();
355 break;
357 case DISPLAY_CURSES:
358 Curses_ShowGameType();
359 break;
364 void
365 ShowLine(unsigned short *bstline)
367 switch (display_type)
369 case DISPLAY_RAW:
370 case DISPLAY_X:
371 Raw_ShowLine(bstline);
372 break;
374 case DISPLAY_CURSES:
375 Curses_ShowLine(bstline);
376 break;
381 void
382 ShowMessage(char *s)
384 switch (display_type)
386 case DISPLAY_RAW:
387 case DISPLAY_X:
388 Raw_ShowMessage(s);
389 break;
391 case DISPLAY_CURSES:
392 Curses_ShowMessage(s);
393 break;
398 void
399 ShowPatternCount(short side, short n)
401 switch (display_type)
403 case DISPLAY_RAW:
404 case DISPLAY_X:
405 Raw_ShowPatternCount(side, n);
406 break;
408 case DISPLAY_CURSES:
409 Curses_ShowPatternCount(side, n);
410 break;
415 void
416 ShowPostnValue(short sq)
418 switch (display_type)
420 case DISPLAY_RAW:
421 case DISPLAY_X:
422 Raw_ShowPostnValue(sq);
423 break;
425 case DISPLAY_CURSES:
426 Curses_ShowPostnValue(sq);
427 break;
432 void
433 ShowPostnValues(void)
435 switch (display_type)
437 case DISPLAY_RAW:
438 case DISPLAY_X:
439 Raw_ShowPostnValues();
440 break;
442 case DISPLAY_CURSES:
443 Curses_ShowPostnValues();
444 break;
449 void
450 ShowResponseTime(void)
452 switch (display_type)
454 case DISPLAY_RAW:
455 case DISPLAY_X:
456 Raw_ShowResponseTime();
457 break;
459 case DISPLAY_CURSES:
460 Curses_ShowResponseTime();
461 break;
466 void
467 ShowResults(short score, unsigned short *bstline, char ch)
469 switch (display_type)
471 case DISPLAY_RAW:
472 case DISPLAY_X:
473 Raw_ShowResults(score, bstline, ch);
474 break;
476 case DISPLAY_CURSES:
477 Curses_ShowResults(score, bstline, ch);
478 break;
483 void
484 ShowSidetoMove(void)
486 switch (display_type)
488 case DISPLAY_RAW:
489 case DISPLAY_X:
490 Raw_ShowSidetoMove();
491 break;
493 case DISPLAY_CURSES:
494 Curses_ShowSidetoMove();
495 break;
500 void
501 ShowStage(void)
503 switch (display_type)
505 case DISPLAY_RAW:
506 case DISPLAY_X:
507 Raw_ShowStage();
508 break;
510 case DISPLAY_CURSES:
511 Curses_ShowStage();
512 break;
517 void
518 TerminateSearch(int sig)
520 switch (display_type)
522 case DISPLAY_RAW:
523 case DISPLAY_X:
524 Raw_TerminateSearch(sig);
525 break;
527 case DISPLAY_CURSES:
528 Curses_TerminateSearch(sig);
529 break;
534 void
535 UpdateDisplay(short f, short t, short redraw, short isspec)
537 switch (display_type)
539 case DISPLAY_RAW:
540 case DISPLAY_X:
541 Raw_UpdateDisplay(f, t, redraw, isspec);
542 break;
544 case DISPLAY_CURSES:
545 Curses_UpdateDisplay(f, t, redraw, isspec);
546 break;
551 void
552 help(void)
554 switch (display_type)
556 case DISPLAY_RAW:
557 case DISPLAY_X:
558 Raw_help();
559 break;
561 case DISPLAY_CURSES:
562 Curses_help();
563 break;