#!/bin/sh -
#
# $Id: chk.def,v 1.1.1.1.2.2 2000/02/08 00:44:19 noriko Exp $

f=../build_win32/libdb.def

# Check to make sure we haven't forgotten to add any interfaces
# to the libdb.def file.
sed '/; /d' $f |
    egrep @ |
    awk '{print $1}' |
    sed -e '/db_xa_switch/d' -e '/^__/d' | sort > __1

egrep __P db.h |
    sed '/^[a-z]/!d' |
    awk '{print $2}' |
    sed 's/^\*//' |
    sed '/^__/d' | sort > __2

if diff __1 __2 > /dev/null; then
	:
else
	echo "<<< libdb.def"
	echo ">>> DB include files"
	diff __1 __2
fi

# Check to make sure we don't have any extras in the libdb.def file.
sed '/; /d' $f |
    egrep @ |
    awk '{print $1}' > __1

for i in `cat __1`; do
	if egrep $i ../*/*.c > /dev/null; then
		:
	else
		echo "$f: $i not found in DB sources"
	fi
done

rm -f __1 __2
