.TH ctags "" "" Command
.PC "Generate tags and refs files for vi editor"
\fBctags\fP [\fB-r\fP] \fIfiles\fP...
.PP
\fBctags\fR generates the files
.B tags
and
.B refs
from a group of C-source files.
.B tags
is used by the
.B elvis
editor's \fB:tag\fR command, \fB<ctrl-]>\fR command, and \fB\-t\fR option.
.B refs
is used by the command \fBref\fR.
.PP
Each C-source file is scanned for
.B #define
statements and global function definitions.
The name of the macro or function becomes the name of a tag.
For each tag, a line is added to
.BR tags ,
which contains the following:
.DS
	\(bu the name of the tag
	\(bu a tab character
	\(bu the name of the file containing the tag
	\(bu a tab character
	\(bu a way to find the particular line within the file
.DE
.PP
.B refs
is used by the command \fBref\fR, which can be invoked via
.BR elvis 's
.B K
command.
When
.B ctags
finds a global function definition,
it copies the function header into
.BR refs .
The first line is flush against the right margin,
but the argument definitions are indented.
The command
.B ref
can search
.B refs
much faster than it could search all C-source files.
The file-names list will typically include the names of all C-source
files in the current directory, in the following format:
.DM
	ctags -r *.[ch]
.DE
.PP
The \fB-r\fP to
.B ctags
tells it to generate both
.B tags
and
.BR refs .
Without \fB-r\fP, it generates only
.BR tags .
.SH "See Also"
.Xr "commands," commands
.Xr "elvis," elvis
.Xr "ref" ref
.SH Notes
This version of
.B ctags
does not parse ANSI source code very well.
It has trouble recognizing the ANSI function definitions.
.PP
.II "Kirkendall, Steve"
.B ctags
is copyright \(co 1990 by Steve Kirkendall,
and was written by Steve Kirkendall (kirkenda@cs.pdx.edu)
assisted by numerous volunteers.
It is freely redistributable, subject to the restrictions noted in
included documentation.
Source code for \fBctags\fR 
is available through the Mark Williams bulletin board,
USENET, and numerous other outlets.
.PP
Please note that this program
is offered as a service to \*(CO users, but is not supported
by Mark Williams Company.
\fICaveat utilitor.\fR
