⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ledlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ledLib.html - generated by refgen from ledLib.c --> <title> ledLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference :  OS Libraries</i></a></p></blockquote><h1>ledLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ledLib</strong> - line-editing library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./ledLib.html#ledOpen">ledOpen</a>(&nbsp;)</b>  -  create a new line-editor ID<br><b><a href="./ledLib.html#ledClose">ledClose</a>(&nbsp;)</b>  -  discard the line-editor ID<br><b><a href="./ledLib.html#ledRead">ledRead</a>(&nbsp;)</b>  -  read a line with line-editing<br><b><a href="./ledLib.html#ledControl">ledControl</a>(&nbsp;)</b>  -  change the line-editor ID parameters<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides a line-editing layer on top of a <b>tty</b> device.The shell uses this interface for its history-editing features.<p>The shell history mechanism is similar to the UNIX Korn shell historyfacility, with a built-in line-editor similar to UNIX <b>vi</b> that allowspreviously typed commands to be edited.  The command <b><a href="./usrLib.html#h">h</a>(&nbsp;)</b> displays the 20most recent commands typed into the shell; old commands fall off the topas new ones are entered.<p>To edit a command, type ESC to enter edit mode, and use the commandslisted below.  The ESC key switches the shell to edit mode.  The RETURNkey always gives the line to the shell from either editing or input mode.<p>The following list is a summary of the commands available in edit mode.<p><table><tr valign=top><td align=left>Movement and search commands:</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><i>n</i>G </td><td align=left> - Go to command number <i>n</i>.</tr><tr valign=top><td align=left>/<i>s</i> </td><td align=left> - Search for string <i>s</i> backward in history.</tr><tr valign=top><td align=left>?<i>s</i> </td><td align=left> - Search for string <i>s</i> forward in history.</tr><tr valign=top><td align=left>n </td><td align=left> - Repeat last search.</tr><tr valign=top><td align=left>N </td><td align=left> - Repeat last search in opposite direction.</tr><tr valign=top><td align=left><i>n</i>k </td><td align=left> - Get <i>n</i>th previous shell command in history.</tr><tr valign=top><td align=left><i>n</i>- </td><td align=left> - Same as "k".</tr><tr valign=top><td align=left><i>n</i>j </td><td align=left> - Get <i>n</i>th next shell command in history.</tr><tr valign=top><td align=left><i>n</i>+ </td><td align=left> - Same as "j".</tr><tr valign=top><td align=left><i>n</i>h </td><td align=left> - Move left <i>n</i> characters.</tr><tr valign=top><td align=left>CTRL-H </td><td align=left> - Same as "h".</tr><tr valign=top><td align=left><i>n</i>l </td><td align=left> - Move right <i>n</i> characters.</tr><tr valign=top><td align=left>\f1SPACE\fP </td><td align=left> - Same as "l".</tr><tr valign=top><td align=left><i>n</i>w </td><td align=left> - Move <i>n</i> words forward.</tr><tr valign=top><td align=left><i>n</i>W </td><td align=left> - Move <i>n</i> blank-separated words forward.</tr><tr valign=top><td align=left><i>n</i>e </td><td align=left> - Move to end of the <i>n</i>th next word.</tr><tr valign=top><td align=left><i>n</i>E </td><td align=left> - Move to end of the <i>n</i>th next blank-separated word.</tr><tr valign=top><td align=left><i>n</i>b </td><td align=left> - Move back <i>n</i> words.</tr><tr valign=top><td align=left><i>n</i>B </td><td align=left> - Move back <i>n</i> blank-separated words.</tr><tr valign=top><td align=left>f<i>c</i> </td><td align=left> - Find character <i>c</i>, searching forward.</tr><tr valign=top><td align=left>F<i>c</i> </td><td align=left> - Find character <i>c</i>, searching backward.</tr><tr valign=top><td align=left>^ </td><td align=left> - Move cursor to first non-blank character in line.</tr><tr valign=top><td align=left>$ </td><td align=left> - Go to end of line.</tr><tr valign=top><td align=left>0 </td><td align=left> - Go to beginning of line.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left></tr></tr></table><table><tr valign=top><td align=left>Insert commands (input is expected until an ESC is typed):</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>a </td><td align=left> - Append.</tr><tr valign=top><td align=left>A </td><td align=left> - Append at end of line.</tr><tr valign=top><td align=left>c \f1SPACE\fP </td><td align=left> - Change character.</tr><tr valign=top><td align=left>cl </td><td align=left> - Change character.</tr><tr valign=top><td align=left>cw </td><td align=left> - Change word.</tr><tr valign=top><td align=left>cc </td><td align=left> - Change entire line.</tr><tr valign=top><td align=left>c$ </td><td align=left> - Change everything from cursor to end of line.</tr><tr valign=top><td align=left>C </td><td align=left> - Same as "c$".</tr><tr valign=top><td align=left>S </td><td align=left> - Same as "cc".</tr><tr valign=top><td align=left>i </td><td align=left> - Insert.</tr><tr valign=top><td align=left>I </td><td align=left> - Insert at beginning of line.</tr><tr valign=top><td align=left>R </td><td align=left> - Type over characters.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left></tr></tr></table><table><tr valign=top><td align=left>Editing commands:</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><i>n</i>r<i>c</i> </td><td align=left> - Replace the following <i>n</i> characters with <i>c</i>.</tr><tr valign=top><td align=left><i>n</i>x </td><td align=left> - Delete <i>n</i> characters starting at cursor.</tr><tr valign=top><td align=left><i>n</i>X </td><td align=left> - Delete <i>n</i> characters to the left of the cursor.</tr><tr valign=top><td align=left>d \f1SPACE\fP </td><td align=left> - Delete character.</tr><tr valign=top><td align=left>dl </td><td align=left> - Delete character.</tr><tr valign=top><td align=left>dw </td><td align=left> - Delete word.</tr><tr valign=top><td align=left>dd </td><td align=left> - Delete entire line.</tr><tr valign=top><td align=left>d$ </td><td align=left> - Delete everything from cursor to end of line.</tr><tr valign=top><td align=left>D </td><td align=left> - Same as "d$".</tr><tr valign=top><td align=left>p </td><td align=left> - Put last deletion after the cursor.</tr><tr valign=top><td align=left>P </td><td align=left> - Put last deletion before the cursor.</tr><tr valign=top><td align=left>u </td><td align=left> - Undo last command.</tr><tr valign=top><td align=left>~ </td><td align=left> - Toggle case, lower to upper or vice versa.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left></tr></tr></table><table><tr valign=top><td align=left>Special commands:</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>CTRL-U </td><td align=left> - Delete line and leave edit mode.</tr><tr valign=top><td align=left>CTRL-L </td><td align=left> - Redraw line.</tr><tr valign=top><td align=left>CTRL-D </td><td align=left> - Complete symbol name.</tr><tr valign=top><td align=left>\f1RETURN\fP </td><td align=left> - Give line to shell and leave edit mode.</tr><tr valign=top><td align=left></tr></tr></table>The default value for <i>n</i> is 1.<p></blockquote><h4>DEFICIENCIES</h4><blockquote><p>Since the shell toggles between raw mode and line mode, type-ahead can belost.  The ESC, redraw, and non-printable characters are built-in.  TheEOF, backspace, and line-delete are not imported well from <b><a href="./tyLib.html#top">tyLib</a></b>.Instead, <b><a href="./tyLib.html#top">tyLib</a></b> should supply and/or support these charactersvia <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b>.<p>Some commands do not take counts as users might expect.  For example,"<i>n</i>i" will not insert whatever was entered <i>n</i> times.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>ledLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><p><i>VxWorks Programmer's Guide: Shell </i><p><hr><a name="ledOpen"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ledOpen(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ledOpen(&nbsp;)</strong> - create a new line-editor ID</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ledOpen    (    int inFd,                 /* low-level device input fd */    int outFd,                /* low-level device output fd */    int histSize              /* size of history list */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates the ID that is used by <b><a href="./ledLib.html#ledRead">ledRead</a>(&nbsp;)</b>, <b><a href="./ledLib.html#ledClose">ledClose</a>(&nbsp;)</b>, and<b><a href="./ledLib.html#ledControl">ledControl</a>(&nbsp;)</b>.  Storage is allocated for up to <i>histSize</i> previously readlines.<p></blockquote><h4>RETURNS</h4><blockquote><p>The line-editor ID, or ERROR if the routine runs out of memory.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ledLib.html#top">ledLib</a></b>, <b><a href="./ledLib.html#ledRead">ledRead</a>(&nbsp;)</b>, <b><a href="./ledLib.html#ledClose">ledClose</a>(&nbsp;)</b>, <b><a href="./ledLib.html#ledControl">ledControl</a>(&nbsp;)</b><hr><a name="ledClose"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ledClose(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ledClose(&nbsp;)</strong> - discard the line-editor ID</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ledClose    (    int led_id                /* ID returned by ledOpen */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine frees resources allocated by <b><a href="./ledLib.html#ledOpen">ledOpen</a>(&nbsp;)</b>.  The low-levelinput/output file descriptors are not closed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ledLib.html#top">ledLib</a></b>, <b><a href="./ledLib.html#ledOpen">ledOpen</a>(&nbsp;)</b><hr><a name="ledRead"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ledRead(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ledRead(&nbsp;)</strong> - read a line with line-editing</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ledRead    (    int    led_id,            /* ID returned by ledOpen */    char * string,            /* where to return line */    int    maxBytes           /* maximum number of chars to read */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine handles line-editing and history substitutions.If the low-level input file descriptor is not in <b>OPT_LINE</b> mode,only an ordinary <b><a href="./ioLib.html#read">read</a>(&nbsp;)</b> routine will be performed.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of characters read, or EOF.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ledLib.html#top">ledLib</a></b><hr><a name="ledControl"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ledControl(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ledControl(&nbsp;)</strong> - change the line-editor ID parameters</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ledControl    (    int led_id,               /* ID returned by ledOpen */    int inFd,                 /* new input fd (NONE = no change) */    int outFd,                /* new output fd (NONE = no change) */    int histSize              /* new history list size (NONE = no */                              /* change), (0 = display) */     )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the input/output filedescriptor and the size of the history list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ledLib.html#top">ledLib</a></b></body></html>

⌨️ 快捷键说明

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