#ifndef lint static char sccsid[] = "@(#)cmd6.c 3.13 4/24/85"; #endif /* * Copyright (c) 1983 Regents of the University of California, * All rights reserved. Redistribution permitted subject to * the terms of the Berkeley Software License Agreement. */ #include "defs.h" #include "string.h" #include "char.h" /* * Debugging commands. */ c_debug() { register struct ww *w; if (!terse) wwputs("[m(smap) n(ns) o(os) s(string) v(nvis) w(win)]? ", cmdwin); wwcurtowin(cmdwin); while (wwpeekc() < 0) wwiomux(); if (!terse) wwputc('\n', cmdwin); switch (wwgetc()) { case 'm': wwdumpsmap(); break; case 'n': wwdumpns(); break; case 'o': wwdumpos(); break; case 's': debug_str(); break; case 'v': if ((w = getwin()) != 0) wwdumpnvis(w); break; case 'w': if ((w = getwin()) != 0) wwdumpwin(w); break; default: wwbell(); } } #ifdef STR_DEBUG debug_str() { register struct ww *w; struct string *s; if ((w = openiwin(wwnrow - 3, "Allocated Strings")) == 0) { error("Can't open string window: %s.", wwerror()); return; } for (s = str_head.s_forw; s != &str_head; s = s->s_forw) { if (more(w, 0) == 2) goto out; wwprintf(w, "(0x%x)\t\"%s\"\n", s->s_data, s->s_data); } waitnl(w); out: closeiwin(w); } #else debug_str() { error("No string debugging."); } #endif