]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tic.1m
ncurses 6.1 - patch 20190817
[ncurses.git] / man / tic.1m
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: tic.1m,v 1.74 2019/07/20 17:57:09 tom Exp $
30 .TH @TIC@ 1M ""
31 .ie \n(.g .ds `` \(lq
32 .el       .ds `` ``
33 .ie \n(.g .ds '' \(rq
34 .el       .ds '' ''
35 .ds n 5
36 .ds d @TERMINFO@
37 .de bP
38 .ie n  .IP \(bu 4
39 .el    .IP \(bu 2
40 ..
41 .SH NAME
42 \fB@TIC@\fR \- the \fIterminfo\fR entry-description compiler
43 .SH SYNOPSIS
44 \fB@TIC@\fR
45 [\fB\-\
46 0\
47 1\
48 C\
49 D\
50 G\
51 I\
52 K\
53 L\
54 N\
55 T\
56 U\
57 V\
58 W\
59 a\
60 c\
61 f\
62 g\
63 q\
64 r\
65 s\
66 t\
67 x\
68 \fR]
69 [\fB\-e\fR \fInames\fR]
70 [\fB\-o\fR \fIdir\fR]
71 [\fB\-Q\fR[\fIn\fR]]
72 [\fB\-R\fR \fIsubset\fR]
73 [\fB\-v\fR[\fIn\fR]]
74 [\fB\-w\fR[\fIn\fR]]
75 \fIfile\fR
76 .br
77 .SH DESCRIPTION
78 The \fB@TIC@\fR command translates a \fBterminfo\fR file from source
79 format into compiled format.
80 The compiled format is necessary for use with
81 the library routines in \fBncurses\fR(3X).
82 .PP
83 As described in \fBterm\fR(\*n), the database may be either a directory
84 tree (one file per terminal entry) or a hashed database (one record per entry).
85 The \fB@TIC@\fR command writes only one type of entry,
86 depending on how it was built:
87 .bP
88 For directory trees, the top-level directory, e.g., /usr/share/terminfo,
89 specifies the location of the database.
90 .bP
91 For hashed databases, a filename is needed.
92 If the given file is not found by that name,
93 but can be found by adding the suffix ".db",
94 then that is used.
95 .IP
96 The default name for the hashed database is the same as the
97 default directory name (only adding a ".db" suffix).
98 .PP
99 In either case (directory or hashed database),
100 \fB@TIC@\fP will create the container if it does not exist.
101 For a directory, this would be the "terminfo" leaf,
102 versus a "terminfo.db" file.
103 .PP
104 The results are normally placed in the system terminfo database \fB\*d\fR.
105 The compiled terminal description can be placed
106 in a different terminfo database.
107 There are two ways to achieve this:
108 .bP
109 First, you may override the system default either by
110 using the \fB\-o\fP option,
111 or by setting the variable \fBTERMINFO\fR
112 in your shell environment to a valid database location.
113 .bP
114 Secondly, if \fB@TIC@\fR cannot write in \fI\*d\fR
115 or the location specified using your TERMINFO variable,
116 it looks for the directory \fI$HOME/.terminfo\fR
117 (or hashed database \fI$HOME/.terminfo.db)\fR;
118 if that location exists, the entry is placed there.
119 .PP
120 Libraries that read terminfo entries are expected to check in succession
121 .bP
122 a location specified with the TERMINFO environment variable,
123 .bP
124 \fI$HOME/.terminfo\fR,
125 .bP
126 directories listed in the TERMINFO_DIRS environment variable,
127 .bP
128 a compiled-in list of directories (@TERMINFO_DIRS@), and
129 .bP
130 the system terminfo database (\fI\*d\fR).
131 .SS OPTIONS
132 .TP
133 \fB\-0\fR
134 restricts the output to a single line
135 .TP
136 \fB\-1\fR
137 restricts the output to a single column
138 .TP
139 \fB\-a\fR
140 tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
141 them.
142 Capabilities are commented by prefixing them with a period.
143 This sets the \fB\-x\fR option, because it treats the commented-out
144 entries as user-defined names.
145 If the source is termcap, accept the 2-character names required by version 6.
146 Otherwise these are ignored.
147 .TP
148 \fB\-C\fR
149 Force source translation to termcap format.
150 Note: this differs from the \fB\-C\fR
151 option of \fB@INFOCMP@\fR(1M) in that it does not merely translate capability
152 names, but also translates terminfo strings to termcap format.
153 Capabilities
154 that are not translatable are left in the entry under their terminfo names
155 but commented out with two preceding dots.
156 The actual format used incorporates some improvements for escaped characters
157 from terminfo format.
158 For a stricter BSD-compatible translation, add the \fB\-K\fR option.
159 .IP
160 If this is combined with \fB\-c\fR, \fB@TIC@\fR makes additional checks
161 to report cases where the terminfo values do not have an exact equivalent
162 in termcap form.
163 For example:
164 .RS
165 .bP
166 \fBsgr\fP usually will not convert, because termcap lacks the ability to
167 work with more than two parameters, and because termcap lacks many of
168 the arithmetic/logical operators used in terminfo.
169 .bP
170 capabilities with more than one delay or with delays before the end of
171 the string will not convert completely.
172 .RE
173 .TP
174 \fB\-c\fR
175 tells \fB@TIC@\fP to only check \fIfile\fR for errors,
176 including syntax problems and bad use-links.
177 If you specify \fB\-C\fR (\fB\-I\fR) with this option, the code
178 will print warnings about entries which, after use resolution, are more than
179 1023 (4096) bytes long.
180 Due to a fixed buffer length in older termcap libraries,
181 as well as buggy checking for the buffer length
182 (and a documented limit in terminfo),
183 these entries may cause core
184 dumps with other implementations.
185 .IP
186 \fB@TIC@\fP checks string capabilities to ensure that those with parameters
187 will be valid expressions.
188 It does this check only for the predefined string capabilities;
189 those which are defined with the \fB\-x\fP option are ignored.
190 .TP
191 \fB\-D\fR
192 tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
193 The first location shown is the one to which it would write compiled
194 terminal descriptions.
195 If \fB@TIC@\fP is not able to find a writable database location
196 according to the rules summarized above,
197 it will print a diagnostic and exit with an error rather than
198 printing a list of database locations.
199 .TP
200 \fB\-e \fR\fInames\fR
201 Limit writes and translations to the following comma-separated list of
202 terminals.
203 If any name or alias of a terminal matches one of the names in
204 the list, the entry will be written or translated as normal.
205 Otherwise no output will be generated for it.
206 The option value is interpreted as a file containing the list if it
207 contains a '/'.
208 (Note: depending on how @TIC@ was compiled,
209 this option may require \fB\-I\fR or \fB\-C\fR.)
210 .TP
211 \fB\-f\fR
212 Display complex terminfo strings which contain if/then/else/endif expressions
213 indented for readability.
214 .TP
215 \fB\-G\fR
216 Display constant literals in decimal form
217 rather than their character equivalents.
218 .TP
219 \fB\-g\fR
220 Display constant character literals in quoted form
221 rather than their decimal equivalents.
222 .TP
223 \fB\-I\fR
224 Force source translation to terminfo format.
225 .TP
226 \fB\-K\fR
227 Suppress some longstanding ncurses extensions to termcap format,
228 e.g., "\\s" for space.
229 .TP
230 \fB\-L\fR
231 Force source translation to terminfo format
232 using the long C variable names listed in <\fBterm.h\fR>
233 .TP
234 \fB\-N\fR
235 Disable smart defaults.
236 Normally, when translating from termcap to terminfo, the compiler makes
237 a number of assumptions about the defaults of string capabilities
238 \fBreset1_string\fR, \fBcarriage_return\fR, \fBcursor_left\fR,
239 \fBcursor_down\fR, \fBscroll_forward\fR, \fBtab\fR, \fBnewline\fR,
240 \fBkey_backspace\fR, \fBkey_left\fR, and \fBkey_down\fR, then attempts
241 to use obsolete termcap capabilities to deduce correct values.
242 It also
243 normally suppresses output of obsolete termcap capabilities such as \fBbs\fR.
244 This option forces a more literal translation that also preserves the
245 obsolete capabilities.
246 .TP
247 \fB\-o\fR\fIdir\fR
248 Write compiled entries to given database location.
249 Overrides the TERMINFO environment variable.
250 .TP
251 \fB\-Q\fR\fIn\fR
252 Rather than show source in terminfo (text) format,
253 print the compiled (binary) format in hexadecimal or base64 form,
254 depending on the option's value:
255 .RS 8
256 .TP 3
257 1
258 hexadecimal
259 .TP 3
260 2
261 base64
262 .TP 3
263 3
264 hexadecimal and base64
265 .RE
266 .TP
267 \fB\-q\fR
268 Suppress comments and blank lines when showing translated source.
269 .TP
270 \fB\-R\fR\fIsubset\fR
271 Restrict output to a given subset.
272 This option is for use with archaic
273 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
274 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
275 that have their own extensions incompatible with SVr4/XSI.
276 Available subsets
277 are "SVr1", "Ultrix", "HP", "BSD" and "AIX";
278 see \fBterminfo\fR(\*n) for details.
279 .TP
280 \fB\-r\fR
281 Force entry resolution (so there are no remaining tc capabilities) even
282 when doing translation to termcap format.
283 This may be needed if you are
284 preparing a termcap file for a termcap library (such as GNU termcap through
285 version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
286 tc capabilities per entry.
287 .TP
288 \fB\-s\fR
289 Summarize the compile by showing the database location into which entries
290 are written, and the number of entries which are compiled.
291 .TP
292 \fB\-T\fR
293 eliminates size-restrictions on the generated text.
294 This is mainly useful for testing and analysis, since the compiled
295 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
296 .TP
297 \fB\-t\fR
298 tells \fB@TIC@\fP to discard commented-out capabilities.
299 Normally when translating from terminfo to termcap,
300 untranslatable capabilities are commented-out.
301 .TP 5
302 \fB\-U\fR
303 tells \fB@TIC@\fP to not post-process the data after parsing the source file.
304 Normally, it infers data which is commonly missing in older terminfo data,
305 or in termcaps.
306 .TP
307 \fB\-V\fR
308 reports the version of ncurses which was used in this program, and exits.
309 .TP
310 \fB\-v\fR\fIn\fR
311 specifies that (verbose) output be written to standard error trace
312 information showing \fB@TIC@\fR's progress.
313 .IP
314 The optional parameter \fIn\fR is a number from 1 to 10, inclusive,
315 indicating the desired level of detail of information.
316 If ncurses is built without tracing support, the optional parameter is ignored.
317 If \fIn\fR is omitted, the default level is 1.
318 If \fIn\fR is specified and greater than 1, the level of
319 detail is increased.
320 .RS
321 .PP
322 The debug flag levels are as follows:
323 .TP
324 1
325 Names of files created and linked
326 .TP
327 2
328 Information related to the \*(``use\*('' facility
329 .TP
330 3
331 Statistics from the hashing algorithm
332 .TP
333 5
334 String-table memory allocations
335 .TP
336 7
337 Entries into the string-table
338 .TP
339 8
340 List of tokens encountered by scanner
341 .TP
342 9
343 All values computed in construction of the hash table
344 .LP
345 If the debug level \fIn\fR is not given, it is taken to be one.
346 .RE
347 .TP
348 \fB\-W\fR
349 By itself, the \fB\-w\fP option will not force long strings to be wrapped.
350 Use the \fB\-W\fP option to do this.
351 .IP
352 If you specify both \fB\-f\fP and \fB\-W\fP options,
353 the latter is ignored when \fB\-f\fP has already split the line.
354 .TP
355 \fB\-w\fR\fIn\fR
356 specifies the width of the output.
357 The parameter is optional.
358 If it is omitted, it defaults to 60.
359 .TP
360 \fB\-x\fR
361 Treat unknown capabilities as user-defined (see \fBuser_caps(\*n)\fP).
362 That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
363 it will infer its type (boolean, number or string) from the syntax and
364 make an extended table entry for that.
365 User-defined capability strings
366 whose name begins with \*(``k\*('' are treated as function keys.
367 .SS PARAMETERS
368 .TP
369 \fIfile\fR
370 contains one or more \fBterminfo\fR terminal descriptions in source
371 format [see \fBterminfo\fR(\*n)].
372 Each description in the file
373 describes the capabilities of a particular terminal.
374 .IP
375 If \fIfile\fR is \*(``-\*('', then the data is read from the standard input.
376 The \fIfile\fR parameter may also be the path of a character-device.
377 .SS PROCESSING
378 .PP
379 All but one of the capabilities recognized by \fB@TIC@\fR are documented
380 in \fBterminfo\fR(\*n).
381 The exception is the \fBuse\fR capability.
382 .PP
383 When a \fBuse\fR=\fIentry\fR\-\fIname\fR field is discovered in a
384 terminal entry currently being compiled, \fB@TIC@\fR reads in the binary
385 from \fB\*d\fR to complete the entry.
386 (Entries created from
387 \fIfile\fR will be used first.
388 \fB@TIC@\fR duplicates the capabilities in
389 \fIentry\fR\-\fIname\fR for the current entry, with the exception of
390 those capabilities that explicitly are defined in the current entry.
391 .PP
392 When an entry, e.g., \fBentry_name_1\fR, contains a
393 \fBuse=\fR\fIentry\fR_\fIname\fR_\fI2\fR field, any canceled
394 capabilities in \fIentry\fR_\fIname\fR_\fI2\fR must also appear in
395 \fBentry_name_1\fR before \fBuse=\fR for these capabilities to be
396 canceled in \fBentry_name_1\fR.
397 .PP
398 Total compiled entries cannot exceed 4096 bytes.
399 The name field cannot
400 exceed 512 bytes.
401 Terminal names exceeding the maximum alias length
402 (32 characters on systems with long filenames, 14 characters otherwise)
403 will be truncated to the maximum alias length
404 and a warning message will be printed.
405 .SH HISTORY
406 .PP
407 System V Release 2 provided a \fBtic\fP utility.
408 It accepted a single option: \fB\-v\fP (optionally followed by a number).
409 According to Ross Ridge's comment in \fImytinfo\fP,
410 this version of \fBtic\fP was
411 unable to represent cancelled capabilities.
412 .PP
413 System V Release 3 provided a different \fBtic\fP utility,
414 written by Pavel Curtis,
415 (originally named \*(``compile\*('' in \fIpcurses\fP).
416 This added an option \fB\-c\fP to check the file for
417 errors, with the caveat that errors in \*(``use=\*('' links
418 would not be reported.
419 System V Release 3 documented a few warning messages which
420 did not appear in \fIpcurses\fP.
421 While the program itself was changed little as development
422 continued with System V Release 4,
423 the table of capabilities grew from 180 (\fIpcurses\fP) to 464 (Solaris).
424 .PP
425 In early development of ncurses (1993),
426 Zeyd Ben-Halim used the table from \fImytinfo\fP to
427 extend the \fIpcurses\fP table to 469 capabilities
428 (456 matched SVr4, 8 were only in SVr4, 13 were not in SVr4).
429 Of those 13, 11 were ultimately discarded
430 (perhaps to match the draft of X/Open Curses).
431 The exceptions were
432 \fBmemory_lock_above\fP and
433 \fBmemory_unlock\fP (see \fBuser_caps\fP(5)).
434 .PP
435 Eric Raymond incorporated parts of \fImytinfo\fP into ncurses
436 to implement the termcap-to-terminfo source conversion,
437 and extended that to begin development of 
438 the corresponding terminfo-to-termcap source conversion,
439 Thomas Dickey completed that development over the course of several years.
440 .PP
441 In 1999, Thomas Dickey added the \fB\-x\fP option
442 to support user-defined capabilities.
443 .PP
444 In 2010, Roy Marples provided a \fBtic\fP program
445 and terminfo library for NetBSD.
446 This implementation adapts several features from ncurses,
447 including \fB@TIC@\fP's \fB\-x\fP option.
448 .PP
449 The \fB\-c\fP option tells \fB@TIC@\fP to check for problems in the
450 terminfo source file.
451 Continued development provides additional checks:
452 .bP
453 \fIpcurses\fP had 8 warnings
454 .bP
455 ncurses in 1996 had 16 warnings
456 .bP
457 Solaris (SVr4) curses has 28 warnings
458 .bP
459 NetBSD tic in 2019 has 19 warnings.
460 .bP
461 ncurses in 2019 has 96 warnings
462 .PP
463 The checking done in ncurses' \fB@TIC@\fP helps with the conversion to
464 termcap, as well as pointing out errors and inconsistencies.
465 It is also used to ensure consistency with the user-defined capabilities.
466 There are 527 distinct capabilities in ncurses' terminal database;
467 128 of those are user-defined.
468 .SH PORTABILITY
469 .PP
470 X/Open Curses, Issue 7 (2009) provides a brief description of \fBtic\fP.
471 It lists one option: \fB\-c\fP.
472 The omission of \fB\-v\fP is unexpected.
473 The change history states that the description is derived from True64 UNIX.
474 According to its manual pages, that system also supported the \fB\-v\fP option.
475 .PP
476 Shortly after Issue 7 was released, Tru64 was discontinued.
477 As of 2019, the surviving implementations of \fBtic\fP
478 are SVr4 (AIX, HP-UX and Solaris),
479 ncurses
480 and NetBSD curses.
481 .PP
482 The X/Open rationale states that some implementations of \fBtic\fP
483 read terminal descriptions from the standard input if the \fIfile\fP
484 parameter is omitted.
485 None of these implementations do that.
486 Further, it comments that some may choose to read from \*(''./terminfo.src\*(''
487 but that is obsolescent behavior from SVr2,
488 and is not (for example) a documented feature of SVr3.
489 .SS COMPATIBILITY
490 There is some evidence that historic \fB@TIC@\fR implementations treated
491 description fields with no whitespace in them as additional aliases or
492 short names.
493 This \fB@TIC@\fR does not do that, but it does warn when
494 description fields may be treated that way and check them for dangerous
495 characters.
496 .SS EXTENSIONS
497 Unlike the SVr4 \fB@TIC@\fR command, this implementation can actually
498 compile termcap sources.
499 In fact, entries in terminfo and termcap syntax can
500 be mixed in a single source file.
501 See \fBterminfo\fR(\*n) for the list of
502 termcap names taken to be equivalent to terminfo names.
503 .PP
504 The SVr4 manual pages are not clear on the resolution rules for \fBuse\fR
505 capabilities.
506 This implementation of \fB@TIC@\fR will find \fBuse\fR targets anywhere
507 in the source file, or anywhere in the file tree rooted at \fBTERMINFO\fR (if
508 \fBTERMINFO\fR is defined),
509 or in the user's \fI$HOME/.terminfo\fR database
510 (if it exists),
511 or (finally) anywhere in the system's file tree of
512 compiled entries.
513 .PP
514 The error messages from this \fB@TIC@\fR have the same format as GNU C
515 error messages, and can be parsed by GNU Emacs's compile facility.
516 .PP
517 The
518 \fB\-0\fR,
519 \fB\-1\fR,
520 \fB\-C\fR,
521 \fB\-G\fR,
522 \fB\-I\fR,
523 \fB\-N\fR,
524 \fB\-R\fR,
525 \fB\-T\fR,
526 \fB\-V\fR,
527 \fB\-a\fR,
528 \fB\-e\fR,
529 \fB\-f\fR,
530 \fB\-g\fR,
531 \fB\-o\fR,
532 \fB\-r\fR,
533 \fB\-s\fR,
534 \fB\-t\fR and
535 \fB\-x\fR
536 options
537 are not supported under SVr4.
538 The SVr4 \fB\-c\fR mode does not report bad \*(``use=\*('' links.
539 .PP
540 System V does not compile entries to or read entries from your
541 \fI$HOME/.terminfo\fR database unless TERMINFO is explicitly set to it.
542 .SH FILES
543 .TP 5
544 \fB\*d/?/*\fR
545 Compiled terminal description database.
546 .SH SEE ALSO
547 \fB@INFOCMP@\fR(1M),
548 \fB@CAPTOINFO@\fR(1M),
549 \fB@INFOTOCAP@\fR(1M),
550 \fB@TOE@\fR(1M),
551 \fBcurses\fR(3X),
552 \fBterm\fR(\*n).
553 \fBterminfo\fR(\*n).
554 \fBuser_caps\fR(\*n).
555 .PP
556 This describes \fBncurses\fR
557 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
558 .SH AUTHOR
559 Eric S. Raymond <esr@snark.thyrsus.com>
560 and
561 .br
562 Thomas E. Dickey <dickey@invisible-island.net>