1 /*
2  * $Id: scrnio.h,v 1.5 2003/09/14 22:14:48 andrew_belov Exp $
3  * ---------------------------------------------------------------------------
4  * Prototypes of the functions located in SCRNIO.C are declared here.
5  *
6  */
7 
8 #ifndef SCRNIO_INCLUDED
9 #define SCRNIO_INCLUDED
10 
11 /* Console routine sets */
12 
13 #define CT_BORLAND                 0    /* Borland library (small and nice) */
14 #define CT_MSGRAPH                 1    /* Microsoft GRAPHICS.LIB (powerful,
15                                            wide-compatible but huge) */
16 #define CT_NATIVE                  2    /* OS-dependent library (NOT impl.) */
17 #define CT_ANSI                    3    /* Reimplement screen I/O to ANSI
18                                            sequences. Only useful for
19                                            ARJDISP. */
20 
21 /* Pick an appropriate set */
22 
23 #if COMPILER==BCC
24  #define CONSOLE_SET      CT_BORLAND
25  #define NEED_CRLF
26 #elif COMPILER==MSC&&defined(FORCE_MSGRAPH)
27  #define CONSOLE_SET      CT_MSGRAPH
28 #elif defined(DIRECT_TO_ANSI)&&TARGET!=OS2
29  #define CONSOLE_SET         CT_ANSI
30  #define NEED_CRLF
31 #else
32  #define CONSOLE_SET       CT_NATIVE
33 #endif
34 
35 /* Graphic libraries */
36 
37 #if CONSOLE_SET==CT_BORLAND
38  #include <conio.h>
39 #elif CONSOLE_SET==CT_MSGRAPH
40  #include <graph.h>
41 #endif
42 
43 /* Screen Sentry. That would help eliminate some extra (duplicate) output. One
44    procedure raises a sentry, another one clobbers it. ASR fix 14/09/2003 */
45 
46 extern int scr_sentry;
47 #define SET_SENTRY() scr_sentry=0;
48 #define CLOBBER_SENTRY() scr_sentry=1;
49 #define CHECK_SENTRY() (scr_sentry==0)
50 
51 /* Prototypes */
52 
53 #if CONSOLE_SET==CT_MSGRAPH
54  #define gotoxy(x, y) _settextposition((short)y, (short)x)
55  #define textbackground(c) _setbkcolor((short)c)
56  #define textcolor(c) _settextcolor((short)c)
57  #define clrscr() _clearscreen(_GWINDOW)
58 #elif CONSOLE_SET!=CT_BORLAND
59  void gotoxy(int x, int y);
60  void textbackground(int c);
61  void textcolor(int c);
62  void clrscr();
63 #endif
64 #if CONSOLE_SET==CT_BORLAND
65  #define wputch(c)          putch(c)
66  #define scrprintf             cprintf
67  #define scrn_reset()
68 #else
69  void textattr(int c);
70  int wherex();
71  int wherey();
72  void clreol();
73  #if CONSOLE_SET==CT_ANSI
74   #define wputch(c) putch(c)
75   #define scrprintf printf
76   void scrn_reset();
77  #else
78   void wputch(int c);
79   void scrprintf(char *fmt, ...);
80   #define scrn_reset()
81  #endif
82 #endif
83 void scr_out(char *str);
84 unsigned char getcurattr();
85 int query_screen_height();
86 void check_wrap(int i);
87 
88 #endif
89