|
|
1.1 ! root 1: # include "curses.ext" ! 2: ! 3: extern char *getenv(); ! 4: ! 5: /* ! 6: * This routine initializes the current and standard screen. ! 7: */ ! 8: WINDOW * ! 9: initscr() { ! 10: ! 11: reg char *sp; ! 12: ! 13: # ifdef DEBUG ! 14: fprintf(outf, "INITSCR()\n"); ! 15: # endif ! 16: if (!My_term && isatty(2)) { ! 17: _tty_ch = 2; ! 18: gettmode(); ! 19: if ((sp = getenv("TERM")) == NULL) ! 20: sp = Def_term; ! 21: setterm(sp); ! 22: # ifdef DEBUG ! 23: fprintf(outf, "INITSCR: term = %s\n", sp); ! 24: # endif ! 25: } ! 26: else ! 27: setterm(Def_term); ! 28: _puts(TI); ! 29: _puts(VS); ! 30: if (curscr != NULL) { ! 31: # ifdef DEBUG ! 32: fprintf(outf, "INITSCR: curscr = 0%o\n", curscr); ! 33: # endif ! 34: delwin(curscr); ! 35: } ! 36: # ifdef DEBUG ! 37: fprintf(outf, "LINES = %d, COLS = %d\n", LINES, COLS); ! 38: # endif ! 39: if ((curscr=newwin(LINES, COLS, 0, 0)) == ERR) ! 40: return ERR; ! 41: curscr->_clear = TRUE; ! 42: if (stdscr != NULL) { ! 43: # ifdef DEBUG ! 44: fprintf(outf, "INITSCR: stdscr = 0%o\n", stdscr); ! 45: # endif ! 46: delwin(stdscr); ! 47: } ! 48: stdscr = newwin(LINES, COLS, 0, 0); ! 49: return stdscr; ! 50: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.