1 /* Public Domain Curses */
5 RCSID("$Id: printw.c,v 1.40 2008/07/13 16:08:18 wmcbrine Exp $")
7 /*man-start**************************************************************
12 int printw(const char *fmt, ...);
13 int wprintw(WINDOW *win, const char *fmt, ...);
14 int mvprintw(int y, int x, const char *fmt, ...);
15 int mvwprintw(WINDOW *win, int y, int x, const char *fmt,...);
16 int vwprintw(WINDOW *win, const char *fmt, va_list varglist);
17 int vw_printw(WINDOW *win, const char *fmt, va_list varglist);
20 The printw() functions add a formatted string to the window at
21 the current or specified cursor position. The format strings are
22 the same as used in the standard C library's printf(). (printw()
23 can be used as a drop-in replacement for printf().)
26 All functions return the number of characters printed, or
29 Portability X/Open BSD SYS V
37 **man-end****************************************************************/
41 int vwprintw(WINDOW
*win
, const char *fmt
, va_list varglist
)
46 PDC_LOG(("vwprintw() - called\n"));
49 len
= vsnprintf(printbuf
, 512, fmt
, varglist
);
51 len
= vsprintf(printbuf
, fmt
, varglist
);
53 return (waddstr(win
, printbuf
) == ERR
) ? ERR
: len
;
56 int printw(const char *fmt
, ...)
61 PDC_LOG(("printw() - called\n"));
64 retval
= vwprintw(stdscr
, fmt
, args
);
70 int wprintw(WINDOW
*win
, const char *fmt
, ...)
75 PDC_LOG(("wprintw() - called\n"));
78 retval
= vwprintw(win
, fmt
, args
);
84 int mvprintw(int y
, int x
, const char *fmt
, ...)
89 PDC_LOG(("mvprintw() - called\n"));
91 if (move(y
, x
) == ERR
)
95 retval
= vwprintw(stdscr
, fmt
, args
);
101 int mvwprintw(WINDOW
*win
, int y
, int x
, const char *fmt
, ...)
106 PDC_LOG(("mvwprintw() - called\n"));
108 if (wmove(win
, y
, x
) == ERR
)
112 retval
= vwprintw(win
, fmt
, args
);
118 int vw_printw(WINDOW
*win
, const char *fmt
, va_list varglist
)
120 PDC_LOG(("vw_printw() - called\n"));
122 return vwprintw(win
, fmt
, varglist
);