From add79f03753c6de0fed1089d5229b818c8541be3 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on ChromeOS)" <rob@synchro.net>
Date: Mon, 20 Feb 2023 15:05:46 -0800
Subject: [PATCH] All loadable modules can now be configured as full
 command-lines

Previously, many/most loadable modules were limited to just 8 chars,
so while technically you could include a command-line option with a
very short module name, now all modules can be configured with full
(up to 63 char) command-lines.
---
 src/sbbs3/sbbsdefs.h     |  1 -
 src/sbbs3/scfg/scfgsys.c | 26 +++++++++++---------------
 src/sbbs3/scfgdefs.h     | 26 +++++++++++++-------------
 3 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h
index 2e65835f8d..eddf5d2e27 100644
--- a/src/sbbs3/sbbsdefs.h
+++ b/src/sbbs3/sbbsdefs.h
@@ -95,7 +95,6 @@
 
 #define LEN_CODE	16		/* Maximum length of internal codes			*/
 #define LEN_QWKID	8		/* Maximum length of QWK-ID					*/
-#define LEN_MODNAME 8		/* Maximum length of loadable module name	*/
 #define LEN_SIFNAME 8		/* Maximum length of SIF filename			*/
 #define LEN_EXTCODE (LEN_CODE*2)	/* Code prefix + suffix */
 
diff --git a/src/sbbs3/scfg/scfgsys.c b/src/sbbs3/scfg/scfgsys.c
index fef2721b7e..b0ec12acfa 100644
--- a/src/sbbs3/scfg/scfgsys.c
+++ b/src/sbbs3/scfg/scfgsys.c
@@ -2621,8 +2621,7 @@ void sys_cfg(void)
 						"\n"
 						"Baja modules (`.bin` files) or JavaScript modules (`.js` files) can be\n"
 						"automatically loaded and executed during certain Terminal Server\n"
-						"operations. The name (root filename) of the module can be specified for\n"
-						"each of the available operations listed below:\n"
+						"operations.  Command-line arguments may be included for all.\n"
 						"\n"
 						"`Login`         Required module for interactive terminal logins (answer)\n"
 						"`Logon`         Executed during terminal logon procedure\n"
@@ -2637,9 +2636,6 @@ void sys_cfg(void)
 						"`Pre Xtrn`      Executed before external programs (doors) run\n"
 						"`Post Xtrn`     Executed after external programs (doors) run\n"
 						"`Temp Transfer` Temporary/archive file transfer menu\n"
-						"\n"
-						"Full module command-lines may be used for the operations listed below:\n"
-						"\n"
 						"`Read Mail`     Executed when a user reads email/netmail\n"
 						"`Scan Msgs`     Executed when a user reads or scans a message sub-board\n"
 						"`Scan Subs`     Executed when a user scans one or more sub-boards for msgs\n"
@@ -2652,7 +2648,7 @@ void sys_cfg(void)
 						"`Note:` JavaScript modules take precedence over Baja modules if both exist\n"
 						"      in your `exec` or `mods` directories.\n"
 					;
-					switch(uifc.list(WIN_ACT|WIN_BOT|WIN_RHT,0,0,40,&mod_dflt,&mod_bar
+					switch(uifc.list(WIN_ACT|WIN_BOT|WIN_RHT,0,0,50,&mod_dflt,&mod_bar
 						,"Loadable Modules",opt)) {
 
 						case -1:
@@ -2706,37 +2702,37 @@ void sys_cfg(void)
 						case 11:
 							uifc.input(WIN_MID|WIN_SAV,0,0,"Post External Program Module"
 								,cfg.postxtrn_mod,sizeof(cfg.postxtrn_mod)-1,K_EDIT);
-							break;														
+							break;
 						case 12:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"Read Mail Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"Read Mail Module"
 								,cfg.readmail_mod,sizeof(cfg.readmail_mod)-1,K_EDIT);
 							break;
 						case 13:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"Scan Msgs Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"Scan Msgs Module"
 								,cfg.scanposts_mod,sizeof(cfg.scanposts_mod)-1,K_EDIT);
 							break;
 						case 14:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"Scan Subs Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"Scan Subs Module"
 								,cfg.scansubs_mod,sizeof(cfg.scansubs_mod)-1,K_EDIT);
 							break;
 						case 15:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"List Msgs Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"List Msgs Module"
 								,cfg.listmsgs_mod,sizeof(cfg.listmsgs_mod)-1,K_EDIT);
 							break;
 						case 16:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"List Logons Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"List Logons Module"
 								,cfg.logonlist_mod,sizeof(cfg.logonlist_mod)-1,K_EDIT);
 							break;
 						case 17:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"List Nodes Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"List Nodes Module"
 								,cfg.nodelist_mod,sizeof(cfg.nodelist_mod)-1,K_EDIT);
 							break;
 						case 18:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"Who's Online Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"Who's Online Module"
 								,cfg.whosonline_mod,sizeof(cfg.whosonline_mod)-1,K_EDIT);
 							break;
 						case 19:
