Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctags(1) — Unisoft V7

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ex(1)

vi(1)

CTAGS(1)  —  UNIX Programmer’s Manual

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.  This is a simple index will still not be created. 

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

Other options are:

−w suppressing warning diagnostics. 

−u causing 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. 

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 tagsfile

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

7th Edition  —  1/27/82

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