home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / include / conio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-23  |  2.8 KB  |  112 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_conio_h_
  3. #define __dj_include_conio_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15.  
  16. extern int directvideo; /* ignored by gppconio */
  17. extern int _wscroll;
  18.  
  19. #define _NOCURSOR      0
  20. #define _SOLIDCURSOR   1
  21. #define _NORMALCURSOR  2
  22.  
  23. struct text_info {
  24.     unsigned char winleft;
  25.     unsigned char wintop;
  26.     unsigned char winright;
  27.     unsigned char winbottom;
  28.     unsigned char attribute;
  29.     unsigned char normattr;
  30.     unsigned char currmode;
  31.     unsigned char screenheight;
  32.     unsigned char screenwidth;
  33.     unsigned char curx;
  34.     unsigned char cury;
  35. };
  36.  
  37. enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
  38.  
  39. enum COLORS {
  40.     /*  dark colors     */
  41.     BLACK,          
  42.     BLUE,
  43.     GREEN,
  44.     CYAN,
  45.     RED,
  46.     MAGENTA,
  47.     BROWN,
  48.     LIGHTGRAY,
  49.     /*  light colors    */
  50.     DARKGRAY,
  51.     LIGHTBLUE,
  52.     LIGHTGREEN,
  53.     LIGHTCYAN,
  54.     LIGHTRED,
  55.     LIGHTMAGENTA,
  56.     YELLOW,
  57.     WHITE
  58. };
  59.  
  60. #define BLINK   0x80    /*  blink bit   */
  61.  
  62. void    blinkvideo(void);
  63. char *  cgets(char *_str); 
  64. void    clreol(void);
  65. void    clrscr(void);
  66. int     _conio_kbhit(void); /* checks for ungetch char */
  67. int     cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
  68. int     cputs(const char *_str);
  69. int     cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
  70. void    delline(void);
  71. int     getch(void);
  72. int     getche(void);
  73. int     gettext(int _left, int _top, int _right, int _bottom, void *_destin);
  74. void    gettextinfo(struct text_info *_r);
  75. void    gotoxy(int _x, int _y);
  76. void    gppconio_init(void);
  77. void    highvideo(void);
  78. void    insline(void);
  79. void    intensevideo(void);
  80. void    lowvideo(void);
  81. int     movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop);
  82. void    normvideo(void);
  83. int     putch(int _c);
  84. int     puttext(int _left, int _top, int _right, int _bottom, void *_source);
  85. void    _setcursortype(int _type);
  86. void    _set_screen_lines(int _nlines);
  87. void    textattr(int _attr);
  88. void    textbackground(int _color);
  89. void    textcolor(int _color);
  90. void    textmode(int _mode);
  91. int     ungetch(int); 
  92. int     wherex(void);
  93. int     wherey(void);
  94. void    window(int _left, int _top, int _right, int _bottom);
  95.  
  96. #define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
  97.                               also wants _conio_kbhit and not kbhit
  98.                               from libc */
  99.  
  100. #endif /* !_POSIX_SOURCE */
  101. #endif /* !__STRICT_ANSI__ */
  102. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  103.  
  104. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  105. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  106.  
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110.  
  111. #endif /* !__dj_include_conio_h_ */
  112.