]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_printw.3x
ncurses 6.2 - patch 20200212
[ncurses.git] / man / curs_printw.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 1998-2010,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_printw.3x,v 1.25 2020/02/02 23:34:34 tom Exp $
31 .TH curs_printw 3X ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de bP
37 .ie n  .IP \(bu 4
38 .el    .IP \(bu 2
39 ..
40 .na
41 .hy 0
42 .SH NAME
43 \fBprintw\fR,
44 \fBwprintw\fR,
45 \fBmvprintw\fR,
46 \fBmvwprintw\fR,
47 \fBvwprintw\fR, \fBvw_printw\fR \- print formatted output in \fBcurses\fR windows
48 .ad
49 .hy
50 .SH SYNOPSIS
51 \fB#include <curses.h>\fR
52 .sp
53 \fBint printw(const char *fmt, ...);\fR
54 .br
55 \fBint wprintw(WINDOW *win, const char *fmt, ...);\fR
56 .br
57 \fBint mvprintw(int y, int x, const char *fmt, ...);\fR
58 .br
59 \fBint mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);\fR
60 .br
61 \fBint vw_printw(WINDOW *win, const char *fmt, va_list varglist);\fR
62 .sp
63 /* obsolete */
64 .br
65 \fBint vwprintw(WINDOW *win, const char *fmt, va_list varglist);\fR
66 .SH DESCRIPTION
67 The \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR and \fBmvwprintw\fR
68 routines are analogous to \fBprintf\fR [see \fBprintf\fR(3)].
69 In
70 effect, the string that would be output by \fBprintf\fR is output
71 instead as though \fBwaddstr\fR were used on the given window.
72 .PP
73 The \fBvwprintw\fR and \fBwv_printw\fR routines are analogous
74 to \fBvprintf\fR [see \fBprintf\fR(3)]
75 and perform a \fBwprintw\fR using a variable argument list.
76 The third argument is a \fBva_list\fR, a pointer to a
77 list of arguments, as defined in \fB<stdarg.h>\fR.
78 .SH RETURN VALUE
79 Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
80 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
81 completion.
82 .PP
83 X/Open defines no error conditions.
84 In this implementation,
85 an error may be returned if it cannot allocate enough memory for the
86 buffer used to format the results.
87 It will return an error if the window pointer is null.
88 .PP
89 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
90 \fBwmove\fP, and return an error if the position is outside the window,
91 or if the window pointer is null.
92 .SH PORTABILITY
93 In this implementation, \fBvw_printw\fP and \fBvwprintw\fP are equivalent,
94 to support legacy applications.
95 However, the latter (\fBvwprintw\fP) is obsolete:
96 .bP
97 The XSI Curses standard, Issue 4 described these functions.
98 The function
99 \fBvwprintw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function
100 \fBvw_printw\fR using the \fB<stdarg.h>\fR interface.
101 .bP
102 The Single Unix Specification, Version 2 states that
103 \fBvw_printw\fR  is preferred to \fBvwprintw\fR since the latter requires
104 including \fB<varargs.h>\fR, which
105 cannot be used in the same file as \fB<stdarg.h>\fR.
106 This implementation uses \fB<stdarg.h>\fR for both,
107 because that header is included in \fB<curses.h\fR>.
108 .bP
109 X/Open Curses, Issue 5 (December 2007) marked \fBvwprintw\fP (along with
110 \fBvwscanw\fP and the termcap interface) as withdrawn.
111 .SH SEE ALSO
112 .na
113 \fBcurses\fR(3X),
114 \fBcurs_addstr\fR(3X),
115 \fBcurs_scanw\fR(3X),
116 \fBcurs_termcap\fP(3X),
117 \fBprintf\fR(3),
118 \fBvprintf\fR(3).