X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=udio.c;h=817391da6972c3e59f1575cba41be7021b68a876;hb=b814f4144f159595bdd580a4bc1221c5bb8ebd14;hp=d3873a244873f337374599cb1203309990d15c2b;hpb=ef65b7aa8aa9801818dfe1de1f4a434719cc62e1;p=debian%2Fyforth diff --git a/udio.c b/udio.c index d3873a2..817391d 100644 --- a/udio.c +++ b/udio.c @@ -10,77 +10,59 @@ */ #include "yforth.h" -#ifdef HAVE_CONIO +#if HAVE_CONIO # include -#elifdef HAVE_CURSES -# include #endif #include "udio.h" /* d_clrscr: clear the screen */ void d_clrscr() { -#ifdef HAVE_CONIO +#if HAVE_CONIO clrscr(); -#elifdef HAVE_CURSES - clear(); #endif } /* d_clreol: clear to end of line */ void d_clreol() { -#ifdef HAVE_CONIO +#if HAVE_CONIO clreol(); -#elifdef HAVE_CURSES - clrtoeol(); #endif } /* d_setattr: set default attributes */ void d_setaddr(Cell attr) { -#ifdef HAVE_CONIO +#if HAVE_CONIO textattr(attr); -#elifdef HAVE_CURSES #endif } /* d_getattr: get default attributes */ Cell d_getattr() { -#ifdef HAVE_CONIO +#if HAVE_CONIO struct text_info ti; gettextinfo(&ti); return (ti.attribute); -#elifdef HAVE_CURSES #endif } /* d_gotoxy: move the cursor to the location (x, y) of the screen */ void d_gotoxy(Cell x, Cell y) { -#ifdef HAVE_CONIO +#if HAVE_CONIO gotoxy(x, y); -#elifdef HAVE_CURSES - move(y, x); #endif } /* d_wherex: current column position of the cursor */ Cell d_wherex() { -#ifdef HAVE_CONIO +#if HAVE_CONIO return (wherex()); -#elifdef HAVE_CURSES - int x, y; - getyx(stdscr, y, x); - return ((Cell) x); #endif } /* d_wherey: current row position of the cursor */ Cell d_wherey() { -#ifdef HAVE_CONIO +#if HAVE_CONIO return (wherey()); -#elifdef HAVE_CURSES - int x, y; - getyx(stdscr, y, x); - return ((Cell) y); #endif } @@ -89,39 +71,24 @@ Cell d_wherey() { * Return */ Char d_getch() { -#ifdef HAVE_CONIO - return (getch()); -#elifdef HAVE_CURSES +#if HAVE_CONIO return (getch()); #endif } /* d_kbhit: return True if a character is available */ Cell d_kbhit() { -#ifdef HAVE_CONIO +#if HAVE_CONIO return (kbhit()); -#elifdef HAVE_CURSES - return (1); -#endif +#endif } /* d_open: Initialize the Input/Output device */ void d_open() { -#ifdef HAVE_CURSES - initscr(); - cbreak(); - noecho(); - nonl(); - /* intrflush(stdscr, FALSE); */ - /* keypad(stdscr, TRUE); */ -#endif -} +} /* d_close: make some work when program finish to restore Input/Output device */ void d_close() { -#ifdef HAVE_CURSES - endwin(); -#endif }