3 ctags - Generates "tags" and (optionally) "refs" files
5 \fBctags\fP [\fB-stvra\fP] \fIfilesnames\fP...
7 \fIctags\fP generates the "tags" and "refs" files
8 from a group of C source files.
9 The "tags" file is used by Elvis' ":tag" command,
12 The "refs" file is sometimes used by the \fIref(1)\fP program.
14 Each C source file is scanned for #define statements and
15 global function definitions.
16 The name of the macro or function becomes the name of a tag.
17 For each tag, a line is added to the "tags" file which contains:
22 - the name of the file containing the tag
24 - a way to find the particular line within the file.
28 The filenames list will typically be the names of all C source
29 files in the current directory, like this:
38 A tag will be generated for each user-defined type.
39 Also tags will be generated for struct and enum names.
40 Types are considered to be global if they are defined in a header file,
41 and static if they are defined in a C source file.
43 Include variable declarations.
44 A tag will be generated for each variable, except for those that are declared
45 inside the body of a function.
48 \fICtags\fR will normally put global tags in the "tags" file, and silently ignore
50 This flag causes both global and static tags to be added.
51 The name of a static tag is generated by prefixing the name of the declared
52 item with the name of the file where it is defined, with a colon in between.
53 For example, "static foo(){}" in "bar.c" results in a tag named "bar.c:foo".
55 This causes \fIctags\fP to generate both "tags" and "refs".
56 Without \fB-r\fP, it would only generate "tags".
58 Append to "tags", and maybe "refs".
59 Normally, \fIctags\fR overwrites these files each time it is invoked.
60 This flag is useful when you have to many files in the current directory
61 for you to list them on a single command-line;
62 it allows you to split the arguments among several invocations.
65 A cross-reference that lists each tag name, the name of the source file that
66 contains it, and a way to locate a particular line in the source file.
68 The "refs" file contains the definitions for each tag in the "tags" file,
70 This file can be useful, for example, when licensing restrictions prevent
71 you from making the source code to the standard C library readable by everybody,
72 but you still everybody to know what arguments the library functions need.
75 \fIctags\fR is sensitive to indenting and line breaks.
76 Consequently, it might not discover all of the tags in a file that
77 is formatted in an unusual way.