Debian Codegraph @

dist/validate/s_chk_proto

raw
1 #!/bin/sh -
2 #
3 # $Id$
4 #
5 # Check to make sure that prototypes are actually needed.
6
7 d=../..
8 [ -f $d/LICENSE ] || {
9 echo 'FAIL: cannot find source distribution directory.'
10 exit 1
11 }
12
13 t1=__1
14 t2=__2
15 t3=__3
16
17 egrep '__P' $d/src/dbinc_auto/*.h |
18 sed -e 's/[ ][ ]*__P.*//' \
19 -e 's/^.*[ *]//' \
20 -e 's/HANDLER)/HANDLER/' \
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
32 find $d -name '*.in' -o -name '*.[ch]' -o -name '*.cpp' > $t2
33 for i in `cat $t1`; do
34 c=$(egrep -Hlw $i $(cat $t2) | wc -l)
35 echo "$i: $c"
36 done | egrep ' 1$' > $t3
37
38 test -s $t3 && {
39 cat $t3
40 echo "FAIL: found unnecessary prototypes."
41 exit 1
42 }
43
44 rm -f $t1 $t2 $t3
45
46 exit 0