Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
c
ctags(1) ctags(1)
NAME
ctags - create a tags file
SYNOPSIS
ctags [-xvFBatwu] files ...
DESCRIPTION
ctags makes a tags file for ex(1) (or vi(1)) from the specified C, Pascal and FORTRAN sources. A tags file
gives the locations of specified objects (for C, functions, macros with argments, and typedefs; Pascal, pro-
cedures, programs and functions; FORTRAN, subroutines, programs and 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. Output is sorted in ascending collation order (see Environment Variables below). All
objects except C typedefs are searched with a pattern, typedefs with a line number. Specifiers are given in
separate fields on the line, separated by spaces or tabs. Using the tags file, ex can quickly find these
objects’ definitions.
-x Cause ctags to print a simple function index. This is done by assembling a list of function
names, file names on which each function is defined, the line numbers where each function
name occurs, and the text of each line. The list is then printed on the standard output. No
tags file is created or changed.
-v Produce a page index on the standard output. This listing contains the function name, file
name, and page number within that file (assuming 56-line pages to match pr(1)).
Files whose name ends in
.c or .h are assumed to be C source files and are searched for C routine and
macro definitions. Others are first examined to see if they contain any Pascal or F
ORTRAN routine
definitions; if not, they are processed again looking for C definitions.
Other options are:
-F Use forward searching patterns (/.../)(default).
-B Use backward searching patterns (?...?).
-a Add the information from the files to the tags file. Unlike re-building the tags file from the
original files, this can cause the same symbol to be entered twice in the tags file. This option
should be used with caution and then only in very special circumstances.
-t Create tags for typedefs.
-w Suppress warning diagnostics.
-u Update the specified files in tags; that is, all references to those files are deleted, and the new
values are added to the file as in -a above. (Beware: this option is implemented in a way
which is rather slow; it is usually faster to simply rebuild the tags file.)
The tag
main is treated specially in C programs. The tag formed is created by adding M to the beginning
of name of the file, with any trailing .c removed, and leading pathname components also removed. This
makes use of ctags practical in directories with more than one program.
EXTERNAL INFLUENCES
Environment Variables
LC_COLLATE determines the order in which the output is sorted.
LC_CTYPE determines the interpretation of the single- and/or multi-byte characters within comments and
string literals.
If LC_COLLATE or LC_CTYPE is not specified in the environment or is set to the empty string, the
value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is
set to the empty string, a default of ‘‘C’’ (see lang(5)) is used instead of LANG. If any internationalization
variable contains an invalid setting, ctags behaves as if all internationalization variables are set to ‘‘C’’.
See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported with the exception that multi-byte character file
names are not supported.
Section 1−−150 − 1 − HP-UX Release 11i: December 2000
___
___