home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / CONIO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  4.2 KB  |  147 lines

  1. /*  conio.h
  2.  
  3.     Direct MSDOS console input/output.
  4.  
  5.     Copyright (c) 1987, 1991 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. #define _NOCURSOR      0
  17. #define _SOLIDCURSOR   1
  18. #define _NORMALCURSOR  2
  19.  
  20. struct text_info {
  21.     unsigned char winleft;
  22.     unsigned char wintop;
  23.     unsigned char winright;
  24.     unsigned char winbottom;
  25.     unsigned char attribute;
  26.     unsigned char normattr;
  27.     unsigned char currmode;
  28.     unsigned char screenheight;
  29.     unsigned char screenwidth;
  30.     unsigned char curx;
  31.     unsigned char cury;
  32. };
  33.  
  34. enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
  35.  
  36. #if !defined(__COLORS)
  37. #define __COLORS
  38.  
  39. enum COLORS {
  40.     BLACK,          /* dark colors */
  41.     BLUE,
  42.     GREEN,
  43.     CYAN,
  44.     RED,
  45.     MAGENTA,
  46.     BROWN,
  47.     LIGHTGRAY,
  48.     DARKGRAY,       /* light colors */
  49.     LIGHTBLUE,
  50.     LIGHTGREEN,
  51.     LIGHTCYAN,
  52.     LIGHTRED,
  53.     LIGHTMAGENTA,
  54.     YELLOW,
  55.     WHITE
  56. };
  57. #endif
  58.  
  59. #define BLINK       128 /* blink bit */
  60.  
  61. extern   int _Cdecl directvideo;
  62. extern   int _Cdecl _wscroll;
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67.  
  68. void        _Cdecl clreol( void );
  69. void        _Cdecl clrscr( void );
  70. void        _Cdecl gotoxy( int __x, int __y );
  71. int         _Cdecl wherex( void );
  72. int         _Cdecl wherey( void );
  73. int         _Cdecl getch( void );
  74. int         _Cdecl getche( void );
  75. int         _Cdecl kbhit( void );
  76. int         _Cdecl putch( int __c );
  77.  
  78. #ifndef _PORT_DEFS
  79. int         _Cdecl inp( unsigned __portid );
  80. unsigned    _Cdecl inpw( unsigned __portid );
  81. int         _Cdecl outp( unsigned __portid, int __value );
  82. unsigned    _Cdecl outpw( unsigned __portid, unsigned __value );
  83. unsigned char _Cdecl inportb( int __portid );
  84. void        _Cdecl outportb( int __portid, unsigned char __value );
  85. #endif  /* !_PORT_DEFS */
  86.  
  87. int         _Cdecl inport( int __portid );
  88. void        _Cdecl outport( int __portid, int __value );
  89.  
  90. void        _Cdecl delline( void );
  91. int         _Cdecl gettext( int __left, int __top,
  92.                             int __right, int __bottom,
  93.                             void *__destin);
  94. void        _Cdecl gettextinfo (struct text_info *__r );
  95. void        _Cdecl highvideo( void );
  96. void        _Cdecl insline( void );
  97. void        _Cdecl lowvideo( void );
  98. int         _Cdecl movetext( int __left, int __top,
  99.                              int __right, int __bottom,
  100.                              int __destleft, int __desttop );
  101. void        _Cdecl normvideo( void );
  102. int         _Cdecl puttext( int __left, int __top,
  103.                             int __right, int __bottom,
  104.                             void *__source );
  105. void        _Cdecl textattr( int __newattr );
  106. void        _Cdecl textbackground( int __newcolor );
  107. void        _Cdecl textcolor( int __newcolor );
  108. void        _Cdecl textmode( int __newmode );
  109. void        _Cdecl window( int __left, int __top, int __right, int __bottom);
  110.  
  111. void        _Cdecl _setcursortype( int __cur_t );
  112. char * _Cdecl cgets( char *__str );
  113. int         _Cdecl cprintf( const char *__format, ... );
  114. int         _Cdecl cputs( const char *__str );
  115. int         _Cdecl cscanf( const char *__format, ... );
  116. char * _Cdecl getpass( const char *__prompt );
  117. int         _Cdecl ungetch( int __ch );
  118.  
  119. #ifndef _PORT_DEFS
  120. #define _PORT_DEFS
  121.  
  122.     /* These are in-line functions.  These prototypes just clean up
  123.        some syntax checks and code generation.
  124.      */
  125. unsigned char _Cdecl    __inportb__( int __portid );
  126. unsigned int _Cdecl     __inportw__( int __portid );
  127. void        _Cdecl      __outportb__( int __portid, unsigned char __value );
  128. void        _Cdecl      __outportw__( int __portid, unsigned int __value );
  129.  
  130. #define inportb         __inportb__
  131. #define inportw         __inportw__
  132. #define outportb        __outportb__
  133. #define outportw        __outportw__
  134.  
  135. #define inp( portid )      __inportb__( portid )
  136. #define outp( portid,v )  (__outportb__( portid,v ), (int)_AL)
  137. #define inpw( portid )     __inportw__( portid )
  138. #define outpw( portid,v ) (__outportw__( portid,v ), (unsigned)_AX)
  139.  
  140. #endif  /* _PORT_DEFS */
  141.  
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145.  
  146. #endif  /* __CONIO_H */
  147.