1 .\" $NetBSD: ctags.1,v 1.14 2003/02/25 10:35:39 wiz Exp $
3 .\" Copyright (c) 1987, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)ctags.1 8.1 (Berkeley) 6/6/93
37 .Nd create a tags file
50 lex, and lisp sources.
51 A tags file gives the locations of specified objects in a group of files.
52 Each line of the tags file contains the object name, the file in which it
53 is defined, and a search pattern for the object definition, separated by
59 can quickly locate these object definitions.
60 Depending upon the options provided to
62 objects will consist of subroutines, typedefs, defines, structs,
66 use backward searching patterns
69 use forward searching patterns
79 that don't take arguments;
81 that take arguments are tagged automatically.
83 Places the tag descriptions in a file called
85 The default behaviour is to place them in a file called
88 create tags for typedefs, structs, unions, and enums.
90 update the specified files in the
93 references to them are deleted, and the new values are appended to the
95 (Beware: this option is implemented in a way which is rather
96 slow; it is usually faster to simply rebuild the
100 An index of the form expected by
102 is produced on the standard output.
104 contains the object name, file name, and page number (assuming 64
106 Since the output will be sorted into lexicographic order,
107 it may be desired to run the output through
110 .Bd -literal -offset indent
111 ctags \-v files \&| sort \-f \*[Gt] index
115 suppress warning diagnostics.
118 produces a list of object
119 names, the line number and file name on which each is defined, as well
120 as the text of that line and prints this on the standard output.
122 is a simple index which can be printed out as an off-line readable
126 Files whose names end in
131 source files and are searched for C style routine and macro definitions.
132 Files whose names end in
137 Files whose names end in
139 are assumed to be lisp files if their
140 first non-blank character is
146 treated as lex files.
147 Other files are first examined to see if they
148 contain any Pascal or Fortran routine definitions, and, if not, are
149 searched for C style definitions.
153 is treated specially in C programs.
155 is created by prepending
157 to the name of the file, with the
160 and any leading pathname components removed.
164 practical in directories with more than one
167 Yacc and lex files each have a special tag.
170 of the second section of the yacc file, and
173 the second section of the lex file.
176 exits with a value of 1 if an error occurred, 0 otherwise.
177 Duplicate objects are not considered errors.
179 .Bl -tag -width tags -compact
181 default output tags file
199 and Pascal is done in a very simpleminded way.
201 is made to deal with block structure; if you have two Pascal procedures
202 in different blocks with the same name you lose.
205 understand about Pascal types.
207 The method of deciding whether to look for C, Pascal or
212 relies on the input being well formed, and any syntactical
213 errors will completely confuse it.
214 It also finds some legal syntax
215 confusing; for example, since it doesn't understand
217 (incidentally, that's a feature, not a bug), any code with unbalanced
220 will cause it to become somewhat disoriented.
221 In a similar fashion, multiple line changes within a definition will
222 cause it to enter the last line of the object, rather than the first, as
223 the searching pattern.
224 The last line of multiple line
226 will similarly be noted.