CTAGS(1) INTERACTIVE UNIX System CTAGS(1)
NAME
ctags - create a tags file
SYNOPSIS
ctags [ -a ] [ -u ] [ -v ] [ -w ] [ -x ] name ...
DESCRIPTION
ctags makes a tags file for vi(1) from the specified C
sources. A tags file gives the locations of specified
objects (in this case functions) in a group of files. Each
line of the tags file contains the function name, the file
in which it is defined, and a scanning pattern used to find
the function definition. These are given in separate fields
on the line, separated by blanks or tabs. Using the tags
file, vi can quickly find these function definitions.
If the -x flag is given, ctags produces a list of function
names and the line number and file name on which each is
defined, as well as the text of that line, and prints this
on the standard output. With the -x option, no tags file is
created. This is a simple index which can be printed out as
an off-line readable function index. Files whose name ends
in .c or .h are assumed to be C source files and are
searched for C routine and macro definitions.
Other options are
-a Causes specified files to be appended to tags; that is,
new values for the files are appended to the tags file.
-u Causes the specified files to be updated in tags; that
is, all references to them are deleted, and the new
values are appended to the file. (Beware: this option
is implemented in a way which is rather slow; it is
usually faster to simply rebuild the tags file.)
-v Produces a list of function names, the filename each
function is declared in, and the function's line
number. This list prints on the standard output, and no
tags file is created.
-w Suppresses warning diagnostics.
The tag main is treated specially in C programs. The tag
formed is created by prefixing M to the name of the file,
with a trailing .c removed, if any, and leading path name
components also removed. This makes use of ctags practical
in directories with more than one program.
FILES
tags Output tags file
SEE ALSO
Rev. C Software Development Set Page 1
CTAGS(1) INTERACTIVE UNIX System CTAGS(1)
ex(1), vi(1) in the INTERACTIVE UNIX System User's/System
Administrator's Reference Manual.
CREDIT
This utility was developed at the University of California
at Berkeley and is used with permission.
Rev. C Software Development Set Page 2