3 * Summary: Functions for DOS support.
4 * Needed by makefile.dos.
5 * Written by: Darshan Shaligram
7 * Added for Crawl Reference by dshaligram on Wed Nov 22 08:41:20 2006 UTC
10 // Every .cc must include AppHdr or bad things happen.
19 #if defined(TARGET_OS_DOS)
21 static bool cursor_is_enabled
= true;
25 struct termios charmode
;
27 tcgetattr (0, &charmode
);
29 charmode
.c_lflag
&= ~ISIG
;
30 tcsetattr (0, TCSANOW
, &charmode
);
36 void set_cursor_enabled(bool enabled
)
38 cursor_is_enabled
= enabled
;
39 _setcursortype(enabled
? _NORMALCURSOR
: _NOCURSOR
);
42 bool is_cursor_enabled()
44 return (cursor_is_enabled
);
47 // This will force the cursor down to the next line.
48 void clear_to_end_of_line()
53 int get_number_of_lines()
58 int get_number_of_cols()
70 case 'O': return CK_END
;
71 case 'P': return CK_DOWN
;
72 case 'I': return CK_PGUP
;
73 case 'H': return CK_UP
;
74 case 'G': return CK_HOME
;
75 case 'K': return CK_LEFT
;
76 case 'Q': return CK_PGDN
;
77 case 'M': return CK_RIGHT
;
78 case 119: return CK_CTRL_HOME
;
79 case 141: return CK_CTRL_UP
;
80 case 132: return CK_CTRL_PGUP
;
81 case 116: return CK_CTRL_RIGHT
;
82 case 118: return CK_CTRL_PGDN
;
83 case 145: return CK_CTRL_DOWN
;
84 case 117: return CK_CTRL_END
;
85 case 115: return CK_CTRL_LEFT
;
86 case 'S': return CK_DELETE
;
97 void putwch(unsigned c
)
99 putch(static_cast<char>(c
));
102 #endif /* #if defined(TARGET_OS_DOS) */