#!/bin/sh
# visutosj - Microsoft Foundation Class (MFC) code pre filter
#
# "@(#)RELEASE VERSION WorkShop Visual 2.0 10/09/96"

fil=
filter="euctosj"

while test $# != 0
do	case "$1" in
	-x)	cat <<!
visutosj - convert visu MFC code before transfer to PC

visutosj [-x] [file]
-x   		this explanation
-f filter	shift-jis filter (default $filter)
-*		any other - flags are passed to the filter

[file]		optional file (otherwise takes stdin)

The filter will translate Japanese strings in Visu generated code
to shift-jis and will change the MFC DEFAULT_CHARSET font setting to
SHIFTJIS_CHARSET
!
		exit 1 ;;
	-f )
		shift
		filter=$1 ;;
	-* )
		filterargs="$filterargs $1" ;;

	* )
		if [ ! -z "$fil" ]; then
			echo "Only one file at a time please!"
			exit 1
		fi
		fil="$1" ;;
	esac
	shift
done


sed -e 's/DEFAULT_CHARSET/SHIFTJIS_CHARSET/' ${fil} | 
${filter} ${filterargs}
