📄 ctags.html
字号:
<!-- INDENTATION --><p>This feature is useful when preprocessor macros are usedin such a way that they cause syntactic confusion due totheir presence. Indeed, this is the best way of workingaround a number of problems caused by the presence ofsyntax-busting macros in source files (see <b>CAVEATS</b>,below). Some examples will illustrate this point.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="23%"></td><td width="77%"><p>int foo ARGDECL4(void *, ptr, long int, nbytes)</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>In the above example, the macro "ARGDECL4"would be mistakenly interpreted to be the name of thefunction instead of the correct name of "foo".Specifying <b>−I</b> <i>ARGDECL4</i> results in thecorrect behavior.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="23%"></td><td width="77%"><p>/* creates an RCS version string in module */</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>MODULE_VERSION("$Revision: 590 $")</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>In the above example the macro invocation looks too muchlike a function definition because it is not followed by asemicolon (indeed, it could even be followed by a globalvariable definition that would look much like a K&Rstyle function parameter declaration). In fact, this seemingfunction definition could possibly even cause the rest ofthe file to be skipped over while trying to complete thedefinition. Specifying <b>−I</b><i>MODULE_VERSION+</i> would avoid such a problem.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="23%"></td><td width="77%"><p>CLASS Example {<br>// your content here<br>};</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>The example above uses "CLASS" as apreprocessor macro which expands to something different foreach platform. For instance CLASS may be defined as"class __declspec(dllexport)" on Win32 platformsand simply "class" on UNIX. Normally, the absenceof the C++ keyword "class" would cause the sourcefile to be incorrectly parsed. Correct behavior can berestored by specifying <b>−I</b><i>CLASS=class</i>.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−L</b> <i>file</i></p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Read from <i>file</i> a list of file names for which tagsshould be generated. If <i>file</i> is specified as"−", then file names are read from standardinput. File names read using this option are processedfollowing file names appearing on the command line. Optionsare also accepted in this input. If this option is specifiedmore than once, only the last will apply. <b>Note:</b><i>file</i> is read in line-oriented mode, where a new lineis the only delimiter and non-trailing white space isconsidered significant, in order that file names containingspaces may be supplied (however, trailing white space isstripped from lines); this can affect how options are parsedif included in the input.</p></td></table><!-- TABS --><table width="100%" border=0 rules="none" frame="void" cols="5" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−n</b></p></td><td width="4%"></td><td width="47%"><p>Equivalent to<b>−−excmd</b>=<i>number</i>.</p></td><td width="35%"></td><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−N</b></p></td><td width="4%"></td><td width="47%"><p>Equivalent to<b>−−excmd</b>=<i>pattern</i>.</p></td><td width="35%"></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−o</b> <i>tagfile</i></p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Equivalent to <b>−f</b> <i>tagfile</i>.</p></td></table><!-- TABS --><table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−R</b></p></td><td width="4%"></td><td width="82%"><p>Equivalent to <b>−−recurse</b>.</p></td><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−u</b></p></td><td width="4%"></td><td width="82%"><p>Equivalent to <b>−−sort</b>=<i>no</i> (i.e."unsorted").</p></td><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−V</b></p></td><td width="4%"></td><td width="82%"><p>Equivalent to <b>−−verbose</b>.</p></td><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−w</b></p></td><td width="4%"></td><td width="82%"><p>This option is silently ignored forbackward-compatibility with the ctags of SVR4 Unix.</p></td><tr valign="top" align="left"><td width="11%"></td><td width="3%"><p><b>−x</b></p></td><td width="4%"></td><td width="82%"><p>Print a tabular, human-readable cross reference (xref)file to standard output instead of generating a tag file.The information contained in the output includes: the tagname; the kind of tag; the line number, file name, andsource line (with extra white space condensed) of the filewhich defines the tag. No tag file is written and alloptions affecting tag file output will be ignored. Exampleapplications for this feature are generating a listing ofall functions located in a source file (e.g. <b>ctags−x −−c−kinds</b>=<i>f file</i>), orgenerating a list of all externally visible global variableslocated in a source file (e.g. <b>ctags −x−−c−kinds</b>=<i>v</i><b>−−file−scope</b>=<i>no file</i>). Thisoption must appear before the first file name.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−−append</b>[=<i>yes</i>|<i>no</i>]</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Indicates whether tags generated from the specified filesshould be appended to those already present in the tag fileor should replace them. This option is off by default. Thisoption must appear before the first file name.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−−etags−include</b>=<i>file</i></p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Include a reference to <i>file</i> in the tag file. Thisoption may be specified as many times as desired. Thissupports Emacs’ capability to use a tag file which"includes" other tag files. [Available only inetags mode]</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−−exclude</b>=[<i>pattern</i>]</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Add <i>pattern</i> to a list of excluded files anddirectories. This option may be specified as many times asdesired. For each file name considered by <b>ctags</b>, each<i>pattern</i> specified using this option will be comparedagainst both the complete path (e.g. some/path/base.ext) andthe base name (e.g. base.ext) of the file, thus allowingpatterns which match a given file name irrespective of itspath, or match only a specific path. If appropriate supportis available from the runtime library of your C compiler,then <i>pattern</i> may contain the usual shell wildcards(not regular expressions) common on Unix (be sure to quotethe option parameter to protect the wildcards from beingexpanded by the shell before being passed to <b>ctags</b>;also be aware that wildcards can match the slash character,’/’). You can determine if shell wildcards areavailable on your platform by examining the output of the<b>−−version</b> option, which will include"+wildcards" in the compiled feature list;otherwise, <i>pattern</i> is matched against file namesusing a simple textual comparison.</p><!-- INDENTATION --><p>If <i>pattern</i> begins with the character’@’, then the rest of the string is interpretedas a file name from which to read exclusion patterns, oneper line. If <i>pattern</i> is empty, the list of excludedpatterns is cleared. Note that at program startup, thedefault exclude list contains "EIFGEN","SCCS", "RCS", and "CVS",which are names of directories for which it is generally notdesirable to descend while processing the<b>−−recurse</b> option.</p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="11%"></td><td width="89%"><p><b>−−excmd</b>=<i>type</i></p></td></table><!-- INDENTATION --><table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="82%"><p>Determines the type of EX command used to locate tags inthe source file. [Ignored in etags mode]</p><!-- INDENTATION --><p>The valid values for <i>type</i> (either the entire wordor the first letter is accepted) are:</p></td></table><!-- TABS --><table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="18%"></td><td width="10%"><p><i>number</i></p></td><td width="4%"></td><td width="68%"><p>Use only line numbers in the tag file for locating tags.This has four advantages:</p></td></table><!-- TABS --><table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="32%"></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -