del_curterm.html
来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 150 行
HTML
150 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>del_curterm</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_000_000_274"> </a>NAME</h4><blockquote>del_curterm, restartterm, set_curterm, setupterm- interfaces to the <b>terminfo</b> database</blockquote><h4><a name = "tag_000_000_275"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="term.h.html">term.h</a>>int del_curterm(TERMINAL *<i>oterm</i>);int restartterm(char *<i>term</i>, int <i>fildes</i>, int *<i>errret</i>);TERMINAL *set_curterm(TERMINAL *<i>nterm</i>);int setupterm(char *<i>term</i>, int <i>fildes</i>, int *<i>errret</i>);</code></pre></blockquote><h4><a name = "tag_000_000_276"> </a>DESCRIPTION</h4><blockquote>These functions retrieve information from the <b>terminfo</b> database.<p>To gain access to the <b>terminfo</b> database,<i><a href="setupterm.html">setupterm()</a></i>must be called first. It is automatically called by<i><a href="initscr.html">initscr()</a></i>and<i><a href="newterm.html">newterm()</a></i>.The<i><a href="setupterm.html">setupterm()</a></i>function initialises the other functions to use the <b>terminfo</b> record fora specified terminal (which depends on whether<i><a href="use_env.html">use_env()</a></i>was called). It sets the<i>cur_term</i>external variable to a <b>TERMINAL</b> structure that contains the record fromthe <b>terminfo</b> database for the specified terminal.<p>The terminal type is the character string <i>term;</i> if <i>term</i> is a nullpointer, the environment variable TERM is used. If TERM is not set or if itsvalue is an empty string, then "unknown" is used as the terminal type.The application must set fildes to a filedescriptor, open for output, to the terminal device, before calling<i><a href="setupterm.html">setupterm()</a></i>.If errret</i> is not null, the integer it points to is set to one of thefollowing values to report the function outcome:<dl compact><dt>-1<dd>The <b>terminfo</b> database was not found (function fails).<dt>0<dd>The entry for the terminal was not found in <b>terminfo</b> (function fails).<dt>1<dd>Success.</dl><p>If<i><a href="setupterm.html">setupterm()</a></i>detects an error and <i>errret</i> is a null pointer,<i><a href="setupterm.html">setupterm()</a></i>writes a diagnostic message and exits.<p>A simple call to<i><a href="setupterm.html">setupterm()</a></i>that uses all the defaults and sends the output to <i>stdout</i> is:<pre><code>setupterm((char *)0, fileno(stdout), (int *)0);</code></pre>The<i><a href="set_curterm.html">set_curterm()</a></i>function sets the variable <i>cur_term</i> to <i>nterm</i>, and makes all of the<b>terminfo</b> boolean, numeric, and string variables use the values from<i>nterm.</i><p>The<i>del_curterm()</i>function frees the space pointed to by <i>oterm</i> and makes it available forfurther use. If <i>oterm</i> is the same as <i>cur_term</i>, references to anyof the <b>terminfo</b> boolean, numeric, and string variables thereafter mayrefer to invalid memory locations until<i><a href="setupterm.html">setupterm()</a></i>is called again.<p>The<i><a href="restartterm.html">restartterm()</a></i>function assumes a previous call to<i><a href="setupterm.html">setupterm()</a></i>(perhaps from<i><a href="initscr.html">initscr()</a></i>or<i><a href="newterm.html">newterm()</a></i>).It lets the application specify a different terminal type in <i>term</i>and updates the information returned by<i><a href="baudrate.html">baudrate()</a></i>based on <i>fildes</i>, but does not destroy other information created by<i><a href="initscr.html">initscr()</a></i>,<i><a href="newterm.html">newterm()</a></i>or<i><a href="setupterm.html">setupterm()</a></i>.</blockquote><h4><a name = "tag_000_000_277"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i><a href="set_curterm.html">set_curterm()</a></i>returns the previous value of <i>cur_term</i>. Otherwise, it returns a nullpointer.<p>Upon successful completion, the other functions return OK. Otherwise, theyreturn ERR.</blockquote><h4><a name = "tag_000_000_278"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_000_279"> </a>APPLICATION USAGE</h4><blockquote>An application would call<i><a href="setupterm.html">setupterm()</a></i>if it required access to the <b>terminfo</b> database but did not otherwiseneed to use Curses.</blockquote><h4><a name = "tag_000_000_280"> </a>SEE ALSO</h4><blockquote><xref href=selecterm></xref><i><a href="baudrate.html">baudrate()</a></i>,<i><a href="erasechar.html">erasechar()</a></i>,<i><a href="has_ic.html">has_ic()</a></i>,<i><a href="longname.html">longname()</a></i>,<i><a href="../xsh/putc.html">putc()</a></i>,<i><a href="termattrs.html">termattrs()</a></i>,<i><a href="termname.html">termname()</a></i>,<i><a href="tgetent.html">tgetent()</a></i>,<i><a href="tigetflag.html">tigetflag()</a></i>,<i><a href="use_env.html">use_env()</a></i>,<i><a href="term.h.html"><term.h></a></i>.</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 + =
减小字号Ctrl + -
显示快捷键?