#! /bin/sh

# Written by Joey, distributed under the terms of the GNU General Public License

if [ $# -lt 2 -o "$1" = "-h" ]
then
    echo "check-complete source-locale dest-locale (e.g. check-complete C fi)"
    echo
    echo "This program displays differences in the ordering of defines"
    exit 0
fi

source=lang_$1.h
if [ ! -f $source ]
then
    echo "Source $source not available, aborting"
    exit 1
fi

dest=lang_$2.h
if [ ! -f $dest ]
then
    echo "Destination $dest not available, aborting"
    exit 1
fi

tmp="/tmp/$source /tmp/$dest"

trap 'rm -f $tmp' 0 1 9 15

grep '#define' $source |sed 's/#define \([A-Za-z][a-zA-Z_0-9]*\).*/\1/g'> /tmp/$source
grep '#define' $dest |sed 's/#define \([A-Za-z][a-zA-Z_0-9]*\).*/\1/g'> /tmp/$dest

echo "Different defines follows.  If nothing follows that's a good sign :-)"; echo
diff -u /tmp/$source /tmp/$dest
