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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)ctags.1 8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD: head/usr.bin/ctags/ctags.1 216370 2010-12-11 08:32:16Z joel $
56 A tags file gives the locations of specified objects in a group of files.
57 Each line of the tags file contains the object name, the file in which it
58 is defined, and a search pattern for the object definition, separated by
64 can quickly locate these object definitions.
65 Depending upon the options provided to
67 objects will consist of subroutines, typedefs, defines, structs,
70 The following options are available:
71 .Bl -tag -width indent
73 Use backward searching patterns
76 Use forward searching patterns
86 that do not take arguments;
88 that take arguments are tagged automatically.
90 Place the tag descriptions in a file called
92 The default behaviour is to place them in a file called
95 Create tags for typedefs, structs, unions, and enums (default).
97 Do not create tags for typedefs, structs, unions, and enums.
99 Update the specified files in the
102 references to them are deleted, and the new values are appended to the
104 (Beware: this option is implemented in a way which is rather
105 slow; it is usually faster to simply rebuild the
109 An index of the form expected by
111 is produced on the standard output.
113 contains the object name, file name, and page number (assuming 64
115 Since the output will be sorted into lexicographic order,
116 it may be desired to run the output through
119 .Bd -literal -offset indent
120 ctags -v files | sort -f > index
124 Suppress warning diagnostics.
127 produces a list of object
128 names, the line number and file name on which each is defined, as well
129 as the text of that line and prints this on the standard output.
131 is a simple index which can be printed out as an off-line readable
135 Files whose names end in
140 source files and are searched for C style routine and macro definitions.
141 Files whose names end in
146 Files whose names end in
148 are assumed to be Lisp files if their
149 first non-blank character is
158 Other files are first examined to see if they
159 contain any Pascal or Fortran routine definitions, and, if not, are
160 searched for C style definitions.
164 is treated specially in C programs.
166 is created by prepending
168 to the name of the file, with the
171 and any leading pathname components removed.
174 practical in directories with more than one
181 files each have a special tag.
184 of the second section of the
189 the second section of the
193 .Bl -tag -width ".Pa tags" -compact
195 default output tags file
199 Duplicate objects are not considered errors.
203 option is a no-op for compatibility with previous versions of
205 that did not create tags for typedefs, enums, structs and unions
221 Recognition of functions, subroutines and procedures
222 for Fortran and Pascal is done in a very simpleminded way.
224 is made to deal with block structure; if you have two Pascal procedures
225 in different blocks with the same name you lose.
229 understand about Pascal types.
231 The method of deciding whether to look for C, Pascal or
237 utility relies on the input being well formed, and any syntactical
238 errors will completely confuse it.
239 It also finds some legal syntax
240 confusing; for example, since it does not understand
242 (incidentally, that is a feature, not a bug), any code with unbalanced
245 will cause it to become somewhat disoriented.
246 In a similar fashion, multiple line changes within a definition will
247 cause it to enter the last line of the object, rather than the first, as
248 the searching pattern.
249 The last line of multiple line
251 will similarly be noted.