#! /bin/sh -f

if [ ! -f Scripts.txt ]
then	echo source for generation not found: Scripts.txt
	echo "(http://unicode.org/Public/UNIDATA/Scripts.txt)"
	exit
fi

#00F8..01BA    ; LATIN # L& [195] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER EZH WITH TAIL
#01BB          ; LATIN # Lo       LATIN LETTER TWO WITH STROKE

egrep '^[^#]' Scripts.txt |
sed	-e 's/ *#.*//' \
	-e 's/^\([0-9A-F][0-9A-F]*\)\.\.\([0-9A-F][0-9A-F]*\) *; *\([^ ]*\) */\1	{0x\1, 0x\2, "\3"},/' \
	-e 's/^\([0-9A-F][0-9A-F]*\) *; *\([^ ]*\) */\1	{0x\1, 0x\1, "\2"},/' \
	-e 's,^\(....\)	,0\1	,' \
| sort | sed -e 's,^.*	,	,' > scriptbl.h
