+#if 1
+
+static chr_t_entry *find_entry(chr_t_entry *t, char **from, int len)
+{
+ chr_t_entry *res;
+
+ if (t->children && t->children[(unsigned char) **from])
+ {
+ char *pos = *from;
+
+ (*from)++;
+ if ((res = find_entry(t->children[(unsigned char) *pos],
+ from, len - 1)))
+ return res;
+ /* no match */
+ *from = pos;
+ }
+ /* no children match. use ourselves */
+ return t;
+}
+
+char **chr_map_input(chr_t_entry *t, char **from, int len)
+{
+ static char *buf[2] = {0, 0}, str[2] = {0, 0};
+ chr_t_entry *res;
+
+ if (!t) /* no table loaded. Null mapping */
+ {
+ if (isalnum(**from))
+ {
+ str[0] = **from;
+ buf[0] = str;
+ }
+ else if (isspace(**from))
+ buf[0] = (char*) CHR_SPACE;
+ else
+ buf[0] = (char*) CHR_UNKNOWN;
+ (*from)++;
+ return buf;
+ }
+ /* no children match. use our target string */
+ if (!(res = find_entry(t, from, len)))
+ abort();
+ buf[0] = (char *) res->target;
+ return buf;
+}
+
+#else
+