Skip to content
Snippets Groups Projects
Commit 7f363ffa authored by rswindell's avatar rswindell
Browse files

Update indentation only. No functional changes.

parent c4799f3a
No related branches found
No related tags found
No related merge requests found
...@@ -42,158 +42,158 @@ void page_cfg() ...@@ -42,158 +42,158 @@ void page_cfg()
uint u; uint u;
static page_t savpage; static page_t savpage;
while(1) { while(1) {
for(i=0;i<cfg.total_pages && i<MAX_OPTS;i++) for(i=0;i<cfg.total_pages && i<MAX_OPTS;i++)
sprintf(opt[i],"%-40.40s %-.20s",cfg.page[i]->cmd,cfg.page[i]->arstr); sprintf(opt[i],"%-40.40s %-.20s",cfg.page[i]->cmd,cfg.page[i]->arstr);
opt[i][0]=0; opt[i][0]=0;
j=WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT; j=WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT;
if(cfg.total_pages) if(cfg.total_pages)
j|=WIN_DEL|WIN_COPY|WIN_CUT; j|=WIN_DEL|WIN_COPY|WIN_CUT;
if(cfg.total_pages<MAX_OPTS) if(cfg.total_pages<MAX_OPTS)
j|=WIN_INS|WIN_INSACT|WIN_XTR; j|=WIN_INS|WIN_INSACT|WIN_XTR;
if(savpage.cmd[0]) if(savpage.cmd[0])
j|=WIN_PASTE; j|=WIN_PASTE;
uifc.helpbuf=
"`External Sysop Chat Pagers:`\n"
"\n"
"This is a list of the configured external sysop chat pagers.\n"
"\n"
"To add a pager, select the desired location and hit ~ INS ~.\n"
"\n"
"To delete a pager, select it and hit ~ DEL ~.\n"
"\n"
"To configure a pager, select it and hit ~ ENTER ~.\n"
;
i=uifc.list(j,0,0,45,&dflt,&bar,"External Sysop Chat Pagers",opt);
if((signed)i==-1)
return;
int msk = i & MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
sprintf(str,"%%!tone +chatpage.ton");
uifc.helpbuf= uifc.helpbuf=
"`External Chat Pager Command Line:`\n" "`External Sysop Chat Pagers:`\n"
"\n"
"This is a list of the configured external sysop chat pagers.\n"
"\n"
"To add a pager, select the desired location and hit ~ INS ~.\n"
"\n" "\n"
"This is the command line to execute for this external chat pager.\n" "To delete a pager, select it and hit ~ DEL ~.\n"
"\n"
"To configure a pager, select it and hit ~ ENTER ~.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Command Line",str,50 i=uifc.list(j,0,0,45,&dflt,&bar,"External Sysop Chat Pagers",opt);
,K_EDIT)<1) if((signed)i==-1)
continue; return;
if((cfg.page=(page_t **)realloc(cfg.page,sizeof(page_t *)*(cfg.total_pages+1))) int msk = i & MSK_ON;
==NULL) { i &= MSK_OFF;
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_pages+1); if (msk == MSK_INS) {
cfg.total_pages=0; sprintf(str,"%%!tone +chatpage.ton");
bail(1); uifc.helpbuf=
continue; "`External Chat Pager Command Line:`\n"
"\n"
"This is the command line to execute for this external chat pager.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Command Line",str,50
,K_EDIT)<1)
continue;
if((cfg.page=(page_t **)realloc(cfg.page,sizeof(page_t *)*(cfg.total_pages+1)))
==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_pages+1);
cfg.total_pages=0;
bail(1);
continue;
}
if(cfg.total_pages)
for(u=cfg.total_pages;u>i;u--)
cfg.page[u]=cfg.page[u-1];
if((cfg.page[i]=(page_t *)malloc(sizeof(page_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(page_t));
continue;
}
memset((page_t *)cfg.page[i],0,sizeof(page_t));
strcpy(cfg.page[i]->cmd,str);
cfg.total_pages++;
uifc.changes=1;
continue;
} }
if(cfg.total_pages) if (msk == MSK_DEL || msk == MSK_CUT) {
for(u=cfg.total_pages;u>i;u--) if(msk == MSK_CUT)
cfg.page[u]=cfg.page[u-1]; savpage = *cfg.page[i];
if((cfg.page[i]=(page_t *)malloc(sizeof(page_t)))==NULL) { free(cfg.page[i]);
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(page_t)); cfg.total_pages--;
for(j=i;j<cfg.total_pages;j++)
cfg.page[j]=cfg.page[j+1];
uifc.changes=1;
continue; continue;
} }
memset((page_t *)cfg.page[i],0,sizeof(page_t)); if (msk == MSK_COPY) {
strcpy(cfg.page[i]->cmd,str); savpage=*cfg.page[i];
cfg.total_pages++; continue;
uifc.changes=1; }
continue; if (msk == MSK_PASTE) {
} *cfg.page[i]=savpage;
if (msk == MSK_DEL || msk == MSK_CUT) { uifc.changes=1;
if(msk == MSK_CUT) continue;
savpage = *cfg.page[i]; }
free(cfg.page[i]); if (msk != 0)
cfg.total_pages--; continue;
for(j=i;j<cfg.total_pages;j++) j=0;
cfg.page[j]=cfg.page[j+1]; done=0;
uifc.changes=1; while(!done) {
continue; k=0;
} sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.page[i]->cmd);
if (msk == MSK_COPY) { sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.page[i]->arstr);
savpage=*cfg.page[i]; sprintf(opt[k++],"%-27.27s%s","Intercept I/O"
continue; ,(cfg.page[i]->misc&XTRN_STDIO) ? "Standard"
} :cfg.page[i]->misc&XTRN_CONIO ? "Console":"No");
if (msk == MSK_PASTE) { opt[k][0]=0;
*cfg.page[i]=savpage; sprintf(str,"Sysop Chat Pager #%d",i+1);
uifc.changes=1; switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&j,0,str,opt)) {
continue; case -1:
} done=1;
if (msk != 0) break;
continue;
j=0;
done=0;
while(!done) {
k=0;
sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.page[i]->cmd);
sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.page[i]->arstr);
sprintf(opt[k++],"%-27.27s%s","Intercept I/O"
,(cfg.page[i]->misc&XTRN_STDIO) ? "Standard"
:cfg.page[i]->misc&XTRN_CONIO ? "Console":"No");
opt[k][0]=0;
sprintf(str,"Sysop Chat Pager #%d",i+1);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&j,0,str,opt)) {
case -1:
done=1;
break;
case 0:
uifc.helpbuf=
"`External Chat Pager Command Line:`\n"
"\n"
"This is the command line to execute for this external chat pager.\n"
;
strcpy(str,cfg.page[i]->cmd);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Command Line"
,cfg.page[i]->cmd,sizeof(cfg.page[i]->cmd)-1,K_EDIT))
strcpy(cfg.page[i]->cmd,str);
break;
case 1:
getar(str,cfg.page[i]->arstr);
break;
case 2:
switch(cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) {
case XTRN_STDIO:
k=0;
break;
case XTRN_CONIO:
k=1;
break;
default:
k=2;
}
strcpy(opt[0],"Standard");
strcpy(opt[1],"Console");
strcpy(opt[2],"No");
opt[3][0]=0;
uifc.helpbuf=
"`Intercept I/O:`\n"
"\n"
"If you wish the screen output and keyboard input to be intercepted\n"
"when running this chat pager, set this option to either `Standard` or ~Console~.\n"
;
switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0,"Intercept I/O"
,opt)) {
case 0: case 0:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != XTRN_STDIO) { uifc.helpbuf=
cfg.page[i]->misc|=XTRN_STDIO; "`External Chat Pager Command Line:`\n"
cfg.page[i]->misc&=~XTRN_CONIO; "\n"
uifc.changes=1; "This is the command line to execute for this external chat pager.\n"
} ;
strcpy(str,cfg.page[i]->cmd);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Command Line"
,cfg.page[i]->cmd,sizeof(cfg.page[i]->cmd)-1,K_EDIT))
strcpy(cfg.page[i]->cmd,str);
break; break;
case 1: case 1:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != XTRN_CONIO) { getar(str,cfg.page[i]->arstr);
cfg.page[i]->misc|=XTRN_CONIO;
cfg.page[i]->misc&=~XTRN_STDIO;
uifc.changes=1;
}
break; break;
case 2: case 2:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != 0) { switch(cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) {
cfg.page[i]->misc&=~(XTRN_STDIO|XTRN_CONIO); case XTRN_STDIO:
uifc.changes=1; k=0;
break;
case XTRN_CONIO:
k=1;
break;
default:
k=2;
}
strcpy(opt[0],"Standard");
strcpy(opt[1],"Console");
strcpy(opt[2],"No");
opt[3][0]=0;
uifc.helpbuf=
"`Intercept I/O:`\n"
"\n"
"If you wish the screen output and keyboard input to be intercepted\n"
"when running this chat pager, set this option to either `Standard` or ~Console~.\n"
;
switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0,"Intercept I/O"
,opt)) {
case 0:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != XTRN_STDIO) {
cfg.page[i]->misc|=XTRN_STDIO;
cfg.page[i]->misc&=~XTRN_CONIO;
uifc.changes=1;
}
break;
case 1:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != XTRN_CONIO) {
cfg.page[i]->misc|=XTRN_CONIO;
cfg.page[i]->misc&=~XTRN_STDIO;
uifc.changes=1;
}
break;
case 2:
if((cfg.page[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != 0) {
cfg.page[i]->misc&=~(XTRN_STDIO|XTRN_CONIO);
uifc.changes=1;
}
break;
} }
break; break;
}
break;
} }
} }
} }
...@@ -207,255 +207,255 @@ void chan_cfg() ...@@ -207,255 +207,255 @@ void chan_cfg()
uint i,u; uint i,u;
static chan_t savchan; static chan_t savchan;
while(1) { while(1) {
for(i=0;i<cfg.total_chans && i<MAX_OPTS;i++) for(i=0;i<cfg.total_chans && i<MAX_OPTS;i++)
sprintf(opt[i],"%-25s",cfg.chan[i]->name); sprintf(opt[i],"%-25s",cfg.chan[i]->name);
opt[i][0]=0; opt[i][0]=0;
j=WIN_ACT|WIN_SAV|WIN_BOT|WIN_RHT; j=WIN_ACT|WIN_SAV|WIN_BOT|WIN_RHT;
if(cfg.total_chans) if(cfg.total_chans)
j|=WIN_DEL|WIN_COPY|WIN_CUT; j|=WIN_DEL|WIN_COPY|WIN_CUT;
if(cfg.total_chans<MAX_OPTS) if(cfg.total_chans<MAX_OPTS)
j|=WIN_INS|WIN_INSACT|WIN_XTR; j|=WIN_INS|WIN_INSACT|WIN_XTR;
if(savchan.name[0]) if(savchan.name[0])
j|=WIN_PASTE; j|=WIN_PASTE;
uifc.helpbuf=
"`Multinode Chat Channels:`\n"
"\n"
"This is a list of the configured multinode chat channels.\n"
"\n"
"To add a channel, select the desired location with the arrow keys and\n"
"hit ~ INS ~.\n"
"\n"
"To delete a channel, select it with the arrow keys and hit ~ DEL ~.\n"
"\n"
"To configure a channel, select it with the arrow keys and hit ~ ENTER ~.\n"
;
i=uifc.list(j,0,0,45,&chan_dflt,&chan_bar,"Multinode Chat Channels",opt);
if((signed)i==-1)
return;
int msk = i & MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
strcpy(str,"Open");
uifc.helpbuf= uifc.helpbuf=
"`Channel Name:`\n" "`Multinode Chat Channels:`\n"
"\n" "\n"
"This is the name or description of the chat channel.\n" "This is a list of the configured multinode chat channels.\n"
; "\n"
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Chat Channel Name",str,25 "To add a channel, select the desired location with the arrow keys and\n"
,K_EDIT)<1) "hit ~ INS ~.\n"
continue;
SAFECOPY(code,str);
prep_code(code,/* prefix: */NULL);
uifc.helpbuf=
"`Chat Channel Internal Code:`\n"
"\n" "\n"
"Every chat channel must have its own unique code for Synchronet to refer\n" "To delete a channel, select it with the arrow keys and hit ~ DEL ~.\n"
"to it internally. This code is usually an abbreviation of the chat\n" "\n"
"channel name.\n" "To configure a channel, select it with the arrow keys and hit ~ ENTER ~.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Internal Code" i=uifc.list(j,0,0,45,&chan_dflt,&chan_bar,"Multinode Chat Channels",opt);
,code,LEN_CODE,K_EDIT|K_UPPER)<1) if((signed)i==-1)
continue; return;
if(!code_ok(code)) { int msk = i & MSK_ON;
uifc.helpbuf=invalid_code; i &= MSK_OFF;
uifc.msg("Invalid Code"); if (msk == MSK_INS) {
uifc.helpbuf=0; strcpy(str,"Open");
continue; uifc.helpbuf=
"`Channel Name:`\n"
"\n"
"This is the name or description of the chat channel.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Chat Channel Name",str,25
,K_EDIT)<1)
continue;
SAFECOPY(code,str);
prep_code(code,/* prefix: */NULL);
uifc.helpbuf=
"`Chat Channel Internal Code:`\n"
"\n"
"Every chat channel must have its own unique code for Synchronet to refer\n"
"to it internally. This code is usually an abbreviation of the chat\n"
"channel name.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Internal Code"
,code,LEN_CODE,K_EDIT|K_UPPER)<1)
continue;
if(!code_ok(code)) {
uifc.helpbuf=invalid_code;
uifc.msg("Invalid Code");
uifc.helpbuf=0;
continue;
}
if((cfg.chan=(chan_t **)realloc(cfg.chan,sizeof(chan_t *)*(cfg.total_chans+1)))
==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_chans+1);
cfg.total_chans=0;
bail(1);
continue;
}
if(cfg.total_chans)
for(u=cfg.total_chans;u>i;u--)
cfg.chan[u]=cfg.chan[u-1];
if((cfg.chan[i]=(chan_t *)malloc(sizeof(chan_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(chan_t));
continue;
}
memset((chan_t *)cfg.chan[i],0,sizeof(chan_t));
strcpy(cfg.chan[i]->name,str);
strcpy(cfg.chan[i]->code,code);
cfg.total_chans++;
uifc.changes=1;
continue;
} }
if((cfg.chan=(chan_t **)realloc(cfg.chan,sizeof(chan_t *)*(cfg.total_chans+1))) if (msk == MSK_DEL || msk == MSK_CUT) {
==NULL) { if(msk == MSK_CUT)
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_chans+1); savchan = *cfg.chan[i];
cfg.total_chans=0; free(cfg.chan[i]);
bail(1); cfg.total_chans--;
continue; for(j=i;j<cfg.total_chans;j++)
cfg.chan[j]=cfg.chan[j+1];
uifc.changes=1;
continue;
} }
if(cfg.total_chans) if (msk == MSK_COPY) {
for(u=cfg.total_chans;u>i;u--) savchan=*cfg.chan[i];
cfg.chan[u]=cfg.chan[u-1];
if((cfg.chan[i]=(chan_t *)malloc(sizeof(chan_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(chan_t));
continue; continue;
} }
memset((chan_t *)cfg.chan[i],0,sizeof(chan_t)); if (msk == MSK_PASTE) {
strcpy(cfg.chan[i]->name,str); *cfg.chan[i]=savchan;
strcpy(cfg.chan[i]->code,code); uifc.changes=1;
cfg.total_chans++; continue;
uifc.changes=1; }
continue; if (msk != 0)
} continue;
if (msk == MSK_DEL || msk == MSK_CUT) { j=0;
if(msk == MSK_CUT) done=0;
savchan = *cfg.chan[i]; while(!done) {
free(cfg.chan[i]); k=0;
cfg.total_chans--; sprintf(opt[k++],"%-27.27s%s","Name",cfg.chan[i]->name);
for(j=i;j<cfg.total_chans;j++) sprintf(opt[k++],"%-27.27s%s","Internal Code",cfg.chan[i]->code);
cfg.chan[j]=cfg.chan[j+1]; sprintf(opt[k++],"%-27.27s%"PRIu32,"Cost in Credits",cfg.chan[i]->cost);
uifc.changes=1; sprintf(opt[k++],"%-27.27s%.40s","Access Requirements"
continue; ,cfg.chan[i]->arstr);
} sprintf(opt[k++],"%-27.27s%s","Password Protection"
if (msk == MSK_COPY) { ,cfg.chan[i]->misc&CHAN_PW ? "Yes" : "No");
savchan=*cfg.chan[i]; sprintf(opt[k++],"%-27.27s%s","Guru Joins When Empty"
continue; ,cfg.chan[i]->misc&CHAN_GURU ? "Yes" : "No");
} sprintf(opt[k++],"%-27.27s%s","Channel Guru"
if (msk == MSK_PASTE) { ,cfg.chan[i]->guru<cfg.total_gurus ? cfg.guru[cfg.chan[i]->guru]->name : "");
*cfg.chan[i]=savchan; sprintf(opt[k++],"%-27.27s%s","Channel Action Set"
uifc.changes=1; ,cfg.actset[cfg.chan[i]->actset]->name);
continue; opt[k][0]=0;
} uifc.helpbuf=
if (msk != 0) "`Chat Channel Configuration:`\n"
continue; "\n"
j=0; "This menu is for configuring the selected chat channel.\n"
done=0; ;
while(!done) { sprintf(str,"%s Chat Channel",cfg.chan[i]->name);
k=0; switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str,opt)) {
sprintf(opt[k++],"%-27.27s%s","Name",cfg.chan[i]->name); case -1:
sprintf(opt[k++],"%-27.27s%s","Internal Code",cfg.chan[i]->code); done=1;
sprintf(opt[k++],"%-27.27s%"PRIu32,"Cost in Credits",cfg.chan[i]->cost); break;
sprintf(opt[k++],"%-27.27s%.40s","Access Requirements" case 0:
,cfg.chan[i]->arstr); uifc.helpbuf=
sprintf(opt[k++],"%-27.27s%s","Password Protection" "`Chat Channel Name:`\n"
,cfg.chan[i]->misc&CHAN_PW ? "Yes" : "No"); "\n"
sprintf(opt[k++],"%-27.27s%s","Guru Joins When Empty" "This is the name or description of the chat channel.\n"
,cfg.chan[i]->misc&CHAN_GURU ? "Yes" : "No"); ;
sprintf(opt[k++],"%-27.27s%s","Channel Guru" strcpy(str,cfg.chan[i]->name);
,cfg.chan[i]->guru<cfg.total_gurus ? cfg.guru[cfg.chan[i]->guru]->name : ""); if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Chat Channel Name"
sprintf(opt[k++],"%-27.27s%s","Channel Action Set" ,cfg.chan[i]->name,sizeof(cfg.chan[i]->name)-1,K_EDIT))
,cfg.actset[cfg.chan[i]->actset]->name); strcpy(cfg.chan[i]->name,str);
opt[k][0]=0; break;
uifc.helpbuf= case 1:
"`Chat Channel Configuration:`\n" uifc.helpbuf=
"\n" "`Chat Channel Internal Code:`\n"
"This menu is for configuring the selected chat channel.\n" "\n"
; "Every chat channel must have its own unique code for Synchronet to refer\n"
sprintf(str,"%s Chat Channel",cfg.chan[i]->name); "to it internally. This code is usually an abbreviation of the chat\n"
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str,opt)) { "channel name.\n"
case -1: ;
done=1; strcpy(str,cfg.chan[i]->code);
break; if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Internal Code"
case 0: ,str,LEN_CODE,K_UPPER|K_EDIT))
uifc.helpbuf= break;
"`Chat Channel Name:`\n" if(code_ok(str))
"\n" strcpy(cfg.chan[i]->code,str);
"This is the name or description of the chat channel.\n" else {
; uifc.helpbuf=invalid_code;
strcpy(str,cfg.chan[i]->name); uifc.msg("Invalid Code");
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Chat Channel Name" uifc.helpbuf=0;
,cfg.chan[i]->name,sizeof(cfg.chan[i]->name)-1,K_EDIT)) }
strcpy(cfg.chan[i]->name,str); break;
break; case 2:
case 1: ultoa(cfg.chan[i]->cost,str,10);
uifc.helpbuf= uifc.helpbuf=
"`Chat Channel Internal Code:`\n" "`Chat Channel Cost to Join:`\n"
"\n" "\n"
"Every chat channel must have its own unique code for Synchronet to refer\n" "If you want users to be charged credits to join this chat channel, set\n"
"to it internally. This code is usually an abbreviation of the chat\n" "this value to the number of credits to charge. If you want this channel\n"
"channel name.\n" "to be free, set this value to `0`.\n"
; ;
strcpy(str,cfg.chan[i]->code); uifc.input(WIN_MID|WIN_SAV,0,0,"Cost to Join (in Credits)"
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Internal Code" ,str,10,K_EDIT|K_NUMBER);
,str,LEN_CODE,K_UPPER|K_EDIT)) cfg.chan[i]->cost=atol(str);
break;
case 3:
sprintf(str,"%s Chat Channel",cfg.chan[i]->name);
getar(str,cfg.chan[i]->arstr);
break; break;
if(code_ok(str)) case 4:
strcpy(cfg.chan[i]->code,str); k=1;
else { uifc.helpbuf=
uifc.helpbuf=invalid_code; "`Allow Channel to be Password Protected:`\n"
uifc.msg("Invalid Code"); "\n"
uifc.helpbuf=0; "If you want to allow the first user to join this channel to password\n"
} "protect it, set this option to `Yes`.\n"
break; ;
case 2: k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
ultoa(cfg.chan[i]->cost,str,10); ,"Allow Channel to be Password Protected"
uifc.helpbuf= ,uifcYesNoOpts);
"`Chat Channel Cost to Join:`\n" if(!k && !(cfg.chan[i]->misc&CHAN_PW)) {
"\n" cfg.chan[i]->misc|=CHAN_PW;
"If you want users to be charged credits to join this chat channel, set\n" uifc.changes=1;
"this value to the number of credits to charge. If you want this channel\n" }
"to be free, set this value to `0`.\n" else if(k==1 && cfg.chan[i]->misc&CHAN_PW) {
; cfg.chan[i]->misc&=~CHAN_PW;
uifc.input(WIN_MID|WIN_SAV,0,0,"Cost to Join (in Credits)" uifc.changes=1;
,str,10,K_EDIT|K_NUMBER); }
cfg.chan[i]->cost=atol(str);
break;
case 3:
sprintf(str,"%s Chat Channel",cfg.chan[i]->name);
getar(str,cfg.chan[i]->arstr);
break;
case 4:
k=1;
uifc.helpbuf=
"`Allow Channel to be Password Protected:`\n"
"\n"
"If you want to allow the first user to join this channel to password\n"
"protect it, set this option to `Yes`.\n"
;
k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
,"Allow Channel to be Password Protected"
,uifcYesNoOpts);
if(!k && !(cfg.chan[i]->misc&CHAN_PW)) {
cfg.chan[i]->misc|=CHAN_PW;
uifc.changes=1;
}
else if(k==1 && cfg.chan[i]->misc&CHAN_PW) {
cfg.chan[i]->misc&=~CHAN_PW;
uifc.changes=1;
}
break;
case 5:
k=1;
uifc.helpbuf=
"`Guru Joins This Channel When Empty:`\n"
"\n"
"If you want the system guru to join this chat channel when there is\n"
"only one user, set this option to `Yes`.\n"
;
k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
,"Guru Joins This Channel When Empty"
,uifcYesNoOpts);
if(!k && !(cfg.chan[i]->misc&CHAN_GURU)) {
cfg.chan[i]->misc|=CHAN_GURU;
uifc.changes=1;
}
else if(k==1 && cfg.chan[i]->misc&CHAN_GURU) {
cfg.chan[i]->misc&=~CHAN_GURU;
uifc.changes=1;
}
break;
case 6:
uifc.helpbuf=
"`Channel Guru:`\n"
"\n"
"This is a list of available chat Gurus. Select the one that you wish\n"
"to have available in this channel.\n"
;
k=0;
for(j=0;j<cfg.total_gurus && j<MAX_OPTS;j++)
sprintf(opt[j],"%-25s",cfg.guru[j]->name);
opt[j][0]=0;
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&j,0
,"Available Chat Gurus",opt);
if(k==-1)
break; break;
cfg.chan[i]->guru=k; case 5:
break; k=1;
case 7: uifc.helpbuf=
uifc.helpbuf= "`Guru Joins This Channel When Empty:`\n"
"`Channel Action Set:`\n" "\n"
"\n" "If you want the system guru to join this chat channel when there is\n"
"This is a list of available chat action sets. Select the one that you\n" "only one user, set this option to `Yes`.\n"
"wish to have available in this channel.\n" ;
; k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
k=0; ,"Guru Joins This Channel When Empty"
for(j=0;j<cfg.total_actsets && j<MAX_OPTS;j++) ,uifcYesNoOpts);
sprintf(opt[j],"%-25s",cfg.actset[j]->name); if(!k && !(cfg.chan[i]->misc&CHAN_GURU)) {
opt[j][0]=0; cfg.chan[i]->misc|=CHAN_GURU;
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&j,0 uifc.changes=1;
,"Available Chat Action Sets",opt); }
if(k==-1) else if(k==1 && cfg.chan[i]->misc&CHAN_GURU) {
cfg.chan[i]->misc&=~CHAN_GURU;
uifc.changes=1;
}
break;
case 6:
uifc.helpbuf=
"`Channel Guru:`\n"
"\n"
"This is a list of available chat Gurus. Select the one that you wish\n"
"to have available in this channel.\n"
;
k=0;
for(j=0;j<cfg.total_gurus && j<MAX_OPTS;j++)
sprintf(opt[j],"%-25s",cfg.guru[j]->name);
opt[j][0]=0;
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&j,0
,"Available Chat Gurus",opt);
if(k==-1)
break;
cfg.chan[i]->guru=k;
break; break;
uifc.changes=1; case 7:
cfg.chan[i]->actset=k; uifc.helpbuf=
break; "`Channel Action Set:`\n"
"\n"
"This is a list of available chat action sets. Select the one that you\n"
"wish to have available in this channel.\n"
;
k=0;
for(j=0;j<cfg.total_actsets && j<MAX_OPTS;j++)
sprintf(opt[j],"%-25s",cfg.actset[j]->name);
opt[j][0]=0;
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&j,0
,"Available Chat Action Sets",opt);
if(k==-1)
break;
uifc.changes=1;
cfg.chan[i]->actset=k;
break;
} }
} }
} }
...@@ -469,128 +469,128 @@ void chatact_cfg(uint setnum) ...@@ -469,128 +469,128 @@ void chatact_cfg(uint setnum)
uint i,n,chatnum[MAX_OPTS+1]; uint i,n,chatnum[MAX_OPTS+1];
static chatact_t savchatact; static chatact_t savchatact;
while(1) { while(1) {
for(i=0,j=0;i<cfg.total_chatacts && j<MAX_OPTS;i++) for(i=0,j=0;i<cfg.total_chatacts && j<MAX_OPTS;i++)
if(cfg.chatact[i]->actset==setnum) { if(cfg.chatact[i]->actset==setnum) {
sprintf(opt[j],"%-*.*s %s",LEN_CHATACTCMD,LEN_CHATACTCMD sprintf(opt[j],"%-*.*s %s",LEN_CHATACTCMD,LEN_CHATACTCMD
,cfg.chatact[i]->cmd,cfg.chatact[i]->out); ,cfg.chatact[i]->cmd,cfg.chatact[i]->out);
chatnum[j++]=i; chatnum[j++]=i;
}
chatnum[j]=cfg.total_chatacts;
opt[j][0]=0;
i=WIN_ACT|WIN_SAV;
if(j)
i|=WIN_DEL|WIN_COPY|WIN_CUT;
if(j<MAX_OPTS)
i|=WIN_INS|WIN_INSACT|WIN_XTR;
if(savchatact.cmd[0])
i|=WIN_PASTE;
uifc.helpbuf=
"`Multinode Chat Actions:`\n"
"\n"
"This is a list of the configured multinode chat actions. The users can\n"
"use these actions in multinode chat by turning on action commands with\n"
"the `/A` command in multinode chat. Then if a line is typed which\n"
"begins with a valid `action command` and has a user name, chat handle,\n"
"or node number following, the output string will be displayed replacing\n"
"the `%s` symbols with the sending user's name and the receiving user's\n"
"name (in that order).\n"
"\n"
"To add an action, select the desired location with the arrow keys and\n"
"hit ~ INS ~.\n"
"\n"
"To delete an action, select it with the arrow keys and hit ~ DEL ~.\n"
"\n"
"To configure an action, select it with the arrow keys and hit ~ ENTER ~.\n"
;
sprintf(str,"%s Chat Actions",cfg.actset[setnum]->name);
i=uifc.list(i,0,0,70,&chatact_dflt,&chatact_bar,str,opt);
if((signed)i==-1)
return;
int msk = i & MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
uifc.helpbuf=
"`Chat Action Command:`\n"
"\n"
"This is the command word (normally a verb) to trigger the action output.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Action Command",cmd,LEN_CHATACTCMD
,K_UPPER)<1)
continue;
uifc.helpbuf=
"`Chat Action Output String:`\n"
"\n"
"This is the output string displayed with this action output.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"",out,LEN_CHATACTOUT
,K_MSG)<1)
continue;
if((cfg.chatact=(chatact_t **)realloc(cfg.chatact
,sizeof(chatact_t *)*(cfg.total_chatacts+1)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_chatacts+1);
cfg.total_chatacts=0;
bail(1);
continue;
}
if(j)
for(n=cfg.total_chatacts;n>chatnum[i];n--)
cfg.chatact[n]=cfg.chatact[n-1];
if((cfg.chatact[chatnum[i]]=(chatact_t *)malloc(sizeof(chatact_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(chatact_t));
continue;
}
memset((chatact_t *)cfg.chatact[chatnum[i]],0,sizeof(chatact_t));
strcpy(cfg.chatact[chatnum[i]]->cmd,cmd);
strcpy(cfg.chatact[chatnum[i]]->out,out);
cfg.chatact[chatnum[i]]->actset=setnum;
cfg.total_chatacts++;
uifc.changes=1;
continue;
} }
chatnum[j]=cfg.total_chatacts; if (msk == MSK_DEL || msk == MSK_CUT) {
opt[j][0]=0; if(msk == MSK_CUT)
i=WIN_ACT|WIN_SAV; savchatact = *cfg.chatact[chatnum[i]];
if(j) free(cfg.chatact[chatnum[i]]);
i|=WIN_DEL|WIN_COPY|WIN_CUT; cfg.total_chatacts--;
if(j<MAX_OPTS) for(j=chatnum[i];j<cfg.total_chatacts && j<MAX_OPTS;j++)
i|=WIN_INS|WIN_INSACT|WIN_XTR; cfg.chatact[j]=cfg.chatact[j+1];
if(savchatact.cmd[0]) uifc.changes=1;
i|=WIN_PASTE; continue;
uifc.helpbuf= }
"`Multinode Chat Actions:`\n" if (msk == MSK_COPY) {
"\n" savchatact=*cfg.chatact[chatnum[i]];
"This is a list of the configured multinode chat actions. The users can\n" continue;
"use these actions in multinode chat by turning on action commands with\n" }
"the `/A` command in multinode chat. Then if a line is typed which\n" if (msk == MSK_PASTE) {
"begins with a valid `action command` and has a user name, chat handle,\n" *cfg.chatact[chatnum[i]]=savchatact;
"or node number following, the output string will be displayed replacing\n" cfg.chatact[chatnum[i]]->actset=setnum;
"the `%s` symbols with the sending user's name and the receiving user's\n" uifc.changes=1;
"name (in that order).\n" continue;
"\n" }
"To add an action, select the desired location with the arrow keys and\n" if (msk != 0)
"hit ~ INS ~.\n" continue;
"\n"
"To delete an action, select it with the arrow keys and hit ~ DEL ~.\n"
"\n"
"To configure an action, select it with the arrow keys and hit ~ ENTER ~.\n"
;
sprintf(str,"%s Chat Actions",cfg.actset[setnum]->name);
i=uifc.list(i,0,0,70,&chatact_dflt,&chatact_bar,str,opt);
if((signed)i==-1)
return;
int msk = i & MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Command:`\n" "`Chat Action Command:`\n"
"\n" "\n"
"This is the command word (normally a verb) to trigger the action output.\n" "This is the command that triggers this chat action.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Action Command",cmd,LEN_CHATACTCMD strcpy(str,cfg.chatact[chatnum[i]]->cmd);
,K_UPPER)<1) if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Chat Action Command"
continue; ,cfg.chatact[chatnum[i]]->cmd,LEN_CHATACTCMD,K_EDIT|K_UPPER)) {
strcpy(cfg.chatact[chatnum[i]]->cmd,str);
continue;
}
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Output String:`\n" "`Chat Action Output String:`\n"
"\n" "\n"
"This is the output string displayed with this action output.\n" "This is the output string that results from this chat action.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"",out,LEN_CHATACTOUT strcpy(str,cfg.chatact[chatnum[i]]->out);
,K_MSG)<1) if(!uifc.input(WIN_MID|WIN_SAV,0,10,""
continue; ,cfg.chatact[chatnum[i]]->out,LEN_CHATACTOUT,K_EDIT|K_MSG))
if((cfg.chatact=(chatact_t **)realloc(cfg.chatact strcpy(cfg.chatact[chatnum[i]]->out,str);
,sizeof(chatact_t *)*(cfg.total_chatacts+1)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_chatacts+1);
cfg.total_chatacts=0;
bail(1);
continue;
}
if(j)
for(n=cfg.total_chatacts;n>chatnum[i];n--)
cfg.chatact[n]=cfg.chatact[n-1];
if((cfg.chatact[chatnum[i]]=(chatact_t *)malloc(sizeof(chatact_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(chatact_t));
continue;
}
memset((chatact_t *)cfg.chatact[chatnum[i]],0,sizeof(chatact_t));
strcpy(cfg.chatact[chatnum[i]]->cmd,cmd);
strcpy(cfg.chatact[chatnum[i]]->out,out);
cfg.chatact[chatnum[i]]->actset=setnum;
cfg.total_chatacts++;
uifc.changes=1;
continue;
}
if (msk == MSK_DEL || msk == MSK_CUT) {
if(msk == MSK_CUT)
savchatact = *cfg.chatact[chatnum[i]];
free(cfg.chatact[chatnum[i]]);
cfg.total_chatacts--;
for(j=chatnum[i];j<cfg.total_chatacts && j<MAX_OPTS;j++)
cfg.chatact[j]=cfg.chatact[j+1];
uifc.changes=1;
continue;
} }
if (msk == MSK_COPY) {
savchatact=*cfg.chatact[chatnum[i]];
continue;
}
if (msk == MSK_PASTE) {
*cfg.chatact[chatnum[i]]=savchatact;
cfg.chatact[chatnum[i]]->actset=setnum;
uifc.changes=1;
continue;
}
if (msk != 0)
continue;
uifc.helpbuf=
"`Chat Action Command:`\n"
"\n"
"This is the command that triggers this chat action.\n"
;
strcpy(str,cfg.chatact[chatnum[i]]->cmd);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Chat Action Command"
,cfg.chatact[chatnum[i]]->cmd,LEN_CHATACTCMD,K_EDIT|K_UPPER)) {
strcpy(cfg.chatact[chatnum[i]]->cmd,str);
continue;
}
uifc.helpbuf=
"`Chat Action Output String:`\n"
"\n"
"This is the output string that results from this chat action.\n"
;
strcpy(str,cfg.chatact[chatnum[i]]->out);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,""
,cfg.chatact[chatnum[i]]->out,LEN_CHATACTOUT,K_EDIT|K_MSG))
strcpy(cfg.chatact[chatnum[i]]->out,str);
}
} }
void guru_cfg() void guru_cfg()
...@@ -601,153 +601,153 @@ void guru_cfg() ...@@ -601,153 +601,153 @@ void guru_cfg()
uint i,u; uint i,u;
static guru_t savguru; static guru_t savguru;
while(1) { while(1) {
for(i=0;i<cfg.total_gurus && i<MAX_OPTS;i++) for(i=0;i<cfg.total_gurus && i<MAX_OPTS;i++)
sprintf(opt[i],"%-25s",cfg.guru[i]->name); sprintf(opt[i],"%-25s",cfg.guru[i]->name);
opt[i][0]=0; opt[i][0]=0;
j=WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT; j=WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT;
if(cfg.total_gurus) if(cfg.total_gurus)
j|=WIN_DEL|WIN_COPY|WIN_CUT; j|=WIN_DEL|WIN_COPY|WIN_CUT;
if(cfg.total_gurus<MAX_OPTS) if(cfg.total_gurus<MAX_OPTS)
j|=WIN_INS|WIN_INSACT|WIN_XTR; j|=WIN_INS|WIN_INSACT|WIN_XTR;
if(savguru.name[0]) if(savguru.name[0])
j|=WIN_PASTE; j|=WIN_PASTE;
uifc.helpbuf=
"`Gurus:`\n"
"\n"
"This is a list of the configured Gurus.\n"
"\n"
"To add a Guru, select the desired location with the arrow keys and\n"
"hit ~ INS ~.\n"
"\n"
"To delete a Guru, select it with the arrow keys and hit ~ DEL ~.\n"
"\n"
"To configure a Guru, select it with the arrow keys and hit ~ ENTER ~.\n"
;
i=uifc.list(j,0,0,45,&guru_dflt,&guru_bar,"Artificial Gurus",opt);
if((signed)i==-1)
return;
int msk = i & MSK_ON;
i &= MSK_OFF;
if (msk == MSK_INS) {
uifc.helpbuf= uifc.helpbuf=
"`Guru Name:`\n" "`Gurus:`\n"
"\n" "\n"
"This is the name of the selected Guru.\n" "This is a list of the configured Gurus.\n"
; "\n"
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Guru Name",str,25 "To add a Guru, select the desired location with the arrow keys and\n"
,0)<1) "hit ~ INS ~.\n"
continue;
SAFECOPY(code,str);
prep_code(code,/* prefix: */NULL);
uifc.helpbuf=
"`Guru Internal Code:`\n"
"\n" "\n"
"Every Guru must have its own unique code for Synchronet to refer to\n" "To delete a Guru, select it with the arrow keys and hit ~ DEL ~.\n"
"it internally. This code is usually an abbreviation of the Guru name.\n" "\n"
"To configure a Guru, select it with the arrow keys and hit ~ ENTER ~.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Internal Code" i=uifc.list(j,0,0,45,&guru_dflt,&guru_bar,"Artificial Gurus",opt);
,code,LEN_CODE,K_EDIT|K_UPPER)<1) if((signed)i==-1)
continue; return;
if(!code_ok(code)) { int msk = i & MSK_ON;
uifc.helpbuf=invalid_code; i &= MSK_OFF;
uifc.msg("Invalid Code"); if (msk == MSK_INS) {
uifc.helpbuf=0; uifc.helpbuf=
continue; "`Guru Name:`\n"
"\n"
"This is the name of the selected Guru.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Guru Name",str,25
,0)<1)
continue;
SAFECOPY(code,str);
prep_code(code,/* prefix: */NULL);
uifc.helpbuf=
"`Guru Internal Code:`\n"
"\n"
"Every Guru must have its own unique code for Synchronet to refer to\n"
"it internally. This code is usually an abbreviation of the Guru name.\n"
;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Internal Code"
,code,LEN_CODE,K_EDIT|K_UPPER)<1)
continue;
if(!code_ok(code)) {
uifc.helpbuf=invalid_code;
uifc.msg("Invalid Code");
uifc.helpbuf=0;
continue;
}
if((cfg.guru=(guru_t **)realloc(cfg.guru,sizeof(guru_t *)*(cfg.total_gurus+1)))
==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_gurus+1);
cfg.total_gurus=0;
bail(1);
continue;
}
if(cfg.total_gurus)
for(u=cfg.total_gurus;u>i;u--)
cfg.guru[u]=cfg.guru[u-1];
if((cfg.guru[i]=(guru_t *)malloc(sizeof(guru_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(guru_t));
continue;
}
memset((guru_t *)cfg.guru[i],0,sizeof(guru_t));
strcpy(cfg.guru[i]->name,str);
strcpy(cfg.guru[i]->code,code);
cfg.total_gurus++;
uifc.changes=1;
continue;
} }
if((cfg.guru=(guru_t **)realloc(cfg.guru,sizeof(guru_t *)*(cfg.total_gurus+1))) if (msk == MSK_DEL || msk == MSK_CUT) {
==NULL) { if(msk == MSK_CUT)
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_gurus+1); savguru = *cfg.guru[i];
cfg.total_gurus=0; free(cfg.guru[i]);
bail(1); cfg.total_gurus--;
continue; for(j=i;j<cfg.total_gurus;j++)
cfg.guru[j]=cfg.guru[j+1];
uifc.changes=1;
continue;
} }
if(cfg.total_gurus) if (msk == MSK_COPY) {
for(u=cfg.total_gurus;u>i;u--) savguru=*cfg.guru[i];
cfg.guru[u]=cfg.guru[u-1];
if((cfg.guru[i]=(guru_t *)malloc(sizeof(guru_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(guru_t));
continue; continue;
} }
memset((guru_t *)cfg.guru[i],0,sizeof(guru_t)); if (msk == MSK_PASTE) {
strcpy(cfg.guru[i]->name,str); *cfg.guru[i]=savguru;
strcpy(cfg.guru[i]->code,code); uifc.changes=1;
cfg.total_gurus++; continue;
uifc.changes=1; }
continue; if (msk != 0)
} continue;
if (msk == MSK_DEL || msk == MSK_CUT) { j=0;
if(msk == MSK_CUT) done=0;
savguru = *cfg.guru[i]; while(!done) {
free(cfg.guru[i]); k=0;
cfg.total_gurus--; sprintf(opt[k++],"%-27.27s%s","Guru Name",cfg.guru[i]->name);
for(j=i;j<cfg.total_gurus;j++) sprintf(opt[k++],"%-27.27s%s","Guru Internal Code",cfg.guru[i]->code);
cfg.guru[j]=cfg.guru[j+1]; sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.guru[i]->arstr);
uifc.changes=1; opt[k][0]=0;
continue; uifc.helpbuf=
} "`Guru Configuration:`\n"
if (msk == MSK_COPY) { "\n"
savguru=*cfg.guru[i]; "This menu is for configuring the selected Guru.\n"
continue; ;
} switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,cfg.guru[i]->name
if (msk == MSK_PASTE) { ,opt)) {
*cfg.guru[i]=savguru; case -1:
uifc.changes=1; done=1;
continue; break;
} case 0:
if (msk != 0) uifc.helpbuf=
continue; "`Guru Name:`\n"
j=0; "\n"
done=0; "This is the name of the selected Guru.\n"
while(!done) { ;
k=0; strcpy(str,cfg.guru[i]->name);
sprintf(opt[k++],"%-27.27s%s","Guru Name",cfg.guru[i]->name); if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Guru Name"
sprintf(opt[k++],"%-27.27s%s","Guru Internal Code",cfg.guru[i]->code); ,cfg.guru[i]->name,sizeof(cfg.guru[i]->name)-1,K_EDIT))
sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.guru[i]->arstr); strcpy(cfg.guru[i]->name,str);
opt[k][0]=0; break;
uifc.helpbuf= case 1:
"`Guru Configuration:`\n" uifc.helpbuf=
"\n" "`Guru Internal Code:`\n"
"This menu is for configuring the selected Guru.\n" "\n"
; "Every Guru must have its own unique code for Synchronet to refer to\n"
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,cfg.guru[i]->name "it internally. This code is usually an abbreviation of the Guru name.\n"
,opt)) { ;
case -1: strcpy(str,cfg.guru[i]->code);
done=1; if(!uifc.input(WIN_MID|WIN_SAV,0,0,"Guru Internal Code"
break; ,str,LEN_CODE,K_EDIT|K_UPPER))
case 0: break;
uifc.helpbuf= if(code_ok(str))
"`Guru Name:`\n" strcpy(cfg.guru[i]->code,str);
"\n" else {
"This is the name of the selected Guru.\n" uifc.helpbuf=invalid_code;
; uifc.msg("Invalid Code");
strcpy(str,cfg.guru[i]->name); uifc.helpbuf=0;
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Guru Name" }
,cfg.guru[i]->name,sizeof(cfg.guru[i]->name)-1,K_EDIT))
strcpy(cfg.guru[i]->name,str);
break;
case 1:
uifc.helpbuf=
"`Guru Internal Code:`\n"
"\n"
"Every Guru must have its own unique code for Synchronet to refer to\n"
"it internally. This code is usually an abbreviation of the Guru name.\n"
;
strcpy(str,cfg.guru[i]->code);
if(!uifc.input(WIN_MID|WIN_SAV,0,0,"Guru Internal Code"
,str,LEN_CODE,K_EDIT|K_UPPER))
break; break;
if(code_ok(str)) case 2:
strcpy(cfg.guru[i]->code,str); getar(cfg.guru[i]->name,cfg.guru[i]->arstr);
else { break;
uifc.helpbuf=invalid_code;
uifc.msg("Invalid Code");
uifc.helpbuf=0;
}
break;
case 2:
getar(cfg.guru[i]->name,cfg.guru[i]->arstr);
break;
} }
} }
} }
...@@ -761,118 +761,118 @@ void actsets_cfg() ...@@ -761,118 +761,118 @@ void actsets_cfg()
uint i,u; uint i,u;
static actset_t savactset; static actset_t savactset;
while(1) { while(1) {
for(i=0;i<cfg.total_actsets && i<MAX_OPTS;i++) for(i=0;i<cfg.total_actsets && i<MAX_OPTS;i++)
sprintf(opt[i],"%-25s",cfg.actset[i]->name); sprintf(opt[i],"%-25s",cfg.actset[i]->name);
opt[i][0]=0; opt[i][0]=0;
j=WIN_ACT|WIN_RHT|WIN_BOT|WIN_SAV; j=WIN_ACT|WIN_RHT|WIN_BOT|WIN_SAV;
if(cfg.total_actsets) if(cfg.total_actsets)
j|=WIN_DEL|WIN_COPY|WIN_CUT; j|=WIN_DEL|WIN_COPY|WIN_CUT;
if(cfg.total_actsets<MAX_OPTS) if(cfg.total_actsets<MAX_OPTS)
j|=WIN_INS|WIN_INSACT|WIN_XTR; j|=WIN_INS|WIN_INSACT|WIN_XTR;
if(savactset.name[0]) if(savactset.name[0])
j|=WIN_PASTE; j|=WIN_PASTE;
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Sets:`\n" "`Chat Action Sets:`\n"
"\n" "\n"
"This is a list of the configured action sets.\n" "This is a list of the configured action sets.\n"
"\n" "\n"
"To add an action set, select the desired location with the arrow keys and\n" "To add an action set, select the desired location with the arrow keys and\n"
"hit ~ INS ~.\n" "hit ~ INS ~.\n"
"\n" "\n"
"To delete an action set, select it with the arrow keys and hit ~ DEL ~.\n" "To delete an action set, select it with the arrow keys and hit ~ DEL ~.\n"
"\n" "\n"
"To configure an action set, select it with the arrow keys and hit\n" "To configure an action set, select it with the arrow keys and hit\n"
"~ ENTER ~.\n" "~ ENTER ~.\n"
; ;
i=uifc.list(j,0,0,45,&actset_dflt,&actset_bar,"Chat Action Sets",opt); i=uifc.list(j,0,0,45,&actset_dflt,&actset_bar,"Chat Action Sets",opt);
if((signed)i==-1) if((signed)i==-1)
return; return;
int msk = i & MSK_ON; int msk = i & MSK_ON;
i &= MSK_OFF; i &= MSK_OFF;
if (msk == MSK_INS) { if (msk == MSK_INS) {
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Set Name:`\n" "`Chat Action Set Name:`\n"
"\n" "\n"
"This is the name of the selected chat action set.\n" "This is the name of the selected chat action set.\n"
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Chat Action Set Name",str,25 if(uifc.input(WIN_MID|WIN_SAV,0,0,"Chat Action Set Name",str,25
,0)<1) ,0)<1)
continue; continue;
if((cfg.actset=(actset_t **)realloc(cfg.actset,sizeof(actset_t *)*(cfg.total_actsets+1))) if((cfg.actset=(actset_t **)realloc(cfg.actset,sizeof(actset_t *)*(cfg.total_actsets+1)))
==NULL) { ==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_actsets+1); errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_actsets+1);
cfg.total_actsets=0; cfg.total_actsets=0;
bail(1); bail(1);
continue; continue;
}
if(cfg.total_actsets)
for(u=cfg.total_actsets;u>i;u--)
cfg.actset[u]=cfg.actset[u-1];
if((cfg.actset[i]=(actset_t *)malloc(sizeof(actset_t)))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(actset_t));
continue;
}
memset((actset_t *)cfg.actset[i],0,sizeof(actset_t));
strcpy(cfg.actset[i]->name,str);
cfg.total_actsets++;
uifc.changes=1;
continue;
} }
if(cfg.total_actsets) if (msk == MSK_DEL || msk == MSK_CUT) {
for(u=cfg.total_actsets;u>i;u--) if(msk == MSK_CUT)
cfg.actset[u]=cfg.actset[u-1]; savactset = *cfg.actset[i];
if((cfg.actset[i]=(actset_t *)malloc(sizeof(actset_t)))==NULL) { free(cfg.actset[i]);
errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(actset_t)); cfg.total_actsets--;
continue; for(j=i;j<cfg.total_actsets;j++)
cfg.actset[j]=cfg.actset[j+1];
uifc.changes=1;
continue;
} }
memset((actset_t *)cfg.actset[i],0,sizeof(actset_t)); if (msk == MSK_COPY) {
strcpy(cfg.actset[i]->name,str); savactset=*cfg.actset[i];
cfg.total_actsets++; continue;
uifc.changes=1; }
continue; if (msk == MSK_PASTE) {
} *cfg.actset[i]=savactset;
if (msk == MSK_DEL || msk == MSK_CUT) { uifc.changes=1;
if(msk == MSK_CUT) continue;
savactset = *cfg.actset[i]; }
free(cfg.actset[i]); if (msk != 0)
cfg.total_actsets--; continue;
for(j=i;j<cfg.total_actsets;j++)
cfg.actset[j]=cfg.actset[j+1];
uifc.changes=1;
continue;
}
if (msk == MSK_COPY) {
savactset=*cfg.actset[i];
continue;
}
if (msk == MSK_PASTE) {
*cfg.actset[i]=savactset;
uifc.changes=1;
continue;
}
if (msk != 0)
continue;
j=0; j=0;
done=0; done=0;
while(!done) { while(!done) {
k=0; k=0;
sprintf(opt[k++],"%-27.27s%s","Action Set Name",cfg.actset[i]->name); sprintf(opt[k++],"%-27.27s%s","Action Set Name",cfg.actset[i]->name);
sprintf(opt[k++],"%-27.27s","Configure Chat Actions..."); sprintf(opt[k++],"%-27.27s","Configure Chat Actions...");
opt[k][0]=0; opt[k][0]=0;
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Set Configuration:`\n" "`Chat Action Set Configuration:`\n"
"\n" "\n"
"This menu is for configuring the selected chat action set.\n" "This menu is for configuring the selected chat action set.\n"
; ;
sprintf(str,"%s Chat Action Set",cfg.actset[i]->name); sprintf(str,"%s Chat Action Set",cfg.actset[i]->name);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str
,opt)) { ,opt)) {
case -1: case -1:
done=1; done=1;
break; break;
case 0: case 0:
uifc.helpbuf= uifc.helpbuf=
"`Chat Action Set Name:`\n" "`Chat Action Set Name:`\n"
"\n" "\n"
"This is the name of the selected action set.\n" "This is the name of the selected action set.\n"
; ;
strcpy(str,cfg.actset[i]->name); strcpy(str,cfg.actset[i]->name);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Action Set Name" if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Action Set Name"
,cfg.actset[i]->name,sizeof(cfg.actset[i]->name)-1,K_EDIT)) ,cfg.actset[i]->name,sizeof(cfg.actset[i]->name)-1,K_EDIT))
strcpy(cfg.actset[i]->name,str); strcpy(cfg.actset[i]->name,str);
break; break;
case 1: case 1:
chatact_cfg(i); chatact_cfg(i);
break; break;
} }
} }
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment