Commit bb43c70b authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Add "Native" option for QWKnet call-out cmd-lines

This really shouldn't be necessary to toggle (at least now) on Windows, since we treat all off-line executions as "native", but for *nix, it could make a big difference if trying to invoke a native program or shell script for a QWKnet call-out and it would either fail due to no DOS support or try to executing using Linux-DOSEMU (unless the command's program name was in the global "native program list" configured in SCFG->External Programs).
parent 47e60472
Pipeline #3011 passed with stage
in 9 minutes and 48 seconds
......@@ -3010,10 +3010,13 @@ void event_thread(void* arg)
sbbs->lprintf(LOG_INFO,"Call-out: %s",sbbs->cfg.qhub[i]->id);
sbbs->online=ON_LOCAL;
sbbs->console|=CON_L_ECHO;
int ex_mode = EX_OFFLINE|EX_SH; /* sh for Unix perl scripts */
if(sbbs->cfg.qhub[i]->misc & QHUB_NATIVE)
ex_mode |= EX_NATIVE;
int result = sbbs->external(
sbbs->cmdstr(sbbs->cfg.qhub[i]->call
,sbbs->cfg.qhub[i]->id,sbbs->cfg.qhub[i]->id,NULL)
,EX_OFFLINE|EX_SH); /* sh for Unix perl scripts */
,ex_mode);
sbbs->lprintf(result ? LOG_ERR : LOG_INFO, "Call-out to: %s returned %d", sbbs->cfg.qhub[i]->id, result);
sbbs->console&=~CON_L_ECHO;
sbbs->online=FALSE;
......@@ -3185,7 +3188,7 @@ void event_thread(void* arg)
sbbs->online=ON_LOCAL;
sbbs->console|=CON_L_ECHO;
sbbs->lprintf(LOG_INFO,"Running %s%stimed event: %s"
,(ex_mode&EX_NATIVE) ? "native ":""
,(ex_mode&EX_NATIVE) ? "native ":"16-bit DOS "
,(ex_mode&EX_BG) ? "background ":""
,event_code);
{
......
......@@ -432,6 +432,7 @@ typedef enum { /* Values for xtrn_t.event */
#define QHUB_NOHEADERS (1<<16) /* Don't include HEADERS.DAT */
#define QHUB_NOVOTING (1<<17) /* Don't include VOTING.DAT */
#define QHUB_UTF8 (1<<18) /* Include UTF-8 characters */
#define QHUB_NATIVE (1<<19) /* Native call-out script */
/* Bits in user.chat */
#define CHAT_ECHO (1<<0) /* Multinode chat echo */
......
......@@ -833,6 +833,7 @@ void qhub_edit(int num)
sprintf(opt[i++],"%-27.27s%s","Pack Command Line",cfg.qhub[num]->pack);
sprintf(opt[i++],"%-27.27s%s","Unpack Command Line",cfg.qhub[num]->unpack);
sprintf(opt[i++],"%-27.27s%s","Call-out Command Line",cfg.qhub[num]->call);
sprintf(opt[i++],"%-27.27s%s","Native Call-out Command",cfg.qhub[num]->misc&QHUB_NATIVE ? "Yes":"No");
if(cfg.qhub[num]->node == NODE_ANY)
SAFECOPY(str, "Any");
else
......@@ -876,6 +877,9 @@ void qhub_edit(int num)
"The `Call-out Command Line` is executed when your system attempts a packet\n"
"exchange with the QWKnet hub (e.g. executes a script).\n"
"\n"
"Toggle `Native Call-out Command` to `Yes` if your Call-out Command-line\n"
"is invoking a native (not a 16-bit DOS) program or script.\n"
"\n"
"`Kludge Lines` (e.g. @TZ, @VIA, @MSGID, @REPLY) provide information not\n"
"available in standard QWK message headers, but are superfluous when the\n"
"HEADERS.DAT file is supported and used.\n"
......@@ -971,6 +975,10 @@ void qhub_edit(int num)
uifc.input(WIN_MID|WIN_SAV,0,0,""
,cfg.qhub[num]->call,sizeof(cfg.qhub[num]->call)-1,K_EDIT);
break;
case __COUNTER__:
cfg.qhub[num]->misc^=QHUB_NATIVE;
uifc.changes=1;
break;
case __COUNTER__:
if(cfg.qhub[num]->node == NODE_ANY)
SAFECOPY(str, "Any");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment