2011-03-30 14:14:36 +00:00
|
|
|
#!/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){
|
2020-03-10 17:09:34 +00:00
|
|
|
echo usage: sig function ... >/fd/2
|
|
|
|
exit usage
|
2011-03-30 14:14:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|