|
|
1.1 ! root 1: # include "curses.ext" ! 2: ! 3: /* ! 4: * This routine implements a printf on the standard screen. ! 5: */ ! 6: printw(fmt, args) ! 7: char *fmt; ! 8: int args; { ! 9: ! 10: return _sprintw(stdscr, fmt, &args); ! 11: } ! 12: ! 13: /* ! 14: * This routine implements a printf on the given window. ! 15: */ ! 16: wprintw(win, fmt, args) ! 17: WINDOW *win; ! 18: char *fmt; ! 19: int args; { ! 20: ! 21: return _sprintw(win, fmt, &args); ! 22: } ! 23: /* ! 24: * This routine actually executes the printf and adds it to the window ! 25: */ ! 26: _sprintw(win, fmt, args) ! 27: WINDOW *win; ! 28: char *fmt; ! 29: int *args; { ! 30: ! 31: FILE junk; ! 32: char buf[512]; ! 33: ! 34: junk._flag = _IOWRT + _IOSTRG; ! 35: junk._ptr = buf; ! 36: junk._cnt = 32767; ! 37: _doprnt(fmt, args, &junk); ! 38: putc('\0', &junk); ! 39: return waddstr(win, buf); ! 40: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.