Commit 6c25fbce authored by rswindell's avatar rswindell
Browse files

Allow settings for newly-imported sub-boards to be specified on the scfg

command-line (uisng -misc=<value> in addition to -import=<filename>). The
value can be decimal or 0x-prefixed hexadecimal, but you need to know the
property bit-flag value (SUB_* in sbbsdefs.h). For use with init-fidonet.js
parent e9316a0e
......@@ -185,6 +185,7 @@ int main(int argc, char **argv)
const char* grpname = NULL;
unsigned int grpnum = 0;
faddr_t faddr = {0};
uint32_t misc = 0;
for(i=1;i<argc;i++) {
if(argv[i][0]=='-'
#ifndef __unix__
......@@ -199,6 +200,10 @@ int main(int argc, char **argv)
faddr = atofaddr(argv[i] + 7);
continue;
}
if(strncmp(argv[i], "-misc=", 6) == 0) {
misc = strtoul(argv[i] + 7, NULL, 0);
continue;
}
if(strcmp(argv[i], "-insert") == 0) {
uifc.insert_mode = TRUE;
continue;
......@@ -298,6 +303,7 @@ int main(int argc, char **argv)
"-e# = set escape delay to #msec\n"
"-import=<filename> = import a message area list file\n"
"-faddr=<addr> = specify your FTN address for imported subs\n"
"-misc=<value> = specify option flags for imported subs\n"
"-g# = set group number (or name) to import into\n"
"-iX = set interface mode to X (default=auto) where X is one of:\n"
#ifdef __unix__
......@@ -379,7 +385,7 @@ int main(int argc, char **argv)
case msgbase:
{
enum import_list_type list_type = determine_msg_list_type(fname);
ported = import_msg_areas(list_type, fp, grpnum, 1, 99999, /* qhub: */NULL, /* pkt_orig: */NULL, &faddr, &added);
ported = import_msg_areas(list_type, fp, grpnum, 1, 99999, /* qhub: */NULL, /* pkt_orig: */NULL, &faddr, misc, &added);
break;
}
case filebase:
......
......@@ -166,7 +166,7 @@ BOOL save_chat_cfg(scfg_t*, int);
BOOL save_xtrn_cfg(scfg_t*, int);
long import_msg_areas(enum import_list_type, FILE*, unsigned grpnum, int min_confnum, int max_confnum
, qhub_t*, const char* pkt_orig, faddr_t* faddr, long* added);
, qhub_t*, const char* pkt_orig, faddr_t* faddr, uint32_t misc, long* added);
/* Prepare a string to be used as an internal code; Note: use the return value, Luke */
char* prep_code(char *str, const char* prefix);
......
......@@ -100,7 +100,7 @@ static bool new_grp(unsigned new_grpnum)
// Return number of imported (including over-written) subs or negative on error
long import_msg_areas(enum import_list_type type, FILE* stream, unsigned grpnum
, int min_confnum, int max_confnum, qhub_t* qhub, const char* pkt_orig, faddr_t* faddr
, int min_confnum, int max_confnum, qhub_t* qhub, const char* pkt_orig, faddr_t* faddr, uint32_t misc
, long* added)
{
char str[256];
......@@ -156,6 +156,7 @@ long import_msg_areas(enum import_list_type type, FILE* stream, unsigned grpnum
new_sub_misc = SUB_FIDO;
break;
}
new_sub_misc |= misc;
while(1) {
memset(&tmpsub,0,sizeof(tmpsub));
......@@ -1026,7 +1027,8 @@ void msgs_cfg()
}
uifc.pop("Importing Areas...");
long added = 0;
ported = import_msg_areas(k, stream, i, min_confnum, max_confnum, /* qhub: */NULL, pkt_orig, /* faddr: */NULL, &added);
ported = import_msg_areas(k, stream, i, min_confnum, max_confnum, /* qhub: */NULL
, pkt_orig, /* faddr: */NULL, /* misc: */0, &added);
fclose(stream);
uifc.pop(0);
if(ported < 0)
......
......@@ -1261,7 +1261,7 @@ BOOL import_qwk_conferences(uint qhubnum)
}
uifc.pop("Importing Areas...");
long added = 0;
long ported = import_msg_areas(IMPORT_LIST_TYPE_QWK_CONTROL_DAT, fp, grpnum, min_confnum, max_confnum, cfg.qhub[qhubnum], /* pkt_orig */NULL, /* faddr: */NULL, &added);
long ported = import_msg_areas(IMPORT_LIST_TYPE_QWK_CONTROL_DAT, fp, grpnum, min_confnum, max_confnum, cfg.qhub[qhubnum], /* pkt_orig */NULL, /* faddr: */NULL, /* misc: */0, &added);
fclose(fp);
uifc.pop(NULL);
if(ported < 0)
......
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