last few day's work
[unix-history] / usr / src / usr.bin / window / wwmisc.c
index 9db15e0..8454f1e 100644 (file)
@@ -1,36 +1,29 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwmisc.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwmisc.c    3.1 83/08/11";
 #endif
 
 #include "ww.h"
 
 #endif
 
 #include "ww.h"
 
-struct ww *wwhead = 0;
-struct ww *curwin = 0;
-
-wwsetcurrent(wp)
-register struct ww *wp;
-{
-       curwin = wp;
-       Wfront(wp->ww_win);
-}
-
-wwhaschildren()
-{
-       register struct ww *wp;
-
-       for (wp = wwhead; wp; wp = wp->ww_next)
-               if (wp->ww_state == WW_HASPROC)
-                       return 1;
-       return 0;
-}
-
-struct ww *
-wwfind(id)
-register id;
+char *
+unctrl(c)
+register char c;
 {
 {
-       register struct ww *w;
+       static char buf[5];
+       register char *p = buf;
 
 
-       for (w = wwhead; w && w->ww_ident != id; w = w->ww_next)
-               ;
-       return w;
+       if (c == DEL) {
+               *p++ = '^';
+               *p++ = '?';
+       } else if (c < ' ') {
+               *p++ = '^';
+               *p++ = c + '@';
+       } else if (c > DEL) {
+               *p++ = '\\';
+               *p++ = (c >> 6 & 3) + '0';
+               *p++ = (c >> 3 & 7) + '0';
+               *p++ = (c & 7) + '0';
+       } else
+               *p++ = c;
+       *p = 0;
+       return buf;
 }
 }