mirror of
https://github.com/rkd77/elinks.git
synced 2024-08-24 21:35:53 -04:00
29 lines
628 B
Bash
Executable File
29 lines
628 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo
|
|
echo Generating entity table.
|
|
|
|
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/# //'); \
|
|
test "$code" = "0x????" && continue
|
|
printf "\t{ %-12s %s }, /* %-46s */\n" \
|
|
"\"$name\"," "$code" "$desc"; \
|
|
done | LC_ALL=C sort > tmp
|
|
N=`cat tmp | wc -l`
|
|
|
|
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
|