Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctags(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ex

vi, vedit, view



CTAGS(1,C)                  AIX Commands Reference                   CTAGS(1,C)



-------------------------------------------------------------------------------
ctags



PURPOSE

Makes a file of tags to help locate objects in source files.

SYNTAX


         +--- -F ----+    +---------------+  +------ file -------+
ctags ---| +-------+ |----|               |--|                   |-|
         +-| -B -u |-+    +- -f tagsfile -+  +- <list_of_files  -+
          ^| -F -v ||
          || -a -w ||
          || -t -x ||
          |+-------+|
          +---------+


DESCRIPTION

The ctags command makes a tags file for the ex and vi editors from the C,
Pascal, and FORTRAN source files specified in the list_of_files parameter.  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,
the ex and vi editors 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 definitions.  Other files first are 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 the use of the ctags command
practical in directories with more than one program.

Notes:

  1. Recognition of the keywords function, subroutine, and procedure in FORTRAN
    and Pascal code is performed in a simple manner.  No attempt is made to
    deal with block structures; if you have two Pascal procedures with the same
    name but in different blocks, the ctags command may yield inadequate
    results.




Processed November 8, 1990        CTAGS(1,C)                                  1





CTAGS(1,C)                  AIX Commands Reference                   CTAGS(1,C)



  2. The ctags command does not recognize the #ifdef statement.

FLAGS

-a         Appends to the tags file.

-B         Uses backward searching patterns (?...?).

-f tagsfile
           Creates a file of the specified name tagsfile instead of the default
           tags.

-F         Uses forward searching patterns (/.../).

-t         Creates tags for typedefs, structs, unions, and enums.

-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
           process may be slow.  (It is usually faster to simply rebuild the
           tags file.)

-v         Verbose option.

-w         Suppresses warning diagnostics.

-x         Causes the ctags command 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 flag provides a simple index.  If you specify
           this flag, the ctags command does not build a tags file.

FILES

tags   Output tags file.

RELATED INFORMATION

See the following commands:  "ex" and "vi, vedit, view."


















Processed November 8, 1990        CTAGS(1,C)                                  2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026