]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/src
merge
[plan9front.git] / sys / man / 1 / src
1 .TH SRC 1 
2 .SH NAME
3 src, Bfn  \- find source code for executable
4 .SH SYNOPSIS
5 .B src
6 [
7 .B -n
8 ]
9 [
10 .B -s
11 .I symbol
12 ]
13 .I file
14 .B ...
15 .PP
16 .B Bfn
17 .I fn
18 .SH DESCRIPTION
19 .I Src
20 examines the named
21 .I files
22 to find the corresponding source code, which is then sent to the editor using
23 .B B
24 (see
25 .IR sam (1)).
26 If
27 .I file
28 is an
29 .IR rc (1)
30 script, the source is the file itself.
31 If
32 .I file
33 is an executable, the source is defined to be the single file containing the
34 definition of
35 .B main
36 and
37 .I src
38 will point the editor at the line that begins the definition.
39 .I Src
40 uses
41 .IR db (1)
42 to extract the symbol table information that identifies the source.
43 .PP
44 .I Src
45 looks for each
46 .I file
47 in the current directory, in
48 .BR /bin ,
49 and in the subdirectories of
50 .BR /bin ,
51 in that order.
52 .PP
53 The
54 .B -n
55 flag causes
56 .B src
57 to print the file name but not send it to the editor.
58 The
59 .B -s
60 flag identifies a
61 .I symbol
62 other than
63 .B main
64 to locate.
65 .PP
66 .I Bfn
67 finds the definition of all C functions named
68 .I fn
69 by searching the
70 .B .c
71 files in the current directory.
72 It prints the file name and line number of each match found and submits the match to the
73 .IR plumber (4)
74 if it is unique.
75 .I Fn
76 can be a
77 .IR regexp (6).
78 .SH EXAMPLES
79 Find the source to the
80 .B main
81 routine in
82 .BR /bin/ed :
83 .IP
84 .EX
85 src ed
86 .EE
87 .PP
88 Find the source for
89 .BR strcmp :
90 .IP
91 .EX
92 src -s strcmp rc
93 .EE
94 .SH SOURCE
95 .B /rc/bin/src
96 .SH "SEE ALSO"
97 .IR db (1),
98 .IR plumb (1),
99 .IR sam (1).
100 .SH BUGS
101 .I Bfn
102 requires the source code to follow
103 .IR style (6).