HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

c
ctags(1) ctags(1)
DIAGNOSTICS
Too many entries to sort.
An attempt to get additional heap space failed; the sort could not be performed.
Unexpected end of function in file file, line
line.
The tags file may be incorrect.
A } character was found unexpectedly in the first column. This can lead to incorrect entries in the
tags file.
Duplicate entry in file file, line
line: name. Second entry ignored.
The same name was detected twice in the same file. A tags entry was made only for the first name
found.
Duplicate entry in files file1 and file2: name (Warning only).
The same name was detected in two different files. A tags entry was made only for the first name
found.
EXAMPLES
Create a tags file named
tags in the current directory for all C source (*.c
) files and all header (*.h)
files in the current directory:
ctags *.[ch]
Once the tags file exists in the current directory, it can be used with commands that support tag files (such
as vi (see vi(1)).
Use the tags file with vi to edit a particular function myfunc() located in one of the source files:
vi -t myfunc
While editing a C source file using vi, use the ex-mode tag command to edit function
myfunc():
:tag myfunc
Use vi to find main() in file myprog.c:
vi -t Mmyprog
While using vi,find main() in file myprog.c (does not have to be the file currently being edited):
:tag Mmyprog
WARNINGS
Recognition of functions, subroutines , and procedures for FORTRAN and Pascal is done in a
very simple way. No attempt is made to deal with block structure; if there are two Pascal procedures in
different blocks with the same name, a warning message is generated.
The method of deciding whether to look for C or Pascal and
FORTRAN functions is an approximation, and can
be fooled by unusual programs.
ctags does not know about #ifdefs and Pascal types.
It relies on the input being well formed to detect typedefs.
Use of -tx shows only the last line of typedefs.
ex is naive about tags files with several identical tags; it simply chooses the first entry its (non-linear)
search finds with that tag. Such files can be created with either the -u or -a options or by editing a tags
file.
If more than one (function) definition appears on a single line, only the first definition is indexed.
AUTHOR
ctags was developed by the University of California, Berkeley.
FILES
tags output tags file
OTAGS temporary file used by -u
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 1151