-
Notifications
You must be signed in to change notification settings - Fork 1
/
doscur.h
148 lines (131 loc) · 4.62 KB
/
doscur.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* DOSCUR.H - CURSES.H for TURBO C
*
* Copyright 1996-2002 by Gerhard Buergmann
*
* 1996-02-28 V 1.0.0
* 1998-04-12 V 1.0.1
* 1999-01-14 V 1.1.1
* 1999-07-01 V 1.2.0
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* See file COPYING for information on distribution conditions.
*/
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define TRUE 1
#define FALSE 0
#define ESC 27
#define KEY_F0 0x3A00
#define KEY_F(n) (KEY_F0+(n<<8))
#define KEY_DOWN 0x5000
#define KEY_UP 0x4800
#define KEY_LEFT 0x4B00
#define KEY_RIGHT 0x4D00
#define KEY_NPAGE 0x5100
#define KEY_PPAGE 0x4900
#define KEY_RETURN 0x0d
#define KEY_ENTER 0x0a
#define KEY_BACKSPACE 0x0E08
#define KEY_HOME 0x4700
#define KEY_LL 0x4f00 /* HOME DOWN, End */
#define KEY_DC 0x5300
#define KEY_IC 0x5200
#define A_NORMAL 3
#define A_STANDOUT 8
#define A_BOLD 8
#define A_REVERSE 127
#define A_BLINK 128
#define A_CHARTEXT 0x00ff
#define A_ATTRIBUTES 0xff00
#define chtype unsigned int
#define WINDOW text_info
extern struct WINDOW scr;
extern int stdscr;
extern int COLS;
extern int LINES;
extern int ECHO;
extern int NODEL;
void attrset(int);
#define initscr() clrscr();window(1,1,COLS,LINES);gettextinfo(&scr)
#define newwin(h,b,y,x) window(x+1,y+1,x+b+1,y+h+1);gettextinfo(&scr)
#define erasechar() KEY_ERASE
#define beep() putch(7)
#define flash() putch(7)
#define wclrtoeol(w) clreol()
#define clrtoeol() clreol()
#define werase(w) window(scr.winleft,scr.wintop,scr.winright,scr.winbottom)
#define erase() clrscr()
#define wclear(w) werase(w)
#define clear() clrscr()
/*
#define wattrset(w,a) textattr(a)
#define attrset(a) textattr(a)
*/
#define standout() highvideo()
#define standend() normvideo()
#define wmove(w,y,x) gotoxy(x+1,y+1)
#define move(y,x) gotoxy(x+1,y+1)
#define mvwaddch(w,y,x,c) gotoxy(x+1,y+1);putch(c)
#define mvaddch(y,x,c) gotoxy(x+1,y+1);putch(c)
#define waddch(w,c) putch(c)
#define addch(c) putch(c)
#define mvwaddstr(w,y,x,s) gotoxy(x+1,y+1);cputs(s)
#define mvaddstr(y,x,s) gotoxy(x+1,y+1);cputs(s)
#define waddstr(s) cputs(s)
#define addstr(s) cputs(s)
#define mvwprintw(w,y,x,s) gotoxy(x+1,y+1);cprintf(s)
#define mvprintw(y,x,s,a) gotoxy(x+1,y+1);cprintf(s,a)
#define wprintw(w,s) cprintf(s)
#define printw cprintf
#define getyx(w,y,x) x=wherex()-1;y=wherey()-1
#define getbegyx(w,y,x) x=scr.winleft;y=scr.wintop;
#define getmaxyx(w,y,x) x=(scr.winright)-(scr.winleft);y=(scr.winbottom)-(scr.wintop)+1
#define winsertln() insline()
#define insertln() insline()
#define wdeleteln(w) delline()
#define deleteln() delline()
#define mvwgetch(w,y,x) gotoxy(x+1,y+1);ugetch()
#define mvgetch(y,x) gotoxy(x+1,y+1);ugetch()
#define wgetch(w) ugetch()
#define mvwgetstr(w,y,x,s) gotoxy(x+1,y+1);gets(s)
#define mvgetstr(y,x,s) gotoxy(x+1,y+1);gets(s)
#define wgetstr(w,s) gets(s)
/*
#define getstr(s) gets(s)
*/
#define flushinp() fflush(stdin)
#define mvwscanw(w,y,x,s) gotoxy(x+1,y+1);cscanf(s)
#define mvscanw(y,x,s) gotoxy(x+1,y+1);cscanf(s)
#define wscanw(w,s) wscanw(s)
#define scanw cscanf
#define mvinsch(y,x,c) gotoxy(x+1,y+1);insch(c)
#define nodelay(w,b) NODEL=b
#define echo() ECHO=TRUE
#define noecho() ECHO=FALSE
#define nl()
#define nonl()
#define keypad(a,b)
#define refresh()
#define wrefresh(w)
#define cbreak()
#define endwin()
#define raw()
#define noraw()
#define notimeout(w,t)
#define idlok(w,b)
#define scrollok(a,b)
#define doupdate()
#define savetty()
#define resetty()
#define ERR (-1)