Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!sri-unix!olympus!sauron!bob@SU-SHASTA.ARPA
From: bob@SU-SHASTA.ARPA
Newsgroups: net.unix-wizards
Subject: Re: _print/_doprnt; curses on sys III
Message-ID: <978@sri-arpa.UUCP>
Date: Mon, 18-Jun-84 09:45:03 EDT
Article-I.D.: sri-arpa.978
Posted: Mon Jun 18 09:45:03 1984
Date-Received: Wed, 20-Jun-84 01:14:12 EDT
Lines: 39

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