* Copyright (c) 1981 Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)printw.c 5.8 (Berkeley) %G%";
* These routines make nonportable assumptions about varargs if __STDC__
* This routine implements a printf on the standard screen.
printw(const char *fmt
, ...)
ret
= _sprintw(stdscr
, fmt
, ap
);
* This routine implements a printf on the given window.
wprintw(WINDOW
*win
, const char *fmt
, ...)
wprintw(win
, fmt
, va_alist
)
ret
= _sprintw(win
, fmt
, ap
);
* Internal write-buffer-to-window function.
_winwrite(cookie
, buf
, n
)
register WINDOW
*win
= (WINDOW
*)cookie
;
if (waddch(win
, *buf
++) == ERR
)
* This routine actually executes the printf and adds it to the window.
* It must not be declared static as it is used in mvprintw.c.
* THIS SHOULD BE RENAMED vwprintw AND EXPORTED
if ((f
= fwopen((void *)win
, _winwrite
)) == NULL
)
(void) vfprintf(f
, fmt
, ap
);
return fclose(f
) ? ERR
: OK
;