File: gen-ent

package info (click to toggle)
links2 2.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,852 kB
  • sloc: ansic: 181,859; sh: 2,585; cpp: 1,450; makefile: 84; awk: 49; perl: 34
file content (22 lines) | stat: -rwxr-xr-x 411 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e
LC_ALL=C
export LC_ALL
echo
echo Generating entity table.
(
cat entities.lnx | sed 's/
$//' | grep '^[ 	]*{"' | sort >tmp
N=`cat tmp | wc -l`
echo '/* Automatically generated by gen-ent */'
echo
echo 'static_const struct { const char *s; int c; } entities ['`expr $N + 1`'] = {'
cat tmp
echo '  {NULL,	0}'
echo '};'
echo
echo '#define N_ENTITIES' $N
) > ../entity.inc
rm -f tmp
echo Done.
echo