3 if test -z "$AWK"; then
6 if test -z "$srcdir"; then
16 * This file is automagically created from term.c -- DO NOT EDIT
39 # SCO-Unix sufferers may need to use the following lines:
40 # perl -p < ${srcdir}/term.c \
41 # -e 's/"/"C/ if /"[A-Z]."/;' \
42 # -e 'y/[a-z]/[A-Z]/ if /"/;' \
44 sed < ${srcdir}/term.c \
45 -e '/"[A-Z]."/s/"/"C/' \
46 -e '/"/y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
48 /^ [{] ".*KMAPDEF[(].*$/{
52 /^ [{] ".*KMAPADEF[(].*$/{
53 if (amin == 0) amin = s
56 /^ [{] ".*KMAPMDEF[(].*$/{
57 if (mmin == 0) mmin = s
61 a=substr($2,2,length($2)-3);
64 printf "#define d_%s d_tcs[%d].%s\n",a,s,b
65 printf "#define D_%s (D_tcs[%d].%s)\n",a,s,b
70 printf "#define %s %d\n",$3,s
79 printf "\n#ifdef MAPKEYS\n"
80 printf "# define KMAPDEFSTART %d\n", min
81 printf "# define NKMAPDEF %d\n", max-min+1
82 printf "# define KMAPADEFSTART %d\n", amin
83 printf "# define NKMAPADEF %d\n", amax-amin+1
84 printf "# define KMAPMDEFSTART %d\n", mmin
85 printf "# define NKMAPMDEF %d\n", mmax-mmin+1
88 ' |
sed -e s
/NUM
/num
/ -e s
/STR
/str
/ -e s
/FLG
/flg
/ \
92 cat << EOF > kmapdef.c
94 * This file is automagically created from term.c -- DO NOT EDIT
103 $AWK < ${srcdir}/term.c
'
105 for (i = 0; i < 3; i++) {
107 if (substr(q, 1, 5) == "KMAPD") {
108 if (min == 0) min = s
110 arr[s] = substr(q, 9, length(q)-9)
112 if (substr(q, 1, 5) == "KMAPA") {
113 if (amin == 0) amin = s
115 anarr[s] = substr(q, 10, length(q)-10)
117 if (substr(q, 1, 5) == "KMAPM") {
118 if (mmin == 0) mmin = s
120 mnarr[s] = substr(q, 10, length(q)-10)
128 printf "char *kmapdef[] = {\n"
129 for (s = min; s <= max; s++) {
140 printf "char *kmapadef[] = {\n"
141 for (s = amin; s <= amax; s++) {
143 printf "%s", anarr[s]
152 printf "char *kmapmdef[] = {\n"
153 for (s = mmin; s <= mmax; s++) {
155 printf "%s", mnarr[s]
163 printf "};\n\n#endif\n"