-							uifc.input(WIN_MID|WIN_SAV,0,0,"Private Message Command"
+							uifc.input(WIN_MID|WIN_SAV,0,0,"Private Message Module"
 								,cfg.privatemsg_mod,sizeof(cfg.privatemsg_mod)-1,K_EDIT);
 							break;
 						case 20:
diff --git a/src/sbbs3/scfgdefs.h b/src/sbbs3/scfgdefs.h
index 2391995b56..a30f38b7ac 100644
--- a/src/sbbs3/scfgdefs.h
+++ b/src/sbbs3/scfgdefs.h
@@ -594,16 +594,16 @@ typedef struct
 	int32_t 		uq; 					/* User Questions */
 	uint32_t		mail_maxcrcs;			/* Dupe checking in e-mail */
 	uint16_t		mail_maxage;			/* Maximum age of e-mail */
-	char			logon_mod[LEN_MODNAME+1];			/* Logon module */
-	char			logoff_mod[LEN_MODNAME+1];			/* Logoff module */
-	char			newuser_mod[LEN_MODNAME+1]; 		/* New User Module */
-	char			login_mod[LEN_MODNAME+1];			/* Login module */
-	char			logout_mod[LEN_MODNAME+1];			/* Logout module */
-	char			sync_mod[LEN_MODNAME+1];			/* Synchronization module */
-	char			expire_mod[LEN_MODNAME+1];			/* User expiration module */
-	char			textsec_mod[LEN_MODNAME+1];			/* Text section module */
-	char			xtrnsec_mod[LEN_MODNAME+1];			/* External Program section module */
-	char			automsg_mod[LEN_MODNAME+1];			/* Auto-message module */
+	char			logon_mod[LEN_CMD+1];			/* Logon module */
+	char			logoff_mod[LEN_CMD+1];			/* Logoff module */
+	char			newuser_mod[LEN_CMD+1]; 		/* New User Module */
+	char			login_mod[LEN_CMD+1];			/* Login module */
+	char			logout_mod[LEN_CMD+1];			/* Logout module */
+	char			sync_mod[LEN_CMD+1];			/* Synchronization module */
+	char			expire_mod[LEN_CMD+1];			/* User expiration module */
+	char			textsec_mod[LEN_CMD+1];			/* Text section module */
+	char			xtrnsec_mod[LEN_CMD+1];			/* External Program section module */
+	char			automsg_mod[LEN_CMD+1];			/* Auto-message module */
 	char			readmail_mod[LEN_CMD+1];	/* Reading mail module */
 	char			scanposts_mod[LEN_CMD+1];	/* Scanning posts (in a single sub) module */
 	char			scansubs_mod[LEN_CMD+1];	/* Scanning sub-boards module */
@@ -612,9 +612,9 @@ typedef struct
 	char			whosonline_mod[LEN_CMD+1];
 	char			privatemsg_mod[LEN_CMD+1];
 	char			logonlist_mod[LEN_CMD+1];
-    char			prextrn_mod[LEN_MODNAME+1];			/* External Program pre-execution module */
-    char			postxtrn_mod[LEN_MODNAME+1];		/* External Program post-execution module */
-	char			tempxfer_mod[LEN_MODNAME+1];
+    char			prextrn_mod[LEN_CMD+1];			/* External Program pre-execution module */
+    char			postxtrn_mod[LEN_CMD+1];		/* External Program post-execution module */
+	char			tempxfer_mod[LEN_CMD+1];
 	uchar			smb_retry_time; 		/* Seconds to retry on SMBs */
 	uint16_t		sec_warn;				/* Seconds before inactivity warning */
 	uint16_t		sec_hangup; 			/* Seconds before inactivity hang-up */
-- 
GitLab