5 /* register, macro, or environments names with more than two characters */
6 static char keys
[NREGS
][GNLEN
];
8 /* per starting character name lists */
9 static int key_head
[256];
10 static int key_next
[NREGS
];
12 /* return the index of s in keys[]; insert it if not in keys[] */
13 static int key_get(char *s
)
15 int head
= (unsigned char) s
[0];
16 int i
= key_head
[head
];
18 if (!strcmp(keys
[i
], s
))
24 key_next
[i
] = key_head
[head
];
29 /* map register names to [0..NREGS * 2) */
32 if (n_cp
|| !s
[1] || !s
[2])
33 return REG(s
[0], s
[1]);
34 return NREGS
+ key_get(s
);
37 /* returns a static buffer */
38 char *map_name(int id
)
40 static char map_buf
[NMLEN
];
42 return keys
[id
- NREGS
];
43 map_buf
[0] = (id
>> 8) & 0xff;
44 map_buf
[1] = id
& 0xff;