#!/bin/sh
echo
echo Generating Unicode2ascii translation table.
(
cat 7bitrepl.lnx | awk -f tr7bit.awk >tmp
N=`cat tmp | wc -l`
echo '/* Automatically generated by gen-7b */'
echo
echo 'struct u7_struct { unsigned short x; char *s; }  __attribute__((packed));'
echo 'struct u7_struct unicode_7b ['`expr $N + 1`'] = {'
sort tmp | sed 's/"/\\"/g' | sed 's/^/	{ /' | sed 's/:/, "/' | sed 's/$/" },/'
echo '	{ -1, NULL }'
echo '};'
echo
echo '#define N_UNICODE_7B' $N
)>uni_7b.h
rm -f tmp
echo Done.
echo
