diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-12-09 05:54:53 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-12-09 05:54:53 +0000 |
commit | 49ac4cb4369b59297c067ed22daacd240c981029 (patch) | |
tree | c419ae9b12b445c835fe589b79a0e772d5082ed0 /lib/libtermlib/terminfo.3 | |
parent | 341b9ccaae810b1f2d3f13e68ad74edcd40957ca (diff) |
Minor mdoc cleanup.
Diffstat (limited to 'lib/libtermlib/terminfo.3')
-rw-r--r-- | lib/libtermlib/terminfo.3 | 172 |
1 files changed, 87 insertions, 85 deletions
diff --git a/lib/libtermlib/terminfo.3 b/lib/libtermlib/terminfo.3 index ce9ddf1a51c..e7543cd7dea 100644 --- a/lib/libtermlib/terminfo.3 +++ b/lib/libtermlib/terminfo.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: terminfo.3,v 1.2 1997/11/29 05:09:35 millert Exp $ +.\" $OpenBSD: terminfo.3,v 1.3 1997/12/09 05:54:52 millert Exp $ .\" .\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> .\" All rights reserved. @@ -87,25 +87,25 @@ programming function keys. For all other functionality, routines are more suitable and their use is recommended. .Pp Initially, -.Nm setupterm +.Fn setupterm should be called. Note that -.Nm setupterm +.Fn setupterm is automatically called by -.Nm initscr +.Fn initscr and -.Nm newterm . +.Fn newterm . This defines the set of terminal-dependent variables [listed in .Xr terminfo 5 ]. The -.Nm terminfo +.Fn terminfo variables .Dv lines and .Dv columns are initialized by -.Nm setupterm +.Fn setupterm as follows: If -.Nm use_env(FALSE) +.Fn use_env FALSE has been called, values for .Dv lines and @@ -131,17 +131,17 @@ The header file .Nm term.h should be included to get the definitions for these strings, numbers, and flags. Parameterized strings should be passed through -.Nm tparm +.Fn tparm to instantiate them. All .Nm terminfo strings [including the output of -.Nm tparm ] +.Fn tparm ] should be printed with -.Nm tputs +.Fn tputs or -.Nm putp . +.Fn putp . Call the -.Nm reset_shell_mode +.Fn reset_shell_mode function to restore the tty modes before exiting [see .Xr curs_kernel 3 ]. Programs which use cursor addressing should output @@ -149,17 +149,17 @@ Programs which use cursor addressing should output upon startup and should output .Nm exit_ca_mode before exiting. Programs desiring shell escapes should call -.Nm reset_shell_mode +.Fn reset_shell_mode and output .Nm exit_ca_mode before the shell is called and should output .Nm enter_ca_mode and call -.Nm reset_prog_mode +.Fn reset_prog_mode after returning from the shell. .Pp The -.Nm setupterm +.Fn setupterm routine reads in the .Nm terminfo database, initializing the @@ -168,27 +168,27 @@ structures, but does not set up the output virtualization structures used by .Xr curses 3 . The terminal type is the character string -.Dv term ; +.Ar term ; if -.Dv term +.Ar term is null, the environment variable .Ev TERM is used. All output is to file descriptor -.Dv fildes +.Ar fildes which is initialized for output. If -.Dv errret +.Ar errret is not null, then -.Nm setupterm +.Fn setupterm returns .Dv OK or .Dv ERR and stores a status value in the integer pointed to by -.Dv errret . +.Ar errret . A status of .Li 1 in -.Dv errret +.Ar errret is normal, .Li 0 means that the terminal could not be found, and @@ -196,9 +196,9 @@ means that the terminal could not be found, and means that the .Nm terminfo database could not be found. If -.Dv errret +.Ar errret is null, -.Nm setupterm +.Fn setupterm prints an error message upon finding an error and exits. Thus, the simplest call is: .Bd -literal -offset indent @@ -209,9 +209,9 @@ which uses all the defaults and sends the output to .Dv stdout . .Pp The -.Nm setterm +.Fn setterm routine is being replaced by -.Nm setupterm . +.Fn setupterm . The call: .Bd -literal -offset indent setupterm(term, 1, (int *)0); @@ -223,44 +223,44 @@ setterm(term); .Ed The -.Nm setterm +.Fn setterm routine is included here for BSD compatibility, and is not recommended for new programs. .Pp The -.Nm set_curterm +.Fn set_curterm routine sets the variable .Dv cur_term to -.Dv nterm , +.Ar nterm , and makes all of the .Nm terminfo boolean, numeric, and string variables use the values from -.Dv nterm . +.Ar nterm . It returns the old value of .Dv cur_term . .Pp The -.Nm del_curterm +.Fn del_curterm routine frees the space pointed to by -.Dv oterm +.Ar oterm and makes it available for further use. If -.Dv oterm +.Ar oterm is the same as .Dv cur_term , references to any of the .Nm terminfo boolean, numeric, and string variables thereafter may refer to invalid memory locations until another -.Nm setupterm +.Fn setupterm has been called. .Pp The -.Nm restartterm +.Fn restartterm routine is similar to -.Nm setupterm +.Fn setupterm and -.Nm initscr , +.Fn initscr , except that it is called after restoring memory to a previous state (for example, when reloading a game saved as a core image dump). It assumes that the windows and the input and output options are the same as when memory was @@ -268,111 +268,113 @@ saved, but the terminal type and baud rate may be different. Accordingly, it saves various tty state bits, does a setupterm, and then restores the bits. .Pp The -.Nm tparm +.Fn tparm routine instantiates the string -.Dv str -with -parameters -.Dv pi . +.Ar str , +substituting the parameters %p1 through %p9 +with the values of +.Ar p1 +through +.Ar p9 . A pointer is returned to the result of -.Dv str +.Ar str with the parameters applied. .Pp The -.Nm tputs +.Fn tputs routine applies padding information to the string -.Dv str +.Ar str and outputs it. The -.Dv str +.Ar str must be a terminfo string variable or the return value from -.Nm tparm , -.Nm tgetstr , +.Fn tparm , +.Fn tgetstr , or -.Nm tgoto . -.Dv affcnt +.Fn tgoto . +.Ar affcnt is the number of lines affected, or 1 if not applicable. -.Dv putc +.Ar putc is a \fBputchar\fR-like routine to which the characters are passed, one at a time. .Pp The -.Nm putp +.Fn putp routine calls: .Bd -literal -offset indent tputs(str, 1, putchar) .Ed Note that the output of -.Nm putp +.Fn putp always goes to .Dv stdout , not to the -.Dv fildes +.Ar fildes specified in -.Nm setupterm . +.Fn setupterm . .Pp The -.Nm vidputs +.Fn vidputs routine displays the string on the terminal in the video attribute mode -.Dv attrs , +.Ar attrs , which is any combination of the attributes listed in .Xr curses 3 . The characters are passed to the \fBputchar\fR-like routine -.Dv putc . +.Ar putc . .Pp The -.Nm vidattr +.Fn vidattr routine is like the -.Nm vidputs +.Fn vidputs routine, except that it outputs through -.Nm putchar . +.Fn putchar . .Pp The -.Nm mvcur +.Fn mvcur routine provides low-level cursor motion. It takes effect immediately (rather than at the next refresh). .Pp The -.Nm tigetflag , -.Nm tigetnum +.Fn tigetflag , +.Fn tigetnum and -.Nm tigetstr +.Fn tigetstr routines return the value of the capability corresponding to the -.Nm terminfo -.Dv capname +.Fn terminfo +.Ar capname passed to them, such as .Dv xenl . .Pp The -.Nm tigetflag +.Fn tigetflag routine returns the value .Li -1 if -.Dv capname +.Ar capname is not a boolean capability. .Pp The -.Nm tigetnum +.Fn tigetnum routine returns the value .Li -2 if -.Dv capname +.Ar capname is not a numeric capability. .Pp The -.Nm tigetstr +.Fn tigetstr routine returns the value .Li (char *)-1 if -.Dv capname +.Ar capname is not a string capability. .Pp The -.Dv capname +.Ar capname for each capability is given in the table column entitled -.Dv capname +.Ar capname code in the capabilities section of .Xr terminfo 5 . .Pp @@ -401,26 +403,26 @@ Routines that return pointers always return on error. .Sh NOTES The -.Nm setupterm +.Fn setupterm routine should be used in place of -.Nm setterm . +.Fn setterm . It may be useful when you want to test for terminal capabilities without committing to the allocation of storage involved in -.Nm initscr . +.Fn initscr . .Pp Note that -.Nm vidattr +.Fn vidattr and -.Nm vidputs +.Fn vidputs may be macros. .Sh PORTABILITY The function -.Nm setterm +.Fn setterm is not described in the XSI Curses standard and must be considered non-portable. All other functions are as described in the XSI curses standard. .Pp In System V Release 4, -.Nm set_curterm +.Fn set_curterm has an .Dv int return type and returns @@ -430,12 +432,12 @@ or We have chosen to implement the XSI Curses semantics. .Pp In System V Release 4, the third argument of -.Nm tputs +.Fn tputs has the type \fBint (*putc)(char)\fR. .Pp The XSI Curses standard prototypes -.Nm tparm +.Fn tparm with a fixed number of parameters, rather than a variable argument list. .Sh SEE ALSO .Xr curses 3 |