.\" .\" Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Shigio Yamaguchi. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" .Dd Aug 19, 1998 .Dt GCTAGS 1 .Os BSD 4 .Sh NAME .Nm gctags .Nd print cross reference list for gtags. .Sh SYNOPSIS .Nm gctags .Op Fl b .Op Fl e .Op Fl n .Op Fl r .Op Fl s .Op Fl w .Ar file ... .Sh DESCRIPTION .Nm Gctags print cross reference list for .Xr gtags 1 from the specified C, .Tn YACC , .Tn JAVA , and assembler source to standard output. Each line of output contains the object name, the line number which it appears, the file in which it is defined, and a line image separated by white-space. It's same with the output of .Xr ctags 1 with -x option. .Pp Depending upon the options provided to .Nm gctags , objects will consist of function definitions, function references and other symbols. This command is the default parser of GLOBAL source code tag system. .Bl -tag -width Ds .It Fl b force level 1 block to begin when reach a '{' at the first column. (C only) .It Fl e force level 1 block to end when reach a '}' at the first column. (C only) .It Fl n suppress output of tags. It is useful to use with .Fl w option. .It Fl r locate function references instead of function definitions. GTAGS file is needed at the current directory. (C and Java source only) By default, locate function definitions. .It Fl s collect symbols other than functions. By default, locate function definitions. .It Fl w print warning message. .El .Pp The .Fl r and .Fl s options override each other; the last one specified determines the method used. .Pp Files whose names end in .Nm \&.c or .Nm \&.h are assumed to be C source files and are searched for C style routine and macro definitions. Files whose names end in .Nm \&.y are assumed to be .Tn YACC source files. Files whose names end in .Nm \&.java are assumed to be Java source files. Files whose names end in .Nm \&.s or .Nm \&.S are assumed to be Assembler source files. Other files are searched for C style definitions. .Pp Yacc files each have a special tag. .Ar Yyparse is the start of the second section of the yacc file. .El .Sh DIAGNOSTICS .Nm Gctags exits with a non 0 value if an error occurred, 0 otherwise. Duplicate objects are not considered errors. .Sh SEE ALSO .Xr btreeop 1 , .Xr ex 1 , .Xr global 1 , .Xr gtags 1 , .Xr htags 1 , .Xr vi 1 . .Sh BUGS .Pp .Nm Gctags relies on the input being well formed, and any syntactical errors will completely confuse it. .Pp Assembler support is far from complete. It extracts only ENTRY() and ALTENTRY() from source file. Probably valid only for FreeBSD and Linux kernel source. .Sh AUTHORS Shigio Yamaguchi (shigio@wafu.netgate.net) .Sh HISTORY The .Nm command appeared in FreeBSD 2.2.2.