ncurses 6.1 - patch 20191130
[ncurses.git] / doc / html / man / curs_printw.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2018,2019 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   * @Id: curs_printw.3x,v 1.24 2019/11/30 21:06:30 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_printw 3x</TITLE>
37 <link rel="author" href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_printw 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>                                                <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>printw</STRONG>, <STRONG>wprintw</STRONG>, <STRONG>mvprintw</STRONG>, <STRONG>mvwprintw</STRONG>, <STRONG>vwprintw</STRONG>, <STRONG>vw_printw</STRONG> - print
50        formatted output in <STRONG>curses</STRONG> windows
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56        <STRONG>int</STRONG> <STRONG>printw(const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>...);</STRONG>
57        <STRONG>int</STRONG> <STRONG>wprintw(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>...);</STRONG>
58        <STRONG>int</STRONG> <STRONG>mvprintw(int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>...);</STRONG>
59        <STRONG>int</STRONG> <STRONG>mvwprintw(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>...);</STRONG>
60        <STRONG>int</STRONG> <STRONG>vw_printw(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>va_list</STRONG> <STRONG>varglist);</STRONG>
61
62        /* obsolete */
63        <STRONG>int</STRONG> <STRONG>vwprintw(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*fmt,</STRONG> <STRONG>va_list</STRONG> <STRONG>varglist);</STRONG>
64
65
66 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
67        The <STRONG>printw</STRONG>, <STRONG>wprintw</STRONG>, <STRONG>mvprintw</STRONG> and <STRONG>mvwprintw</STRONG> routines are  analogous  to
68        <STRONG>printf</STRONG>  [see <STRONG>printf(3)</STRONG>].  In effect, the string that would be output by
69        <STRONG>printf</STRONG> is output instead as though <STRONG>waddstr</STRONG> were used on the given  win-
70        dow.
71
72        The  <STRONG>vwprintw</STRONG>  and  <STRONG>wv_printw</STRONG>  routines  are  analogous to <STRONG>vprintf</STRONG> [see
73        <STRONG>printf(3)</STRONG>] and perform a <STRONG>wprintw</STRONG> using a variable argument  list.   The
74        third  argument  is a <STRONG>va_list</STRONG>, a pointer to a list of arguments, as de-
75        fined in <STRONG>&lt;stdarg.h&gt;</STRONG>.
76
77
78 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
79        Routines that return an integer return <STRONG>ERR</STRONG> upon failure  and  <STRONG>OK</STRONG>  (SVr4
80        only  specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
81        pletion.
82
83        X/Open defines no error conditions.  In this implementation,  an  error
84        may be returned if it cannot allocate enough memory for the buffer used
85        to format the results.  It will return an error if the  window  pointer
86        is null.
87
88        Functions  with  a  "mv"  prefix  first perform a cursor movement using
89        <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
90        the window pointer is null.
91
92
93 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
94        In  this implementation, <STRONG>vw_printw</STRONG> and <STRONG>vwprintw</STRONG> are equivalent, to sup-
95        port legacy applications.  However, the latter (<STRONG>vwprintw</STRONG>) is obsolete:
96
97        <STRONG>o</STRONG>   The XSI Curses standard, Issue 4 described  these  functions.   The
98            function  <STRONG>vwprintw</STRONG> is marked TO BE WITHDRAWN, and is to be replaced
99            by a function <STRONG>vw_printw</STRONG> using the <STRONG>&lt;stdarg.h&gt;</STRONG> interface.
100
101        <STRONG>o</STRONG>   The Single Unix Specification, Version 2 states that <STRONG>vw_printw</STRONG>   is
102            preferred   to   <STRONG>vwprintw</STRONG>   since  the  latter  requires  including
103            <STRONG>&lt;varargs.h&gt;</STRONG>, which cannot be used in the same file  as  <STRONG>&lt;stdarg.h&gt;</STRONG>.
104            This  implementation  uses <STRONG>&lt;stdarg.h&gt;</STRONG> for both, because that header
105            is included in <STRONG>&lt;curses.h</STRONG>&gt;.
106
107        <STRONG>o</STRONG>   X/Open Curses, Issue 5 (December 2007) marked <STRONG>vwprintw</STRONG> (along  with
108            <STRONG>vwscanw</STRONG> and the termcap interface) as withdrawn.
109
110
111 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
112        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, <STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3x)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>,
113        <STRONG>printf(3)</STRONG>, <STRONG>vprintf(3)</STRONG>.
114
115
116
117                                                                <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>
118 </PRE>
119 <div class="nav">
120 <ul>
121 <li><a href="#h2-NAME">NAME</a></li>
122 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
123 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
124 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
125 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
126 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
127 </ul>
128 </div>
129 </BODY>
130 </HTML>