Newer
Older
,"Unpack Command Line"
,cfg.arcdef[i].unpack,sizeof(cfg.arcdef[i].unpack)-1
}
"~ Domains ~\n\n"
;
i=0;
while(1) {
for(u=0; u < cfg.domain_count; u++)
snprintf(opt[u], MAX_OPLN-1, "%-*s %s"
,FIDO_DOMAIN_LEN, cfg.domain_list[u].name, cfg.domain_list[u].dns_suffix);
opt[u][0]=0;
int mode = WIN_SAV | WIN_INS | WIN_DEL | WIN_ACT
| WIN_INSACT | WIN_DELACT | WIN_XTR;
if(cfg.domain_count)
mode |= WIN_COPY | WIN_CUT;
if(savedomain.name[0])
mode |= WIN_PASTE | WIN_PASTEXTR;
i=uifc.list(mode,0,0,0,&domain_opt,0,"Domains",opt);
if(i==-1)
break;
int msk = i&MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
str[0]=0;
uifc.helpbuf=
"~ Domain ~\n\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0
,"FTN Domain Name", str, FIDO_DOMAIN_LEN, K_EDIT)<1)
continue;
if(!new_domain(i)) {
printf("\nMemory Allocation Error\n");
}
SAFECOPY(cfg.domain_list[i].name, str);
}
if (msk == MSK_DEL || msk == MSK_CUT) {
if(msk == MSK_CUT)
memcpy(&savedomain, &cfg.domain_list[i], sizeof(savedomain));
cfg.domain_count--;
if(cfg.domain_count <= 0) {
cfg.domain_count = 0;
}
for(u=i; u < cfg.domain_count; u++)
memcpy(&cfg.domain_list[u], &cfg.domain_list[u+1], sizeof(struct fido_domain));
}
if (msk == MSK_COPY) {
memcpy(&savedomain, &cfg.domain_list[i], sizeof(savedomain));
}
if (msk == MSK_PASTE) {
if(!new_domain(i))
continue;
memcpy(&cfg.domain_list[i], &savedomain, sizeof(savedomain));
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
}
if (msk != 0)
continue;
while(1) {
j=0;
uifc.helpbuf=
"Configuring a Domain"
;
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Name"
,cfg.domain_list[i].name);
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Zones"
,int_list(cfg.domain_list[i].zone_list, cfg.domain_list[i].zone_count));
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","DNS Suffix"
,cfg.domain_list[i].dns_suffix);
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Outbound Root"
,cfg.domain_list[i].root);
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","NodeList"
,cfg.domain_list[i].nodelist);
opt[j][0]=0;
SAFEPRINTF(str, "Domain - %s", cfg.domain_list[i].name);
k=uifc.list(WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT,0,0,0,&listop,0,str,opt);
if(k==-1)
break;
switch(k) {
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Domain Name"
,cfg.domain_list[i].name,sizeof(cfg.domain_list[i].name)-1
,K_EDIT);
break;
case 1:
SAFECOPY(str, int_list(cfg.domain_list[i].zone_list, cfg.domain_list[i].zone_count));
if(uifc.input(WIN_MID|WIN_SAV, 0, 0
,"Zone List (comma-separated)"
,str, 40, K_EDIT) >= 0) {
FREE_AND_NULL(cfg.domain_list[i].zone_list);
cfg.domain_list[i].zone_list = parseIntList(str, ",", &cfg.domain_list[i].zone_count);
uifc.changes = TRUE;
}
break;
case 2:
uifc.input(WIN_MID|WIN_SAV,0,0
,"DNS Suffix"
,cfg.domain_list[i].dns_suffix,sizeof(cfg.domain_list[i].dns_suffix)-1
,K_EDIT);
break;
case 3:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Outbound Root Directory"
,cfg.domain_list[i].root,sizeof(cfg.domain_list[i].root)-1
,K_EDIT);
break;
case 4:
uifc.input(WIN_MID|WIN_SAV,0,0
,"NodeList"
,cfg.domain_list[i].nodelist,sizeof(cfg.domain_list[i].nodelist)-1
,K_EDIT);
break;
}
break;
case 7:
uifc.helpbuf=
"~ EchoLists ~\n\n"
"This feature allows you to specify lists of echoes, in `BACKBONE.NA`\n"
"format, which are utilized in `addition` to your Area File (e.g. \n"
"`areas.bbs`) for advanced AreaFix (Area Management) operations.\n";
while(1) {
for(u=0;u<cfg.listcfgs;u++)
int mode = WIN_SAV | WIN_INS | WIN_DEL | WIN_ACT
| WIN_INSACT | WIN_DELACT | WIN_XTR;
if(cfg.listcfgs)
mode |= WIN_COPY | WIN_CUT;
if(savlistcfg.listpath[0])
mode |= WIN_PASTE | WIN_PASTEXTR;
break;
int msk = i&MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
str[0]=0;
uifc.helpbuf=
"~ EchoList ~\n\n"
"This is the path and filename of the echolist file you wish\n"
"to add.\n";
if(uifc.input(WIN_MID|WIN_SAV,0,0
if(!new_list(i)) {
printf("\nMemory Allocation Error\n");
}
SAFECOPY(cfg.listcfg[i].listpath,str);
}
if (msk == MSK_DEL || msk == MSK_CUT) {
if(msk == MSK_CUT)
memcpy(&savlistcfg, &cfg.listcfg[i], sizeof(echolist_t));
cfg.listcfgs--;
if(cfg.listcfgs<=0) {
cfg.listcfgs=0;
}
for(u=i;u<cfg.listcfgs;u++)
memcpy(&cfg.listcfg[u],&cfg.listcfg[u+1]
}
if (msk == MSK_COPY) {
memcpy(&savlistcfg,&cfg.listcfg[i],sizeof(echolist_t));
}
if (msk == MSK_PASTE) {
if(!new_list(i))
continue;
memcpy(&cfg.listcfg[i],&savlistcfg,sizeof(echolist_t));
}
if (msk != 0)
continue;
;
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","EchoList Path/Name"
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Required Key"
,strListCombine(cfg.listcfg[i].keys, str, sizeof(str), ","));
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Hub Address"
,(cfg.listcfg[i].hub.zone) ?
faddrtoa(&cfg.listcfg[i].hub) : "None");
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Forward AreaMgr Requests"
if(cfg.listcfg[i].forward) {
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","AreaMgr Name"
,cfg.listcfg[i].areamgr);
snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","AreaMgr Password"
,cfg.listcfg[i].password);
}
SAFEPRINTF(str, "EchoList - %s", getfname(cfg.listcfg[i].listpath));
k=uifc.list(WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT,0,0,0,&listop,0,str,opt);
break;
uifc.input(WIN_MID|WIN_SAV,0,0
,"EchoList Path/Name"
,cfg.listcfg[i].listpath,sizeof(cfg.listcfg[i].listpath)-1
,K_EDIT);
"~ Required Key ~\n\n"
"These keys determine which linked nodes have access to the selected\n"
"echolist file via AreaFix requests (e.g. query, add, remove).\n"
"\n"
"A linked node need only have one of the required keys to have access\n"
"the echolist."
;
for(u=0; cfg.listcfg[i].keys!=NULL && cfg.listcfg[i].keys[u] != NULL;u++)
strcpy(opt[u],cfg.listcfg[i].keys[u]);
x=uifc.list(WIN_SAV|WIN_INS|WIN_DEL|WIN_ACT|
WIN_XTR|WIN_INSACT|WIN_DELACT|WIN_RHT
if(x==-1)
break;
if((x&MSK_ON)==MSK_INS) {
x&=MSK_OFF;
str[0]=0;
if(uifc.input(WIN_MID|WIN_SAV,0,0
,K_EDIT|K_UPPER)<1)
continue;
}
if((x&MSK_ON)==MSK_DEL) {
x&=MSK_OFF;
}
,str,SBBSECHO_MAX_KEY_LEN,K_EDIT|K_UPPER);
strListReplace(cfg.listcfg[i].keys,x,str);
}
SAFECOPY(str,faddrtoa(&cfg.listcfg[i].hub));
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
else
str[0]=0;
uifc.input(WIN_MID|WIN_SAV,0,0
,"Hub Address",str
,25,K_EDIT);
if(str[0])
cfg.listcfg[i].hub=atofaddr(str);
else
memset(&cfg.listcfg[i].hub,0
,sizeof(faddr_t));
break;
case 3:
cfg.listcfg[i].forward = !cfg.listcfg[i].forward;
break;
case 4:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Name to use when forwarding AreaMgr requests"
,cfg.listcfg[i].areamgr,sizeof(cfg.listcfg[i].areamgr)-1
,K_EDIT);
break;
case 5:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Password to use when forwarding AreaMgr requests"
,cfg.listcfg[i].password,sizeof(cfg.listcfg[i].password)-1
,K_EDIT|K_UPPER);
break;
}
case 8:
if(!sbbsecho_write_ini(&cfg))
uifc.msg("Error saving configuration file");
else {
orig_cfg = cfg;
uifc.changes = FALSE;
}
break;
case -1:
if(uifc.changes) {
uifc.helpbuf=
"~ Save Configuration File ~\n\n"
"Select `Yes` to save the config file, `No` to quit without saving,\n"
"or hit ~ ESC ~ to go back to the menu.\n\n";
i=uifc.list(WIN_MID,0,0,0,&i,0,"Save Config File",uifcYesNoOpts);
if(i==-1) break;
if(i) {uifc.bail(); exit(0);}
if(!sbbsecho_write_ini(&cfg))
uifc.msg("Error saving configuration file");
}
uifc.bail();
exit(0);
}