aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd.c33
1 files changed, 33 insertions, 0 deletions
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