1 /* yForth? - A Forth interpreter written in ANSI C
2 * Copyright (C) 2012 Luca Padovani
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * ------------------------------------------------------------------------
18 * Abstract: User Device Input/Output functions. Here are enclosed all
19 * non-portable functions.
28 /* d_clrscr: clear the screen */
35 /* d_clreol: clear to end of line */
42 /* d_setattr: set default attributes */
43 void d_setaddr(Cell attr) {
49 /* d_getattr: get default attributes */
54 return (ti.attribute);
58 /* d_gotoxy: move the cursor to the location (x, y) of the screen */
59 void d_gotoxy(Cell x, Cell y) {
65 /* d_wherex: current column position of the cursor */
72 /* d_wherey: current row position of the cursor */
79 /* d_getch: read a characted from the input device without displaying it and
80 * return as soon as the character is enteres (i.e. no wait for Carriage
89 /* d_kbhit: return True if a character is available */
96 /* d_open: Initialize the Input/Output device */
100 /* d_close: make some work when program finish to restore Input/Output device */