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