decompress_data is now cleaner, isn't it?
[elinks.git] / Unicode / gen-7b
blobde3876ce7a918ad89b18d5ccdd6bf485b41978c2
1 #!/bin/sh
3 echo
4 echo Generating Unicode2ascii translation table.
6 cat 7bitrepl.lnx | awk -f tr7bit.awk >tmp
7 N=`cat tmp | wc -l`
8 echo '/* Automatically generated by gen-7b */'
9 echo '/* DO NOT EDIT THIS FILE! EDIT Unicode/7bitrepl.lnx INSTEAD! */'
10 echo
11 echo 'static const struct { unicode_val_T x; unsigned char *s; } unicode_7b ['`expr $N + 1`'] = {'
12 sort tmp | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/^/ {/' | sed 's/:/, "/' | sed 's/$/"},/'
13 echo ' {-1, NULL}'
14 echo '};'
15 echo
16 echo '#define N_UNICODE_7B' $N
17 )>../src/intl/uni_7b.inc
18 rm -f tmp
19 echo Done.
20 echo