home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
UTIL
/
WWIVE
/
MYWIVE.ZIP
/
DEFAULTS.C
< prev
next >
Wrap
Text File
|
1993-04-17
|
17KB
|
765 lines
#include "vars.h"
#pragma hdrstop
void select_editor()
{
char s[81],s1[81],*ss;
int i;
helpl=37;
if (numed==0) {
nl();
pl("eNo full screen editors available.");
nl();
return;
}
for (i=0; i<5; i++)
odc[i]=0;
pl("0. Normal non-full screen editor");
for (i=0; i<numed; i++) {
npr("%d. %s\r\n",i+1,editors[i].description);
if (((i+1) %10)==0)
odc[(i+1)/10-1]=(i+1)/10;
}
nl();
ansic(2);
npr("Which editor (1-%d, <C/R>=leave as is) ? ",numed);
ss=mmkey(2);
i=atoi(ss);
if ((i>=1) && (i<=numed))
thisuser.defed=i;
else
if (strcmp(ss,"0")==0)
thisuser.defed=0;
}
void print_cur_stata()
{
char s[81],s1[81],s2[81],s3[2],s4[41];
int i;
userrec ur;
yourinfo();
nl();
pl(" fYour Configurable Defaults");
npr("7[117] fScreen size 7: e%d X %d",
thisuser.screenchars,
thisuser.screenlines);
npr(" 7[127] fANSI 7: e%s\r\n",
(thisuser.sysstatus & sysstatus_ansi)?
((thisuser.sysstatus & sysstatus_color)? "Color":"Monochrome"):
"No ANSI");
npr("7[137] fPause on screen 7: e%-3s",
(thisuser.sysstatus & sysstatus_pause_on_page)?"On":"Off");
outstr(" 7[147] fMailbox 7:e ");
if ((thisuser.forwardsys==0) && (thisuser.forwardusr==0))
pl("Normal");
else {
if (thisuser.forwardsys) {
sprintf(s,"Forward to #%u @%u.",thisuser.forwardusr,thisuser.forwardsys);
pl(s);
} else {
read_user(thisuser.forwardusr,&ur);
if (ur.inact & inact_deleted) {
thisuser.forwardusr=0;
pl("Normal");
} else {
sprintf(s,"Forward to %s",nam(&ur,thisuser.forwardusr));
pl(s);
}
}
}
pl("7[157] fConfigured Q-scan 7[167] fChange password");
npr("7[177] fUpdate macros");
pl(" 7[187] fChange colors");
npr("7[197] fFull screen editor7: e%s",
((thisuser.defed) && (thisuser.defed<=numed))?
editors[thisuser.defed-1].description:"None.");
npr(" 7[1A7] fExtended colors 7: e%s\r\n",
(thisuser.sysstatus & sysstatus_funky_colors)?"Yes":"No");
npr("7[1B7] fOptional lines 7: e%-2d\r\n",thisuser.optional_val);
strcpy(s3,thisuser.sex_type);
i=atoi(s3);
if(i==1) strcpy(s4,"Straight");
if(i==2) strcpy(s4,"Gay");
if(i==3) strcpy(s4,"Bi-Sexual");
if(i==4) strcpy(s4,"Still under personal debate");
npr("7[1C7] fSexual Preference 7: e%s\r\n",s4);
npr("7[1O7] fPersonal Tag 7: e%s\r\n",thisuser.note);
pl("7[1Q7] fQuit to main menu");
nl();
nl();
}
void print_cur_stat()
{
char s[81],s1[81],s2[81],s3[2],s4[41];
int i;
userrec ur;
if (okansi())
print_cur_stata();
else {
yourinfo();
nl();
pl(" Your Configurable Defaults");
npr("[1] Screen size : %d X %d",
thisuser.screenchars,
thisuser.screenlines);
npr(" [2] ANSI : %s\r\n",
(thisuser.sysstatus & sysstatus_ansi)?
((thisuser.sysstatus & sysstatus_color)? "Color":"Monochrome"):
"No ANSI");
npr("[3] Pause on screen : %-3s",
(thisuser.sysstatus & sysstatus_pause_on_page)?"On":"Off");
outstr(" [4] Mailbox : ");
if ((thisuser.forwardsys==0) && (thisuser.forwardusr==0))
pl("Normal");
else {
if (thisuser.forwardsys) {
sprintf(s,"Forward to #%u @%u.",thisuser.forwardusr,thisuser.forwardsys);
pl(s);
} else {
read_user(thisuser.forwardusr,&ur);
if (ur.inact & inact_deleted) {
thisuser.forwardusr=0;
pl("Normal");
} else {
sprintf(s,"Forward to %s",nam(&ur,thisuser.forwardusr));
pl(s);
}
}
}
pl("[5] Configured Q-scan [6] Change password");
npr("[7] Update macros");
npr(" [B] Optional lines : %-2d\r\n",thisuser.optional_val);
strcpy(s3,thisuser.sex_type);
i=atoi(s3);
if(i==1) strcpy(s4,"Straight");
if(i==2) strcpy(s4,"Gay");
if(i==3) strcpy(s4,"Bi-Sexual");
if(i==4) strcpy(s4,"Still under personal debate");
npr("7[1C7] fSexual Preference 7: e%s\r\n",s4);
npr("[O] Personal Tag : %s\r\n",thisuser.note);
pl("[Q] Quit to main menu");
nl();
nl();
}
}
char *cn(char c)
{
static char s[20];
if ((checkcomp("Ami")) || (checkcomp("Mac"))) {
sprintf(s,"Color #%d",c);
return(s);
}
switch(c) {
case 0:
return("Black");
case 1:
return("Blue");
case 2:
return("Green");
case 3:
return("Cyan");
case 4:
return("Red");
case 5:
return("Magenta");
case 6:
return("Yellow");
case 7:
return("White");
}
return("");
}
char *describe(char col)
{
static char s[81];
char s1[81];
if (thisuser.sysstatus & sysstatus_color) {
strcpy(s1,cn(col&0x07));
sprintf(s,"%s on %s", s1, cn((col>>4)&0x07));
} else {
if ((col & 0x07) == 0)
strcpy(s,"Inversed");
else
strcpy(s,"Normal");
}
if (col & 0x08) {
if ((checkcomp("Ami")) || (checkcomp("Mac")))
strcat(s,", Bold");
else
strcat(s,", Intense");
}
if (col & 0x80) {
if (checkcomp("Ami"))
strcat(s,", Italicized");
else
if (checkcomp("Mac"))
strcat(s,", Underlined");
else
strcat(s,", Blinking");
}
return(s);
}
void color_list()
{
int i;
nl();
nl();
for (i=0; i<8; i++) {
if (i==0)
setc(0x70);
else
setc(i);
npr("%d. %s",i,cn(i));
setc(0x07);
nl();
}
}
void change_colors()
{
int i,done,i1,i2;
char s[81],ch,nc;
done=0;
helpl=36;
nl();
do {
if ((thisuser.sysstatus & sysstatus_color)==0) {
strcpy(s,"Monochrome base color : ");
if ((thisuser.bwcolors[1] & 0x70) == 0)
strcat(s,cn(thisuser.bwcolors[1] & 0x07));
else
strcat(s,cn((thisuser.bwcolors[1] >> 4) & 0x07));
pl(s);
nl();
}
for (i=0; i<8; i++) {
ansic(i);
itoa(i,s,10);
strcat(s,". ");
switch(i) {
case 0:
strcat(s,"Default ");
break;
case 1:
strcat(s,"Yes/No ");
break;
case 2:
strcat(s,"Prompt ");
break;
case 3:
strcat(s,"Note ");
break;
case 4:
strcat(s,"Input line ");
break;
case 5:
strcat(s,"Yes/No Question ");
break;
case 6:
strcat(s,"Notice! ");
break;
case 7:
strcat(s,"Border ");
break;
}
if (thisuser.sysstatus & sysstatus_color)
strcat(s,describe(thisuser.colors[i]));
else
strcat(s,describe(thisuser.bwcolors[i]));
pl(s);
}
nl();
prt(2,"7[1Change which7] (10-77, 1Q=Quit7) 1? ");
ch=onek("Q01234567");
if (ch=='Q')
done=1;
else {
i1=ch-'0';
if (thisuser.sysstatus & sysstatus_color) {
color_list();
ansic(0);
nl();
prt(2,"Foreground? ");
ch=onek("01234567");
nc=ch-'0';
prt(2,"Background? ");
ch=onek("01234567");
nc=nc | ((ch-'0') << 4);
} else {
nl();
prt(5,"Inversed? ");
if (yn()) {
if ((thisuser.bwcolors[1] & 0x70) == 0)
nc=0 | ((thisuser.bwcolors[1] & 0x07) << 4);
else
nc=(thisuser.bwcolors[1] & 0x70);
} else {
if ((thisuser.bwcolors[1] & 0x70) == 0)
nc=0 | (thisuser.bwcolors[1] & 0x07);
else
nc=((thisuser.bwcolors[1] & 0x70) >> 4);
}
}
if ((checkcomp("Ami")) || (checkcomp("Mac")))
prt(5,"Bold? ");
else
prt(5,"Intensified? ");
if (yn())
nc |= 0x08;
if (checkcomp("Ami"))
prt(5,"Italicized? ");
else
if (checkcomp("Mac"))
prt(5,"Underlined? ");
else
prt(5,"Blinking? ");
if (yn())
nc |= 0x80;
nl();
nl();
setc(nc);
outstr(describe(nc));
ansic(0);
nl();
nl();
prt(5,"Is this OK? ");
if (yn()) {
nl();
pl("Color saved.");
nl();
if (thisuser.sysstatus & sysstatus_color)
thisuser.colors[i1]=nc;
else
thisuser.bwcolors[i1]=nc;
} else {
nl();
pl("Not saved, then.");
nl();
}
}
} while ((!done) && (!hangup));
}
void l_config_qscan()
{
int i,abort;
char s[81];
abort=0;
nl();
pl("fBoards to q-scan marked with 'e*f'");
nl();
for (i=0; (i<MAX_SUBS) && (usub[i].subnum!=-1) && (!abort); i++) {
sprintf(s,"%c %s. %s",
#if MAX_SUBS>32
(usub[i].subnum>=32)?
(((1L << (usub[i].subnum-32)) & thisuser.qscn2)?'*':' '):
(((1L << (usub[i].subnum)) & thisuser.qscn)?'*':' '),
#else
((1L << (usub[i].subnum)) & thisuser.qscn)?'*':' ',
#endif
usub[i].keys,
subboards[usub[i].subnum].name);
pla(s,&abort);
}
nl();
nl();
}
void config_qscan()
{
char *s;
int i,done;
l_config_qscan();
done=0;
do {
nl();
pl("fEnter sub-board identifier, or Q to Quit");
helpl=7;
outstr("eConfig: ");
s=mmkey(0);
if (s[0])
for (i=0; i<MAX_SUBS; i++)
if (strcmp(usub[i].keys,s)==0) {
#if MAX_SUBS>32
if (usub[i].subnum>=32)
thisuser.qscn2 ^=((1L) << (usub[i].subnum-32));
else
thisuser.qscn ^=((1L) << (usub[i].subnum));
#else
thisuser.qscn ^=((1L) << (usub[i].subnum));
#endif
}
if (strcmp(s,"Q")==0)
done=1;
if (strcmp(s,"?")==0)
l_config_qscan();
} while ((!done) && (!hangup));
}
void list_macro(unsigned char *s)
{
int i;
i=0;
outchr('\"');
while ((i<80) && (s[i]!=0)) {
if (s[i]>=32)
outchr(s[i]);
else {
outchr('^');
outchr(s[i]+64);
}
++i;
}
outchr('"');
nl();
}
void make_macros()
{
unsigned char tempmac[81],s[81];
unsigned char ch,ch1;
int i,i1,done,done1;
done=0;
do {
nl();
prt(2,"1Macrosf: 1Lf:1istf, 1Mf:1akef, 1Qf:1uit f: ");
helpl=33;
ch=onek("QLM");
switch(ch) {
case 'Q':
done=1;
break;
case 'L':
nl();
nl();
pl("1Ctrl-D macro: ");
list_macro(&(thisuser.macros[0][0]));
nl();
pl("1Ctrl-F macro: ");
list_macro(&(thisuser.macros[1][0]));
nl();
pl("1Ctrl-A macro: ");
list_macro(&(thisuser.macros[2][0]));
break;
case 'M':
nl();
prt(2,"7[1Which7] (1A7,1D7,1F7, 1Q7=1quit7) 1: ");
ch1=onek("QADF");
if (ch1!='Q') {
switch(ch1) {
case 'A': i1=2; break;
case 'D': i1=0; break;
case 'F': i1=1; break;
}
strcpy(s,&(thisuser.macros[i1][0]));
thisuser.macros[i1][0]=0;
done1=0;
i=0;
nl();
pl("eEnter your macro now, hit ctrl-Z when done.");
nl();
okskey=0;
do {
ch1=getkey();
if (ch1==26)
done1=1;
else
if (ch1==8) {
if (i>0) {
i--;
backspace();
if (tempmac[i]<32)
backspace();
}
} else {
if (ch1>=32) {
tempmac[i++]=ch1;
outchr(ch1);
} else {
tempmac[i++]=ch1;
outchr('^');
outchr(ch1+64);
}
}
if (i>=78)
done1=1;
} while ((!done1) && (!hangup));
okskey=1;
tempmac[i]=0;
nl();
pl("eYou enteredf:");
nl();
nl();
list_macro(tempmac);
nl();
prt(5,"Is this OK? ");
if (yn()) {
strcpy(&(thisuser.macros[i1][0]),tempmac);
nl();
pl("fMacro saved.");
} else {
nl();
strcpy(&(thisuser.macros[i1][0]),s);
pl("eNothing saved.");
}
}
break;
}
} while ((!done) && (!hangup));
}
void input_pw1()
{
char s[81],s1[81];
int ok;
nl();
prt(5,"eChange password? ");
if (yn()) {
nl();
pl("1You must now enter your current password.");
outstr(": ");
mpl(8);
echo=0;
input(s,8);
if (strcmp(s,thisuser.pw)) {
nl();
pl("6Incorrect.");
nl();
return;
}
nl();
nl();
pl("1Enter your new password, 3 to 8 characters long.");
outstr(": ");
mpl(8);
echo=0;
input(s,8);
nl();
nl();
pl("1Repeat password for verification.");
outstr(": ");
mpl(8);
echo=0;
input(s1,8);
if (strcmp(s,s1)==0) {
strcpy(thisuser.pw,s);
nl();
pl("fPassword changed.");
nl();
sysoplog("Changed Password.");
} else {
nl();
pl("6VERIFY FAILED.");
pl("6Password not changed.");
nl();
}
}
}
void modify_mailbox()
{
int i,i1,i2;
unsigned int u;
char s[81];
net_system_list_rec *csne;
nl();
helpl=35;
prt(5,"eDo you want to forward your mail? ");
if (!yn()) {
thisuser.forwardsys=0;
thisuser.forwardusr=0;
return;
}
nl();
if (syscfg.systemnumber) {
prt(5,"eForward to another system? ");
if (yn()) {
nl();
prt(2,"1Which system (number)? ");
input(s,5);
i2=atoi(s);
if ((csne=next_system(i2))==NULL) {
nl();
pl("6Unknown system.");
nl();
return;
}
nl();
npr("1System name: f%s\r\n",csne -> name);
nl();
if (i2==syscfg.systemnumber) {
nl();
pl("6That's this system.");
nl();
return;
}
prt(2,"eWhich user number on that system? ");
input(s,5);
i=atoi(s);
if ((i>0) && (i<20000)) {
thisuser.forwardsys=i2;
thisuser.forwardusr=i;
nl();
pl("fSaved.");
nl();
}
return;
}
}
nl();
prt(2,"eForward to which user? ");
input(s,40);
i=finduser1(s);
if (i==usernum) {
thisuser.forwardsys=0;
thisuser.forwardusr=0;
nl();
pl("fForwarding reset.");
nl();
return;
}
if (i>0) {
thisuser.forwardsys=0;
thisuser.forwardusr=i;
nl();
pl("fSaved.");
nl();
}
}
void optional_lines()
{
char s[81];
int i;
pl("7You may specify your optional lines value from 0-10,");
pl("70 being all, 10 being none.");
prt(2,"eWhat value? ");
input(s,2);
i=atoi(s);
if ((s[0]) && (i>=0) && (i<11))
thisuser.optional_val = i;
}
/*void enter_regnum()
{
char s[81];
long l;
pl("fYou may now enter your WWIV registration number.");
pl("fEnter 0 for none.");
nl();
prt(2,"eWWIVf: ");
input(s,5);
l=atol(s);
if ((s[0]) && (l>=0))
thisuser.wwiv_regnum = l;
} */
void defaults()
{
int i,i1,i2,j,done;
char s[81],s1[81],s2[81],s4[2],ch;
done=0;
print_cur_stat();
do {
nl();
helpl=4;
if (okansi()) {
prt(2,"7[1Defaults7]1: 7(11-9,A-C,O,?,Q7) 1: ");
ch=onek("Q?123456789ABCO");
} else {
prt(2,"[Defaults]: (1-7,B,C,O,?,Q) : ");
ch=onek("Q?1234567BCO");
}
switch(ch) {
case 'Q':
done=1;
break;
case '?':
print_cur_stat();
break;
case '1':
input_screensize();
break;
case '2':
input_ansistat();
break;
case '3':
if (thisuser.sysstatus & sysstatus_pause_on_page)
thisuser.sysstatus ^= sysstatus_pause_on_page;
nl();
prt(5,"ePause each screenfull? ");
if (yn())
thisuser.sysstatus |= sysstatus_pause_on_page;
break;
case '4':
modify_mailbox();
break;
case '5':
config_qscan();
break;
case '6':
if (usernum==133)
pl("The Guest Account cannot change passwords");
else
input_pw1();
break;
case '7':
make_macros();
break;
case '8':
change_colors();
break;
case '9':
select_editor();
break;
case 'A':
if (thisuser.sysstatus & sysstatus_funky_colors)
thisuser.sysstatus ^= sysstatus_funky_colors;
nl();
prt(5,"eUse extended colors? ");
if (yn())
thisuser.sysstatus |= sysstatus_funky_colors;
break;
case 'B':
optional_lines();
break;
case 'C':
input_sex_type();
break;
case 'O':
nl();
npr("f%s \r\n",thisuser.note);
nl();
pl("eYou may now enter your new tag");
prt(2,":");
inputl(thisuser.note,40);
sprintf(s,"Changed Tag to - %s",thisuser.note);
sysoplog(s);
break;
}
} while ((!done) && (!hangup));
}