fix a stupid typo
[unix-history] / usr / src / lib / libcurses / printw.c
CommitLineData
113386fd
KA
1/*
2 * printw and friends
3 *
4 * %G% (Berkeley) @(#)printw.c 1.1
5 */
6
7# include "curses.ext"
8
9/*
10 * This routine implements a printf on the standard screen.
11 */
12printw(fmt, args)
13char *fmt;
14int args; {
15
16 return _sprintw(stdscr, fmt, &args);
17}
18
19/*
20 * This routine implements a printf on the given window.
21 */
22wprintw(win, fmt, args)
23WINDOW *win;
24char *fmt;
25int args; {
26
27 return _sprintw(win, fmt, &args);
28}
29/*
30 * This routine actually executes the printf and adds it to the window
31 *
32 * This is really a modified version of "sprintf". As such,
33 * it assumes that sprintf interfaces with the other printf functions
34 * in a certain way. If this is not how your system works, you
35 * will have to modify this routine to use the interface that your
36 * "sprintf" uses.
37 */
38_sprintw(win, fmt, args)
39WINDOW *win;
40char *fmt;
41int *args; {
42
43 FILE junk;
44 char buf[512];
45
46 junk._flag = _IOWRT + _IOSTRG;
47 junk._ptr = buf;
48 junk._cnt = 32767;
49 _doprnt(fmt, args, &junk);
50 putc('\0', &junk);
51 return waddstr(win, buf);
52}