diff -r 000000000000 -r dd21522fd290 webengine/wmlengine/src/Unicode/tools/genSource.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webengine/wmlengine/src/Unicode/tools/genSource.sh Mon Mar 30 12:54:55 2009 +0300 @@ -0,0 +1,59 @@ +#!/bin/bash + +declare -a names +names=( LetterUppercase LetterLowercase LetterTitlecase LetterModifier \ + LetterOther MarkNonSpacing MarkSpacingCombining MarkEnclosing \ + NumberDecimalDigit NumberLetter NumberOther PunctuationConnector \ + PunctuationDash PunctuationOpen PunctuationClose PunctuationInitial \ + PunctuationFinal PunctuationOther SymbolMath SymbolCurrency \ + SymbolModifier SymbolOther SeparatorSpace SeparatorLine \ + SeparatorParagraph OtherControl OtherFormat OtherSurrogate \ + OtherPrivateUse OtherNotAssigned ) +declare -a codes +codes=( Lu Ll Lt Lm Lo Mn Mc Me Nd Nl No Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So Zs \ + Zl Zp Cc Cf Cs Co Cn ) + +cp Validate.h.pre ../test/Validate.h +cp Validate.c.pre ../test/Validate.c + +# code generation +for (( index=0; index < ${#codes[*]}; index=index + 1 )); do + echo ${names[$index]} + + space="`echo ${names[$index]}|sed -e 's/^.\{7,7\}//' -e 's/./ /g'`" + + sed >../src/NW_Unicode_${names[$index]}.c >../src/NW_Unicode_${names[$index]}.c + sed >>../src/NW_Unicode_${names[$index]}.c ../src/NW_Unicode_${names[$index]}.c ../include/NW_Unicode_${names[$index]}.h ../include/NW_Unicode_${names[$index]}I.h ../test/Validate${names[$index]}.c >../test/Validate${names[$index]}.c + sed >>../test/Validate${names[$index]}.c >../test/Validate.h "#include \"NW_Unicode_${names[$index]}.h\"" + echo >>../test/Validate.h "extern NW_Bool Validate${names[$index]} (void);" + echo >>../test/Validate.h + + sleep 1 + echo -e >>../test/Validate.c " if (!Validate${names[$index]} ()) {\n return NW_FALSE;\n }" + + rm ranges.${codes[$index]}.$$.bak codes.${codes[$index]}.$$.bak +done + +cat Validate.h.post >>../test/Validate.h +cat Validate.c.post >>../test/Validate.c