home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / CONIO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  8.2 KB  |  293 lines

  1. /*  conio.h
  2.  
  3.     Direct MSDOS console input/output.
  4.  
  5.     Copyright (c) 1987, 1992 by Borland International
  6.     All Rights Reserved.
  7. */
  8.  
  9. #if !defined(__CONIO_H)
  10. #define __CONIO_H
  11.  
  12. #if !defined(___DEFS_H)
  13. #include <_defs.h>
  14. #endif
  15.  
  16. #if !defined(_RC_INVOKED)
  17. #pragma option -a-
  18. #endif
  19.  
  20. #define _NOCURSOR      0
  21. #define _SOLIDCURSOR   1
  22. #define _NORMALCURSOR  2
  23.  
  24. struct text_info {
  25.     unsigned char winleft;
  26.     unsigned char wintop;
  27.     unsigned char winright;
  28.     unsigned char winbottom;
  29.     unsigned char attribute;
  30.     unsigned char normattr;
  31.     unsigned char currmode;
  32.     unsigned char screenheight;
  33.     unsigned char screenwidth;
  34.     unsigned char curx;
  35.     unsigned char cury;
  36. };
  37.  
  38. #if !defined(__COLORS)
  39. #define __COLORS
  40.  
  41. enum COLORS {
  42.     BLACK,          /* dark colors */
  43.     BLUE,
  44.     GREEN,
  45.     CYAN,
  46.     RED,
  47.     MAGENTA,
  48.     BROWN,
  49.     LIGHTGRAY,
  50.     DARKGRAY,       /* light colors */
  51.     LIGHTBLUE,
  52.     LIGHTGREEN,
  53.     LIGHTCYAN,
  54.     LIGHTRED,
  55.     LIGHTMAGENTA,
  56.     YELLOW,
  57.     WHITE
  58. };
  59. #endif
  60.  
  61. #define BLINK       128 /* blink bit */
  62.  
  63. #if !defined(__FLAT__)
  64.  
  65. enum text_modes {  LASTMODE=-1,
  66.                    BW40=0,
  67.                    C40,
  68.                    BW80,
  69.                    C80,
  70.                    MONO=7,
  71.                    C4350=64 };
  72.  
  73. #if !defined(_Windows)
  74.  
  75. #if !defined(__STDC__)  /*  NON-ANSI  */
  76. #define directvideo  _directvideo
  77. #endif
  78.  
  79. extern   int _RTLENTRY _directvideo;
  80.  
  81. #endif  /* _windows */
  82.  
  83. extern   int _RTLENTRY _wscroll;
  84.  
  85. #ifdef __cplusplus
  86. extern "C" {
  87. #endif
  88.  
  89. void        _RTLENTRY clreol( void );
  90. void        _RTLENTRY clrscr( void );
  91. void        _RTLENTRY gotoxy( int __x, int __y );
  92. int         _RTLENTRY getch( void );
  93. int         _RTLENTRY getche( void );
  94. int         _RTLENTRY kbhit( void );
  95. int         _RTLENTRY putch( int __c );
  96. int         _RTLENTRY wherex( void );
  97. int         _RTLENTRY wherey( void );
  98.  
  99. #ifndef _PORT_DEFS
  100. unsigned char   _RTLENTRY inportb( unsigned __portid );
  101. unsigned        _RTLENTRY inport ( unsigned __portid );
  102. int             _RTLENTRY inp( unsigned __portid );
  103. unsigned        _RTLENTRY inpw( unsigned __portid );
  104. void            _RTLENTRY outportb( unsigned __portid, unsigned char __value );
  105. void            _RTLENTRY outport ( unsigned __portid, unsigned __value );
  106. int             _RTLENTRY outp( unsigned __portid, int __value );
  107. unsigned        _RTLENTRY outpw( unsigned __portid, unsigned __value );
  108. #endif  /* !_PORT_DEFS */
  109.  
  110. #if !defined(_Windows)
  111.  
  112. void        _RTLENTRY delline( void );
  113. int         _RTLENTRY gettext( int __left, int __top,
  114.                            int __right, int __bottom,
  115.                            void *__destin);
  116. void        _RTLENTRY gettextinfo (struct text_info *__r );
  117. void        _RTLENTRY highvideo( void );
  118. void        _RTLENTRY insline( void );
  119. void        _RTLENTRY lowvideo( void );
  120. int         _RTLENTRY movetext( int __left, int __top,
  121.                             int __right, int __bottom,
  122.                             int __destleft, int __desttop );
  123. void        _RTLENTRY normvideo( void );
  124. int         _RTLENTRY puttext( int __left, int __top,
  125.                            int __right, int __bottom,
  126.                            void *__source );
  127. void        _RTLENTRY textattr( int __newattr );
  128. void        _RTLENTRY textbackground( int __newcolor );
  129. void        _RTLENTRY textcolor( int __newcolor );
  130. void        _RTLENTRY textmode( int __newmode );
  131. void        _RTLENTRY window( int __left, int __top, int __right, int __bottom);
  132.  
  133. void        _RTLENTRY _setcursortype( int __cur_t );
  134. char *      _RTLENTRY cgets( char *__str );
  135. int         _RTLENTRY cprintf( const char *__format, ... );
  136. int         _RTLENTRY cputs( const char *__str );
  137. int         _RTLENTRY cscanf( const char *__format, ... );
  138. char *      _RTLENTRY getpass( const char *__prompt );
  139. int         _RTLENTRY ungetch( int __ch );
  140.  
  141. #endif /* _Windows */
  142.  
  143. #ifndef _PORT_DEFS
  144. #define _PORT_DEFS
  145.  
  146.     /* These are in-line functions.  These prototypes just clean up
  147.        some syntax checks and code generation.
  148.      */
  149. unsigned char   _RTLENTRY  __inportb__ (unsigned __portid);
  150. unsigned        _RTLENTRY  __inportw__ (unsigned __portid);
  151. unsigned char   _RTLENTRY  __outportb__(unsigned __portid, unsigned char __value);
  152. unsigned        _RTLENTRY  __outportw__(unsigned __portid, unsigned __value);
  153.  
  154. #define inportb(__portid)           __inportb__(__portid)
  155. #define outportb(__portid, __value) ((void) __outportb__(__portid, __value))
  156. #define inport(__portid)            __inportw__(__portid)
  157. #define outport(__portid, __value)  ((void) __outportw__(__portid, __value))
  158.  
  159. /* MSC-compatible macros for port I/O */
  160. #define inp(__portid)               __inportb__ (__portid)
  161. #define outp(__portid, __value)     __outportb__(__portid, (unsigned char)__value)
  162. #define inpw(__portid)              __inportw__ (__portid)
  163. #define outpw(__portid, __value)    __outportw__(__portid, __value)
  164.  
  165. #endif  /* _PORT_DEFS */
  166.  
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170.  
  171. #else  /* __FLAT__ */
  172.  
  173. enum text_modes
  174. {
  175.     /* DOS-compatible modes */
  176.  
  177.     LASTMODE = -1,
  178.     BW40     = 0,
  179.     C40,
  180.     BW80,
  181.     C80,
  182.     MONO     = 7,
  183.     C4350    = 64,
  184.  
  185.     /* New Color modes */
  186.  
  187.     C40X14   = 8,
  188.     C40X21,
  189.     C40X28,
  190.     C40X43,
  191.     C40X50,
  192.     C40X60,
  193.  
  194.     C80X14,
  195.     C80X21,
  196.     C80X28,
  197.     C80X43,
  198.     C80X50,
  199.     C80X60,
  200.  
  201.     /* New Black & White modes */
  202.  
  203.     BW40X14,
  204.     BW40X21,
  205.     BW40X28,
  206.     BW40X43,
  207.     BW40X50,
  208.     BW40X60,
  209.  
  210.     BW80X14,
  211.     BW80X21,
  212.     BW80X28,
  213.     BW80X43,
  214.     BW80X50,
  215.     BW80X60,
  216.  
  217.     /* New Monochrome modes */
  218.  
  219.     MONO14,             /* Invalid VGA mode */
  220.     MONO21,
  221.     MONO28,
  222.     MONO43,
  223.     MONO50,
  224.     MONO60,
  225.  
  226.     _ORIGMODE = 65      /* original mode at program startup */
  227. };
  228.  
  229.  
  230. #define PASS_MAX    8   /* max. no. of chars returned by getpass */
  231.  
  232. #if !defined(__STDC__)  /*  NON-ANSI  */
  233. #define directvideo  _directvideo
  234. #endif
  235.  
  236. extern   int _RTLENTRY _EXPDATA _directvideo;
  237.  
  238. extern   int _RTLENTRY _EXPDATA _wscroll;
  239.  
  240. #ifdef __cplusplus
  241. extern "C" {
  242. #endif
  243.  
  244. void        _RTLENTRY _EXPFUNC clreol( void );
  245. void        _RTLENTRY _EXPFUNC clrscr( void );
  246. void        _RTLENTRY _EXPFUNC delline( void );
  247. int         _RTLENTRY _EXPFUNC gettext( int __left, int __top,
  248.                             int __right, int __bottom,
  249.                             void *__destin);
  250. void        _RTLENTRY _EXPFUNC gettextinfo (struct text_info *__r );
  251. void        _RTLENTRY _EXPFUNC gotoxy( int __x, int __y );
  252. void        _RTLENTRY _EXPFUNC highvideo( void );
  253. void        _RTLENTRY _EXPFUNC insline( void );
  254. void        _RTLENTRY _EXPFUNC lowvideo( void );
  255. int         _RTLENTRY _EXPFUNC movetext( int __left, int __top,
  256.                              int __right, int __bottom,
  257.                              int __destleft, int __desttop );
  258. void        _RTLENTRY _EXPFUNC normvideo( void );
  259. int         _RTLENTRY _EXPFUNC puttext( int __left, int __top,
  260.                             int __right, int __bottom,
  261.                             void *__source );
  262. void        _RTLENTRY _EXPFUNC textattr( int __newattr );
  263. void        _RTLENTRY _EXPFUNC textbackground( int __newcolor );
  264. void        _RTLENTRY _EXPFUNC textcolor( int __newcolor );
  265. void        _RTLENTRY _EXPFUNC textmode( int __newmode );
  266. void        _RTLENTRY _EXPFUNC window( int __left, int __top, int __right, int __bottom);
  267.  
  268. void        _RTLENTRY _EXPFUNC _setcursortype( int __cur_t );
  269. char *      _RTLENTRY _EXPFUNC cgets( char *__str );
  270. int         _RTLENTRY _EXPFUNC cprintf( const char *__format, ... );
  271. int         _RTLENTRY _EXPFUNC cputs( const char *__str );
  272. int         _RTLENTRY _EXPFUNC cscanf( const char *__format, ... );
  273. int         _RTLENTRY _EXPFUNC getch( void );
  274. int         _RTLENTRY _EXPFUNC getche( void );
  275. char *      _RTLENTRY _EXPFUNC getpass( const char *__prompt );
  276. int         _RTLENTRY _EXPFUNC kbhit( void );
  277. int         _RTLENTRY _EXPFUNC putch( int __c );
  278. int         _RTLENTRY _EXPFUNC ungetch( int __ch );
  279. int         _RTLENTRY _EXPFUNC wherex( void );
  280. int         _RTLENTRY _EXPFUNC wherey( void );
  281.  
  282. #ifdef __cplusplus
  283. }
  284. #endif
  285.  
  286. #endif  /* __FLAT__  */
  287.  
  288. #if !defined(_RC_INVOKED)
  289. #pragma option -a.
  290. #endif
  291.  
  292. #endif  /* __CONIO_H */
  293.