source: trunk/minix/man/man1/ref.1@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 3.7 KB
RevLine 
[9]1.TH REF 1
2.SH NAME
3ref - Display a C function header
4.SH SYNOPSIS
5\fBref\fR [-t] [-c \fIclass\fR]... [-f \fIfile\fR]... \fItag\fR
6.SH DESCRIPTION
7\fIref\fP quickly locates and displays the header of a function.
8To do this, \fIref\fR
9looks in the "tags" file for the line that describes the function, and then
10scans the source file for the function.
11When it locates the function, it displays an introductory comment
12(if there is one), the function's declaration, and the declarations of all
13arguments.
14.SH "SEARCH METHOD"
15.PP
16\fIref\fR uses a fairly sophisticated tag look-up algorithm.
17If you supply a filename via \fB-f\fR \fIfile\fR, then elvis first scans
18the tags file for a static tag from that file.
19This search is limited to the tags file in the current directory.
20.PP
21If you supply a classname via \fB-c\fR \fIclass\fR, then elvis searches
22for a tag from that class.
23This search is not limited to the current directory;
24You can supply a list of directories in the environment variable \fITAGPATH\fR,
25and \fIref\fR will search through the "tags" file in each directory until it finds
26a tag in the desired class.
27.PP
28If that fails, \fIref\fR will then try to look up an ordinary global tag.
29This search checks all of the directories listed in \fITAGPATH\fR, too.
30.PP
31If you've given the \fB-t\fR flag, then \fIref\fR will simply output the tag line that
32it found, and then exit.
33Without \fB-t\fR, though, \fIref\fR will search for the tag line.
34It will try to open the source file, which should be in the same directory
35as the tags file where the tag was discovered.
36If the source file doesn't exist, or is unreadable, then \fIref\fR will try to open
37a file called "\fIrefs\fR" in that directory.
38Either way, \fIref\fR will try to locate the tag, and display whatever it finds.
39.SH "INTERACTION WITH ELVIS"
40.PP
41\fIref\fP is used by \fIelvis\fR' shift-K command.
42If the cursor is located on a word such as "splat", in the file "foo.c",
43then \fIelvis\fR will invoke \fIref\fR with the command "ref -f foo.c splat".
44.PP
45If \fIelvis\fR has been compiled with the -DEXTERNAL_TAGS flag, then \fIelvis\fR will
46use \fIref\fR \fB\fRto scan the tags files.
47This is slower than the built-in tag searching, but it allows \fIelvis\fR to access
48the more sophisticated tag lookup provided by \fIref\fR.
49Other than that, external tags should act exactly like internal tags.
50.SH OPTIONS
51.IP \fB-t\fR
52Output tag info, instead of the function header.
53.IP "\fB-f\fR \fIfile\fR"
54The tag might be a static function in \fIfile\fR.
55You can use several -f flags to have \fIref\fR consider static tags from more than one file.
56.IP "\fB-c\fR \fIclass\fR"
57The tag might be a member of class \fIclass\fR.
58You can use several -c flags to have \fIref\fR consider tags from more than one class.
59.SH FILES
60.IP \fBtags\fR
61List of function names and their locations, generated by \fIctags\fR.
62.IP \fBrefs\fR
63Function headers extracted from source files (optional).
64.SH ENVIRONMENT
65.IP \fBTAGPATH\fR
66List of directories to be searched.
67The elements in the list are separated by either
68semicolons (for MS-DOS, Atari TOS, and AmigaDos), or
69by colons (every other operating system).
70For each operating system, \fIref\fR has a built-in default which is probably
71adequate.
72.SH NOTES
73.PP
74You might want to generate a "tags" file the directory that contains the
75source code for standard C library on your system.
76If licensing restrictions prevent you from making the library source readable
77by everybody, then you can have \fIctags\fR generate a "refs" file,
78and make "refs" readable by everybody.
79.PP
80If your system doesn't come with the library source code, then perhaps you
81can produce something workable from the \fIlint\fR libraries.
82.SH "SEE ALSO"
83elvis(1), ctags(1)
84.SH AUTHOR
85.nf
86Steve Kirkendall
87kirkenda@cs.pdx.edu
88.fi
Note: See TracBrowser for help on using the repository browser.