4 /* in ASCII order, not that it matters */
5 static const char controllablechars[] = "?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
16 if ((ctlp = strchr(controllablechars, ch)) == 0) {
17 die("unrecognised control character '%c'\n", ch);
20 if (ctlp == controllablechars)
21 return('\177'); /* DEL */
23 return((unsigned char)(ctlp - controllablechars - 1));
24 } else { /* Want uncontrol */
25 if (ch == '\177' || ch == -1)
27 else if (0 < ch && ch < (sizeof(controllablechars) - 1))
28 return(controllablechars[ch+1]);
30 die("invalid control request: '\\%03o'\n", ch & 0xFF);