/* * printw and friends * * 1/26/81 (Berkeley) @(#)printw.c 1.1 */ # include "curses.ext" /* * This routine implements a printf on the standard screen. */ printw(fmt, args) char *fmt; int args; { return _sprintw(stdscr, fmt, &args); } /* * This routine implements a printf on the given window. */ wprintw(win, fmt, args) WINDOW *win; char *fmt; int args; { return _sprintw(win, fmt, &args); } /* * This routine actually executes the printf and adds it to the window * * This is really a modified version of "sprintf". As such, * it assumes that sprintf interfaces with the other printf functions * in a certain way. If this is not how your system works, you * will have to modify this routine to use the interface that your * "sprintf" uses. */ struct SIMIO { int flag; char *strp; }; _sprintw(win, fmt, args) WINDOW *win; char *fmt; int *args; { char buf[200]; struct SIMIO simio; simio.flag= -1; simio.strp= buf; _doprnt(fmt, args, &simio); *(simio.strp)='\0'; return waddstr(win, buf); }