ctags(1)							     ctags(1)



NAME
  ctags - Makes a tags file for source file objects.

SYNOPSIS

  ctags [-aBdFtuvw] [-x | -f tags_file] file ...

  The ctags command makes a tags file for ex and vi editors from the speci-
  fied C, Pascal, FORTRAN, yacc, lex, and LISP source files.  A tags file
  gives the locations of specified objects (in this case functions and type
  definitions) in a group of files.

FLAGS

  -a  Adds item(s) to the tags file.  This option can be very slow for large
      tags files.

  -f tags_file
      Creates a tags file with the name specified by tags_file.

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

  -d  Creates tags for #define directives that do not take arguments.
      #define directives that take arguments are tagged automatically.

  -F  Uses forward searching pattern (/.../) (default).

  -t  Creates tags for type definitions (typedef), and for struct, union, and
      enum declarations.

  -u  Updates the specified files in tags; that is, all references to them
      are deleted, and the new values are added to the file. The tags file is
      sorted. This flag may be slow, so it is usually faster to simply
      rebuild the tags file.

  -v  Produces an index of the form expected by vgrind on the standard out-
      put.  This listing contains the function name, filename, and page
      number (assuming 64-line pages).	Because the output will be sorted
      according to the current collating sequence as defined by the value of
      the LC_COLLATE environment variable, it may be desirable to run the
      output through sort -f.  Sample use:

	   ctags -v files | sort -f > index
	   vgrind -x index


  -w  Suppresses warning diagnostics.

  -x  Causes ctags to display a list of object names, the line number and
      filename on which each is defined, as well as the text of that line.
      This provides a simple index, which can be printed out as an offline
      readable function index.	If you specify this flag, ctags does not
      build a tags file, but writes to standard output.

DESCRIPTION

  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.  Func-
  tions are searched with a pattern and type definitions with a line number.
  Specifiers are given in separate fields on the line, separated by spaces or
  tabs.	 Using the tags file, ex and vi can quickly find these object defini-
  tions.

  If a filename ends in .c or .h, it is assumed to be a C source file and is
  searched for C routine and macro definitions.	 Files whose names end in .y
  are assumed to be yacc source files.	Files whose names end in .l are
  assumed to be either LISP files (if their first nonspace character is ;
  (semicolon), ( (open parenthesis), or [ (open bracket)) or lex files other-
  wise.	 Others are first examined to see if they contain any Pascal or FOR-
  TRAN routine definitions; if not, they are processed again for C defini-
  tions.

  The tag main is treated specially in C programs.  The tag formed is created
  by prefixing M to the filename, removing a trailing .c (if any), and remov-
  ing the leading pathname components.	This makes use of ctags practical in
  directories with more than one program.

RESTRICTIONS

  Recognition of functions, subroutines, and procedures for FORTRAN and Pas-
  cal does not deal with block structure.  Therefore, you cannot have two
  Pascal procedures in different blocks with the same name.

  The ctags command does not know about ifdefs.

FILES

  tags	    Default tags file.	Use the -f flag to specify another filename.

RELATED INFORMATION

  Commands:  ex(1), lex(1), sort(1) vi(1)/vedit(1)/view(1), yacc(1).