134 lines
4.7 KiB
HTML
134 lines
4.7 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>ref(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>ref(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
ref - Display a C function header
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>ref</STRONG> [-t] [-c <EM>class</EM>]... [-f <EM>file</EM>]... <EM>tag</EM>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<EM>ref</EM> quickly locates and displays the header of a function. To do this,
|
|
<EM>ref</EM> looks in the "tags" file for the line that describes the function,
|
|
and then scans the source file for the function. When it locates the
|
|
function, it displays an introductory comment (if there is one), the
|
|
function's declaration, and the declarations of all arguments.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEARCH METHOD</H2><PRE>
|
|
|
|
<EM>ref</EM> uses a fairly sophisticated tag look-up algorithm. If you supply a
|
|
filename via <STRONG>-f</STRONG> <EM>file</EM>, then elvis first scans the tags file for a static
|
|
tag from that file. This search is limited to the tags file in the
|
|
current directory.
|
|
|
|
If you supply a classname via <STRONG>-c</STRONG> <EM>class</EM>, then elvis searches for a tag
|
|
from that class. This search is not limited to the current directory;
|
|
You can supply a list of directories in the environment variable <EM>TAGPATH</EM>,
|
|
and <EM>ref</EM> will search through the "tags" file in each directory until it
|
|
finds a tag in the desired class.
|
|
|
|
If that fails, <EM>ref</EM> will then try to look up an ordinary global tag. This
|
|
search checks all of the directories listed in <EM>TAGPATH</EM>, too.
|
|
|
|
If you've given the <STRONG>-t</STRONG> flag, then <EM>ref</EM> will simply output the tag line
|
|
that it found, and then exit. Without <STRONG>-t</STRONG>, though, <EM>ref</EM> will search for
|
|
the tag line. It will try to open the source file, which should be in
|
|
the same directory as the tags file where the tag was discovered. If the
|
|
source file doesn't exist, or is unreadable, then <EM>ref</EM> will try to open a
|
|
file called "<EM>refs</EM>" in that directory. Either way, <EM>ref</EM> will try to locate
|
|
the tag, and display whatever it finds.
|
|
|
|
|
|
</PRE>
|
|
<H2>INTERACTION WITH ELVIS</H2><PRE>
|
|
|
|
<EM>ref</EM> is used by <EM>elvis</EM>' shift-K command. If the cursor is located on a
|
|
word such as "splat", in the file "foo.c", then <EM>elvis</EM> will invoke <EM>ref</EM>
|
|
with the command "ref -f foo.c splat".
|
|
|
|
If <EM>elvis</EM> has been compiled with the -DEXTERNAL_TAGS flag, then <EM>elvis</EM> will
|
|
use <EM>ref</EM> to scan the tags files. This is slower than the built-in tag
|
|
searching, but it allows <EM>elvis</EM> to access the more sophisticated tag
|
|
lookup provided by <EM>ref</EM>. Other than that, external tags should act
|
|
exactly like internal tags.
|
|
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-t</STRONG> Output tag info, instead of the function header.
|
|
|
|
<STRONG>-f</STRONG> <EM>file</EM>
|
|
The tag might be a static function in <EM>file</EM>. You can use several -f
|
|
flags to have <EM>ref</EM> consider static tags from more than one file.
|
|
|
|
<STRONG>-c</STRONG> <EM>class</EM>
|
|
The tag might be a member of class <EM>class</EM>. You can use several -c
|
|
flags to have <EM>ref</EM> consider tags from more than one class.
|
|
|
|
|
|
</PRE>
|
|
<H2>FILES</H2><PRE>
|
|
|
|
<STRONG>tags</STRONG> List of function names and their locations, generated by <EM>ctags</EM>.
|
|
|
|
<STRONG>refs</STRONG> Function headers extracted from source files (optional).
|
|
|
|
|
|
</PRE>
|
|
<H2>ENVIRONMENT</H2><PRE>
|
|
|
|
<STRONG>TAGPATH</STRONG>
|
|
List of directories to be searched. The elements in the list are
|
|
separated by either semicolons (for MS-DOS, Atari TOS, and
|
|
AmigaDos), or by colons (every other operating system). For each
|
|
operating system, <EM>ref</EM> has a built-in default which is probably
|
|
adequate.
|
|
|
|
|
|
</PRE>
|
|
<H2>NOTES</H2><PRE>
|
|
|
|
You might want to generate a "tags" file the directory that contains the
|
|
source code for standard C library on your system. If licensing
|
|
restrictions prevent you from making the library source readable by
|
|
everybody, then you can have <EM>ctags</EM> generate a "refs" file, and make
|
|
"refs" readable by everybody.
|
|
|
|
If your system doesn't come with the library source code, then perhaps
|
|
you can produce something workable from the <EM>lint</EM> libraries.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/elvis.1.html">elvis(1)</A></STRONG>, <STRONG><A HREF="../man1/ctags.1.html">ctags(1)</A></STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Steve Kirkendall
|
|
kirkenda@cs.pdx.edu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|