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