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

📄 ncurses.3x

📁 ncurses-5.4
💻 3X
📖 第 1 页 / 共 3 页
字号:
.SH RETURN VALUERoutines that return an integer return \fBERR\fR upon failure and aninteger value other than \fBERR\fR upon successful completion, unlessotherwise noted in the routine descriptions..PPAll macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR.  The returnvalues of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and\fBgetmaxyx\fR are undefined (i.e., these should not be used as theright-hand side of assignment statements)..PPRoutines that return pointers return \fBNULL\fR on error..SH ENVIRONMENTThe following environment symbols are useful for customizing theruntime behavior of the \fBncurses\fR library.  The most importantones have been already discussed in detail..TP 5BAUDRATEThe debugging library checks this environment symbol when the applicationhas redirected output to a file.The symbol's numeric value is used for the baudrate.If no value is found, \fBncurses\fR uses 9600.This allows testers to construct repeatable test-casesthat take into account costs that depend on baudrate..TP 5CCWhen set, change occurrences of the command_character(i.e., the \fBcmdch\fP capability)of the loaded terminfo entries to the value of this symbol.Very few terminfo entries provide this feature..TP 5COLUMNSSpecify the width of the screen in characters.Applications running in a windowing environment usually are able toobtain the width of the window in which they are executing.If neither the $COLUMNS value nor the terminal's screen size is available,\fBncurses\fR uses the size which may be specified in the terminfo database(i.e., the \fBcols\fR capability)..IPIt is important that your application use a correct size for the screen.However, this is not always possible because your application may berunning on a host which does not honor NAWS (Negotiations About WindowSize), or because you are temporarily running as another user..IPEither COLUMNS or LINES symbols may be specified independently.This is mainly useful to circumvent legacy misfeatures of terminal descriptions,e.g., xterm which commonly specifies a 65 line screen.For best results, \fBlines\fR and \fBcols\fR should not be specified ina terminal description for terminals which are run as emulations..IPUse the \fBuse_env\fR function to disable this feature..TP 5ESCDELAYSpecifies the total time, in milliseconds, for which ncurses willawait a character sequence, e.g., a function key.The default value, 1000 milliseconds, is enough for most uses.However, it is made a variable to accommodate unusual applications..IPThe most common instance where you may wish to change this valueis to work with slow hosts, e.g., running on a network.If the host cannot read characters rapidly enough, it will have the sameeffect as if the terminal did not send characters rapidly enough.The library will still see a timeout..IPNote that xterm mouse events are built up from character sequencesreceived from the xterm.If your application makes heavy use of multiple-clicking, you maywish to lengthen this default value because the timeout appliesto the composed multi-click event as well as the individual clicks..TP 5HOMETells \fBncurses\fR where your home directory is.That is where it may read and write auxiliary terminal descriptions:.IP$HOME/.termcap.br$HOME/.terminfo.TP 5LINESLike COLUMNS, specify the height of the screen in characters.See COLUMNS for a detailed description..TP 5MOUSE_BUTTONS_123This applies only to the OS/2 EMX port.It specifies the order of buttons on the mouse.OS/2 numbers a 3-button mouse inconsistently from otherplatforms:.sp1 = left.br2 = right.br3 = middle..spThis symbol lets you customize the mouse.The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.If it is not specified, \fBncurses\fR uses 132..TP 5NCURSES_ASSUMED_COLORSOverride the compiled-in assumption that theterminal's default colors are white-on-black(see \fBassume_default_colors\fR(3X)).You may set the foreground and background color values with this environmentvariable by proving a 2-element list: foreground,background.For example, to tell ncurses to not assume anythingabout the colors, set this to "-1,-1".To make it green-on-black, set it to "2,0".Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed..TP 5NCURSES_NO_PADDINGMost of the terminal descriptions in the terminfo database are writtenfor real "hardware" terminals.Many people use terminal emulatorswhich run in a windowing environment and use curses-based applications.Terminal emulators can duplicateall of the important aspects of a hardware terminal, but they do nothave the same limitations.The chief limitation of a hardware terminal from the standpointof your application is the management of dataflow, i.e., timing.Unless a hardware terminal is interfaced into a terminal concentrator(which does flow control),it (or your application) must manage dataflow, preventing overruns.The cheapest solution (no hardware cost)is for your program to do this by pausing afteroperations that the terminal does slowly, such as clearing the display..IPAs a result, many terminal descriptions (including the vt100)have delay times embedded.  You may wish to use these descriptions,but not want to pay the performance penalty..IPSet the NCURSES_NO_PADDING symbol to disable all but mandatorypadding.  Mandatory padding is used as a part of special controlsequences such as \fIflash\fR..TP 5NCURSES_NO_SETBUFNormally \fBncurses\fR enables buffered output during terminal initialization.This is done (as in SVr4 curses) for performance reasons.For testing purposes, both of \fBncurses\fR and certain applications,this feature is made optional.  Setting the NCURSES_NO_SETBUF variabledisables output buffering, leaving the output in the original (usuallyline buffered) mode..TP 5NCURSES_TRACEDuring initialization, the \fBncurses\fR debugging librarychecks the NCURSES_TRACE symbol.If it is defined, to a numeric value, \fBncurses\fR calls the \fBtrace\fRfunction, using that value as the argument..IPThe argument values, which are defined in \fBcurses.h\fR, provide severaltypes of information.When running with traces enabled, your application will write thefile \fBtrace\fR to the current directory..TP 5TERMDenotes your terminal type.Each terminal type is distinct, though many are similar..TP 5TERMCAPIf the \fBncurses\fR library has been configured with \fItermcap\fRsupport, \fBncurses\fR will check for a terminal's description intermcap form if it is not available in the terminfo database..IPThe TERMCAP symbol contains either a terminal description (withnewlines stripped out),or a file name telling where the information denoted by the TERM symbol exists.In either case, setting it directs \fBncurses\fR to ignorethe usual place for this information, e.g., /etc/termcap..TP 5TERMINFOOverrides the directory in which \fBncurses\fR searches for your terminaldescription.This is the simplest, but not the only way to change the list of directories.The complete list of directories in order follows:.RS.TP 3-the last directory to which \fBncurses\fR wrote, if any, is searched first.TP 3-the directory specified by the TERMINFO symbol.TP 3-$HOME/.terminfo.TP 3-directories listed in the TERMINFO_DIRS symbol.TP 3-one or more directories whose names are configured and compiled into thencurses library, e.g.,@TERMINFO@.RE.TP 5TERMINFO_DIRSSpecifies a list of directories to search for terminal descriptions.The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.All of the terminal descriptions are in terminfo form, which makesa subdirectory named for the first letter of the terminal names therein..TP 5TERMPATHIf TERMCAP does not hold a file name then \fBncurses\fR checksthe TERMPATH symbol.This is a list of filenames separated by spaces or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.If the TERMPATH symbol is not set, \fBncurses\fR looks in the files/etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order..PPThe library may be configured to disregard the following variables when thecurrent user is the superuser (root), or if the application uses setuid orsetgid permissions:$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME..SH FILES.TP 5@DATADIR@/tabsetdirectory containing initialization files for the terminal capability database@TERMINFO@terminal capability database.SH SEE ALSO\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routinedescriptions..SH EXTENSIONSThe \fBncurses\fR library can be compiled with an option (\fB\-DUSE_GETCAP\fR)that falls back to the old-style /etc/termcap file if the terminal setup codecannot find a terminfo entry corresponding to \fBTERM\fR.  Use of this featureis not recommended, as it essentially includes an entire termcap compiler inthe \fBncurses\fR startup code, at significant cost in core and startup cycles..PPThe \fBncurses\fR library includes facilities for capturing mouse events oncertain terminals (including xterm). See the \fBcurs_mouse\fR(3X)manual page for details..PPThe \fBncurses\fR library includes facilities for responding to windowresizing events, e.g., when running in an xterm.See the \fBresizeterm\fR(3X)and \fBwresize\fR(3X) manual pages for details.In addition, the library may be configured with a SIGWINCH handler..PPThe \fBncurses\fR library extends the fixed set of function key capabilitiesof terminals by allowing the application designer to define additionalkey sequences at runtime.See the \fBdefine_key\fR(3X)\fBkey_defined\fR(3X),and \fBkeyok\fR(3X) manual pages for details..PPThe \fBncurses\fR library can exploit the capabilities of terminals whichimplement the ISO-6429 SGR 39 and SGR 49 controls, which allow an applicationto reset the terminal to its original foreground and background colors.From the users' perspective, the application is able to draw coloredtext on a background whose color is set independently, providing bettercontrol over color contrasts.See the \fBdefault_colors\fR(3X) manual page for details..PPThe \fBncurses\fR library includes a function for directing application outputto a printer attached to the terminal device.  See the \fBcurs_print\fR(3X)manual page for details..SH PORTABILITYThe \fBncurses\fR library is intended to be BASE-level conformant with the XSICurses standard.  The EXTENDED XSI Curses functionality(including color support) is supported..PPA small number of local differences (that is, individual differences betweenthe XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fRsections of the library man pages..PPThe routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4.  Seethe \fBcurs_getch\fR(3X) manual page for details..PPThe routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4.  Seethe \fBcurs_slk\fR(3X) manual page for details..PPThe routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are notpart of XPG4, nor are they present in SVr4.  See the \fBcurs_mouse\fR(3X)manual page for details..PPThe routine \fBmcprint\fR was not present in any previous cursesimplementation.  See the \fBcurs_print\fR(3X) manual page for details..PPThe routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4.  Seethe \fBwresize\fR(3X) manual page for details..PPIn historic curses versions, delays embedded in the capabilities \fBcr\fR,\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delaybits in the UNIX tty driver.  In this implementation, all padding is done byNUL sends.  This method is slightly more expensive, but narrows the interfaceto the UNIX kernel significantly and increases the package's portabilitycorrespondingly..SH NOTESThe header file \fB<curses.h>\fR automatically includes the header files\fB<stdio.h>\fR and \fB<unctrl.h>\fR..PPIf standard output from a \fBncurses\fR program is re-directed to somethingwhich is not a tty, screen updates will be directed to standard error.  Thiswas an undocumented feature of AT&T System V Release 3 curses..SH AUTHORSZeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.Based on pcurses by Pavel Curtis..\"#.\"# The following sets edit modes for GNU EMACS.\"# Local Variables:.\"# mode:nroff.\"# fill-column:79.\"# End:

⌨️ 快捷键说明

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