|
|
1.1 ! root 1: #include <scn.h> ! 2: static int errSw; ! 3: ! 4: /* ! 5: * Show any error. ! 6: */ ! 7: void ! 8: showError(s) ! 9: char *s; ! 10: { ! 11: char work[80]; ! 12: ! 13: if (NULL == errWindow) ! 14: fatal("No error window"); ! 15: sprintf(work, "Error: %r", &s); ! 16: wmove(errWindow, 0, 0); ! 17: wstandout(errWindow); ! 18: waddstr(errWindow, work); ! 19: wstandend(errWindow); ! 20: wrefresh(errWindow); ! 21: errSw = 1; ! 22: } ! 23: ! 24: /* ! 25: * Get a char from screen, Erase error window if not clear. ! 26: */ ! 27: getChr() ! 28: { ! 29: int c; ! 30: ! 31: c = getch(); ! 32: if (errSw) { ! 33: wmove(errWindow, 0, 0); ! 34: wclrtoeol(errWindow); ! 35: wrefresh(errWindow); ! 36: errSw = 0; ! 37: } ! 38: return (c); ! 39: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.