From 4f31140995b95672100d3ffa8158fe4a30b22ca9 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 27 Apr 2026 02:46:24 -0400 Subject: /POOL debugging command. --- src/cmd.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/cmd.c') diff --git a/src/cmd.c b/src/cmd.c index 86e51f4..43f9fbe 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -8,6 +8,8 @@ #include "streq.h" #include "timers.h" +#define DEBUG_POOL + /* A "command" is actually anything the user types, whether or not it starts with a / character. */ @@ -35,6 +37,9 @@ static void do_ver(void); static void do_reset(void); static void do_reboot(void); static void do_optional_chan(void); +#ifdef DEBUG_POOL +static void do_pool(void); +#endif typedef struct { char *cmd; @@ -72,6 +77,9 @@ cmd_t command_defs[] = { { "RESET", do_reset, 0 }, { "VER", do_ver, 0 }, { "VERSION", do_ver, 0 }, +#ifdef DEBUG_POOL + { "POOL", do_pool, 0 }, +#endif { 0, 0 } }; @@ -468,3 +476,28 @@ void cmd_send_pm(char *args) { arg1 = args; do_msg(); } + +#ifdef DEBUG_POOL +static void do_pool(void) { + line_t *l; + char p; + int count; + + for(p = 0; p < MAX_POOLS; p++) { + if(pools[p].screen_count == POOL_UNUSED) + break; + + count = 0; + l = pools[p].free_list; + + while(l != (line_t *)END_MARKER) + count++; + + scr_print_current("Pool "); + scr_cur_printnum(p); + scr_print_current(" has "); + scr_cur_printnum(count); + scr_print_current("lines\n"); + } +} +#endif -- cgit v1.2.3