diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-04-27 02:46:24 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-04-27 02:46:24 -0400 |
| commit | 4f31140995b95672100d3ffa8158fe4a30b22ca9 (patch) | |
| tree | 8457a16f656f5a6b8df04fd84ba23f6adbb378f5 /src/cmd.c | |
| parent | 18c80370b5fed57d151c55d186cb94be0a1e1ec6 (diff) | |
| download | fujinet-chat-4f31140995b95672100d3ffa8158fe4a30b22ca9.tar.gz | |
/POOL debugging command.
Diffstat (limited to 'src/cmd.c')
| -rw-r--r-- | src/cmd.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -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 |
