]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tic.1m
ncurses 6.0 - patch 20171014
[ncurses.git] / man / tic.1m
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2016,2017 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.65 2017/07/08 19:48:37 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 .IP \(bu 4
39 ..
40 .SH NAME
41 \fB@TIC@\fR \- the \fIterminfo\fR entry-description compiler
42 .SH SYNOPSIS
43 \fB@TIC@\fR
44 [\fB\-\
45 0\
46 1\
47 C\
48 D\
49 G\
50 I\
51 K\
52 L\
53 N\
54 T\
55 U\
56 V\
57 W\
58 a\
59 c\
60 f\
61 g\
62 q\
63 r\
64 s\
65 t\
66 x\
67 \fR]
68 [\fB\-e\fR \fInames\fR]
69 [\fB\-o\fR \fIdir\fR]
70 [\fB\-Q\fR[\fIn\fR]]
71 [\fB\-R\fR \fIsubset\fR]
72 [\fB\-v\fR[\fIn\fR]]
73 [\fB\-w\fR[\fIn\fR]]
74 \fIfile\fR
75 .br
76 .SH DESCRIPTION
77 The \fB@TIC@\fR command translates a \fBterminfo\fR file from source
78 format into compiled format.
79 The compiled format is necessary for use with
80 the library routines in \fBncurses\fR(3X).
81 .PP
82 As described in \fBterm\fR(\*n), the database may be either a directory
83 tree (one file per terminal entry) or a hashed database (one record per entry).
84 The \fB@TIC@\fR command writes only one type of entry,
85 depending on how it was built:
86 .bP
87 For directory trees, the top-level directory, e.g., /usr/share/terminfo,
88 specifies the location of the database.
89 .bP
90 For hashed databases, a filename is needed.
91 If the given file is not found by that name,
92 but can be found by adding the suffix ".db",
93 then that is used.
94 .IP
95 The default name for the hashed database is the same as the
96 default directory name (only adding a ".db" suffix).
97 .PP
98 In either case (directory or hashed database),
99 \fB@TIC@\fP will create the container if it does not exist.
100 For a directory, this would be the "terminfo" leaf,
101 versus a "terminfo.db" file.
102 .PP
103 The results are normally placed in the system terminfo database \fB\*d\fR.
104 The compiled terminal description can be placed
105 in a different terminfo database.
106 There are two ways to achieve this:
107 .bP
108 First, you may override the system default either by
109 using the \fB\-o\fP option,
110 or by setting the variable \fBTERMINFO\fR
111 in your shell environment to a valid database location.
112 .bP
113 Secondly, if \fB@TIC@\fR cannot write in \fI\*d\fR
114 or the location specified using your TERMINFO variable,
115 it looks for the directory \fI$HOME/.terminfo\fR
116 (or hashed database \fI$HOME/.terminfo.db)\fR;
117 if that location exists, the entry is placed there.
118 .PP
119 Libraries that read terminfo entries are expected to check in succession
120 .bP
121 a location specified with the TERMINFO environment variable,
122 .bP
123 \fI$HOME/.terminfo\fR,
124 .bP
125 directories listed in the TERMINFO_DIRS environment variable,
126 .bP
127 a compiled-in list of directories (@TERMINFO_DIRS@), and
128 .bP
129 the system terminfo database (\fI\*d\fR).
130 .SS OPTIONS
131 .TP
132 \fB\-0\fR
133 restricts the output to a single line
134 .TP
135 \fB\-1\fR
136 restricts the output to a single column
137 .TP
138 \fB\-a\fR
139 tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
140 them.
141 Capabilities are commented by prefixing them with a period.
142 This sets the \fB\-x\fR option, because it treats the commented-out
143 entries as user-defined names.
144 If the source is termcap, accept the 2-character names required by version 6.
145 Otherwise these are ignored.
146 .TP
147 \fB\-C\fR
148 Force source translation to termcap format.
149 Note: this differs from the \fB\-C\fR
150 option of \fB@INFOCMP@\fR(1M) in that it does not merely translate capability
151 names, but also translates terminfo strings to termcap format.
152 Capabilities
153 that are not translatable are left in the entry under their terminfo names
154 but commented out with two preceding dots.
155 The actual format used incorporates some improvements for escaped characters
156 from terminfo format.
157 For a stricter BSD-compatible translation, add the \fB\-K\fR option.
158 .IP
159 If this is combined with \fB\-c\fR, \fB@TIC@\fR makes additional checks
160 to report cases where the terminfo values do not have an exact equivalent
161 in termcap form.
162 For example:
163 .RS
164 .bP
165 \fBsgr\fP usually will not convert, because termcap lacks the ability to
166 work with more than two parameters, and because termcap lacks many of
167 the arithmetic/logical operators used in terminfo.
168 .bP
169 capabilities with more than one delay or with delays before the end of
170 the string will not convert completely.
171 .RE
172 .TP
173 \fB\-c\fR
174 tells \fB@TIC@\fP to only check \fIfile\fR for errors, including syntax problems and
175 bad use links.
176 If you specify \fB\-C\fR (\fB\-I\fR) with this option, the code
177 will print warnings about entries which, after use resolution, are more than
178 1023 (4096) bytes long.
179 Due to a fixed buffer length in older termcap libraries,
180 as well as buggy checking for the buffer length
181 (and a documented limit in terminfo),
182 these entries may cause core
183 dumps with other implementations.
184 .IP
185 \fB@TIC@\fP checks string capabilities to ensure that those with parameters
186 will be valid expressions.
187 It does this check only for the predefined string capabilities;
188 those which are defined with the \fB\-x\fP option are ignored.
189 .TP
190 \fB\-D\fR
191 tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
192 The first location shown is the one to which it would write compiled
193 terminal descriptions.
194 If \fB@TIC@\fP is not able to find a writable database location
195 according to the rules summarized above,
196 it will print a diagnostic and exit with an error rather than
197 printing a list of database locations.
198 .TP
199 \fB\-e \fR\fInames\fR
200 Limit writes and translations to the following comma-separated list of
201 terminals.
202 If any name or alias of a terminal matches one of the names in
203 the list, the entry will be written or translated as normal.
204 Otherwise no output will be generated for it.
205 The option value is interpreted as a file containing the list if it
206 contains a '/'.
207 (Note: depending on how tic was compiled, this option may require \fB\-I\fR or \fB\-C\fR.)
208 .TP
209 \fB\-f\fR
210 Display complex terminfo strings which contain if/then/else/endif expressions
211 indented for readability.
212 .TP
213 \fB\-G\fR
214 Display constant literals in decimal form
215 rather than their character equivalents.
216 .TP
217 \fB\-g\fR
218 Display constant character literals in quoted form
219 rather than their decimal equivalents.
220 .TP
221 \fB\-I\fR
222 Force source translation to terminfo format.
223 .TP
224 \fB\-K\fR
225 Suppress some longstanding ncurses extensions to termcap format,
226 e.g., "\\s" for space.
227 .TP
228 \fB\-L\fR
229 Force source translation to terminfo format
230 using the long C variable names listed in <\fBterm.h\fR>
231 .TP
232 \fB\-N\fR
233 Disable smart defaults.
234 Normally, when translating from termcap to terminfo, the compiler makes
235 a number of assumptions about the defaults of string capabilities
236 \fBreset1_string\fR, \fBcarriage_return\fR, \fBcursor_left\fR,
237 \fBcursor_down\fR, \fBscroll_forward\fR, \fBtab\fR, \fBnewline\fR,
238 \fBkey_backspace\fR, \fBkey_left\fR, and \fBkey_down\fR, then attempts
239 to use obsolete termcap capabilities to deduce correct values.
240 It also
241 normally suppresses output of obsolete termcap capabilities such as \fBbs\fR.
242 This option forces a more literal translation that also preserves the
243 obsolete capabilities.
244 .TP
245 \fB\-o\fR\fIdir\fR
246 Write compiled entries to given database location.
247 Overrides the TERMINFO environment variable.
248 .TP
249 \fB\-Q\fR\fIn\fR
250 Rather than show source in terminfo (text) format,
251 print the compiled (binary) format in hexadecimal or base64 form,
252 depending on the option's value:
253 .RS 8
254 .TP 3
255 1
256 hexadecimal
257 .TP 3
258 2
259 base64
260 .TP 3
261 3
262 hexadecimal and base64
263 .RE
264 .TP
265 \fB\-q\fR
266 Suppress comments and blank lines when showing translated source.
267 .TP
268 \fB\-R\fR\fIsubset\fR
269 Restrict output to a given subset.
270 This option is for use with archaic
271 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
272 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
273 that have their own extensions incompatible with SVr4/XSI.
274 Available subsets
275 are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see \fBterminfo\fR(\*n) for details.
276 .TP
277 \fB\-r\fR
278 Force entry resolution (so there are no remaining tc capabilities) even
279 when doing translation to termcap format.
280 This may be needed if you are
281 preparing a termcap file for a termcap library (such as GNU termcap through
282 version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
283 tc capabilities per entry.
284 .TP
285 \fB\-s\fR
286 Summarize the compile by showing the database location into which entries
287 are written, and the number of entries which are compiled.
288 .TP
289 \fB\-T\fR
290 eliminates size-restrictions on the generated text.
291 This is mainly useful for testing and analysis, since the compiled
292 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
293 .TP
294 \fB\-t\fR
295 tells \fB@TIC@\fP to discard commented-out capabilities.
296 Normally when translating from terminfo to termcap,
297 untranslatable capabilities are commented-out.
298 .TP 5
299 \fB\-U\fR
300 tells \fB@TIC@\fP to not post-process the data after parsing the source file.
301 Normally, it infers data which is commonly missing in older terminfo data,
302 or in termcaps.
303 .TP
304 \fB\-V\fR
305 reports the version of ncurses which was used in this program, and exits.
306 .TP
307 \fB\-v\fR\fIn\fR
308 specifies that (verbose) output be written to standard error trace
309 information showing \fB@TIC@\fR's progress.
310 .IP
311 The optional parameter \fIn\fR is a number from 1 to 10, inclusive,
312 indicating the desired level of detail of information.
313 If ncurses is built without tracing support, the optional parameter is ignored.
314 If \fIn\fR is omitted, the default level is 1.
315 If \fIn\fR is specified and greater than 1, the level of
316 detail is increased.
317 .RS
318 .PP
319 The debug flag levels are as follows:
320 .TP
321 1
322 Names of files created and linked
323 .TP
324 2
325 Information related to the \*(``use\*('' facility
326 .TP
327 3
328 Statistics from the hashing algorithm
329 .TP
330 5
331 String-table memory allocations
332 .TP
333 7
334 Entries into the string-table
335 .TP
336 8
337 List of tokens encountered by scanner
338 .TP
339 9
340 All values computed in construction of the hash table
341 .LP
342 If the debug level \fIn\fR is not given, it is taken to be one.
343 .RE
344 .TP
345 \fB\-W\fR
346 By itself, the \fB\-w\fP option will not force long strings to be wrapped.
347 Use the \fB\-W\fP option to do this.
348 .IP
349 If you specify both \fB\-f\fP and \fB\-W\fP options,
350 the latter is ignored when \fB\-f\fP has already split the line.
351 .TP
352 \fB\-w\fR\fIn\fR
353 specifies the width of the output.
354 The parameter is optional.
355 If it is omitted, it defaults to 60.
356 .TP
357 \fB\-x\fR
358 Treat unknown capabilities as user-defined.
359 That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
360 it will infer its type (boolean, number or string) from the syntax and
361 make an extended table entry for that.
362 User-defined capability strings
363 whose name begins with \*(``k\*('' are treated as function keys.
364 .SS PARAMETERS
365 .TP
366 \fIfile\fR
367 contains one or more \fBterminfo\fR terminal descriptions in source
368 format [see \fBterminfo\fR(\*n)].
369 Each description in the file
370 describes the capabilities of a particular terminal.
371 .IP
372 If \fIfile\fR is \*(``-\*('', then the data is read from the standard input.
373 The \fIfile\fR parameter may also be the path of a character-device.
374 .SS PROCESSING
375 .PP
376 All but one of the capabilities recognized by \fB@TIC@\fR are documented
377 in \fBterminfo\fR(\*n).
378 The exception is the \fBuse\fR capability.
379 .PP
380 When a \fBuse\fR=\fIentry\fR\-\fIname\fR field is discovered in a
381 terminal entry currently being compiled, \fB@TIC@\fR reads in the binary
382 from \fB\*d\fR to complete the entry.
383 (Entries created from
384 \fIfile\fR will be used first.
385 \fB@TIC@\fR duplicates the capabilities in
386 \fIentry\fR\-\fIname\fR for the current entry, with the exception of
387 those capabilities that explicitly are defined in the current entry.
388 .PP
389 When an entry, e.g., \fBentry_name_1\fR, contains a
390 \fBuse=\fR\fIentry\fR_\fIname\fR_\fI2\fR field, any canceled
391 capabilities in \fIentry\fR_\fIname\fR_\fI2\fR must also appear in
392 \fBentry_name_1\fR before \fBuse=\fR for these capabilities to be
393 canceled in \fBentry_name_1\fR.
394 .PP
395 Total compiled entries cannot exceed 4096 bytes.
396 The name field cannot
397 exceed 512 bytes.
398 Terminal names exceeding the maximum alias length
399 (32 characters on systems with long filenames, 14 characters otherwise)
400 will be truncated to the maximum alias length and a warning message will be printed.
401 .SH COMPATIBILITY
402 There is some evidence that historic \fB@TIC@\fR implementations treated
403 description fields with no whitespace in them as additional aliases or
404 short names.
405 This \fB@TIC@\fR does not do that, but it does warn when
406 description fields may be treated that way and check them for dangerous
407 characters.
408 .SH EXTENSIONS
409 Unlike the SVr4 \fB@TIC@\fR command, this implementation can actually
410 compile termcap sources.
411 In fact, entries in terminfo and termcap syntax can
412 be mixed in a single source file.
413 See \fBterminfo\fR(\*n) for the list of
414 termcap names taken to be equivalent to terminfo names.
415 .PP
416 The SVr4 manual pages are not clear on the resolution rules for \fBuse\fR
417 capabilities.
418 This implementation of \fB@TIC@\fR will find \fBuse\fR targets anywhere
419 in the source file, or anywhere in the file tree rooted at \fBTERMINFO\fR (if
420 \fBTERMINFO\fR is defined),
421 or in the user's \fI$HOME/.terminfo\fR database
422 (if it exists),
423 or (finally) anywhere in the system's file tree of
424 compiled entries.
425 .PP
426 The error messages from this \fB@TIC@\fR have the same format as GNU C
427 error messages, and can be parsed by GNU Emacs's compile facility.
428 .PP
429 The
430 \fB\-0\fR,
431 \fB\-1\fR,
432 \fB\-C\fR,
433 \fB\-G\fR,
434 \fB\-I\fR,
435 \fB\-N\fR,
436 \fB\-R\fR,
437 \fB\-T\fR,
438 \fB\-V\fR,
439 \fB\-a\fR,
440 \fB\-e\fR,
441 \fB\-f\fR,
442 \fB\-g\fR,
443 \fB\-o\fR,
444 \fB\-r\fR,
445 \fB\-s\fR,
446 \fB\-t\fR and
447 \fB\-x\fR
448 options
449 are not supported under SVr4.
450 The SVr4 \fB\-c\fR mode does not report bad use links.
451 .PP
452 System V does not compile entries to or read entries from your
453 \fI$HOME/.terminfo\fR database unless TERMINFO is explicitly set to it.
454 .SH FILES
455 .TP 5
456 \fB\*d/?/*\fR
457 Compiled terminal description database.
458 .SH SEE ALSO
459 \fB@INFOCMP@\fR(1M),
460 \fB@CAPTOINFO@\fR(1M),
461 \fB@INFOTOCAP@\fR(1M),
462 \fB@TOE@\fR(1M),
463 \fBcurses\fR(3X),
464 \fBterm\fR(\*n).
465 \fBterminfo\fR(\*n).
466 .PP
467 This describes \fBncurses\fR
468 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
469 .SH AUTHOR
470 Eric S. Raymond <esr@snark.thyrsus.com>
471 and
472 .br
473 Thomas E. Dickey <dickey@invisible-island.net>