Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctags(1) — GL2 W2.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ex(1)

vi(1)

CTAGS(1)  —  Silicon Graphics

NAME

ctags − maintain a tags file for a C program

SYNOPSIS

ctags [ −a ] [ −u ] [ −w ] [ −x ] name ... 

DESCRIPTION

Ctags makes a tags file for ex(1) and vi(1) from the specified C, Fortran, and Pascal sources.

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 function name, the file in which it is defined, and a scanning pattern used to find the function definition.  These are given in separate fields on the line, separated by blanks or tabs.  Using the tags file, ex can quickly find these function definitions. 

Options

The −a option causes the output to be appended to the tags file instead of rewriting it. 

The −u option causes the specified files to be updated in tags, that is, all references to them are deleted, and the new values are appended to the file.  This option implies the −a option.  (Beware:  this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the tags file.) 

The −w option suppresses warning diagnostics. 

If the −x flag is given, ctags produces a list of function names, the line number and file name on which each is defined, as well as the text of that line and prints this on the standard output. 

Files whose name ends in ".c" or ".h" are assumed to be C source files and are searched for C routine and macro definitions. 

The tag main is treated specially in C programs.  The tag formed is created by prepending "M" to the name of the file, with a trailing ".c" removed, if any, and leading pathname components also removed.  This makes use of ctags, practical in directories with more than one program.

EXAMPLE

ctags ∗.c ∗.h

puts the tags from all the ".c" and ".h" files into the tagsfile "tags". 

FILES

tagsoutput tags file

SEE ALSO

ex(1), vi(1). 

AUTHOR

Ken Arnold

Version 2.4  —  May 08, 1986

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