Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/rc/bin/sig – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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