Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / string / mkwide
blob55a0bab4304b02d08f45976a8a3207464a9341c3
1 #! /bin/sh
3 # generate list of wide characters, with convex closure
5 skipcheck=false
7 if [ ! -r EastAsianWidth.txt ]
8 then ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1
9 fi
10 if [ ! -r UnicodeData.txt ]
11 then ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1
13 if [ ! -r Blocks.txt ]
14 then ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1
17 sed -e "s,^\([^;]*\);[NAH],\1," -e t -e d EastAsianWidth.txt > wide.na
18 sed -e "s,^\([^;]*\);[WF],\1," -e t -e d EastAsianWidth.txt > wide.fw
20 PATH="$PATH:." # for uniset
22 nrfw=`uniset +wide.fw nr | sed -e 's,.*:,,'`
23 echo FW $nrfw
24 nrna=`uniset +wide.na nr | sed -e 's,.*:,,'`
25 echo NAH $nrna
27 extrablocks="2E80-303E"
29 # check all blocks
30 includes () {
31 nr=`uniset +wide.$2 -$1 nr | sed -e 's,.*:,,'`
32 test $nr != $3
34 echo "adding compact closure of wide ranges, this may take ~10min"
35 for b in $extrablocks `sed -e 's,^\([0-9A-F]*\)\.\.\([0-9A-F]*\).*,\1-\2,' -e t -e d Blocks.txt`
36 do range=$b
37 echo checking $range $* >&2
38 if includes $range fw $nrfw && ! includes $range na $nrna
39 then echo $range
41 done > wide.blocks
44 sed -e "s,^,//," -e 1q EastAsianWidth.txt
45 sed -e "s,^,//," -e 1q Blocks.txt
46 uniset `sed -e 's,^,+,' wide.blocks` +wide.fw c
47 ) > wide.t
49 rm -f wide.na wide.fw wide.blocks