#!/bin/sh -
#
# Id: chk.proto,v 1.3 2001/05/05 14:48:11 bostic Exp 
#
# Check to make sure that prototypes are actually needed.

# Run from the top-level directory.
[ -f db_config.h ] && cd ..

t1=/tmp/__1

egrep '__P' include_auto/*.h |
    sed -e 's/[	 ][	 ]*__P.*//' \
    -e 's/^.*[	 *]//' \
    -e '/__db_cprint/d' \
    -e '/__db_lprint/d' \
    -e '/__db_noop_log/d' \
    -e '/__db_prnpage/d' \
    -e '/__db_txnlist_print/d' \
    -e '/__ham_func2/d' \
    -e '/__ham_func3/d' \
    -e '/_print$/d' \
    -e '/_read$/d' > ${t1}

for i in `cat ${t1}`; do
	c=`egrep -low $i include/*.in include/*.h */*.c */*.cpp | wc -l`
	echo "$i: $c"
done | egrep ' 1$'

rm -f ${t1}
