summaryrefslogtreecommitdiff
path: root/bdb/dist/build/chk.define
blob: 9e2aa0db49802d857f3cd5e7a2a33f91bc60b6ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh -
#
# $Id: chk.define,v 1.8 2000/12/12 18:20:59 bostic Exp $
#
# Check to make sure that all #defines are actually used.

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

t1=/tmp/__1

egrep '^#define' include/*.h |
    sed -e '/db_185.h/d' -e '/xa.h/d' |
    awk '{print $2}' |
    sed -e '/^B_DELETE/d' \
	-e '/^B_MAX/d' \
	-e '/^CIRCLEQ/d' \
	-e '/^DB_RO_ACCESS/d' \
	-e '/^DEFINE_DB_CLASS/d' \
	-e '/^LIST/d' \
	-e '/^LOG_OP/d' \
	-e '/^MINFILL/d' \
	-e '/^MUTEX_FIELDS/d' \
	-e '/^NCACHED2X/d' \
	-e '/^NCACHED30/d' \
	-e '/^PAIR_MASK/d' \
	-e '/^POWER_OF_TWO/d' \
	-e '/^P_16_COPY/d' \
	-e '/^P_32_COPY/d' \
	-e '/^P_32_SWAP/d' \
	-e '/^SH_CIRCLEQ/d' \
	-e '/^SH_LIST/d' \
	-e '/^SH_TAILQ/d' \
	-e '/^TAILQ/d' \
	-e '/UNUSED/d' \
	-e '/^WRAPPED_CLASS/d' \
	-e '/^XA_$/d' \
	-e '/^_DB_SERVER_H_RPCGEN/d' \
	-e '/_AUTO_H$/d' \
	-e '/_H_$/d' \
        -e '/ext_h_/d' \
        -e '/^i_/d' \
	-e 's/(.*//' | sort > ${t1}

for i in `cat ${t1}`; do
	if egrep -w $i */*.c */*.cpp > /dev/null; then
		:;
	else
		f=`egrep -l $i include/*.h |
		    sed 's;include/;;' | tr -s "[:space:]" " "`
		echo "$i: $f"
	fi
done | sort +1

rm -f ${t1}