termios.h.html

来自「posix标准英文,html格式」· HTML 代码 · 共 828 行 · 第 1/2 页

HTML
828
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2004 IEEE and The Open Group, All Rights Reserved --><title>&lt;termios.h&gt;</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="&lt;termios.h&gt;"></a> <a name="tag_13_74"></a><!-- &lt;termios.h&gt; --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright &copy; 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_13_74_01"></a>NAME</h4><blockquote>termios.h - define values for termios</blockquote><h4><a name="tag_13_74_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><tt>#include &lt;termios.h&gt;</tt></p></blockquote><h4><a name="tag_13_74_03"></a>DESCRIPTION</h4><blockquote><p>The <i>&lt;termios.h&gt;</i> header contains the definitions used by the terminal I/O interfaces (see <a href="xbd_chap11.html#tag_11"><i>General Terminal Interface</i></a> for the structures and names defined).</p><h5><a name="tag_13_74_03_01"></a>The termios Structure</h5><p>The following data types shall be defined through <b>typedef</b>:</p><dl compact><dt><b>cc_t</b></dt><dd>Used for terminal special characters.</dd><dt><b>speed_t</b></dt><dd>Used for terminal baud rates.</dd><dt><b>tcflag_t</b></dt><dd>Used for terminal modes.</dd></dl><p>The above types shall be all unsigned integer types.</p><p>The implementation shall support one or more programming environments in which the widths of <b>cc_t</b>, <b>speed_t</b>, and<b>tcflag_t</b> are no greater than the width of type <b>long</b>. The names of these programming environments can be obtainedusing the <a href="../functions/confstr.html"><i>confstr</i>()</a> function or the <a href="../utilities/getconf.html"><i>getconf</i></a> utility.</p><p>The <b>termios</b> structure shall be defined, and shall include at least the following members:</p><pre><tt>tcflag_t  c_iflag    </tt> Input modes. <tt>tcflag_t  c_oflag    </tt> Output modes. <tt>tcflag_t  c_cflag    </tt> Control modes. <tt>tcflag_t  c_lflag    </tt> Local modes. <tt>cc_t      c_cc[NCCS] </tt> Control characters. <tt></tt></pre><p>A definition shall be provided for:</p><dl compact><dt>NCCS</dt><dd>Size of the array <i>c_cc</i> for control characters.</dd></dl><p>The following subscript names for the array <i>c_cc</i> shall be defined:</p><center><table border="1" cellpadding="3" align="center"><tr valign="top"><th colspan="2" align="center"><p class="tent"><b>Subscript Usage</b></p></th><th align="left"><p class="tent">&nbsp;</p></th></tr><tr valign="top"><th align="center"><p class="tent"><b>Canonical Mode</b></p></th><th align="center"><p class="tent"><b>Non-Canonical Mode</b></p></th><th align="center"><p class="tent"><b>Description</b></p></th></tr><tr valign="top"><td align="left"><p class="tent">VEOF</p></td><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">EOF character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VEOL</p></td><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">EOL character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VERASE</p></td><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">ERASE character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VINTR</p></td><td align="left"><p class="tent">VINTR</p></td><td align="left"><p class="tent">INTR character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VKILL</p></td><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">KILL character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">VMIN</p></td><td align="left"><p class="tent">MIN value.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VQUIT</p></td><td align="left"><p class="tent">VQUIT</p></td><td align="left"><p class="tent">QUIT character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VSTART</p></td><td align="left"><p class="tent">VSTART</p></td><td align="left"><p class="tent">START character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VSTOP</p></td><td align="left"><p class="tent">VSTOP</p></td><td align="left"><p class="tent">STOP character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">VSUSP</p></td><td align="left"><p class="tent">VSUSP</p></td><td align="left"><p class="tent">SUSP character.</p></td></tr><tr valign="top"><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent">VTIME</p></td><td align="left"><p class="tent">TIME value.</p></td></tr></table></center><p>The subscript values shall be unique, except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOLsubscripts, respectively.</p><p>The following flags shall be provided.</p><h5><a name="tag_13_74_03_02"></a>Input Modes</h5><p>The <i>c_iflag</i> field describes the basic terminal input control:</p><dl compact><dt>BRKINT</dt><dd>Signal interrupt on break.</dd><dt>ICRNL</dt><dd>Map CR to NL on input.</dd><dt>IGNBRK</dt><dd>Ignore break condition.</dd><dt>IGNCR</dt><dd>Ignore CR.</dd><dt>IGNPAR</dt><dd>Ignore characters with parity errors.</dd><dt>INLCR</dt><dd>Map NL to CR on input.</dd><dt>INPCK</dt><dd>Enable input parity check.</dd><dt>ISTRIP</dt><dd>Strip character.</dd><dt>IXANY</dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Enable any character to restart output. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>IXOFF</dt><dd>Enable start/stop input control.</dd><dt>IXON</dt><dd>Enable start/stop output control.</dd><dt>PARMRK</dt><dd>Mark parity errors.</dd></dl><h5><a name="tag_13_74_03_03"></a>Output Modes</h5><p>The <i>c_oflag</i> field specifies the system treatment of output:</p><dl compact><dt>OPOST</dt><dd>Post-process output.</dd><dt>ONLCR</dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Map NL to CR-NL on output.</dd><dt>OCRNL</dt><dd>Map CR to NL on output.</dd><dt>ONOCR</dt><dd>No CR output at column 0.</dd><dt>ONLRET</dt><dd>NL performs CR function.</dd><dt>OFILL</dt><dd>Use fill characters for delay.</dd><dt>NLDLY</dt><dd>Select newline delays: <dl compact><dt>NL0</dt><dd>Newline type 0.</dd><dt>NL1</dt><dd>Newline type 1.</dd></dl></dd><dt>CRDLY</dt><dd>Select carriage-return delays: <dl compact><dt>CR0</dt><dd>Carriage-return delay type 0.</dd><dt>CR1</dt><dd>Carriage-return delay type 1.</dd><dt>CR2</dt><dd>Carriage-return delay type 2.</dd><dt>CR3</dt><dd>Carriage-return delay type 3.</dd></dl></dd><dt>TABDLY</dt><dd>Select horizontal-tab delays: <dl compact><dt>TAB0</dt><dd>Horizontal-tab delay type 0.</dd><dt>TAB1</dt><dd>Horizontal-tab delay type 1.</dd><dt>TAB2</dt><dd>Horizontal-tab delay type 2.</dd><dt>TAB3</dt><dd>Expand tabs to spaces.</dd></dl></dd><dt>BSDLY</dt><dd>Select backspace delays: <dl compact><dt>BS0</dt><dd>Backspace-delay type 0.</dd><dt>BS1</dt><dd>Backspace-delay type 1.</dd></dl></dd><dt>VTDLY</dt><dd>Select vertical-tab delays: <dl compact><dt>VT0</dt>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?