1#!/bin/sh - 2# 3# $Id: chk.proto,v 12.0 2004/11/17 03:44:44 bostic Exp $ 4# 5# Check to make sure that prototypes are actually needed. 6 7d=../.. 8 9[ -f $d/LICENSE ] || { 10 echo 'FAIL: cannot find source distribution directory.' 11 exit 1 12} 13 14t1=__1 15t2=__2 16t3=__3 17 18egrep '__P' $d/dbinc_auto/*.h | 19 sed -e 's/[ ][ ]*__P.*//' \ 20 -e 's/^.*[ *]//' \ 21 -e '/__db_cprint/d' \ 22 -e '/__db_lprint/d' \ 23 -e '/__db_noop_log/d' \ 24 -e '/__db_prnpage/d' \ 25 -e '/__db_txnlist_print/d' \ 26 -e '/__db_util_arg/d' \ 27 -e '/__ham_func2/d' \ 28 -e '/__ham_func3/d' \ 29 -e '/_print$/d' \ 30 -e '/_read$/d' > $t1 31 32find $d -name '*.in' -o -name '*.[ch]' -o -name '*.cpp' > $t2 33for i in `cat $t1`; do 34 c=$(egrep -Hlw $i $(cat $t2) | wc -l) 35 echo "$i: $c" 36done | egrep ' 1$' > $t3 37 38test -s $t3 && { 39 cat $t3 40 echo "FAIL: found unnecessary prototypes." 41 exit 1 42} 43 44exit 0 45