📄 termcap.3
字号:
.\" Copyright (c) 1980 Regents of the University of California..\" All rights reserved. The Berkeley software License Agreement.\" specifies the terms and conditions for redistribution..\".\" @(#)termcap.3x 6.1 (Berkeley) 5/15/85.\".TH TERMCAP 3 "May 15, 1985".UC 4.SH NAMEtermcap, tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs \- terminal independent operation routines.SH SYNOPSIS.nf.ft B#include <termcap.h>int tgetent(char *\fIbp\fP, char *\fIname\fP)int tgetflag(char *\fIid\fP)int tgetnum(char *\fIid\fP)char *tgetstr(char *\fIid\fP, char **\fIarea\fP)char *tgoto(char *\fIcm\fP, int \fIdestcol\fP, int \fIdestline\fP)int tputs(char *\fIcp\fP, int \fIaffcnt\fP, void (*\fIoutc\fP)(int)).ft R.fi.SH DESCRIPTIONThese functions extract and use capabilities from the terminal capability database.BR termcap (5).These are low level routines;see.BR curses (3)for a higher level package..PP.B Tgetentextracts the entry for terminal.I nameinto the buffer at.IR bp ..I Bpshould be a character buffer of size1024 and must be retained through all subsequent callsto.BR tgetnum ,.BR tgetflag ,and.BR tgetstr ..B Tgetentreturns \-1 if it cannot find a termcapfile, 0 if the terminal name given does not have an entry,and 1 if all goes well..PP.B Tgetentuses the following recipe to find the termcap file and entry.IR name :.PP.in +5nif $TERMCAP is itself a termcap entry for.I name.brthen.in +5nuse $TERMCAP.in -5nelif $TERMCAP names a file.brthen.in +5nuse entry.I namefound in that file.in -5nelif this is Minix-vmd.brthen.in +5nif $TERMPATH is defined.brthen.in +5nsearch the termcap files named in $TERMPATH for the first occurance of a.I nameentry and use that entry.in -5nelse.in +5nthe path.B $HOME/.termcap:/etc/termcap:/usr/etc/termcap"is searched for entry.I name.in -5nfi.in -5nfi.in -5n.RE.PP.B Tgetnumgets the numeric value of capability.IR id ,returning \-1 if is not given for the terminal..B Tgetflagreturns 1 if the specified capability is present inthe terminal's entry, 0 if it is not..B Tgetstrreturns the string value of the capability.IR id ,places it in the buffer at.IR area ,and advances the.I areapointer.It decodes the abbreviations for this field described in.BR termcap (5),except for cursor addressing and padding information..B Tgetstrreturns NULL if the capability was not found..PP.B Tgotoreturns a cursor addressing string decoded from.I cmto go to column.I destcolin line.IR destline .It uses the external variables.B UP(from the \fBup\fR capability)and.B BC(if \fBbc\fR is given rather than \fBbs\fR)if necessary to avoid placing \fB\en\fR, \fB^D\fR or \fB^@\fR inthe returned string.(Programs which call tgoto should be sure to turn off the XTABS bit(s),since.B tgotomay now output a tab.Note that programs using termcap should in general turn off XTABSanyway since some terminals use CTRL-I for other functions,such as nondestructive space.)If a \fB%\fR sequence is given which is not understood, then.B tgotoreturns \*(lqOOPS\*(rq..PP.B Tputsdecodes the leading padding information of the string.IR cp ;.I affcntgives the number of lines affected by the operation, or 1 if this isnot applicable,.I outcis a routine which is called with each character in turn.The external variable.B ospeedshould contain the output speed of the terminal as encoded by.BR stty (3).The external variable.B PCshould contain a pad character to be used (from the \fBpc\fR capability)if a null (\fB^@\fR) is inappropriate..SH SEE ALSO.BR curses (3),.BR termcap (5)..SH AUTHORWilliam Joy.SH NOTESThe Minix implementation does not support any of the external variables,only the functions calls. The Minix-vmd termcap does support it all,although noone in his right mind meddles with those variables.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -