|
|
char * term_dj_rawkey_string [P4_NUM_KEYS] = |
static int c_interrupt_key (char ch) { return 0; } |
static void c_interactive_terminal (void) {} |
static void c_system_terminal (void) {} |
static void c_query_winsize (void) {} |
static int c_prepare_terminal (void) { setbuf (stdout, NULL); PFE.cols = ScreenCols (); PFE.rows = ScreenRows (); return 1; } |
static void
c_cleanup_terminal (void)
{
return; |
static int c_keypressed (void) { return kbhit (); } |
|
static int newgetkey (void) { int key; if (nextkey) { key = nextkey; nextkey = 0; return key; } key = getkey (); if (key > 255) { nextkey = key & 255; return 255; } return key; } |
|
static void c_putc (char c) { int row, col; if (attribs == BW_NORMAL || iscntrl(c)) { putchar (c); return; } ScreenGetCursor (&row, &col); ScreenPutChar (c, attribs, col, row); ScreenSetCursor (row, col + 1); } |
static void c_puts (const char *s) { int i; if (attribs == BW_NORMAL) { fputs (s, stdout); return; } for (i = 0; s[i]; i++) c_putc(s[i]); } |
|
static void c_putc (char c) { putchar (c); } |
static void c_puts (const char *s) { fputs (s, stdout); } |
|
static void c_gotoxy (int x, int y) { ScreenSetCursor (y, x); } |
static void c_wherexy (int *x, int *y) { ScreenGetCursor (y, x); } |
static void _addxy (int x, int y) { int col, row; ScreenGetCursor (&row, &col); ScreenSetCursor (row + y, col + x); } |
static void _clrscr (void) { ScreenClear (); ScreenSetCursor (0, 0); } |
static void _home (void) { ScreenSetCursor (0, 0); } |
static void _clreol (void)
{
int i, col;
ScreenGetCursor (&i, &col);
for (i = col; i < PFE.cols; i++)
putchar ( |
static void _clrdown (void) { int i, row, col; ScreenGetCursor (&row, &col); clreol (); for (i = row + 1; i < PFE.rows; i++) { gotoxy (0, i); clreol (); } gotoxy (col, row); } |
static int c_tput (int attr)
{
switch (attr)
{
case P4_TERM_GOLEFT: _addxy (-1, 0); break;
case P4_TERM_GORIGHT: _addxy ( 1, 0); break;
case P4_TERM_GOUP: _addxy ( 0, -1); break;
case P4_TERM_GODOWN: _addxy ( 0, 1); break;
case P4_TERM_CLRSCR: _clrscr (); break;
case P4_TERM_HOME: _home (); break;
case P4_TERM_CLREOL: _clreol (); break;
case P4_TERM_CLRDOWN: _clrdown (); break;
case P4_TERM_BELL: putchar ( |
|
p4_term_struct p4_term_ios =
{
|
|