#! /bin/csh -f

set defs = _defines.h
set undefs = _undefs.h
set tmp = /usr/tmp/$$
set srcs = "../src/*.cxx ../../Xtf/*.cxx"
cp /dev/null $tmp
echo "Boolean" >> $tmp
echo "Alignment" >> $tmp
echo "Axis" >> $tmp
echo "CharCode" >> $tmp
echo "Coord" >> $tmp
echo "PixelCoord" >> $tmp
echo "Tag" >> $tmp
egrep "^((class)|(struct))" {.,Impls,OS}/*.h $srcs | \
    sed -e 's/.*class \([^ ;\*]*\).*$/\1/' \
	-e 's/.*struct \([^ ;\*]*\).*$/\1/' | \
    sort | uniq | \
	fgrep -v "(" | \
	fgrep -v "{" | \
	grep -v '^istream$' | \
	grep -v '^iostream$' | \
	grep -v '^ostream$' | \
	grep -v '^Xf' | \
	grep -v '^Xtf' | \
	grep -v '^_Xtf' \
	>> $tmp
rm -f $defs $undefs
sed -e 's/\(.*\)/#define \1 _lib_fresco(\1)/' < $tmp > $defs
sed -e 's/^/#undef /' < $tmp > $undefs
chmod a-w $defs $undefs
rm $tmp
