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

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