ctags(1) MPE/iX Shell and Utilities ctags(1)
______________________________________________________________________
NAME
ctags -- produce tags file for ex, more, and vi
SYNOPSIS
ctags [-aBFwx] [-f tagfile] sourcefile ...
DESCRIPTION
By default, ctags generates a file named tags in the current
directory which summarizes the C function, macro, and typedef
definitions found in the sourcefiles named on the command line.
See tags(2) for a description of the format of the tags file.
You can access this file with the -t name option in ex, more, and
vi, the command
:tag name
in ex and vi, and the command
:tname
in more. The idea is that you tell the utility which function
you want to look at, and it checks the tags file to determine
which source file contains the function.
ctags makes special provision for the function main() which may
occur in several source files. The tags file contains an entry
for the first main() routine found. For all occurrences of
main() (including the first), the tags file also contains an
entry for Mname where name is the name of the input sourcefile,
with the .c suffix and any leading path name components removed.
For example, a tags file created for a C source code file named
foo.c would contain an entry for Mfoo which represents the main()
routine in foo.c.
ctags uses sort(1) to sort the file by tag name, according to the
POSIX locale's collation sequence.
Options
ctags accepts the following options:
-a appends output to the existing tags file rather than
overwriting the file.
-B produces a tags file that searches backward from the current
position to find the pattern matching the tag.
-F searches for tag patterns in the forward direction
(default).
-f tagfile
generates a file named tagfile rather than the default tags.
1
ctags(1) MPE/iX Shell and Utilities ctags(1)
______________________________________________________________________
-w suppresses warning messages.
-x produces a human-readable report on the standard output.
The report gives the definition name, the line number of
where it appears in the file, the name of the file in which
it appears, and the text of that line. ctags arranges this
output in columns and sorts it in order by tag name accord-
ing to the current locale's collation sequence. This option
does not produce a tags file.
FILES
ctags generates the following file:
tags output tags file
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 An error occurred.
Messages
Message: cannot allocate buffer: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: cannot create temp file: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: cannot determine NAME_MAX: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: cannot open temp file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Don't know how to process "filename"
Cause: You specified an input file that did not have a .c or
.h extension.
Action: Only specify input files with .c or .h extensions.
Message: file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Option -option argument missing
Cause: You did not provide an argument for -option.
Action: Provide the missing argument.
2
ctags(1) MPE/iX Shell and Utilities ctags(1)
______________________________________________________________________
Message: pipe to command "cmd": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: tag file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: tmp file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: unable to pipe to sort command: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Unknown option "-option"
Cause: You specified an option that is not valid for ctags.
Action: Check the DESCRIPTION section for a list of valid ctags
options.
Message: Warning: ident already defined in filename.
Cause: You defined the identifier ident multiple times. The
occurrence which produced this warning is ignored.
Action: Remove the extra definitions of ident.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. 4.2 BSD UNIX and up.
The only language understood by this version of ctags is C.
The -B, -F, and -w options are MPE/iX extensions to the POSIX
standard.
NOTE
Recognizing a function definition in C source code can be some-
what difficult. Since ctags does not know which C preprocessor
symbols are defined, there may be some misplaced function defini-
tion information if sections of code within #if...#endif are not
complete blocks.
ctags invokes the sort command internally.
MPE/iX NOTES
For information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
more(1), sort(1), vi(1), tags(2)
3