Annotation of 43BSDTahoe/ucb/window/cmd6.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1983 Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms are permitted
                      6:  * provided that the above copyright notice and this paragraph are
                      7:  * duplicated in all such forms and that any documentation,
                      8:  * advertising materials, and other materials related to such
                      9:  * distribution and use acknowledge that the software was developed
                     10:  * by the University of California, Berkeley.  The name of the
                     11:  * University may not be used to endorse or promote products derived
                     12:  * from this software without specific prior written permission.
                     13:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
                     14:  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                     15:  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     16:  */
                     17: 
                     18: #ifndef lint
                     19: static char sccsid[] = "@(#)cmd6.c     3.15 (Berkeley) 6/29/88";
                     20: #endif /* not lint */
                     21: 
                     22: #include "defs.h"
                     23: #include "string.h"
                     24: #include "char.h"
                     25: 
                     26: /*
                     27:  * Debugging commands.
                     28:  */
                     29: 
                     30: c_debug()
                     31: {
                     32:        register struct ww *w;
                     33: 
                     34:        if (!terse)
                     35:                wwputs("[m(smap) n(ns) o(os) s(string) v(nvis) w(win)]? ", cmdwin);
                     36:        wwcurtowin(cmdwin);
                     37:        while (wwpeekc() < 0)
                     38:                wwiomux();
                     39:        if (!terse)
                     40:                wwputc('\n', cmdwin);
                     41:        switch (wwgetc()) {
                     42:        case 'm':
                     43:                wwdumpsmap();
                     44:                break;
                     45:        case 'n':
                     46:                wwdumpns();
                     47:                break;
                     48:        case 'o':
                     49:                wwdumpos();
                     50:                break;
                     51:        case 's':
                     52:                debug_str();
                     53:                break;
                     54:        case 'v':
                     55:                if ((w = getwin()) != 0)
                     56:                        wwdumpnvis(w);
                     57:                break;
                     58:        case 'w':
                     59:                if ((w = getwin()) != 0)
                     60:                        wwdumpwin(w);
                     61:                break;
                     62:        default:
                     63:                wwbell();
                     64:        }
                     65: }
                     66: 
                     67: #ifdef STR_DEBUG
                     68: debug_str()
                     69: {
                     70:        register struct ww *w;
                     71:        struct string *s;
                     72: 
                     73:        if ((w = openiwin(wwnrow - 3, "Allocated Strings")) == 0) {
                     74:                error("Can't open string window: %s.", wwerror());
                     75:                return;
                     76:        }
                     77:        for (s = str_head.s_forw; s != &str_head; s = s->s_forw) {
                     78:                if (more(w, 0) == 2)
                     79:                        goto out;
                     80:                wwprintf(w, "(0x%x)\t\"%s\"\n", s->s_data, s->s_data);
                     81:        }
                     82:        waitnl(w);
                     83: out:
                     84:        closeiwin(w);
                     85: }
                     86: #else
                     87: debug_str()
                     88: {
                     89:        error("No string debugging.");
                     90: }
                     91: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.