mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Move the SGML entity database back to the format used by unicode.org
This commit is contained in:
parent
a5d71488a2
commit
3e6c08ce12
1102
Unicode/entities.lnx
1102
Unicode/entities.lnx
File diff suppressed because it is too large
Load Diff
1027
Unicode/entities.txt
Normal file
1027
Unicode/entities.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,18 +2,26 @@
|
||||
|
||||
echo
|
||||
echo Generating entity table.
|
||||
(
|
||||
cat entities.lnx | grep '^[ ]*{"' | sort >tmp
|
||||
|
||||
sed -n '/^[^#]/,$p' < entities.txt | while read line; do \
|
||||
name=$(echo "$line" | cut -f 1); \
|
||||
code=$(echo "$line" | cut -f 3); \
|
||||
desc=$(echo "$line" | cut -f 4 | sed 's/# //'); \
|
||||
printf "\t{ %-12s %s }, /* %-46s */\n" \
|
||||
"\"$name\"," "$code" "$desc"; \
|
||||
done | LC_ALL=C sort > tmp
|
||||
N=`cat tmp | wc -l`
|
||||
echo '/* Automatically generated by gen-ent */'
|
||||
echo
|
||||
echo 'struct entity { char *s; unicode_val_T c; } entities ['`expr $N + 1`'] = {'
|
||||
cat tmp
|
||||
echo ' {NULL, 0}'
|
||||
echo '};'
|
||||
echo
|
||||
echo '#define N_ENTITIES' $N
|
||||
) > ../src/intl/entity.inc
|
||||
|
||||
cat > ../src/intl/entity.inc <<EOF
|
||||
/* Automatically generated by gen-ent */
|
||||
|
||||
struct entity { char *s; unicode_val_T c; } entities [$(expr $N + 1)] = {
|
||||
$(cat tmp)
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
#define N_ENTITIES $N
|
||||
EOF
|
||||
rm -f tmp
|
||||
echo Done.
|
||||
echo
|
||||
|
Loading…
Reference in New Issue
Block a user