1#!/bin/sh -
2#
3# $Id: chk.mtx,v 1.1 2007/08/09 13:35:40 bostic Exp $
4#
5# Check to make sure __mutex_print_id knows about all of the mutex types.
6
7d=../../
8
9[ -d $d/mutex ] || {
10	echo 'FAIL: cannot find source distribution directory.'
11	exit 1
12}
13
14t1=__1
15t2=__2
16
17egrep 'case MTX_.*return' $d/mutex/mut_stat.c |
18sed -e 's/.*case //' \
19    -e 's/:.*//' |
20sort > $t1
21
22egrep '#define.MTX_' $d/dbinc/mutex.h |
23sed -e 's/#define.//' \
24    -e 's/	.*//' \
25    -e '/MTX_MAX_ENTRY/d' |
26sort > $t2
27
28cmp $t1 $t2 > /dev/null || {
29	echo "<<< mutex/mut_stat.c >>> dbinc/mutex.h"
30	diff $t1 $t2
31	exit 1
32}
33
34exit 0
35