Debian Codegraph @

ctags.html

raw
1 <!-- Creator : groff version 1.21 -->
2 <!-- CreationDate: Thu Mar 17 14:38:55 2011 -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4 "http://www.w3.org/TR/html4/loose.dtd">
5 <html>
6 <head>
7 <meta name="generator" content="groff -Thtml, see www.gnu.org">
8 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9 <meta name="Content-Style" content="text/css">
10 <style type="text/css">
11 p { margin-top: 0; margin-bottom: 0; vertical-align: top }
12 pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
13 table { margin-top: 0; margin-bottom: 0; vertical-align: top }
14 h1 { text-align: center }
15 </style>
16 <title>CTAGS</title>
17
18 </head>
19 <body>
20
21 <h1 align="center">CTAGS</h1>
22
23 <a href="#NAME">NAME</a><br>
24 <a href="#SYNOPSIS">SYNOPSIS</a><br>
25 <a href="#DESCRIPTION">DESCRIPTION</a><br>
26 <a href="#SOURCE FILES">SOURCE FILES</a><br>
27 <a href="#OPTIONS">OPTIONS</a><br>
28 <a href="#OPERATIONAL DETAILS">OPERATIONAL DETAILS</a><br>
29 <a href="#TAG FILE FORMAT">TAG FILE FORMAT</a><br>
30 <a href="#HOW TO USE WITH VI">HOW TO USE WITH VI</a><br>
31 <a href="#HOW TO USE WITH GNU EMACS">HOW TO USE WITH GNU EMACS</a><br>
32 <a href="#HOW TO USE WITH NEDIT">HOW TO USE WITH NEDIT</a><br>
33 <a href="#CAVEATS">CAVEATS</a><br>
34 <a href="#BUGS">BUGS</a><br>
35 <a href="#ENVIRONMENT VARIABLES">ENVIRONMENT VARIABLES</a><br>
36 <a href="#FILES">FILES</a><br>
37 <a href="#SEE ALSO">SEE ALSO</a><br>
38 <a href="#AUTHOR">AUTHOR</a><br>
39 <a href="#MOTIVATION">MOTIVATION</a><br>
40 <a href="#CREDITS">CREDITS</a><br>
41
42 <hr>
43
44
45 <h2>NAME
46 <a name="NAME"></a>
47 </h2>
48
49
50 <p style="margin-left:11%; margin-top: 1em">ctags &minus;
51 Generate tag files for source code</p>
52
53 <h2>SYNOPSIS
54 <a name="SYNOPSIS"></a>
55 </h2>
56
57
58 <p style="margin-left:11%; margin-top: 1em"><b>ctags</b>
59 [<b>options</b>] [<i>file(s)</i>] <b><br>
60 etags</b> [<b>options</b>] [<i>file(s)</i>]</p>
61
62 <h2>DESCRIPTION
63 <a name="DESCRIPTION"></a>
64 </h2>
65
66
67 <p style="margin-left:11%; margin-top: 1em">The
68 <b>ctags</b> and <b>etags</b> programs (hereinafter
69 collectively referred to as <b>ctags</b>, except where
70 distinguished) generate an index (or &quot;tag&quot;) file
71 for a variety of language objects found in <i>file(s)</i>.
72 This tag file allows these items to be quickly and easily
73 located by a text editor or other utility. A &quot;tag&quot;
74 signifies a language object for which an index entry is
75 available (or, alternatively, the index entry created for
76 that object).</p>
77
78 <p style="margin-left:11%; margin-top: 1em">Alternatively,
79 <b>ctags</b> can generate a cross reference file which
80 lists, in human readable form, information about the various
81 source objects found in a set of language files.</p>
82
83 <p style="margin-left:11%; margin-top: 1em">Tag index files
84 are supported by numerous editors, which allow the user to
85 locate the object associated with a name appearing in a
86 source file and jump to the file and line which defines the
87 name. Those known about at the time of this release are:</p>
88
89 <p style="margin-left:17%; margin-top: 1em"><b>Vi</b>(1)
90 and its derivatives (e.g. Elvis, Vim, Vile, Lemmy),
91 <b>CRiSP</b>, <b>Emacs</b>, <b>FTE</b> (Folding Text
92 Editor), <b>JED</b>, <b>jEdit</b>, <b>Mined</b>,
93 <b>NEdit</b> (Nirvana Edit), <b>TSE</b> (The SemWare
94 Editor), <b>UltraEdit</b>, <b>WorkSpace</b>, <b>X2</b>,
95 <b>Zeus</b></p>
96
97 <p style="margin-left:11%; margin-top: 1em"><b>Ctags</b> is
98 capable of generating different kinds of tags for each of
99 many different languages. For a complete list of supported
100 languages, the names by which they are recognized, and the
101 kinds of tags which are generated for each, see the
102 <b>&minus;&minus;list&minus;languages</b> and
103 <b>&minus;&minus;list&minus;kinds</b> options.</p>
104
105 <h2>SOURCE FILES
106 <a name="SOURCE FILES"></a>
107 </h2>
108
109
110 <p style="margin-left:11%; margin-top: 1em">Unless the
111 <b>&minus;&minus;language&minus;force</b> option is
112 specified, the language of each source file is automatically
113 selected based upon a mapping of file names to languages.
114 The mappings in effect for each language may be display
115 using the <b>&minus;&minus;list&minus;maps</b> option and
116 may be changed using the <b>&minus;&minus;langmap</b>
117 option. On platforms which support it, if the name of a file
118 is not mapped to a language and the file is executable, the
119 first line of the file is checked to see if the file is a
120 &quot;#!&quot; script for a recognized language.</p>
121
122 <p style="margin-left:11%; margin-top: 1em">By default, all
123 other files names are ignored. This permits running
124 <b>ctags</b> on all files in either a single directory (e.g.
125 &quot;ctags *&quot;), or on all files in an entire source
126 directory tree (e.g. &quot;ctags &minus;R&quot;), since only
127 those files whose names are mapped to languages will be
128 scanned.</p>
129
130 <p style="margin-left:11%; margin-top: 1em">[The reason
131 that .h extensions are mapped to C++ files rather than C
132 files is because it is common to use .h extensions in C++,
133 and no harm results in treating them as C++ files.]</p>
134
135 <h2>OPTIONS
136 <a name="OPTIONS"></a>
137 </h2>
138
139
140 <p style="margin-left:11%; margin-top: 1em">Despite the
141 wealth of available options, defaults are set so that
142 <b>ctags</b> is most commonly executed without any options
143 (e.g. &quot;ctags *&quot;, or &quot;ctags &minus;R&quot;),
144 which will create a tag file in the current directory for
145 all recognized source files. The options described below are
146 provided merely to allow custom tailoring to meet special
147 needs.</p>
148
149 <p style="margin-left:11%; margin-top: 1em">Note that
150 spaces separating the single-letter options from their
151 parameters are optional.</p>
152
153 <p style="margin-left:11%; margin-top: 1em">Note also that
154 the boolean parameters to the long form options (those
155 beginning with &quot;&minus;&minus;&quot; and that take a
156 &quot;<i>[=yes</i>|<i>no]</i>&quot; parameter) may be
157 omitted, in which case &quot;<b>=</b><i>yes</i>&quot; is
158 implied. (e.g. <b>&minus;&minus;sort</b> is equivalent to
159 <b>&minus;&minus;sort</b>=<i>yes</i>). Note further that
160 &quot;=<i>1</i>&quot; and &quot;=<i>on</i>&quot; are
161 considered synonyms for &quot;=<i>yes</i>&quot;, and that
162 &quot;=<i>0</i>&quot; and &quot;=<i>off</i>&quot; are
163 considered synonyms for &quot;=<i>no</i>&quot;.</p>
164
165 <p style="margin-left:11%; margin-top: 1em">Some options
166 are either ignored or useful only when used while running in
167 etags mode (see <b>&minus;e</b> option). Such options will
168 be noted.</p>
169
170 <p style="margin-left:11%; margin-top: 1em">Most options
171 may appear anywhere on the command line, affecting only
172 those files which follow the option. A few options, however,
173 must appear before the first file name and will be noted as
174 such.</p>
175
176 <p style="margin-left:11%; margin-top: 1em">Options taking
177 language names will accept those names in either upper or
178 lower case. See the
179 <b>&minus;&minus;list&minus;languages</b> option for a
180 complete list of the built-in language names.</p>
181
182 <table width="100%" border="0" rules="none" frame="void"
183 cellspacing="0" cellpadding="0">
184 <tr valign="top" align="left">
185 <td width="11%"></td>
186 <td width="3%">
187
188
189 <p><b>&minus;a</b></p></td>
190 <td width="4%"></td>
191 <td width="82%">
192
193
194 <p>Equivalent to <b>&minus;&minus;append</b>.</p></td></tr>
195 <tr valign="top" align="left">
196 <td width="11%"></td>
197 <td width="3%">
198
199
200 <p><b>&minus;B</b></p></td>
201 <td width="4%"></td>
202 <td width="82%">
203
204
205 <p>Use backward searching patterns (e.g. ?pattern?).
206 [Ignored in etags mode]</p></td></tr>
207 <tr valign="top" align="left">
208 <td width="11%"></td>
209 <td width="3%">
210
211
212 <p><b>&minus;e</b></p></td>
213 <td width="4%"></td>
214 <td width="82%">
215
216
217 <p>Enable etags mode, which will create a tag file for use
218 with the Emacs editor. Alternatively, if <b>ctags</b> is
219 invoked by a name containing the string &quot;etags&quot;
220 (either by renaming, or creating a link to, the executable),
221 etags mode will be enabled. This option must appear before
222 the first file name.</p></td></tr>
223 </table>
224
225 <p style="margin-left:11%;"><b>&minus;f</b>
226 <i>tagfile</i></p>
227
228 <p style="margin-left:18%;">Use the name specified by
229 <i>tagfile</i> for the tag file (default is
230 &quot;tags&quot;, or &quot;TAGS&quot; when running in etags
231 mode). If <i>tagfile</i> is specified as
232 &quot;&minus;&quot;, then the tag file is written to
233 standard output instead. <b>Ctags</b> will stubbornly refuse
234 to take orders if <i>tagfile</i> exists and its first line
235 contains something other than a valid tags line. This will
236 save your neck if you mistakenly type &quot;ctags &minus;f
237 *.c&quot;, which would otherwise overwrite your first C file
238 with the tags generated by the rest! It will also refuse to
239 accept a multi-character file name which begins with a
240 &rsquo;&minus;&rsquo; (dash) character, since this most
241 likely means that you left out the tag file name and this
242 option tried to grab the next option as the file name. If
243 you really want to name your output tag file
244 &quot;&minus;ugly&quot;, specify it as
245 &quot;./&minus;ugly&quot;. This option must appear before
246 the first file name. If this option is specified more than
247 once, only the last will apply.</p>
248
249 <table width="100%" border="0" rules="none" frame="void"
250 cellspacing="0" cellpadding="0">
251 <tr valign="top" align="left">
252 <td width="11%"></td>
253 <td width="3%">
254
255
256 <p><b>&minus;F</b></p></td>
257 <td width="4%"></td>
258 <td width="82%">
259
260
261 <p>Use forward searching patterns (e.g. /pattern/)
262 (default). [Ignored in etags mode]</p></td></tr>
263 </table>
264
265 <p style="margin-left:11%;"><b>&minus;h</b> <i>list</i></p>
266
267 <p style="margin-left:18%;">Specifies a list of file
268 extensions, separated by periods, which are to be
269 interpreted as include (or header) files. To indicate files
270 having no extension, use a period not followed by a
271 non-period character (e.g. &quot;.&quot;, &quot;..x&quot;,
272 &quot;.x.&quot;). This option only affects how the scoping
273 of a particular kinds of tags is interpreted (i.e. whether
274 or not they are considered as globally visible or visible
275 only within the file in which they are defined); it does not
276 map the extension to any particular language. Any tag which
277 is located in a non-include file and cannot be seen (e.g.
278 linked to) from another file is considered to have
279 file-limited (e.g. static) scope. No kind of tag appearing
280 in an include file will be considered to have file-limited
281 scope. If the first character in the list is a plus sign,
282 then the extensions in the list will be appended to the
283 current list; otherwise, the list will replace the current
284 list. See, also, the <b>&minus;&minus;file&minus;scope</b>
285 option. The default list is
286 &quot;.h.H.hh.hpp.hxx.h++.inc.def&quot;. To restore the
287 default list, specify <b>&minus;h</b> <i>default</i>. Note
288 that if an extension supplied to this option is not already
289 mapped to a particular language (see <b>SOURCE FILES</b>,
290 above), you will also need to use either the
291 <b>&minus;&minus;langmap</b> or
292 <b>&minus;&minus;language&minus;force</b> option.</p>
293
294 <p style="margin-left:11%;"><b>&minus;I</b>
295 <i>identifier&minus;list</i></p>
296
297 <p style="margin-left:18%;">Specifies a list of identifiers
298 which are to be specially handled while parsing C and C++
299 source files. This option is specifically provided to handle
300 special cases arising through the use of preprocessor
301 macros. When the identifiers listed are simple identifiers,
302 these identifiers will be ignored during parsing of the
303 source files. If an identifier is suffixed with a
304 &rsquo;+&rsquo; character, <b>ctags</b> will also ignore any
305 parenthesis-enclosed argument list which may immediately
306 follow the identifier in the source files. If two
307 identifiers are separated with the &rsquo;=&rsquo;
308 character, the first identifiers is replaced by the second
309 identifiers for parsing purposes. The list of identifiers
310 may be supplied directly on the command line or read in from
311 a separate file. If the first character of
312 <i>identifier&minus;list</i> is &rsquo;@&rsquo;,
313 &rsquo;.&rsquo; or a pathname separator (&rsquo;/&rsquo; or
314 &rsquo;\&rsquo;), or the first two characters specify a
315 drive letter (e.g. &quot;C:&quot;), the parameter
316 <i>identifier&minus;list</i> will be interpreted as a
317 filename from which to read a list of identifiers, one per
318 input line. Otherwise, <i>identifier&minus;list</i> is a
319 list of identifiers (or identifier pairs) to be specially
320 handled, each delimited by a either a comma or by white
321 space (in which case the list should be quoted to keep the
322 entire list as one command line argument). Multiple
323 <b>&minus;I</b> options may be supplied. To clear the list
324 of ignore identifiers, supply a single dash
325 (&quot;&minus;&quot;) for <i>identifier&minus;list</i>.</p>
326
327 <p style="margin-left:18%; margin-top: 1em">This feature is
328 useful when preprocessor macros are used in such a way that
329 they cause syntactic confusion due to their presence.
330 Indeed, this is the best way of working around a number of
331 problems caused by the presence of syntax-busting macros in
332 source files (see <b>CAVEATS</b>, below). Some examples will
333 illustrate this point.</p>
334
335 <p style="margin-left:23%; margin-top: 1em">int foo
336 ARGDECL4(void *, ptr, long int, nbytes)</p>
337
338 <p style="margin-left:18%; margin-top: 1em">In the above
339 example, the macro &quot;ARGDECL4&quot; would be mistakenly
340 interpreted to be the name of the function instead of the
341 correct name of &quot;foo&quot;. Specifying <b>&minus;I</b>
342 <i>ARGDECL4</i> results in the correct behavior.</p>
343
344 <p style="margin-left:23%; margin-top: 1em">/* creates an
345 RCS version string in module */ <br>
346 MODULE_VERSION(&quot;$Revision: 750 $&quot;)</p>
347
348 <p style="margin-left:18%; margin-top: 1em">In the above
349 example the macro invocation looks too much like a function
350 definition because it is not followed by a semicolon
351 (indeed, it could even be followed by a global variable
352 definition that would look much like a K&amp;R style
353 function parameter declaration). In fact, this seeming
354 function definition could possibly even cause the rest of
355 the file to be skipped over while trying to complete the
356 definition. Specifying <b>&minus;I</b>
357 <i>MODULE_VERSION+</i> would avoid such a problem.</p>
358
359 <p style="margin-left:23%; margin-top: 1em">CLASS Example {
360 <br>
361 // your content here <br>
362 };</p>
363
364 <p style="margin-left:18%; margin-top: 1em">The example
365 above uses &quot;CLASS&quot; as a preprocessor macro which
366 expands to something different for each platform. For
367 instance CLASS may be defined as &quot;class
368 __declspec(dllexport)&quot; on Win32 platforms and simply
369 &quot;class&quot; on UNIX. Normally, the absence of the C++
370 keyword &quot;class&quot; would cause the source file to be
371 incorrectly parsed. Correct behavior can be restored by
372 specifying <b>&minus;I</b> <i>CLASS=class</i>.</p>
373
374 <p style="margin-left:11%;"><b>&minus;L</b> <i>file</i></p>
375
376 <p style="margin-left:18%;">Read from <i>file</i> a list of
377 file names for which tags should be generated. If
378 <i>file</i> is specified as &quot;&minus;&quot;, then file
379 names are read from standard input. File names read using
380 this option are processed following file names appearing on
381 the command line. Options are also accepted in this input.
382 If this option is specified more than once, only the last
383 will apply. <b>Note:</b> <i>file</i> is read in
384 line-oriented mode, where a new line is the only delimiter
385 and non-trailing white space is considered significant, in
386 order that file names containing spaces may be supplied
387 (however, trailing white space is stripped from lines); this
388 can affect how options are parsed if included in the
389 input.</p>
390
391 <table width="100%" border="0" rules="none" frame="void"
392 cellspacing="0" cellpadding="0">
393 <tr valign="top" align="left">
394 <td width="11%"></td>
395 <td width="3%">
396
397
398 <p><b>&minus;n</b></p></td>
399 <td width="4%"></td>
400 <td width="47%">
401
402
403 <p>Equivalent to
404 <b>&minus;&minus;excmd</b>=<i>number</i>.</p> </td>
405 <td width="35%">
406 </td></tr>
407 <tr valign="top" align="left">
408 <td width="11%"></td>
409 <td width="3%">
410
411
412 <p><b>&minus;N</b></p></td>
413 <td width="4%"></td>
414 <td width="47%">
415
416
417 <p>Equivalent to
418 <b>&minus;&minus;excmd</b>=<i>pattern</i>.</p> </td>
419 <td width="35%">
420 </td></tr>
421 </table>
422
423 <p style="margin-left:11%;"><b>&minus;o</b>
424 <i>tagfile</i></p>
425
426 <p style="margin-left:18%;">Equivalent to <b>&minus;f</b>
427 <i>tagfile</i>.</p>
428
429 <table width="100%" border="0" rules="none" frame="void"
430 cellspacing="0" cellpadding="0">
431 <tr valign="top" align="left">
432 <td width="11%"></td>
433 <td width="3%">
434
435
436 <p><b>&minus;R</b></p></td>
437 <td width="4%"></td>
438 <td width="82%">
439
440
441 <p>Equivalent to <b>&minus;&minus;recurse</b>.</p></td></tr>
442 <tr valign="top" align="left">
443 <td width="11%"></td>
444 <td width="3%">
445
446
447 <p><b>&minus;u</b></p></td>
448 <td width="4%"></td>
449 <td width="82%">
450
451
452 <p>Equivalent to <b>&minus;&minus;sort</b>=<i>no</i> (i.e.
453 &quot;unsorted&quot;).</p> </td></tr>
454 <tr valign="top" align="left">
455 <td width="11%"></td>
456 <td width="3%">
457
458
459 <p><b>&minus;V</b></p></td>
460 <td width="4%"></td>
461 <td width="82%">
462
463
464 <p>Equivalent to <b>&minus;&minus;verbose</b>.</p></td></tr>
465 <tr valign="top" align="left">
466 <td width="11%"></td>
467 <td width="3%">
468
469
470 <p><b>&minus;w</b></p></td>
471 <td width="4%"></td>
472 <td width="82%">
473
474
475 <p>This option is silently ignored for
476 backward-compatibility with the ctags of SVR4 Unix.</p></td></tr>
477 <tr valign="top" align="left">
478 <td width="11%"></td>
479 <td width="3%">
480
481
482 <p><b>&minus;x</b></p></td>
483 <td width="4%"></td>
484 <td width="82%">
485
486
487 <p>Print a tabular, human-readable cross reference (xref)
488 file to standard output instead of generating a tag file.
489 The information contained in the output includes: the tag
490 name; the kind of tag; the line number, file name, and
491 source line (with extra white space condensed) of the file
492 which defines the tag. No tag file is written and all
493 options affecting tag file output will be ignored. Example
494 applications for this feature are generating a listing of
495 all functions located in a source file (e.g. <b>ctags
496 &minus;x &minus;&minus;c&minus;kinds</b>=<i>f file</i>), or
497 generating a list of all externally visible global variables
498 located in a source file (e.g. <b>ctags &minus;x
499 &minus;&minus;c&minus;kinds</b>=<i>v</i>
500 <b>&minus;&minus;file&minus;scope</b>=<i>no file</i>). This
501 option must appear before the first file name.</p></td></tr>
502 </table>
503
504
505 <p style="margin-left:11%;"><b>&minus;&minus;append</b>[=<i>yes</i>|<i>no</i>]</p>
506
507 <p style="margin-left:18%;">Indicates whether tags
508 generated from the specified files should be appended to
509 those already present in the tag file or should replace
510 them. This option is off by default. This option must appear
511 before the first file name.</p>
512
513
514 <p style="margin-left:11%;"><b>&minus;&minus;etags&minus;include</b>=<i>file</i></p>
515
516 <p style="margin-left:18%;">Include a reference to
517 <i>file</i> in the tag file. This option may be specified as
518 many times as desired. This supports Emacs&rsquo; capability
519 to use a tag file which &quot;includes&quot; other tag
520 files. [Available only in etags mode]</p>
521
522
523 <p style="margin-left:11%;"><b>&minus;&minus;exclude</b>=[<i>pattern</i>]</p>
524
525 <p style="margin-left:18%;">Add <i>pattern</i> to a list of
526 excluded files and directories. This option may be specified
527 as many times as desired. For each file name considered by
528 <b>ctags</b>, each <i>pattern</i> specified using this
529 option will be compared against both the complete path (e.g.
530 some/path/base.ext) and the base name (e.g. base.ext) of the
531 file, thus allowing patterns which match a given file name
532 irrespective of its path, or match only a specific path. If
533 appropriate support is available from the runtime library of
534 your C compiler, then <i>pattern</i> may contain the usual
535 shell wildcards (not regular expressions) common on Unix (be
536 sure to quote the option parameter to protect the wildcards
537 from being expanded by the shell before being passed to
538 <b>ctags</b>; also be aware that wildcards can match the
539 slash character, &rsquo;/&rsquo;). You can determine if
540 shell wildcards are available on your platform by examining
541 the output of the <b>&minus;&minus;version</b> option, which
542 will include &quot;+wildcards&quot; in the compiled feature
543 list; otherwise, <i>pattern</i> is matched against file
544 names using a simple textual comparison.</p>
545
546 <p style="margin-left:18%; margin-top: 1em">If
547 <i>pattern</i> begins with the character &rsquo;@&rsquo;,
548 then the rest of the string is interpreted as a file name
549 from which to read exclusion patterns, one per line. If
550 <i>pattern</i> is empty, the list of excluded patterns is
551 cleared. Note that at program startup, the default exclude
552 list contains &quot;EIFGEN&quot;, &quot;SCCS&quot;,
553 &quot;RCS&quot;, and &quot;CVS&quot;, which are names of
554 directories for which it is generally not desirable to
555 descend while processing the <b>&minus;&minus;recurse</b>
556 option.</p>
557
558
559 <p style="margin-left:11%;"><b>&minus;&minus;excmd</b>=<i>type</i></p>
560
561 <p style="margin-left:18%;">Determines the type of EX
562 command used to locate tags in the source file. [Ignored in
563 etags mode]</p>
564
565 <p style="margin-left:18%; margin-top: 1em">The valid
566 values for <i>type</i> (either the entire word or the first
567 letter is accepted) are:</p>
568
569 <table width="100%" border="0" rules="none" frame="void"
570 cellspacing="0" cellpadding="0">
571 <tr valign="top" align="left">
572 <td width="18%"></td>
573 <td width="10%">
574
575
576 <p><i>number</i></p></td>
577 <td width="4%"></td>
578 <td width="68%">
579
580
581 <p>Use only line numbers in the tag file for locating tags.
582 This has four advantages:</p></td></tr>
583 </table>
584
585 <p style="margin-left:32%;">1.</p>
586
587 <table width="100%" border="0" rules="none" frame="void"
588 cellspacing="0" cellpadding="0">
589 <tr valign="top" align="left">
590 <td width="32%"></td>
591 <td width="3%"></td>
592 <td width="3%"></td>
593 <td width="62%">
594
595
596 <p style="margin-top: 1em">Significantly reduces the size
597 of the resulting tag file.</p></td></tr>
598 <tr valign="top" align="left">
599 <td width="32%"></td>
600 <td width="3%">
601
602
603 <p>2.</p></td>
604 <td width="3%"></td>
605 <td width="62%">
606
607
608 <p>Eliminates failures to find tags because the line
609 defining the tag has changed, causing the pattern match to
610 fail (note that some editors, such as <b>vim</b>, are able
611 to recover in many such instances).</p></td></tr>
612 <tr valign="top" align="left">
613 <td width="32%"></td>
614 <td width="3%">
615
616
617 <p>3.</p></td>
618 <td width="3%"></td>
619 <td width="62%">
620
621
622 <p>Eliminates finding identical matching, but incorrect,
623 source lines (see <b>BUGS</b>, below).</p></td></tr>
624 <tr valign="top" align="left">
625 <td width="32%"></td>
626 <td width="3%">
627
628
629 <p>4.</p></td>
630 <td width="3%"></td>
631 <td width="62%">
632
633
634 <p>Retains separate entries in the tag file for lines which
635 are identical in content. In <i>pattern</i> mode, duplicate
636 entries are dropped because the search patterns they
637 generate are identical, making the duplicate entries
638 useless.</p> </td></tr>
639 </table>
640
641 <p style="margin-left:32%; margin-top: 1em">However, this
642 option has one significant drawback: changes to the source
643 files can cause the line numbers recorded in the tag file to
644 no longer correspond to the lines in the source file,
645 causing jumps to some tags to miss the target definition by
646 one or more lines. Basically, this option is best used when
647 the source code to which it is applied is not subject to
648 change. Selecting this option type causes the following
649 options to be ignored: <b>&minus;BF</b>.</p>
650
651 <table width="100%" border="0" rules="none" frame="void"
652 cellspacing="0" cellpadding="0">
653 <tr valign="top" align="left">
654 <td width="18%"></td>
655 <td width="11%">
656
657
658 <p style="margin-top: 1em"><i>pattern</i></p></td>
659 <td width="3%"></td>
660 <td width="68%">
661
662
663 <p style="margin-top: 1em">Use only search patterns for all
664 tags, rather than the line numbers usually used for macro
665 definitions. This has the advantage of not referencing
666 obsolete line numbers when lines have been added or removed
667 since the tag file was generated.</p></td></tr>
668 <tr valign="top" align="left">
669 <td width="18%"></td>
670 <td width="11%">
671
672
673 <p><i>mixed</i></p></td>
674 <td width="3%"></td>
675 <td width="68%">
676
677
678 <p>In this mode, patterns are generally used with a few
679 exceptions. For C, line numbers are used for macro
680 definition tags. This was the default format generated by
681 the original <b>ctags</b> and is, therefore, retained as the
682 default for this option. For Fortran, line numbers are used
683 for common blocks because their corresponding source lines
684 are generally identical, making pattern searches useless for
685 finding all matches.</p></td></tr>
686 </table>
687
688
689 <p style="margin-left:11%;"><b>&minus;&minus;extra</b>=<i>[+|&minus;]flags</i></p>
690
691 <p style="margin-left:18%;">Specifies whether to include
692 extra tag entries for certain kinds of information. The
693 parameter <i>flags</i> is a set of one-letter flags, each
694 representing one kind of extra tag entry to include in the
695 tag file. If <i>flags</i> is preceded by either the
696 &rsquo;+&rsquo; or &rsquo;&minus;&rsquo; character, the
697 effect of each flag is added to, or removed from, those
698 currently enabled; otherwise the flags replace any current
699 settings. The meaning of each flag is as follows:</p>
700
701 <table width="100%" border="0" rules="none" frame="void"
702 cellspacing="0" cellpadding="0">
703 <tr valign="top" align="left">
704 <td width="23%"></td>
705 <td width="2%">
706
707
708 <p><i>f</i></p></td>
709 <td width="4%"></td>
710 <td width="71%">
711
712
713 <p>Include an entry for the base file name of every source
714 file (e.g. &quot;example.c&quot;), which addresses the first
715 line of the file.</p></td></tr>
716 <tr valign="top" align="left">
717 <td width="23%"></td>
718 <td width="2%">
719
720
721 <p><i>q</i></p></td>
722 <td width="4%"></td>
723 <td width="71%">
724
725
726 <p>Include an extra class-qualified tag entry for each tag
727 which is a member of a class (for languages for which this
728 information is extracted; currently C++, Eiffel, and Java).
729 The actual form of the qualified tag depends upon the
730 language from which the tag was derived (using a form that
731 is most natural for how qualified calls are specified in the
732 language). For C++, it is in the form
733 &quot;class::member&quot;; for Eiffel and Java, it is in the
734 form &quot;class.member&quot;. This may allow easier
735 location of a specific tags when multiple occurrences of a
736 tag name occur in the tag file. Note, however, that this
737 could potentially more than double the size of the tag
738 file.</p> </td></tr>
739 </table>
740
741
742 <p style="margin-left:11%;"><b>&minus;&minus;fields</b>=<i>[+|&minus;]flags</i></p>
743
744 <p style="margin-left:18%;">Specifies the available
745 extension fields which are to be included in the entries of
746 the tag file (see <b>TAG FILE FORMAT</b>, below, for more
747 information). The parameter <i>flags</i> is a set of
748 one-letter flags, each representing one type of extension
749 field to include, with the following meanings (disabled by
750 default unless indicated):</p>
751
752 <table width="100%" border="0" rules="none" frame="void"
753 cellspacing="0" cellpadding="0">
754 <tr valign="top" align="left">
755 <td width="23%"></td>
756 <td width="2%">
757
758
759 <p><i>a</i></p></td>
760 <td width="4%"></td>
761 <td width="71%">
762
763
764 <p>Access (or export) of class members</p></td></tr>
765 <tr valign="top" align="left">
766 <td width="23%"></td>
767 <td width="2%">
768
769
770 <p><i>f</i></p></td>
771 <td width="4%"></td>
772 <td width="71%">
773
774
775 <p>File-restricted scoping [enabled]</p></td></tr>
776 <tr valign="top" align="left">
777 <td width="23%"></td>
778 <td width="2%">
779
780
781 <p><i>i</i></p></td>
782 <td width="4%"></td>
783 <td width="71%">
784
785
786 <p>Inheritance information</p></td></tr>
787 <tr valign="top" align="left">
788 <td width="23%"></td>
789 <td width="2%">
790
791
792 <p><i>k</i></p></td>
793 <td width="4%"></td>
794 <td width="71%">
795
796
797 <p>Kind of tag as a single letter [enabled]</p></td></tr>
798 <tr valign="top" align="left">
799 <td width="23%"></td>
800 <td width="2%">
801
802
803 <p><i>K</i></p></td>
804 <td width="4%"></td>
805 <td width="71%">
806
807
808 <p>Kind of tag as full name</p></td></tr>
809 <tr valign="top" align="left">
810 <td width="23%"></td>
811 <td width="2%">
812
813
814 <p><i>l</i></p></td>
815 <td width="4%"></td>
816 <td width="71%">
817
818
819 <p>Language of source file containing tag</p></td></tr>
820 <tr valign="top" align="left">
821 <td width="23%"></td>
822 <td width="2%">
823
824
825 <p><i>m</i></p></td>
826 <td width="4%"></td>
827 <td width="71%">
828
829
830 <p>Implementation information</p></td></tr>
831 <tr valign="top" align="left">
832 <td width="23%"></td>
833 <td width="2%">
834
835
836 <p><i>n</i></p></td>
837 <td width="4%"></td>
838 <td width="71%">
839
840
841 <p>Line number of tag definition</p></td></tr>
842 <tr valign="top" align="left">
843 <td width="23%"></td>
844 <td width="2%">
845
846
847 <p><i>s</i></p></td>
848 <td width="4%"></td>
849 <td width="71%">
850
851
852 <p>Scope of tag definition [enabled]</p></td></tr>
853 <tr valign="top" align="left">
854 <td width="23%"></td>
855 <td width="2%">
856
857
858 <p><i>S</i></p></td>
859 <td width="4%"></td>
860 <td width="71%">
861
862
863 <p>Signature of routine (e.g. prototype or parameter
864 list)</p> </td></tr>
865 <tr valign="top" align="left">
866 <td width="23%"></td>
867 <td width="2%">
868
869
870 <p><i>z</i></p></td>
871 <td width="4%"></td>
872 <td width="71%">
873
874
875 <p>Include the &quot;kind:&quot; key in kind field</p></td></tr>
876 <tr valign="top" align="left">
877 <td width="23%"></td>
878 <td width="2%">
879
880
881 <p><i>t</i></p></td>
882 <td width="4%"></td>
883 <td width="71%">
884
885
886 <p>Type and name of a variable or typedef as
887 &quot;typeref:&quot; field [enabled]</p></td></tr>
888 </table>
889
890 <p style="margin-left:18%; margin-top: 1em">Each letter or
891 group of letters may be preceded by either &rsquo;+&rsquo;
892 to add it to the default set, or &rsquo;&minus;&rsquo; to
893 exclude it. In the absence of any preceding &rsquo;+&rsquo;
894 or &rsquo;&minus;&rsquo; sign, only those kinds explicitly
895 listed in <i>flags</i> will be included in the output (i.e.
896 overriding the default set). This option is ignored if the
897 option <b>&minus;&minus;format</b>=<i>1</i> has been
898 specified. The default value of this option is
899 <i>fkst</i>.</p>
900
901
902 <p style="margin-left:11%;"><b>&minus;&minus;file&minus;scope</b>[=<i>yes</i>|<i>no</i>]</p>
903
904 <p style="margin-left:18%;">Indicates whether tags scoped
905 only for a single file (i.e. tags which cannot be seen
906 outside of the file in which they are defined, such as
907 &quot;static&quot; tags) should be included in the output.
908 See, also, the <b>&minus;h</b> option. This option is
909 enabled by default.</p>
910
911
912 <p style="margin-left:11%;"><b>&minus;&minus;filter</b>[=<i>yes</i>|<i>no</i>]</p>
913
914 <p style="margin-left:18%;">Causes <b>ctags</b> to behave
915 as a filter, reading source file names from standard input
916 and printing their tags to standard output on a file-by-file
917 basis. If <b>&minus;&minus;sorted</b> is enabled, tags are
918 sorted only within the source file in which they are
919 defined. File names are read from standard input in
920 line-oriented input mode (see note for <b>&minus;L</b>
921 option) and only after file names listed on the command line
922 or from any file supplied using the <b>&minus;L</b> option.
923 When this option is enabled, the options <b>&minus;f</b>,
924 <b>&minus;o</b>, and <b>&minus;&minus;totals</b> are
925 ignored. This option is quite esoteric and is disabled by
926 default. This option must appear before the first file
927 name.</p>
928
929
930 <p style="margin-left:11%;"><b>&minus;&minus;filter&minus;terminator</b>=<i>string</i></p>
931
932 <p style="margin-left:18%;">Specifies a string to print to
933 standard output following the tags for each file name parsed
934 when the <b>&minus;&minus;filter</b> option is enabled. This
935 may permit an application reading the output of ctags to
936 determine when the output for each file is finished. Note
937 that if the file name read is a directory and
938 <b>&minus;&minus;recurse</b> is enabled, this string will be
939 printed only once at the end of all tags found for by
940 descending the directory. This string will always be
941 separated from the last tag line for the file by its
942 terminating newline. This option is quite esoteric and is
943 empty by default. This option must appear before the first
944 file name.</p>
945
946
947 <p style="margin-left:11%;"><b>&minus;&minus;format</b>=<i>level</i></p>
948
949 <p style="margin-left:18%;">Change the format of the output
950 tag file. Currently the only valid values for <i>level</i>
951 are <i>1</i> or <i>2</i>. Level 1 specifies the original tag
952 file format and level 2 specifies a new extended format
953 containing extension fields (but in a manner which retains
954 backward-compatibility with original <b>vi</b>(1)
955 implementations). The default level is 2. This option must
956 appear before the first file name. [Ignored in etags
957 mode]</p>
958
959 <p style="margin-left:11%;"><b>&minus;&minus;help</b></p>
960
961 <p style="margin-left:18%;">Prints to standard output a
962 detailed usage description, and then exits.</p>
963
964
965 <p style="margin-left:11%;"><b>&minus;&minus;if0</b>[=<i>yes</i>|<i>no</i>]</p>
966
967 <p style="margin-left:18%;">Indicates a preference as to
968 whether code within an &quot;#if 0&quot; branch of a
969 preprocessor conditional should be examined for non-macro
970 tags (macro tags are always included). Because the intent of
971 this construct is to disable code, the default value of this
972 option is <i>no</i>. Note that this indicates a preference
973 only and does not guarantee skipping code within an
974 &quot;#if 0&quot; branch, since the fall-back algorithm used
975 to generate tags when preprocessor conditionals are too
976 complex follows all branches of a conditional. This option
977 is disabled by default.</p>
978
979
980 <p style="margin-left:11%;"><b>&minus;&minus;&lt;LANG&gt;&minus;kinds</b>=<i>[+|&minus;]kinds</i></p>
981
982 <p style="margin-left:18%;">Specifies a list of
983 language-specific kinds of tags (or kinds) to include in the
984 output file for a particular language, where
985 <b>&lt;LANG&gt;</b> is case-insensitive and is one of the
986 built-in language names (see the
987 <b>&minus;&minus;list&minus;languages</b> option for a
988 complete list). The parameter <i>kinds</i> is a group of
989 one-letter flags designating kinds of tags (particular to
990 the language) to either include or exclude from the output.
991 The specific sets of flags recognized for each language,
992 their meanings and defaults may be list using the
993 <b>&minus;&minus;list&minus;kinds</b> option. Each letter or
994 group of letters may be preceded by either &rsquo;+&rsquo;
995 to add it to, or &rsquo;&minus;&rsquo; to remove it from,
996 the default set. In the absence of any preceding
997 &rsquo;+&rsquo; or &rsquo;&minus;&rsquo; sign, only those
998 kinds explicitly listed in <i>kinds</i> will be included in
999 the output (i.e. overriding the default for the specified
1000 language).</p>
1001
1002 <p style="margin-left:18%; margin-top: 1em">As an example
1003 for the C language, in order to add prototypes and external
1004 variable declarations to the default set of tag kinds, but
1005 exclude macros, use
1006 <b>&minus;&minus;c&minus;kinds</b>=<i>+px&minus;d</i>; to
1007 include only tags for functions, use
1008 <b>&minus;&minus;c&minus;kinds</b>=<i>f</i>.</p>
1009
1010
1011 <p style="margin-left:11%;"><b>&minus;&minus;langdef</b>=<i>name</i></p>
1012
1013 <p style="margin-left:18%;">Defines a new user-defined
1014 language, <i>name</i>, to be parsed with regular
1015 expressions. Once defined, <i>name</i> may be used in other
1016 options taking language names. The typical use of this
1017 option is to first define the language, then map file names
1018 to it using <i>&minus;&minus;langmap</i>, then specify
1019 regular expressions using
1020 <i>&minus;&minus;regex&minus;&lt;LANG&gt;</i> to define how
1021 its tags are found.</p>
1022
1023
1024 <p style="margin-left:11%;"><b>&minus;&minus;langmap</b>=<i>map[,map[...]]</i></p>
1025
1026 <p style="margin-left:18%;">Controls how file names are
1027 mapped to languages (see the
1028 <b>&minus;&minus;list&minus;maps</b> option). Each
1029 comma-separated <i>map</i> consists of the language name
1030 (either a built-in or user-defined language), a colon, and a
1031 list of file extensions and/or file name patterns. A file
1032 extension is specified by preceding the extension with a
1033 period (e.g. &quot;.c&quot;). A file name pattern is
1034 specified by enclosing the pattern in parentheses (e.g.
1035 &quot;([Mm]akefile)&quot;). If appropriate support is
1036 available from the runtime library of your C compiler, then
1037 the file name pattern may contain the usual shell wildcards
1038 common on Unix (be sure to quote the option parameter to
1039 protect the wildcards from being expanded by the shell
1040 before being passed to <b>ctags</b>). You can determine if
1041 shell wildcards are available on your platform by examining
1042 the output of the <b>&minus;&minus;version</b> option, which
1043 will include &quot;+wildcards&quot; in the compiled feature
1044 list; otherwise, the file name patterns are matched against
1045 file names using a simple textual comparison. When mapping a
1046 file extension, it will first be unmapped from any other
1047 languages.</p>
1048
1049 <p style="margin-left:18%; margin-top: 1em">If the first
1050 character in a map is a plus sign, then the extensions and
1051 file name patterns in that map will be appended to the
1052 current map for that language; otherwise, the map will
1053 replace the current map. For example, to specify that only
1054 files with extensions of .c and .x are to be treated as C
1055 language files, use
1056 &quot;<b>&minus;&minus;langmap</b>=<i>c:.c.x</i>&quot;; to
1057 also add files with extensions of .j as Java language files,
1058 specify
1059 &quot;<b>&minus;&minus;langmap</b>=<i>c:.c.x,java:+.j</i>&quot;.
1060 To map makefiles (e.g. files named either
1061 &quot;Makefile&quot;, &quot;makefile&quot;, or having the
1062 extension &quot;.mak&quot;) to a language called
1063 &quot;make&quot;, specify
1064 &quot;<b>&minus;&minus;langmap</b>=<i>make:([Mm]akefile).mak</i>&quot;.
1065 To map files having no extension, specify a period not
1066 followed by a non-period character (e.g. &quot;.&quot;,
1067 &quot;..x&quot;, &quot;.x.&quot;). To clear the mapping for
1068 a particular language (thus inhibiting automatic generation
1069 of tags for that language), specify an empty extension list
1070 (e.g.
1071 &quot;<b>&minus;&minus;langmap</b>=<i>fortran:</i>&quot;).
1072 To restore the default language mappings for all a
1073 particular language, supply the keyword &quot;default&quot;
1074 for the mapping. To specify restore the default language
1075 mappings for all languages, specify
1076 &quot;<b>&minus;&minus;langmap</b>=<i>default</i>&quot;.
1077 Note that file extensions are tested before file name
1078 patterns when inferring the language of a file.</p>
1079
1080
1081 <p style="margin-left:11%;"><b>&minus;&minus;language&minus;force</b>=<i>language</i></p>
1082
1083 <p style="margin-left:18%;">By default, <b>ctags</b>
1084 automatically selects the language of a source file,
1085 ignoring those files whose language cannot be determined
1086 (see <b>SOURCE FILES</b>, above). This option forces the
1087 specified <i>language</i> (case-insensitive; either built-in
1088 or user-defined) to be used for every supplied file instead
1089 of automatically selecting the language based upon its
1090 extension. In addition, the special value <i>auto</i>
1091 indicates that the language should be automatically selected
1092 (which effectively disables this option).</p>
1093
1094
1095 <p style="margin-left:11%;"><b>&minus;&minus;languages</b>=<i>[+|&minus;]list</i></p>
1096
1097 <p style="margin-left:18%;">Specifies the languages for
1098 which tag generation is enabled, with <i>list</i> containing
1099 a comma-separated list of language names (case-insensitive;
1100 either built-in or user-defined). If the first language of
1101 <i>list</i> is not preceded by either a &rsquo;+&rsquo; or
1102 &rsquo;&minus;&rsquo;, the current list will be cleared
1103 before adding or removing the languages in <i>list</i>.
1104 Until a &rsquo;&minus;&rsquo; is encountered, each language
1105 in the list will be added to the current list. As either the
1106 &rsquo;+&rsquo; or &rsquo;&minus;&rsquo; is encountered in
1107 the list, the languages following it are added or removed
1108 from the current list, respectively. Thus, it becomes simple
1109 to replace the current list with a new one, or to add or
1110 remove languages from the current list. The actual list of
1111 files for which tags will be generated depends upon the
1112 language extension mapping in effect (see the
1113 <b>&minus;&minus;langmap</b> option). Note that all
1114 languages, including user-defined languages are enabled
1115 unless explicitly disabled using this option. Language names
1116 included in <i>list</i> may be any built-in language or one
1117 previously defined with <b>&minus;&minus;langdef</b>. The
1118 default is &quot;all&quot;, which is also accepted as a
1119 valid argument. See the
1120 <b>&minus;&minus;list&minus;languages</b> option for a
1121 complete list of the built-in language names.</p>
1122
1123
1124 <p style="margin-left:11%;"><b>&minus;&minus;license</b></p>
1125
1126 <p style="margin-left:18%;">Prints a summary of the
1127 software license to standard output, and then exits.</p>
1128
1129
1130 <p style="margin-left:11%;"><b>&minus;&minus;line&minus;directives</b>[=<i>yes</i>|<i>no</i>]</p>
1131
1132 <p style="margin-left:18%;">Specifies whether
1133 &quot;#line&quot; directives should be recognized. These are
1134 present in the output of preprocessors and contain the line
1135 number, and possibly the file name, of the original source
1136 file(s) from which the preprocessor output file was
1137 generated. When enabled, this option will cause <b>ctags</b>
1138 to generate tag entries marked with the file names and line
1139 numbers of their locations original source file(s), instead
1140 of their actual locations in the preprocessor output. The
1141 actual file names placed into the tag file will have the
1142 same leading path components as the preprocessor output
1143 file, since it is assumed that the original source files are
1144 located relative to the preprocessor output file (unless, of
1145 course, the #line directive specifies an absolute path).
1146 This option is off by default. <b>Note:</b> This option is
1147 generally only useful when used together with the
1148 <b>&minus;&minus;excmd</b>=<i>number</i> (<b>&minus;n</b>)
1149 option. Also, you may have to use either the
1150 <b>&minus;&minus;langmap</b> or
1151 <b>&minus;&minus;language&minus;force</b> option if the
1152 extension of the preprocessor output file is not known to
1153 <b>ctags</b>.</p>
1154
1155
1156 <p style="margin-left:11%;"><b>&minus;&minus;links</b>[=<i>yes</i>|<i>no</i>]</p>
1157
1158 <p style="margin-left:18%;">Indicates whether symbolic
1159 links (if supported) should be followed. When disabled,
1160 symbolic links are ignored. This option is on by
1161 default.</p>
1162
1163
1164 <p style="margin-left:11%;"><b>&minus;&minus;list&minus;kinds</b>[=<i>language</i>|<i>all</i>]</p>
1165
1166 <p style="margin-left:18%;">Lists the tag kinds recognized
1167 for either the specified language or all languages, and then
1168 exits. Each kind of tag recorded in the tag file is
1169 represented by a one-letter flag, which is also used to
1170 filter the tags placed into the output through use of the
1171 <b>&minus;&minus;&lt;LANG&gt;&minus;kinds</b> option. Note
1172 that some languages and/or tag kinds may be implemented
1173 using regular expressions and may not be available if regex
1174 support is not compiled into <b>ctags</b> (see the
1175 <b>&minus;&minus;regex&minus;&lt;LANG&gt;</b> option). Each
1176 kind listed is enabled unless followed by
1177 &quot;[off]&quot;.</p>
1178
1179
1180 <p style="margin-left:11%;"><b>&minus;&minus;list&minus;maps</b>[=<i>language</i>|<i>all</i>]</p>
1181
1182 <p style="margin-left:18%;">Lists the file extensions and
1183 file name patterns which associate a file name with a
1184 language for either the specified language or all languages,
1185 and then exits. See the <b>&minus;&minus;langmap</b> option,
1186 and <b>SOURCE FILES</b>, above.</p>
1187
1188
1189 <p style="margin-left:11%;"><b>&minus;&minus;list&minus;languages</b></p>
1190
1191 <p style="margin-left:18%;">Lists the names of the
1192 languages understood by <b>ctags</b>, and then exits. These
1193 language names are case insensitive and may be used in the
1194 <b>&minus;&minus;language&minus;force</b>,
1195 <b>&minus;&minus;languages</b>,
1196 <b>&minus;&minus;&lt;LANG&gt;&minus;kinds</b>, and
1197 <b>&minus;&minus;regex&minus;&lt;LANG&gt;</b> options.</p>
1198
1199
1200 <p style="margin-left:11%;"><b>&minus;&minus;options</b>=<i>file</i></p>
1201
1202 <p style="margin-left:18%;">Read additional options from
1203 <i>file</i>. The file should contain one option per line. As
1204 a special case, if <b>&minus;&minus;options</b>=<i>NONE</i>
1205 is specified as the first option on the command line, it
1206 will disable the automatic reading of any configuration
1207 options from either a file or the environment (see
1208 <b>FILES</b>).</p>
1209
1210
1211 <p style="margin-left:11%;"><b>&minus;&minus;recurse</b>[=<i>yes</i>|<i>no</i>]</p>
1212
1213 <p style="margin-left:18%;">Recurse into directories
1214 encountered in the list of supplied files. If the list of
1215 supplied files is empty and no file list is specified with
1216 the <b>&minus;L</b> option, then the current directory (i.e.
1217 &quot;.&quot;) is assumed. Symbolic links are followed. If
1218 you don&rsquo;t like these behaviors, either explicitly
1219 specify the files or pipe the output of <b>find</b>(1) into
1220 <b>ctags &minus;L&minus;</b> instead. <b>Note:</b> This
1221 option is not supported on all platforms at present. It is
1222 available if the output of the <b>&minus;&minus;help</b>
1223 option includes this option. See, also, the
1224 <b>&minus;&minus;exclude</b> to limit recursion.</p>
1225
1226
1227 <p style="margin-left:11%;"><b>&minus;&minus;regex&minus;&lt;LANG&gt;</b>=<i>/regexp/replacement/[kind&minus;spec/][flags]</i></p>
1228
1229 <p style="margin-left:18%;">The <i>/regexp/replacement/</i>
1230 pair define a regular expression replacement pattern,
1231 similar in style to <b>sed</b> substitution commands, with
1232 which to generate tags from source files mapped to the named
1233 language, <b>&lt;LANG&gt;</b>, (case-insensitive; either a
1234 built-in or user-defined language). The regular expression,
1235 <i>regexp</i>, defines an extended regular expression
1236 (roughly that used by <b>egrep</b>(1)), which is used to
1237 locate a single source line containing a tag and may specify
1238 tab characters using \t. When a matching line is found, a
1239 tag will be generated for the name defined by
1240 <i>replacement</i>, which generally will contain the special
1241 back-references \1 through \9 to refer to matching
1242 sub-expression groups within <i>regexp</i>. The
1243 &rsquo;/&rsquo; separator characters shown in the parameter
1244 to the option can actually be replaced by any character.
1245 Note that whichever separator character is used will have to
1246 be escaped with a backslash (&rsquo;\&rsquo;) character
1247 wherever it is used in the parameter as something other than
1248 a separator. The regular expression defined by this option
1249 is added to the current list of regular expressions for the
1250 specified language unless the parameter is omitted, in which
1251 case the current list is cleared.</p>
1252
1253 <p style="margin-left:18%; margin-top: 1em">Unless modified
1254 by <i>flags</i>, <i>regexp</i> is interpreted as a Posix
1255 extended regular expression. The <i>replacement</i> should
1256 expand for all matching lines to a non-empty string of
1257 characters, or a warning message will be reported. An
1258 optional kind specifier for tags matching <i>regexp</i> may
1259 follow <i>replacement</i>, which will determine what kind of
1260 tag is reported in the &quot;kind&quot; extension field (see
1261 <b>TAG FILE FORMAT</b>, below). The full form of
1262 <i>kind&minus;spec</i> is in the form of a single letter, a
1263 comma, a name (without spaces), a comma, a description,
1264 followed by a separator, which specify the short and long
1265 forms of the kind value and its textual description
1266 (displayed using <b>&minus;&minus;list&minus;kinds</b>).
1267 Either the kind name and/or the description may be omitted.
1268 If <i>kind&minus;spec</i> is omitted, it defaults to
1269 &quot;<i>r,regex</i>&quot;. Finally, <i>flags</i> are one or
1270 more single-letter characters having the following effect
1271 upon the interpretation of <i>regexp</i>:</p>
1272
1273 <table width="100%" border="0" rules="none" frame="void"
1274 cellspacing="0" cellpadding="0">
1275 <tr valign="top" align="left">
1276 <td width="23%"></td>
1277 <td width="2%">
1278
1279
1280 <p><i>b</i></p></td>
1281 <td width="4%"></td>
1282 <td width="71%">
1283
1284
1285 <p>The pattern is interpreted as a Posix basic regular
1286 expression.</p> </td></tr>
1287 <tr valign="top" align="left">
1288 <td width="23%"></td>
1289 <td width="2%">
1290
1291
1292 <p><i>e</i></p></td>
1293 <td width="4%"></td>
1294 <td width="71%">
1295
1296
1297 <p>The pattern is interpreted as a Posix extended regular
1298 expression (default).</p></td></tr>
1299 <tr valign="top" align="left">
1300 <td width="23%"></td>
1301 <td width="2%">
1302
1303
1304 <p><i>i</i></p></td>
1305 <td width="4%"></td>
1306 <td width="71%">
1307
1308
1309 <p>The regular expression is to be applied in a
1310 case-insensitive manner.</p></td></tr>
1311 </table>
1312
1313 <p style="margin-left:18%; margin-top: 1em">Note that this
1314 option is available only if <b>ctags</b> was compiled with
1315 support for regular expressions, which depends upon your
1316 platform. You can determine if support for regular
1317 expressions is compiled in by examining the output of the
1318 <b>&minus;&minus;version</b> option, which will include
1319 &quot;+regex&quot; in the compiled feature list.</p>
1320
1321 <p style="margin-left:18%; margin-top: 1em">For more
1322 information on the regular expressions used by <b>ctags</b>,
1323 see either the <b>regex(5,7)</b> man page, or the GNU info
1324 documentation for regex (e.g. &quot;info regex&quot;).</p>
1325
1326
1327 <p style="margin-left:11%;"><b>&minus;&minus;sort</b>[=<i>yes</i>|<i>no</i>|<i>foldcase</i>]</p>
1328
1329 <p style="margin-left:18%;">Indicates whether the tag file
1330 should be sorted on the tag name (default is <i>yes</i>).
1331 Note that the original <b>vi</b>(1) required sorted tags.
1332 The <i>foldcase</i> value specifies case insensitive (or
1333 case-folded) sorting. Fast binary searches of tag files
1334 sorted with case-folding will require special support from
1335 tools using tag files, such as that found in the ctags
1336 readtags library, or Vim version 6.2 or higher (using
1337 &quot;set ignorecase&quot;). This option must appear before
1338 the first file name. [Ignored in etags mode]</p>
1339
1340
1341 <p style="margin-left:11%;"><b>&minus;&minus;tag&minus;relative</b>[=<i>yes</i>|<i>no</i>]</p>
1342
1343 <p style="margin-left:18%;">Indicates that the file paths
1344 recorded in the tag file should be relative to the directory
1345 containing the tag file, rather than relative to the current
1346 directory, unless the files supplied on the command line are
1347 specified with absolute paths. This option must appear
1348 before the first file name. The default is <i>yes</i> when
1349 running in etags mode (see the <b>&minus;e</b> option),
1350 <i>no</i> otherwise.</p>
1351
1352
1353 <p style="margin-left:11%;"><b>&minus;&minus;totals</b>[=<i>yes</i>|<i>no</i>]</p>
1354
1355 <p style="margin-left:18%;">Prints statistics about the
1356 source files read and the tag file written during the
1357 current invocation of <b>ctags</b>. This option is off by
1358 default. This option must appear before the first file
1359 name.</p>
1360
1361
1362 <p style="margin-left:11%;"><b>&minus;&minus;verbose</b>[=<i>yes</i>|<i>no</i>]</p>
1363
1364 <p style="margin-left:18%;">Enable verbose mode. This
1365 prints out information on option processing and a brief
1366 message describing what action is being taken for each file
1367 considered by <b>ctags</b>. Normally, <b>ctags</b> does not
1368 read command line arguments until after options are read
1369 from the configuration files (see <b>FILES</b>, below) and
1370 the <b>CTAGS</b> environment variable. However, if this
1371 option is the first argument on the command line, it will
1372 take effect before any options are read from these sources.
1373 The default is <i>no</i>.</p>
1374
1375
1376 <p style="margin-left:11%;"><b>&minus;&minus;version</b></p>
1377
1378 <p style="margin-left:18%;">Prints a version identifier for
1379 <b>ctags</b> to standard output, and then exits. This is
1380 guaranteed to always contain the string &quot;Exuberant
1381 Ctags&quot;.</p>
1382
1383 <h2>OPERATIONAL DETAILS
1384 <a name="OPERATIONAL DETAILS"></a>
1385 </h2>
1386
1387
1388 <p style="margin-left:11%; margin-top: 1em">As <b>ctags</b>
1389 considers each file name in turn, it tries to determine the
1390 language of the file by applying the following three tests
1391 in order: if the file extension has been mapped to a
1392 language, if the file name matches a shell pattern mapped to
1393 a language, and finally if the file is executable and its
1394 first line specifies an interpreter using the Unix-style
1395 &quot;#!&quot; specification (if supported on the platform).
1396 If a language was identified, the file is opened and then
1397 the appropriate language parser is called to operate on the
1398 currently open file. The parser parses through the file and
1399 adds an entry to the tag file for each language object it is
1400 written to handle. See <b>TAG FILE FORMAT</b>, below, for
1401 details on these entries.</p>
1402
1403 <p style="margin-left:11%; margin-top: 1em">This
1404 implementation of <b>ctags</b> imposes no formatting
1405 requirements on C code as do legacy implementations. Older
1406 implementations of ctags tended to rely upon certain
1407 formatting assumptions in order to help it resolve coding
1408 dilemmas caused by preprocessor conditionals.</p>
1409
1410 <p style="margin-left:11%; margin-top: 1em">In general,
1411 <b>ctags</b> tries to be smart about conditional
1412 preprocessor directives. If a preprocessor conditional is
1413 encountered within a statement which defines a tag,
1414 <b>ctags</b> follows only the first branch of that
1415 conditional (except in the special case of &quot;#if
1416 0&quot;, in which case it follows only the last branch). The
1417 reason for this is that failing to pursue only one branch
1418 can result in ambiguous syntax, as in the following
1419 example:</p>
1420
1421 <p style="margin-left:22%; margin-top: 1em">#ifdef
1422 TWO_ALTERNATIVES <br>
1423 struct { <br>
1424 #else <br>
1425 union { <br>
1426 #endif</p>
1427
1428 <p style="margin-left:28%;">short a; <br>
1429 long b;</p>
1430
1431 <p style="margin-left:22%;">}</p>
1432
1433 <p style="margin-left:11%; margin-top: 1em">Both branches
1434 cannot be followed, or braces become unbalanced and
1435 <b>ctags</b> would be unable to make sense of the
1436 syntax.</p>
1437
1438 <p style="margin-left:11%; margin-top: 1em">If the
1439 application of this heuristic fails to properly parse a
1440 file, generally due to complicated and inconsistent pairing
1441 within the conditionals, <b>ctags</b> will retry the file
1442 using a different heuristic which does not selectively
1443 follow conditional preprocessor branches, but instead falls
1444 back to relying upon a closing brace (&quot;}&quot;) in
1445 column 1 as indicating the end of a block once any brace
1446 imbalance results from following a #if conditional
1447 branch.</p>
1448
1449 <p style="margin-left:11%; margin-top: 1em"><b>Ctags</b>
1450 will also try to specially handle arguments lists enclosed
1451 in double sets of parentheses in order to accept the
1452 following conditional construct:</p>
1453
1454 <p style="margin-left:22%; margin-top: 1em">extern void foo
1455 __ARGS((int one, char two));</p>
1456
1457 <p style="margin-left:11%; margin-top: 1em">Any name
1458 immediately preceding the &quot;((&quot; will be
1459 automatically ignored and the previous name will be
1460 used.</p>
1461
1462 <p style="margin-left:11%; margin-top: 1em">C++ operator
1463 definitions are specially handled. In order for consistency
1464 with all types of operators (overloaded and conversion), the
1465 operator name in the tag file will always be preceded by the
1466 string &quot;operator &quot; (i.e. even if the actual
1467 operator definition was written as
1468 &quot;operator&lt;&lt;&quot;).</p>
1469
1470 <p style="margin-left:11%; margin-top: 1em">After creating
1471 or appending to the tag file, it is sorted by the tag name,
1472 removing identical tag lines.</p>
1473
1474 <h2>TAG FILE FORMAT
1475 <a name="TAG FILE FORMAT"></a>
1476 </h2>
1477
1478
1479 <p style="margin-left:11%; margin-top: 1em">When not
1480 running in etags mode, each entry in the tag file consists
1481 of a separate line, each looking like this in the most
1482 general case:</p>
1483
1484
1485 <p style="margin-left:12%; margin-top: 1em">tag_name&lt;TAB&gt;file_name&lt;TAB&gt;ex_cmd;&quot;&lt;TAB&gt;extension_fields</p>
1486
1487 <p style="margin-left:11%; margin-top: 1em">The fields and
1488 separators of these lines are specified as follows:</p>
1489
1490 <table width="100%" border="0" rules="none" frame="void"
1491 cellspacing="0" cellpadding="0">
1492 <tr valign="top" align="left">
1493 <td width="17%"></td>
1494 <td width="3%">
1495
1496
1497 <p>1.</p></td>
1498 <td width="3%"></td>
1499 <td width="77%">
1500
1501
1502 <p>tag name</p></td></tr>
1503 <tr valign="top" align="left">
1504 <td width="17%"></td>
1505 <td width="3%">
1506
1507
1508 <p>2.</p></td>
1509 <td width="3%"></td>
1510 <td width="77%">
1511
1512
1513 <p>single tab character</p></td></tr>
1514 <tr valign="top" align="left">
1515 <td width="17%"></td>
1516 <td width="3%">
1517
1518
1519 <p>3.</p></td>
1520 <td width="3%"></td>
1521 <td width="77%">
1522
1523
1524 <p>name of the file in which the object associated with the
1525 tag is located</p></td></tr>
1526 <tr valign="top" align="left">
1527 <td width="17%"></td>
1528 <td width="3%">
1529
1530
1531 <p>4.</p></td>
1532 <td width="3%"></td>
1533 <td width="77%">
1534
1535
1536 <p>single tab character</p></td></tr>
1537 <tr valign="top" align="left">
1538 <td width="17%"></td>
1539 <td width="3%">
1540
1541
1542 <p>5.</p></td>
1543 <td width="3%"></td>
1544 <td width="77%">
1545
1546
1547 <p>EX command used to locate the tag within the file;
1548 generally a search pattern (either /pattern/ or ?pattern?)
1549 or line number (see <b>&minus;&minus;excmd</b>). Tag file
1550 format 2 (see <b>&minus;&minus;format</b>) extends this EX
1551 command under certain circumstances to include a set of
1552 extension fields (described below) embedded in an EX comment
1553 immediately appended to the EX command, which leaves it
1554 backward-compatible with original <b>vi</b>(1)
1555 implementations.</p> </td></tr>
1556 </table>
1557
1558 <p style="margin-left:11%; margin-top: 1em">A few special
1559 tags are written into the tag file for internal purposes.
1560 These tags are composed in such a way that they always sort
1561 to the top of the file. Therefore, the first two characters
1562 of these tags are used a magic number to detect a tag file
1563 for purposes of determining whether a valid tag file is
1564 being overwritten rather than a source file.</p>
1565
1566 <p style="margin-left:11%; margin-top: 1em">Note that the
1567 name of each source file will be recorded in the tag file
1568 exactly as it appears on the command line. Therefore, if the
1569 path you specified on the command line was relative to the
1570 current directory, then it will be recorded in that same
1571 manner in the tag file. See, however, the
1572 <b>&minus;&minus;tag&minus;relative</b> option for how this
1573 behavior can be modified.</p>
1574
1575 <p style="margin-left:11%; margin-top: 1em">Extension
1576 fields are tab-separated key-value pairs appended to the end
1577 of the EX command as a comment, as described above. These
1578 key value pairs appear in the general form
1579 &quot;<i>key</i>:<i>value</i>&quot;. Their presence in the
1580 lines of the tag file are controlled by the
1581 <b>&minus;&minus;fields</b> option. The possible keys and
1582 the meaning of their values are as follows:</p>
1583
1584 <table width="100%" border="0" rules="none" frame="void"
1585 cellspacing="0" cellpadding="0">
1586 <tr valign="top" align="left">
1587 <td width="11%"></td>
1588 <td width="9%">
1589
1590
1591 <p style="margin-top: 1em"><i>access</i></p></td>
1592 <td width="9%"></td>
1593 <td width="71%">
1594
1595
1596 <p style="margin-top: 1em">Indicates the visibility of this
1597 class member, where <i>value</i> is specific to the
1598 language.</p> </td></tr>
1599 <tr valign="top" align="left">
1600 <td width="11%"></td>
1601 <td width="9%">
1602
1603
1604 <p><i>file</i></p></td>
1605 <td width="9%"></td>
1606 <td width="71%">
1607
1608
1609 <p>Indicates that the tag has file-limited visibility. This
1610 key has no corresponding value.</p></td></tr>
1611 <tr valign="top" align="left">
1612 <td width="11%"></td>
1613 <td width="9%">
1614
1615
1616 <p><i>kind</i></p></td>
1617 <td width="9%"></td>
1618 <td width="71%">
1619
1620
1621 <p>Indicates the type, or kind, of tag. Its value is either
1622 one of the corresponding one-letter flags described under
1623 the various <b>&minus;&minus;&lt;LANG&gt;&minus;kinds</b>
1624 options above, or a full name. It is permitted (and is, in
1625 fact, the default) for the key portion of this field to be
1626 omitted. The optional behaviors are controlled with the
1627 <b>&minus;&minus;fields</b> option.</p></td></tr>
1628 </table>
1629
1630 <p style="margin-left:11%;"><i>implementation</i></p>
1631
1632 <p style="margin-left:29%;">When present, this indicates a
1633 limited implementation (abstract vs. concrete) of a routine
1634 or class, where <i>value</i> is specific to the language
1635 (&quot;virtual&quot; or &quot;pure virtual&quot; for C++;
1636 &quot;abstract&quot; for Java).</p>
1637
1638 <table width="100%" border="0" rules="none" frame="void"
1639 cellspacing="0" cellpadding="0">
1640 <tr valign="top" align="left">
1641 <td width="11%"></td>
1642 <td width="14%">
1643
1644
1645 <p><i>inherits</i></p></td>
1646 <td width="4%"></td>
1647 <td width="71%">
1648
1649
1650 <p>When present, <i>value</i>. is a comma-separated list of
1651 classes from which this class is derived (i.e. inherits
1652 from).</p> </td></tr>
1653 <tr valign="top" align="left">
1654 <td width="11%"></td>
1655 <td width="14%">
1656
1657
1658 <p><i>signature</i></p></td>
1659 <td width="4%"></td>
1660 <td width="71%">
1661
1662
1663 <p>When present, <i>value</i> is a language-dependent
1664 representation of the signature of a routine. A routine
1665 signature in its complete form specifies the return type of
1666 a routine and its formal argument list. This extension field
1667 is presently supported only for C-based languages and does
1668 not include the return type.</p></td></tr>
1669 </table>
1670
1671 <p style="margin-left:11%; margin-top: 1em">In addition,
1672 information on the scope of the tag definition may be
1673 available, with the key portion equal to some
1674 language-dependent construct name and its value the name
1675 declared for that construct in the program. This scope entry
1676 indicates the scope in which the tag was found. For example,
1677 a tag generated for a C structure member would have a scope
1678 looking like &quot;struct:myStruct&quot;.</p>
1679
1680 <h2>HOW TO USE WITH VI
1681 <a name="HOW TO USE WITH VI"></a>
1682 </h2>
1683
1684
1685 <p style="margin-left:11%; margin-top: 1em">Vi will, by
1686 default, expect a tag file by the name &quot;tags&quot; in
1687 the current directory. Once the tag file is built, the
1688 following commands exercise the tag indexing feature:</p>
1689
1690 <table width="100%" border="0" rules="none" frame="void"
1691 cellspacing="0" cellpadding="0">
1692 <tr valign="top" align="left">
1693 <td width="11%"></td>
1694 <td width="14%">
1695
1696
1697 <p style="margin-top: 1em"><b>vi &minus;t tag</b></p></td>
1698 <td width="4%"></td>
1699 <td width="71%">
1700
1701
1702 <p style="margin-top: 1em">Start vi and position the cursor
1703 at the file and line where &quot;tag&quot; is defined.</p></td></tr>
1704 <tr valign="top" align="left">
1705 <td width="11%"></td>
1706 <td width="14%">
1707
1708
1709 <p><b>:ta tag</b></p></td>
1710 <td width="4%"></td>
1711 <td width="71%">
1712
1713
1714 <p>Find a tag.</p></td></tr>
1715 <tr valign="top" align="left">
1716 <td width="11%"></td>
1717 <td width="14%">
1718
1719
1720 <p><b>Ctrl-]</b></p></td>
1721 <td width="4%"></td>
1722 <td width="71%">
1723
1724
1725 <p>Find the tag under the cursor.</p></td></tr>
1726 <tr valign="top" align="left">
1727 <td width="11%"></td>
1728 <td width="14%">
1729
1730
1731 <p><b>Ctrl-T</b></p></td>
1732 <td width="4%"></td>
1733 <td width="71%">
1734
1735
1736 <p>Return to previous location before jump to tag (not
1737 widely implemented).</p></td></tr>
1738 </table>
1739
1740 <h2>HOW TO USE WITH GNU EMACS
1741 <a name="HOW TO USE WITH GNU EMACS"></a>
1742 </h2>
1743
1744
1745 <p style="margin-left:11%; margin-top: 1em">Emacs will, by
1746 default, expect a tag file by the name &quot;TAGS&quot; in
1747 the current directory. Once the tag file is built, the
1748 following commands exercise the tag indexing feature:
1749 <b><br>
1750 M-x visit&minus;tags&minus;table &lt;RET&gt; FILE
1751 &lt;RET&gt;</b></p>
1752
1753 <p style="margin-left:26%;">Select the tag file,
1754 &quot;FILE&quot;, to use.</p>
1755
1756 <p style="margin-left:11%;"><b>M-. [TAG]
1757 &lt;RET&gt;</b></p>
1758
1759 <p style="margin-left:26%;">Find the first definition of
1760 TAG. The default tag is the identifier under the cursor.</p>
1761
1762 <table width="100%" border="0" rules="none" frame="void"
1763 cellspacing="0" cellpadding="0">
1764 <tr valign="top" align="left">
1765 <td width="11%"></td>
1766 <td width="11%">
1767
1768
1769 <p><b>M-*</b></p></td>
1770 <td width="4%"></td>
1771 <td width="72%">
1772
1773
1774 <p>Pop back to where you previously invoked
1775 &quot;M-.&quot;.</p> </td>
1776 <td width="2%">
1777 </td></tr>
1778 <tr valign="top" align="left">
1779 <td width="11%"></td>
1780 <td width="11%">
1781
1782
1783 <p><b>C-u M-.</b></p></td>
1784 <td width="4%"></td>
1785 <td width="72%">
1786
1787
1788 <p>Find the next definition for the last tag.</p></td>
1789 <td width="2%">
1790 </td></tr>
1791 </table>
1792
1793 <p style="margin-left:11%; margin-top: 1em">For more
1794 commands, see the <i>Tags</i> topic in the Emacs info
1795 document.</p>
1796
1797 <h2>HOW TO USE WITH NEDIT
1798 <a name="HOW TO USE WITH NEDIT"></a>
1799 </h2>
1800
1801
1802 <p style="margin-left:11%; margin-top: 1em">NEdit version
1803 5.1 and later can handle the new extended tag file format
1804 (see <b>&minus;&minus;format</b>). To make NEdit use the tag
1805 file, select &quot;File&minus;&gt;Load Tags File&quot;. To
1806 jump to the definition for a tag, highlight the word, then
1807 press Ctrl-D. NEdit 5.1 can can read multiple tag files from
1808 different directories. Setting the X resource nedit.tagFile
1809 to the name of a tag file instructs NEdit to automatically
1810 load that tag file at startup time.</p>
1811
1812 <h2>CAVEATS
1813 <a name="CAVEATS"></a>
1814 </h2>
1815
1816
1817 <p style="margin-left:11%; margin-top: 1em">Because
1818 <b>ctags</b> is neither a preprocessor nor a compiler, use
1819 of preprocessor macros can fool <b>ctags</b> into either
1820 missing tags or improperly generating inappropriate tags.
1821 Although <b>ctags</b> has been designed to handle certain
1822 common cases, this is the single biggest cause of reported
1823 problems. In particular, the use of preprocessor constructs
1824 which alter the textual syntax of C can fool <b>ctags</b>.
1825 You can work around many such problems by using the
1826 <b>&minus;I</b> option.</p>
1827
1828 <p style="margin-left:11%; margin-top: 1em">Note that since
1829 <b>ctags</b> generates patterns for locating tags (see the
1830 <b>&minus;&minus;excmd</b> option), it is entirely possible
1831 that the wrong line may be found by your editor if there
1832 exists another source line which is identical to the line
1833 containing the tag. The following example demonstrates this
1834 condition:</p>
1835
1836 <p style="margin-left:22%; margin-top: 1em">int
1837 variable;</p>
1838
1839 <p style="margin-left:22%; margin-top: 1em">/* ... */ <br>
1840 void foo(variable) <br>
1841 int variable; <br>
1842 {</p>
1843
1844 <p style="margin-left:28%;">/* ... */</p>
1845
1846 <p style="margin-left:22%;">}</p>
1847
1848 <p style="margin-left:11%; margin-top: 1em">Depending upon
1849 which editor you use and where in the code you happen to be,
1850 it is possible that the search pattern may locate the local
1851 parameter declaration in foo() before it finds the actual
1852 global variable definition, since the lines (and therefore
1853 their search patterns are identical). This can be avoided by
1854 use of the <b>&minus;&minus;excmd</b>=<i>n</i> option.</p>
1855
1856 <h2>BUGS
1857 <a name="BUGS"></a>
1858 </h2>
1859
1860
1861 <p style="margin-left:11%; margin-top: 1em"><b>Ctags</b>
1862 has more options than <b>ls</b>(1).</p>
1863
1864 <p style="margin-left:11%; margin-top: 1em">When parsing a
1865 C++ member function definition (e.g.
1866 &quot;className::function&quot;), <b>ctags</b> cannot
1867 determine whether the scope specifier is a class name or a
1868 namespace specifier and always lists it as a class name in
1869 the scope portion of the extension fields. Also, if a C++
1870 function is defined outside of the class declaration (the
1871 usual case), the access specification (i.e. public,
1872 protected, or private) and implementation information (e.g.
1873 virtual, pure virtual) contained in the function declaration
1874 are not known when the tag is generated for the function
1875 definition. It will, however be available for prototypes
1876 (e.g <b>&minus;&minus;c++&minus;kinds</b>=<i>+p</i>).</p>
1877
1878 <p style="margin-left:11%; margin-top: 1em">No qualified
1879 tags are generated for language objects inherited into a
1880 class.</p>
1881
1882 <h2>ENVIRONMENT VARIABLES
1883 <a name="ENVIRONMENT VARIABLES"></a>
1884 </h2>
1885
1886
1887 <table width="100%" border="0" rules="none" frame="void"
1888 cellspacing="0" cellpadding="0">
1889 <tr valign="top" align="left">
1890 <td width="11%"></td>
1891 <td width="9%">
1892
1893
1894 <p style="margin-top: 1em"><b>CTAGS</b></p></td>
1895 <td width="3%"></td>
1896 <td width="77%">
1897
1898
1899 <p style="margin-top: 1em">If this environment variable
1900 exists, it will be expected to contain a set of default
1901 options which are read when <b>ctags</b> starts, after the
1902 configuration files listed in <b>FILES</b>, below, are read,
1903 but before any command line options are read. Options
1904 appearing on the command line will override options
1905 specified in this variable. Only options will be read from
1906 this variable. Note that all white space in this variable is
1907 considered a separator, making it impossible to pass an
1908 option parameter containing an embedded space. If this is a
1909 problem, use a configuration file instead.</p></td></tr>
1910 <tr valign="top" align="left">
1911 <td width="11%"></td>
1912 <td width="9%">
1913
1914
1915 <p><b>ETAGS</b></p></td>
1916 <td width="3%"></td>
1917 <td width="77%">
1918
1919
1920 <p>Similar to the <b>CTAGS</b> variable above, this
1921 variable, if found, will be read when <b>etags</b> starts.
1922 If this variable is not found, <b>etags</b> will try to use
1923 <b>CTAGS</b> instead.</p></td></tr>
1924 <tr valign="top" align="left">
1925 <td width="11%"></td>
1926 <td width="9%">
1927
1928
1929 <p><b>TMPDIR</b></p></td>
1930 <td width="3%"></td>
1931 <td width="77%">
1932
1933
1934 <p>On Unix-like hosts where mkstemp() is available, the
1935 value of this variable specifies the directory in which to
1936 place temporary files. This can be useful if the size of a
1937 temporary file becomes too large to fit on the partition
1938 holding the default temporary directory defined at
1939 compilation time. <b>ctags</b> creates temporary files only
1940 if either (1) an emacs-style tag file is being generated,
1941 (2) the tag file is being sent to standard output, or (3)
1942 the program was compiled to use an internal sort algorithm
1943 to sort the tag files instead of the the sort utility of the
1944 operating system. If the sort utility of the operating
1945 system is being used, it will generally observe this
1946 variable also. Note that if <b>ctags</b> is setuid, the
1947 value of TMPDIR will be ignored.</p></td></tr>
1948 </table>
1949
1950 <h2>FILES
1951 <a name="FILES"></a>
1952 </h2>
1953
1954
1955 <p style="margin-left:11%; margin-top: 1em"><i>/ctags.cnf
1956 (on MSDOS, MSWindows only) <br>
1957 /etc/ctags.conf <br>
1958 /usr/local/etc/ctags.conf <br>
1959 $HOME/.ctags <br>
1960 $HOME/ctags.cnf (on MSDOS, MSWindows only) <br>
1961 .ctags <br>
1962 ctags.cnf (on MSDOS, MSWindows only)</i></p>
1963
1964 <p style="margin-left:22%;">If any of these configuration
1965 files exist, each will be expected to contain a set of
1966 default options which are read in the order listed when
1967 <b>ctags</b> starts, but before the <b>CTAGS</b> environment
1968 variable is read or any command line options are read. This
1969 makes it possible to set up site-wide, personal or
1970 project-level defaults. It is possible to compile
1971 <b>ctags</b> to read an additional configuration file before
1972 any of those shown above, which will be indicated if the
1973 output produced by the <b>&minus;&minus;version</b> option
1974 lists the &quot;custom-conf&quot; feature. Options appearing
1975 in the <b>CTAGS</b> environment variable or on the command
1976 line will override options specified in these files. Only
1977 options will be read from these files. Note that the option
1978 files are read in line-oriented mode in which spaces are
1979 significant (since shell quoting is not possible). Each line
1980 of the file is read as one command line parameter (as if it
1981 were quoted with single quotes). Therefore, use new lines to
1982 indicate separate command-line arguments.</p>
1983
1984 <table width="100%" border="0" rules="none" frame="void"
1985 cellspacing="0" cellpadding="0">
1986 <tr valign="top" align="left">
1987 <td width="11%"></td>
1988 <td width="6%">
1989
1990
1991 <p style="margin-top: 1em"><i>tags</i></p></td>
1992 <td width="5%"></td>
1993 <td width="58%">
1994
1995
1996 <p style="margin-top: 1em">The default tag file created by
1997 <b>ctags</b>.</p> </td>
1998 <td width="20%">
1999 </td></tr>
2000 <tr valign="top" align="left">
2001 <td width="11%"></td>
2002 <td width="6%">
2003
2004
2005 <p><i>TAGS</i></p></td>
2006 <td width="5%"></td>
2007 <td width="58%">
2008
2009
2010 <p>The default tag file created by <b>etags</b>.</p></td>
2011 <td width="20%">
2012 </td></tr>
2013 </table>
2014
2015 <h2>SEE ALSO
2016 <a name="SEE ALSO"></a>
2017 </h2>
2018
2019
2020 <p style="margin-left:11%; margin-top: 1em">The official
2021 Exuberant Ctags web site at:</p>
2022
2023
2024 <p style="margin-left:22%; margin-top: 1em">http://ctags.sourceforge.net</p>
2025
2026 <p style="margin-left:11%; margin-top: 1em">Also
2027 <b>ex</b>(1), <b>vi</b>(1), <b>elvis</b>, or, better yet,
2028 <b>vim</b>, the official editor of <b>ctags</b>. For more
2029 information on <b>vim</b>, see the VIM Pages web site
2030 at:</p>
2031
2032
2033 <p style="margin-left:22%; margin-top: 1em">http://www.vim.org/</p>
2034
2035 <h2>AUTHOR
2036 <a name="AUTHOR"></a>
2037 </h2>
2038
2039
2040 <p style="margin-left:11%; margin-top: 1em">Darren Hiebert
2041 &lt;dhiebert at users.sourceforge.net&gt; <br>
2042 http://DarrenHiebert.com/</p>
2043
2044 <h2>MOTIVATION
2045 <a name="MOTIVATION"></a>
2046 </h2>
2047
2048
2049 <p style="margin-left:11%; margin-top: 1em">&quot;Think ye
2050 at all times of rendering some service to every member of
2051 the human race.&quot;</p>
2052
2053 <p style="margin-left:11%; margin-top: 1em">&quot;All
2054 effort and exertion put forth by man from the fullness of
2055 his heart is worship, if it is prompted by the highest
2056 motives and the will to do service to humanity.&quot;</p>
2057
2058 <p style="margin-left:22%; margin-top: 1em">&minus;&minus;
2059 From the Baha&rsquo;i Writings</p>
2060
2061 <h2>CREDITS
2062 <a name="CREDITS"></a>
2063 </h2>
2064
2065
2066 <p style="margin-left:11%; margin-top: 1em">This version of
2067 <b>ctags</b> was originally derived from and inspired by the
2068 ctags program by Steve Kirkendall
2069 &lt;[email protected]&gt; that comes with the Elvis vi
2070 clone (though virtually none of the original code
2071 remains).</p>
2072
2073 <p style="margin-left:11%; margin-top: 1em">Credit is also
2074 due Bram Moolenaar &lt;[email protected]&gt;, the author of
2075 <b>vim</b>, who has devoted so much of his time and energy
2076 both to developing the editor as a service to others, and to
2077 helping the orphans of Uganda.</p>
2078
2079 <p style="margin-left:11%; margin-top: 1em">The section
2080 entitled &quot;HOW TO USE WITH GNU EMACS&quot; was
2081 shamelessly stolen from the info page for GNU
2082 <b>etags</b>.</p>
2083 <hr>
2084 </body>
2085 </html>