⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.ref

📁 代码检索工具GLOBAL源码。可用来浏览分析LINUX源码。
💻 REF
字号:
@c This file is generated automatically by convert.pl from global/manual.in.@unnumberedsubsec NAMEglobal - print the locations of specified object.@unnumberedsubsec SYNOPSIS@noindent@quotationglobal [-aGilnqrstTvx][-e] pattern@*global -c[qsv] prefix@*global -f[anqrstvx] files@*global -g[aGilnoqtvx][-e] pattern@*global -I[ailnqtvx][-e] pattern@*global -p[qrv]@*global -P[aGilnoqtvx][-e] pattern@*global -u[qv]@*@end quotation@unnumberedsubsec DESCRIPTIONGlobal find the locations of specified objectin C, C++, Yacc, Java, PHP and Assembly source files.Global can treat a source tree, that is, a directory thathas subdirectories and source files.You can get the relative path of objects from anywhere within the tree.Global can locate not only function definitions but alsofunction references and other symbols.Duplicate entries are allowed.In advance of using this command, you must execute gtags(1)at the root directory of the source tree to make tag files.Then you can execute at anywhere in the source tree.@unnumberedsubsec COMMANDSThe following commands are available:@table @asis@item patternPrint object which match to the pattern.Extended regular expressions which are the same as thoseaccepted by egrep(1) are available.@item @samp{-c}, @samp{--completion} [prefix]Print candidate function names which start with specifiedprefix. Prefix is not specified,print all function names.@item @samp{-f}, @samp{--file} filesPrint all function definitions in the files.This option implies -x option.@item @samp{-g}, @samp{--grep}Print all lines which match to the pattern.@item @samp{-I}, @samp{--idutils}Print all lines which match to the pattern.This function use id-utils(1) as a search engine.To use this command, you need to install id-utils(1)in your system and you must execute gtags(1)with @samp{-I} option.@item @samp{-p}, @samp{--print-dbpath}Print the location of @file{GTAGS}.@item @samp{-P}, @samp{--path} [pattern]Print the path which match to the pattern.If no pattern specified, print all.@item @samp{-u}, @samp{--update}Locate tag files and update them incrementally.@item @samp{--version}Show version number.@item @samp{--help}Show help.@end table@unnumberedsubsec OPTIONSThe following options are available:@table @asis@item @samp{-a}, @samp{--absolute}Print absolute path name. By default, print relative path name.@item @samp{-e}, @samp{--regexp} patternUse pattern as the pattern; useful to protect  patternsbeginning with -.@item @samp{-G}, @samp{--basic-regexp}Interpret pattern as a  basic regular expression.The default is extended regular expression.This option is valid for the @samp{-g} and @samp{-P} command.@item @samp{-i}, @samp{--ignore-case}ignore case distinctions in pattern.@item @samp{-l}, @samp{--local}Print just objects which exist under the current directory.@item @samp{-n}, @samp{--nofilter}Suppress sort filter and path conversion filter.@item @samp{-o}, @samp{--other}Search pattern in not only source files but also other fileslike @file{README}.This option is valid only with @samp{-g} or @samp{-P} command.@item @samp{-q}, @samp{--quiet}Quiet mode.@item @samp{-r}, @samp{--reference}, @samp{--rootdir}Print the locations of object references.By default, print object definitions.With the @samp{-p} option, print the root directory of source tree.@item @samp{-s}, @samp{--symbol}Print the locations of specified symbol other than function names.You need @file{GSYMS} tags file. See gtags(1).@item @samp{-t}, @samp{--tags}Print with standard ctags format.@item @samp{-T}, @samp{--through}Go through all the tag files listed in @var{GTAGSLIBPATH}.By default, stop searching when tag is found.This option is ignored when either @samp{-s}, @samp{-r}or @samp{-l} option is specified.@item @samp{-v}, @samp{--verbose}Verbose mode.@item @samp{-x}, @samp{--cxref}In addition to the default output, produce the line number andthe line contents.@end table@unnumberedsubsec EXAMPLES@example	$ ls -F	Makefile      src/    lib/	$ gtags	$ global main	src/main.c	$ global -x main	main              10 src/main.c  main (argc, argv) @{	$ global -x '^[sg]et'	set_num           20 lib/util.c  set_num(values)	get_num           30 lib/util.c  get_num() @{	$ global -rx '^[sg]et'	set_num          113 src/op.c            set_num(32);	set_num          225 src/opop.c               if (set_num(0) > 0) @{	get_num           90 src/op.c            while (get_num() > 0) @{	$ cd lib	$ global -rx '^[sg]et'	set_num          113 ../src/op.c            set_num(32);	set_num          225 ../src/opop.c               if (set_num(0) > 0) @{	get_num           90 ../src/op.c            while (get_num() > 0) @{	$ global strlen	$ (cd /usr/src/sys; gtags)	$ export GTAGSLIBPATH=/usr/src/sys	$ global strlen	../../../usr/src/sys/libkern/strlen.c	$ (cd /usr/src/lib; gtags)	$ GTAGSLIBPATH=/usr/src/lib:/usr/src/sys	$ global strlen	../../../usr/src/lib/libc/string/strlen.c@end example@unnumberedsubsec FILES@table @asis@item @file{GTAGS}Tag file for function definitions.@item @file{GRTAGS}Tag file for function references.@item @file{GSYMS}Tag file for other symbols.@item @file{GPATH}Tag file for path of source files.@item @file{GTAGSROOT}If environment variable @var{GTAGSROOT} is not set and @file{GTAGSROOT} existin the same directory with @file{GTAGS} then use the valueas @var{GTAGSROOT}.@item @file{/etc/gtags.conf}, @file{$HOME/.globalrc}Configuration file.@end table@unnumberedsubsec ENVIRONMENTThe following environment variables affect the execution of global:@table @asis@item @var{GTAGSROOT}The directory which is the root of source tree.@item @var{GTAGSDBPATH}The directory on which gtags database exist.This value is ignored when @var{GTAGSROOT} is not defined.@item @var{GTAGSLIBPATH}If this variable is set, it is used as the path to searchfor library functions. If the specified function is notfound in a source tree, global also search in these paths.@item @var{GTAGSLABEL}If this variable is set, its value is used as the labelof configuration file. The default is @code{default}.@end table@unnumberedsubsec CONFIGURATIONThe following configuration variables affect the execution of global:@table @asis@item @code{icase_path}(boolean)Ignore case distinctions in the pattern.@end table@unnumberedsubsec DIAGNOSTICSGlobal exits with a non 0 value if an error occurred, 0 otherwise.@unnumberedsubsec SEE ALSOgtags-parser(1),gtags(1),htags(1),less(1).GNU GLOBAL source code tag system@*(http://www.gnu.org/software/global/).@unnumberedsubsec AUTHORTama Communications Corporation.@unnumberedsubsec HISTORYThe global command appeared in FreeBSD 2.2.2.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -