2007-03-10 19:04:07 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
|
|
|
# Check to make sure that prototypes are actually needed.
|
|
|
|
|
|
|
|
d=../..
|
|
|
|
|
|
|
|
[ -f $d/LICENSE ] || {
|
|
|
|
echo 'FAIL: cannot find source distribution directory.'
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
t1=__1
|
|
|
|
t2=__2
|
|
|
|
t3=__3
|
|
|
|
|
2009-09-01 13:53:56 +00:00
|
|
|
trap 'rm -f $t1 $t2 $t3' 0 1 2 3 13 15
|
|
|
|
|
2007-03-10 19:04:07 +00:00
|
|
|
egrep '__P' $d/src/inc/*.h |
|
2009-09-01 13:53:56 +00:00
|
|
|
sed -e '/db_int.h/d' |
|
2007-03-10 19:04:07 +00:00
|
|
|
sed -e 's/[ ][ ]*__P.*//' \
|
|
|
|
-e 's/^.*[ *]//' \
|
|
|
|
> $t1
|
|
|
|
|
|
|
|
find $d -name '*.in' -o -name '*.[ch]' -o -name '*.cpp' > $t2
|
|
|
|
for i in `cat $t1`; do
|
|
|
|
c=$(egrep -Hlw $i $(cat $t2) | wc -l)
|
|
|
|
echo "$i: $c"
|
|
|
|
done | egrep ' 1$' > $t3
|
|
|
|
|
|
|
|
test -s $t3 && {
|
|
|
|
cat $t3
|
|
|
|
echo "FAIL: found unnecessary prototypes."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
exit 0
|