1 .\" Copyright (c) 1987, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)ctags.1 8.1 (Berkeley) 6/6/93
60 A tags file gives the locations of specified objects in a group of files.
61 Each line of the tags file contains the object name, the file in which it
62 is defined, and a search pattern for the object definition, separated by
68 can quickly locate these object definitions.
69 Depending upon the options provided to
71 objects will consist of subroutines, typedefs, defines, structs,
74 The following options are available:
75 .Bl -tag -width indent
77 Use backward searching patterns
80 Use forward searching patterns
84 Do not create tags for typedefs, structs, unions, and enums.
92 that do not take arguments;
94 that take arguments are tagged automatically.
96 Place the tag descriptions in a file called
98 The default behaviour is to place them in a file called
101 Update the specified files in the
104 references to them are deleted, and the new values are appended to the
106 (Beware: this option is implemented in a way which is rather
107 slow; it is usually faster to simply rebuild the
111 An index of the form expected by
113 is produced on the standard output.
115 contains the object name, file name, and page number (assuming 64
117 Since the output will be sorted into lexicographic order,
118 it may be desired to run the output through
121 .Bd -literal -offset indent
122 ctags -v files | sort -f > index
126 Suppress warning diagnostics.
129 produces a list of object
130 names, the line number and file name on which each is defined, as well
131 as the text of that line and prints this on the standard output.
133 is a simple index which can be printed out as an off-line readable
137 Files whose names end in
142 source files and are searched for C style routine and macro definitions.
143 Files whose names end in
148 Files whose names end in
150 are assumed to be Lisp files if their
151 first non-blank character is
160 Other files are first examined to see if they
161 contain any Pascal or Fortran routine definitions, and, if not, are
162 searched for C style definitions.
166 is treated specially in C programs.
168 is created by prepending
170 to the name of the file, with the
173 and any leading pathname components removed.
176 practical in directories with more than one
183 files each have a special tag.
186 of the second section of the
191 the second section of the
195 .Bl -tag -width ".Pa tags" -compact
197 default output tags file
202 utility exits with a value of 1 if an error occurred, 0 otherwise.
203 Duplicate objects are not considered errors.
207 option is a no-op for compatibility with previous versions of
209 that did not create tags for typedefs, enums, structs and unions
225 Recognition of functions, subroutines and procedures
226 for Fortran and Pascal is done in a very simpleminded way.
228 is made to deal with block structure; if you have two Pascal procedures
229 in different blocks with the same name you lose.
233 understand about Pascal types.
235 The method of deciding whether to look for C, Pascal or
241 utility relies on the input being well formed, and any syntactical
242 errors will completely confuse it.
243 It also finds some legal syntax
244 confusing; for example, since it does not understand
246 (incidentally, that is a feature, not a bug), any code with unbalanced
249 will cause it to become somewhat disoriented.
250 In a similar fashion, multiple line changes within a definition will
251 cause it to enter the last line of the object, rather than the first, as
252 the searching pattern.
253 The last line of multiple line
255 will similarly be noted.