USG_PG3/usr/bin/getfuncs
cp /dev/null temprhole
if $1x != x goto test
: bad
echo file of source files not given
goto out
: test
if ! -r $1 -o ! -w $1 goto bad
if { cmp $1 /dev/null >temprhole } goto bad
ed - $1
v/mch\.s/s/^/grep "^[abcdefghijklmnopqrstuvwxyz0123456789]*(" /
g/mch\.s/s/^/grep "^_[abcdefghijklmnopqrstuvwxyz0123456789]*:" /
g/$/s/$/ >>tempfuns/
w tempfsh
q
cp /dev/null tempfuns
sh tempfsh
if { cmp tempfuns /dev/null >temprhole } goto nof
ed - tempfuns
g/(.*$/s///
g/:/s///
g/_/s///
g/cannot open/d
g/ka6/d
w tempfuns
q
sort <tempfuns >tempsfuns
mv tempsfuns tempfuns
: nof
rm tempfsh
if $2x = x goto no2
mv tempfuns $2
goto out
: no2
mv tempfuns functions
: out
rm temprhole