last few day's work
[unix-history] / usr / src / usr.bin / window / wwmisc.c
CommitLineData
8584be19 1#ifndef lint
30647f51 2static char *sccsid = "@(#)wwmisc.c 3.1 83/08/11";
8584be19
EW
3#endif
4
5#include "ww.h"
6
2ea355ad
EW
7char *
8unctrl(c)
9register char c;
10{
11 static char buf[5];
12 register char *p = buf;
13
14 if (c == DEL) {
15 *p++ = '^';
16 *p++ = '?';
17 } else if (c < ' ') {
18 *p++ = '^';
19 *p++ = c + '@';
20 } else if (c > DEL) {
21 *p++ = '\\';
22 *p++ = (c >> 6 & 3) + '0';
23 *p++ = (c >> 3 & 7) + '0';
24 *p++ = (c & 7) + '0';
25 } else
26 *p++ = c;
27 *p = 0;
28 return buf;
29}