📄 vid_puts.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>vidattr</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_002_001_144"> </a>NAME</h4><blockquote>vidattr, vid_attr, vidputs, vid_puts - output attributes to the terminal</blockquote><h4><a name = "tag_002_001_145"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="curses.h.html">curses.h</a>>int vidattr(chtype <i>attr</i>);int vid_attr(attr_t <i>attr</i>, short <i>color_pair_number</i>, void <i>*opt</i>);int vidputs(chtype <i>attr</i>, int (*<i>putfunc</i>)(int));int vid_puts(attr_t <i>attr</i>, short <i>color_pair_number</i>, void <i>*opt</i>, int<br> (*<i>putfunc</i>)(int));</code></pre></blockquote><h4><a name = "tag_002_001_146"> </a>DESCRIPTION</h4><blockquote>These functions output commands to the terminal that change the terminal'sattributes.<p>If the <b>terminfo</b> database indicates that the terminal in use can displaycharacters in the rendition specified by <i>attr</i>, then<i>vidattr()</i>outputs one or more commands to request that the terminal display subsequentcharacters in that rendition. The function outputs by calling<i><a href="../xsh/putchar.html">putchar()</a></i>.The<i>vidattr()</i>function neither relies on nor updates the model which Cursesmaintains of the prior rendition mode.<p>The<i>vidputs()</i>function computes the same terminal output string that<i>vidattr()</i>does, based on <i>attr</i>, but<i>vidputs()</i>outputs by calling the user-supplied function<i>putfunc</i>.The<i>vid_attr()</i>and<i>vid_puts()</i>functions correspond to<i>vidattr()</i>and<i>vidputs()</i>respectively, but take a set ofarguments, one of type<b>attr_t</b>for the attributes, short forthe colour pair number and a void *, and thus support theattribute constants with the WA_ prefix.<p>The opts argument is reserved for definition in a futureedition of this document. Currently, the application mustprovide a null pointer as opts.<p>The user-supplied function<i>putfunc</i>(which can be specified as an argument to either<i>vidputs()</i>or<i>vid_puts()</i>)is either<i><a href="../xsh/putchar.html">putchar()</a></i>or some other function with the same prototype. Both the<i>vidputs()</i>and the<i>vid_puts()</i>function ignore the return value of<i>putfunc</i>.</blockquote><h4><a name = "tag_002_001_147"> </a>RETURN VALUE</h4><blockquote>Upon successful completion, these functions return OK.Otherwise, they return ERR.</blockquote><h4><a name = "tag_002_001_148"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_002_001_149"> </a>APPLICATION USAGE</h4><blockquote>After use of any of these functions, the model Cursesmaintains of the state of the terminal might not match the actual state of theterminal. The application should touch and refresh the window before resumingconventional use of Curses.<p>Use of these functions requires that the application contain so muchinformation about a particular class of terminal that it defeats the purposeof using Curses.<p>On some terminals, a command to change rendition conceptually occupies spacein the screen buffer (with or without width). Thus, a command to set theterminal to a new rendition would change the rendition of some charactersalready displayed.</blockquote><h4><a name = "tag_002_001_150"> </a>SEE ALSO</h4><blockquote><i><a href="doupdate.html">doupdate()</a></i>,<i><a href="is_linetouched.html">is_linetouched()</a></i>,<i><a href="../xsh/putchar.html">putchar()</a></i>(in the <b>XSH</b> specification),<i><a href="../xsh/putwchar.html">putwchar()</a></i>(in the <b>XSH</b> specification),<i><a href="tigetflag.html">tigetflag()</a></i>,<i><a href="curses.h.html"><curses.h></a></i>.<br></blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -