Commit | Line | Data |
---|---|---|
efdd6d01 C |
1 | .TH CTAGS 1 4/1/81 |
2 | .UC 4 | |
3 | .SH NAME | |
4 | ctags \- create a tags file | |
5 | .SH SYNOPSIS | |
6 | .B ctags | |
7 | [ | |
8 | .B \-u | |
9 | ] [ | |
10 | .B \-v | |
11 | ] [ | |
12 | .B \-w | |
13 | ] [ | |
14 | .B \-x | |
15 | ] | |
16 | name ... | |
17 | .SH DESCRIPTION | |
18 | .I Ctags | |
19 | makes a tags file for | |
20 | .IR ex (1) | |
21 | from the specified C, Pascal and Fortran sources. | |
22 | A tags file gives the locations of specified objects (in this case | |
23 | functions) in a group of files. | |
24 | Each line of the tags file contains the function name, | |
25 | the file in which it is defined, and a scanning pattern used to find | |
26 | the function definition. These are given in separate fields on the line, | |
27 | separated by blanks or tabs. | |
28 | Using the | |
29 | .I tags | |
30 | file, | |
31 | .I ex | |
32 | can quickly find these function definitions. | |
33 | .PP | |
34 | If the | |
35 | .B \-x | |
36 | flag is given, | |
37 | .I ctags | |
38 | produces a list of function names, the line number and file | |
39 | name on which each is defined, as well as the text of that line | |
40 | and prints this on the standard output. This is a simple index | |
41 | which can be printed out as an off-line readable function index. | |
42 | .PP | |
43 | If the | |
44 | .B \-v | |
45 | flag is given, | |
46 | an index of the form expected by | |
47 | .IR vgrind (1) | |
48 | is produced on the standard output. | |
49 | This listing contains the function name, | |
50 | file name, and page number | |
51 | (assuming 64 line pages). | |
52 | Since the output will be sorted into lexicographic order, | |
53 | it may be desired to run the output through | |
54 | .BR "sort \-f" . | |
55 | Sample use: | |
56 | .nf | |
57 | ctags \-v files | sort \-f > index | |
58 | vgrind \-x index | |
59 | .fi | |
60 | .PP | |
61 | Files whose name ends in | |
62 | .B \.c | |
63 | or | |
64 | .B \.h | |
65 | are assumed to be C source files and are searched for C routine and | |
66 | macro definitions. | |
67 | Others are first examined to see if they contain any Pascal or | |
68 | Fortran routine definitions; if not, they are processed again | |
69 | looking for C definitions. | |
70 | .PP | |
71 | Other options are: | |
72 | .TP 5 | |
73 | .B \-w | |
74 | suppressing warning diagnostics. | |
75 | .TP 5 | |
76 | .B \-u | |
77 | causing the specified files to be | |
78 | .I updated | |
79 | in tags, that is, all references to them are deleted, | |
80 | and the new values are appended to the file. | |
81 | (Beware: this option is implemented in a way which is rather slow; | |
82 | it is usually faster to simply rebuild the | |
83 | .I tags | |
84 | file.) | |
85 | .PP | |
86 | The tag | |
87 | .I main | |
88 | is treated specially in C programs. | |
89 | The tag formed is created by prepending | |
90 | .I M | |
91 | to the name of the file, with a trailing .c removed, if | |
92 | any, and leading pathname components also removed. | |
93 | This makes use of | |
94 | .I ctags | |
95 | practical in directories with more than one program. | |
96 | .SH FILES | |
97 | .DT | |
98 | tags output tags file | |
99 | .SH SEE ALSO | |
100 | ex(1), vi(1) | |
101 | .SH AUTHOR | |
102 | Ken Arnold; FORTRAN added by Jim Kleckner; Bill Joy | |
103 | added Pascal and | |
104 | .B \-x, | |
105 | replacing | |
106 | .I cxref. | |
107 | .SH BUGS | |
108 | Recognition of \fBfunctions\fR, \fBsubroutines\fR and \fBprocedures\fR | |
109 | for FORTRAN and Pascal is done is a very simpleminded way. | |
110 | No attempt is made to deal with block structure; if you have two | |
111 | Pascal procedures in different blocks with the same name you lose. | |
112 | .PP | |
113 | The method of deciding whether to look for C or Pascal and FORTRAN | |
114 | functions is a hack. |