#!/bin/csh -f

#	Create the funcdecls.h file from the source in the directory

if ($#argv == 0) then
    set files="*.c"
else
    set files="$*"
endif

grep '^[A-Za-z].*)[^;]*$' $files | sed 's/^[^:]*://' | \
	grep -v '^[ 	]*static' | egrep -v '([^a-z_])?main\(' | \
	sed -e 's/ *$//' -e '/^[^ ]*$/s/^/int /' | sed 's/$/;/' | \
	sed 's/(.*)/()/' | \
	sort +1 | uniq
