c

ctags(1)

ctags(1)

NAME

ctags - create a tags ®le

SYNOPSIS

ctags [-xvFBatwu]®les ...

DESCRIPTION

ctags makes a tags ®le for ex(1) (or vi(1)) from the speci®ed C, Pascal and FORTRAN sources. A tags ®le gives the locations of speci®ed objects (for C, functions, macros with argments, and typedefs; Pascal, pro- cedures, programs and functions; FORTRAN, subroutines, programs and functions) in a group of ®les. Each line of the tags ®le contains the object name, the ®le in which it is de®ned, and an address speci®cation for the object de®nition. 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. Speci®ers are given in separate ®elds on the line, separated by spaces or tabs. Using the tags ®le, ex can quickly ®nd these objects' de®nitions.

-xCause ctags to print a simple function index. This is done by assembling a list of function names, ®le names on which each function is de®ned, 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 ®le is created or changed.

-vProduce a page index on the standard output. This listing contains the function name, ®le name, and page number within that ®le (assuming 56-line pages to match pr(1)).

Files whose name ends in .c or .h are assumed to be C source ®les and are searched for C routine and macro de®nitions. Others are ®rst examined to see if they contain any Pascal or FORTRAN routine de®nitions; if not, they are processed again looking for C de®nitions.

Other options are:

-FUse forward searching patterns (/.../) (default). -BUse backward searching patterns (?...?).

-aAdd the information from the ®les to the tags ®le. Unlike re-building the tags ®le from the original ®les, this can cause the same symbol to be entered twice in the tags ®le. This option should be used with caution and then only in very special circumstances.

-tCreate tags for typedefs.

-wSuppress warning diagnostics.

-uUpdate the speci®ed ®les in tags; that is, all references to those ®les are deleted, and the new values are added to the ®le as in -aabove. (Beware: this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the tags ®le.)

The tag main is treated specially in C programs. The tag formed is created by adding M to the beginning of name of the ®le, 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 speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed 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 ®le names are not supported.

Section 1150

− 1 −

HP-UX Release 11i: December 2000