ctags
PURPOSE
Makes a file of tags to help locate objects in source
files.
SYNOPSIS
ctags [ -auwx ] name ...
DESCRIPTION
The ctags command makes a tags file for ex and vi editors
from the specified C, Pascal, and FORTRAN source files.
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 object name, the file in which
it is defined, and an address specification for the
object definition. Functions are searched with a
pattern. Specifiers are given in separate fields on the
line, separated by blanks or tabs. Using the tags file,
ex and vi can quickly find these object definitions.
If a file name ends in .c or .h, it is assumed to be a C
source file and is searched for C routine and macro defi-
nitions. Others are first examined to see if they
contain any Pascal or FORTRAN routine definitions; if
not, they are processed again for C definitions.
The tag main is treated specially in C programs. The tag
formed is created by prefixing M to the file name,
removing a trailing .c (if any), and removing the leading
path name components. This makes use of ctags practical
in directories with more than one program.
Notes:
1. Recognitions of the keywords function, subroutine,
and procedure in FORTRAN and Pascal code is performed
in a very simple-minded way. No attempt is made to
deal with block structure; if you have two Pascal
procedures with the same name but in different
blocks, ctags may yield inadequate results.
2. The ctags command does not know about #ifdef.
FLAGS
-a Appends to tags file.
-w Suppresses warning diagnostics.
-x Causes ctags to display a list of object names, the
line number and file name on which each is defined,
as well as the text of that line. This provides a
simple index index. If you specify this flag, ctags
does not build a tags file.
-u Updates the specified files in tags; that is, all
references to them are deleted, and the new values
are appended to the file. This flag may be slow.
(It is usually faster to simply rebuild the tags
file.)
FILES
tags Output tags file.
RELATED INFORMATION
The following commands: "ex" and "vi, vedit, view."