blob: 91816164100773a7b507e9f91b42473f5009a5a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/rc
# Usage: sig key ...
# prints out function signatures by grepping the manual
*=`{echo $*|tr A-Z a-z|tr -dc 'a-z0-9_ \012'} # fold case, delete funny chars
if(~ $#* 0){
echo usage: sig function ... >/fd/2
exit usage
}
for (i) {
files=`{grep -il '[ ]\*?'$i'\(' /sys/man/2/*}
for(j in $files) {
{echo .nr LL 20i; sed -n '/^.SH SYNOPSIS/,/^.SH.*DESCR/p' $j } |
nroff -man |
sed '
:a
/,$/ {
N
s/\n//
}
ta
s/[ ]+/ /g' |
grep -i -e '[ *]'$i'\(' | sed 's/^[ +]/ /'
}
}
exit 0
|