#! /bin/csh -f

set tmp = /tmp/$$
cp /dev/null $tmp
echo "Alignment" >> $tmp
echo "ColorIntensity" >> $tmp
echo "ColorOp" >> $tmp
echo "Coord" >> $tmp
echo "EventType" >> $tmp
echo "EventButton" >> $tmp
echo "GlyphBreakType" >> $tmp
echo "GlyphIndex" >> $tmp
echo "IntCoord" >> $tmp
echo "PixelCoord" >> $tmp
echo "Selection" >> $tmp
grep "^class" {.,../IV-X11,../IV-look,../IV-2_6/InterViews}/*.h | \
    sed -e 's/.*class \([^ ;\*]*\).*$/\1/' | \
    sort | uniq | \
	fgrep -v "(" | \
	grep -v '^String$' | \
	grep -v '^IOHandler$' | \
	grep -v '^istream$' | \
	grep -v '^iostream$' | \
	grep -v '^ostream$' \
	>> $tmp
sed -e 's/\(.*\)/#define \1 _lib_iv(\1)/' < $tmp > "_defines.h"
sed -e 's/^/#undef /' < $tmp > "_undefs.h"
rm $tmp
