| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | set -e |
| 3 | LC_ALL=C |
| 4 | export LC_ALL |
| 5 | echoscip-shell system . . echo. |
| 6 | echoscip-shell system . . echo. Generating entity table. |
| 7 | ( |
| 8 | catscip-shell system . . cat. entities.lnx | sedscip-shell system . . sed. 's/ $//' | grepscip-shell system . . grep. '^[ ]*{"' | sortscip-shell system . . sort. >tmp |
| 9 | N=`catscip-shell system . . cat. tmp | wcscip-shell system . . wc. -l` |
| 10 | echoscip-shell system . . echo. '/* Automatically generated by gen-ent */scip-shell filesystem . . `/* Automatically generated by gen-ent */`.' |
| 11 | echoscip-shell system . . echo. |
| 12 | echoscip-shell system . . echo. 'static_const struct { const char *s; int c; } entities ['`exprscip-shell system . . expr. $N + 1`'] = {' |
| 13 | catscip-shell system . . cat. tmp |
| 14 | echoscip-shell system . . echo. ' {NULL, 0}' |
| 15 | echoscip-shell system . . echo. '};' |
| 16 | echoscip-shell system . . echo. |
| 17 | echoscip-shell system . . echo. '#define N_ENTITIES' $N |
| 18 | ) > ../entity.inc |
| 19 | rmscip-shell system . . rm. -f tmp |
| 20 | echoscip-shell system . . echo. Done. |
| 21 | echoscip-shell system . . echo. |