-
Notifications
You must be signed in to change notification settings - Fork 0
/
conio.h
92 lines (83 loc) · 2.14 KB
/
conio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef _CONIO_H_
#define _CONIO_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct text_info {
unsigned char winleft; /* left window coordinate */
unsigned char wintop; /* top window coordinate */
unsigned char winright; /* right window coordinate */
unsigned char winbottom; /* bottom window coordinate */
unsigned char attribute; /* text attribute */
unsigned char normattr; /* normal attribute */
unsigned char currmode; /* BW40, BW80, C40, C80, or C4350 */
unsigned char screenheight; /* text screen's height */
unsigned char screenwidth; /* text screen's width */
unsigned char curx; /* x-coordinate in current window */
unsigned char cury; /* y-coordinate in current window */
} text_info;
typedef enum {
BLACK,
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY,
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
} COLORS;
enum text_modes {
LASTMODE=-1,
BW40=0,
C40,
BW80,
C80,
MONO=7,
C4350=64
};
#define _NOCURSOR 0
#define _SOLIDCURSOR 1
#define _NORMALCURSOR 2
#define cscanf scanf
char *cgets(char *str);
void clreol(void);
void clrscr(void);
int cprintf(const char *format, ...);
int cputs(const char *str);
void delline(void);
int getch(void);
int getche(void);
char *getpass(const char *prompt);
int _gettext(int left, int top, int right, int bottom, void *destin);
void gettextinfo(struct text_info *r);
void gotoxy(int, int);
void highvideo(void);
void insline(void);
int kbhit(void);
void lowvideo(void);
int movetext(int left, int top, int right, int bottom, int destleft, int desttop);
void normvideo(void);
int putch(int c);
int putchxy(int x, int y, int c);
int puttext(int left, int top, int right, int bottom, void *source);
void _setcursortype(int cur_t);
void textattr(int newattr);
void textbackground(int newcolor);
void textcolor(int newcolor);
void textmode(int newmode);
int ungetch(int ch);
int wherex(void);
int wherey(void);
void window(int left, int top, int right, int bottom);
#ifdef __cplusplus
}
#endif
#endif /* _CONIO_H_ */