conio.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /* A conio implementation for Mingw/Dev-C++.
  2. *
  3. * Written by:
  4. * Hongli Lai <[email protected]>
  5. * tkorrovi <[email protected]> on 2002/02/26.
  6. * Andrew Westcott <[email protected]>
  7. *
  8. * Offered for use in the public domain without any warranty.
  9. */
  10. #ifndef _CONIO_H_
  11. #define _CONIO_H_
  12. #include <stdio.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define BLINK 0
  17. typedef enum
  18. {
  19. BLACK,
  20. BLUE,
  21. GREEN,
  22. CYAN,
  23. RED,
  24. MAGENTA,
  25. BROWN,
  26. LIGHTGRAY,
  27. DARKGRAY,
  28. LIGHTBLUE,
  29. LIGHTGREEN,
  30. LIGHTCYAN,
  31. LIGHTRED,
  32. LIGHTMAGENTA,
  33. YELLOW,
  34. WHITE
  35. } COLORS;
  36. #define cgets _cgets
  37. #define cprintf _cprintf
  38. #define cputs _cputs
  39. #define cscanf _cscanf
  40. #define ScreenClear clrscr
  41. /* blinkvideo */
  42. void clreol (void);
  43. void clrscr (void);
  44. int _conio_gettext (int left, int top, int right, int bottom,
  45. char *str);
  46. /* _conio_kbhit */
  47. void delline (void);
  48. /* gettextinfo */
  49. void gotoxy(int x, int y);
  50. /*
  51. highvideo
  52. insline
  53. intensevideo
  54. lowvideo
  55. movetext
  56. normvideo
  57. */
  58. void puttext (int left, int top, int right, int bottom, char *str);
  59. // Screen Variables
  60. /* ScreenCols
  61. ScreenGetChar
  62. ScreenGetCursor
  63. ScreenMode
  64. ScreenPutChar
  65. ScreenPutString
  66. ScreenRetrieve
  67. ScreenRows
  68. ScreenSetCursor
  69. ScreenUpdate
  70. ScreenUpdateLine
  71. ScreenVisualBell
  72. _set_screen_lines */
  73. void _setcursortype (int type);
  74. void textattr (int _attr);
  75. void textbackground (int color);
  76. void textcolor (int color);
  77. /* textmode */
  78. int wherex (void);
  79. int wherey (void);
  80. /* window */
  81. /* The code below was part of Mingw's conio.h */
  82. /*
  83. * conio.h
  84. *
  85. * Low level console I/O functions. Pretty please try to use the ANSI
  86. * standard ones if you are writing new code.
  87. *
  88. * This file is part of the Mingw32 package.
  89. *
  90. * Contributors:
  91. * Created by Colin Peters <[email protected]>
  92. *
  93. * THIS SOFTWARE IS NOT COPYRIGHTED
  94. *
  95. * This source code is offered for use in the public domain. You may
  96. * use, modify or distribute it freely.
  97. *
  98. * This code is distributed in the hope that it will be useful but
  99. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  100. * DISCLAMED. This includes but is not limited to warranties of
  101. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  102. *
  103. * $Revision: 1.2 $
  104. * $Author: bellard $
  105. * $Date: 2005/04/17 13:14:29 $
  106. *
  107. */
  108. char* _cgets (char*);
  109. int _cprintf (const char*, ...);
  110. int _cputs (const char*);
  111. int _cscanf (char*, ...);
  112. int _getch (void);
  113. int _getche (void);
  114. int _kbhit (void);
  115. int _putch (int);
  116. int _ungetch (int);
  117. int getch (void);
  118. int getche (void);
  119. int kbhit (void);
  120. int putch (int);
  121. int ungetch (int);
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif /* _CONIO_H_ */