#! /bin/sh

echo '#include "codeconv.h"'
echo ''
echo 'int u16tojis[65536];'
echo 'int jistou16[65536];'
echo ''
echo 'void tblinit()'
echo '{'
echo '    int i;'
echo ''
echo '    for (i = 0; i < 65536; i++) {'
echo '	u16tojis[i] = jistou16[i] = -1;'
echo '    }'
echo ''

cat jisx0208-win7utf8-conv.txt |
awk '
{	
	printf "    u16tojis[%s] = %s; /* %s */\n", $1, $2, $4
}
'

cat jisx0208-win7utf8-conv.txt |
awk '
{	
	printf "    jistou16[%s] = %s; /* %s */\n", $2, $1, $4
}
'

echo '}'
