blob: 9918f9df9a718918cc62edd9a56c6b09dc53cb66 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
4.\" Permission is hereby granted, free of charge, to any person obtaining a *
5.\" copy of this software and associated documentation files (the *
6.\" "Software"), to deal in the Software without restriction, including *
7.\" without limitation the rights to use, copy, modify, merge, publish, *
8.\" distribute, distribute with modifications, sublicense, and/or sell *
9.\" copies of the Software, and to permit persons to whom the Software is *
10.\" furnished to do so, subject to the following conditions: *
11.\" *
12.\" The above copyright notice and this permission notice shall be included *
13.\" in all copies or substantial portions of the Software. *
14.\" *
15.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22.\" *
23.\" Except as contained in this notice, the name(s) of the above copyright *
24.\" holders shall not be used in advertising or otherwise to promote the *
25.\" sale, use or other dealings in this Software without prior written *
26.\" authorization. *
27.\"***************************************************************************
28.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_printw.3x,v 1.20 2010/12/04 18:40:45 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_printw 3X ""
31.na
32.hy 0
33.SH NAME
34\fBprintw\fR,
35\fBwprintw\fR,
36\fBmvprintw\fR,
37\fBmvwprintw\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010038\fBvwprintw\fR, \fBvw_printw\fR \- print formatted output in \fBcurses\fR windows
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053039.ad
40.hy
41.SH SYNOPSIS
42\fB#include <curses.h>\fR
43.sp
44\fBint printw(const char *fmt, ...);\fR
45.br
46\fBint wprintw(WINDOW *win, const char *fmt, ...);\fR
47.br
48\fBint mvprintw(int y, int x, const char *fmt, ...);\fR
49.br
50\fBint mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);\fR
51.br
52\fBint vwprintw(WINDOW *win, const char *fmt, va_list varglist);\fR
53.br
54\fBint vw_printw(WINDOW *win, const char *fmt, va_list varglist);\fR
55.br
56.SH DESCRIPTION
57The \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR and \fBmvwprintw\fR
58routines are analogous to \fBprintf\fR [see \fBprintf\fR(3)]. In
59effect, the string that would be output by \fBprintf\fR is output
60instead as though \fBwaddstr\fR were used on the given window.
61.PP
62The \fBvwprintw\fR and \fBwv_printw\fR routines are analogous
63to \fBvprintf\fR [see \fBprintf\fR(3)]
64and perform a \fBwprintw\fR using a variable argument list.
65The third argument is a \fBva_list\fR, a pointer to a
66list of arguments, as defined in \fB<stdarg.h>\fR.
67.SH RETURN VALUE
68Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
69(SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
70completion.
71.PP
72X/Open defines no error conditions.
73In this implementation,
74an error may be returned if it cannot allocate enough memory for the
75buffer used to format the results.
76It will return an error if the window pointer is null.
Steve Kondikae271bc2015-11-15 02:50:53 +010077.PP
78Functions with a "mv" prefix first perform a cursor movement using
79\fBwmove\fP, and return an error if the position is outside the window,
80or if the window pointer is null.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053081.SH PORTABILITY
82The XSI Curses standard, Issue 4 describes these functions. The function
83\fBvwprintw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function
84\fBvw_printw\fR using the \fB<stdarg.h>\fR interface.
85The Single Unix Specification, Version 2 states that
86\fBvw_printw\fR is preferred to \fBvwprintw\fR since the latter requires
87including \fB<varargs.h>\fR, which
88cannot be used in the same file as \fB<stdarg.h>\fR.
89This implementation uses \fB<stdarg.h>\fR for both, because that header
90is included in \fB<curses.h\fR>.
91.SH SEE ALSO
92\fBcurses\fR(3X), \fBprintf\fR(3), \fBvprintf(3)\fR