#!/bin/sh -
#
# Check spelling in comments and quoted strings from the source files.

t=__wt.$$
trap 'rm -f $t; exit 0' 0 1 2 3 13 15

# If aspell has not been installed, quit
type aspell > /dev/null 2>&1 || {
	echo 'skipped: aspell not found'
	exit 0
}

check() {
	aspell --mode=ccpp --lang=en list < ../$1 |
	sort -u |
	comm -23 /dev/stdin s_string.ok > $t
	test -s $t && {
		echo "==== $1"
		cat $t
	}
}

l="`cd .. && echo src/include/*.[hi] src/include/*.in`"
for i in $l `sed -e '/^[a-z]/! d' filelist`; do
	check $i
done

exit 0
