_print/_doprnt; curses on sys III
bob at SU-SHASTA.ARPA
bob at SU-SHASTA.ARPA
Mon Jun 18 23:45:03 AEST 1984
SHAME ON Ken Arnold and Bill Joy for making assumptions about
printf's implementation. Yes, System III and System V have done
away with _doprnt. I have re-written printw and wprintw to not
have implementation dependencies and reproduce them here for your
use.
--------------------------------------------------------------------------
/*
* This routine implements a printf on the standard screen.
*/
printw(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
char *fmt;
int *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10;
{
return wprintw(stdscr, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
}
/*
* This routine actually executes the printf and adds it to the window
* This is really a modified version of "sprintf".
*
*/
int
wprintw(win, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
WINDOW *win;
char *fmt;
int *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10;
{
int rc;
char buf[512];
rc = sprintf(buf, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
return waddstr(win, buf);
}
--------------------------------------------------------------------------
Bob Toxen
Silicon Graphics
ucbvax!Shasta!olympus!bob
More information about the Comp.unix.wizards
mailing list