Commit b63a0da3 authored by rswindell's avatar rswindell
Browse files

Replaced use of decimal constant, 7, with BEL macro (defined in gen_defs.h).

parent c6d859cf
......@@ -157,7 +157,7 @@ int sbbs_t::atcodes(char *instr)
/* STOP */
else if(!strcmp(sp,"BELL") || !strcmp(sp,"BEEP"))
outchar(7);
outchar(BEL);
// else if(!strcmp(sp,"EVENT"))
// bputs(sectostr(sys_eventtime,str2));
......
......@@ -128,7 +128,7 @@ uchar cesc(char ch)
case 'b':
return(BS);
case 'a':
return(7);
return(BEL);
case 'f':
return(FF);
case 'v':
......@@ -254,7 +254,7 @@ void writecstr(uchar *p)
str[j]=BS;
break;
case 'a':
str[j]=7; /* BEL */
str[j]=BEL;
break;
case 'f':
str[j]=FF;
......
......@@ -163,7 +163,7 @@ void sbbs_t::chatsection()
bprintf(text[NodeJoinedMultiChat]
,cfg.sys_nodes+1,cfg.guru[cfg.chan[channel-1]->guru]->name
,channel);
outchar(7);
outchar(BEL);
for(i=0;i<preusrs;i++) {
for(j=0;j<usrs;j++)
if(preusr[i]==usr[j])
......@@ -182,7 +182,7 @@ void sbbs_t::chatsection()
bprintf(text[NodeLeftMultiChat]
,cfg.sys_nodes+1,cfg.guru[cfg.chan[channel-1]->guru]->name
,channel);
outchar(7);
outchar(BEL);
for(i=0;i<usrs;i++) {
for(j=0;j<preusrs;j++)
if(usr[i]==preusr[j])
......
......@@ -76,7 +76,6 @@ int sbbs_t::bputs(char *str)
if(str==text[i])
break;
if(i<TOTAL_TEXT) { /* Replacement text */
//lputc(7);
i=atcodes(str+l);
l+=i;
if(i)
......@@ -164,8 +163,8 @@ void sbbs_t::outchar(char ch)
if(console&CON_L_ECHO) {
if(console&CON_L_ECHOX && (uchar)ch>=SP)
putch('X');
else if(cfg.node_misc&NM_NOBEEP && ch==7); /* Do nothing if beep */
else if(ch==7) {
else if(cfg.node_misc&NM_NOBEEP && ch==BEL); /* Do nothing if beep */
else if(ch==BEL) {
sbbs_beep(2000,110);
nosound(); }
else putch(ch); }
......@@ -190,8 +189,7 @@ void sbbs_t::outchar(char ch)
if(i==1440) { /* timeout - beep flush outbuf */
i=rioctl(TXBC);
lprintf("timeout(outchar) %04X %04X\r\n",i,rioctl(IOFO));
outcom(7);
// lputc(7);
outcom(BEL);
rioctl(IOCS|PAUSE); } } }
if(ch==LF) {
lncntr++;
......
......@@ -40,22 +40,46 @@
/****************************************************************************/
/* Converts a date string in format MM/DD/YY into unix time format */
/****************************************************************************/
time_t DLLCALL dstrtounix(scfg_t* cfg, char *str)
time_t DLLCALL dstrtounix(scfg_t* cfg, char *instr)
{
char* p;
char* day;
char str[16];
struct tm tm;
if(!strncmp(str,"00/00/00",8))
if(!instr[0] || !strncmp(instr,"00/00/00",8))
return(0);
if(isdigit(instr[0]) && isdigit(instr[1])
&& isdigit(instr[3] && isdigit(instr[4])
&& isdigit(instr[6] && isdigit(instr[7]))
p=instr; /* correctly formatted */
else {
p=instr; /* incorrectly formatted */
while(*p && isdigit(*p)) p++;
if(*p==0)
return(0);
p++;
day=p;
while(*p && isdigit(*p)) p++;
if(*p==0)
return(0);
p++;
sprintf(str,"%02u/%02u/%02u"
,atoi(instr)%100,atoi(day)%100,atoi(p)%100);
p=str;
}
memset(&tm,0,sizeof(tm));
tm.tm_year=((str[6]&0xf)*10)+(str[7]&0xf);
tm.tm_year=((p[6]&0xf)*10)+(p[7]&0xf);
if (tm.tm_year<Y2K_2DIGIT_WINDOW)
tm.tm_year+=100;
if(cfg->sys_misc&SM_EURODATE) {
tm.tm_mon=((str[3]&0xf)*10)+(str[4]&0xf);
tm.tm_mday=((str[0]&0xf)*10)+(str[1]&0xf); }
tm.tm_mon=((p[3]&0xf)*10)+(p[4]&0xf);
tm.tm_mday=((p[0]&0xf)*10)+(p[1]&0xf); }
else {
tm.tm_mon=((str[0]&0xf)*10)+(str[1]&0xf);
tm.tm_mday=((str[3]&0xf)*10)+(str[4]&0xf); }
tm.tm_mon=((p[0]&0xf)*10)+(p[1]&0xf);
tm.tm_mday=((p[3]&0xf)*10)+(p[4]&0xf); }
if (tm.tm_mon)
tm.tm_mon--; /* zero-based month field */
return(mktime(&tm));
......
......@@ -151,7 +151,6 @@ void sbbs_t::nodesync()
}
if(sys_status&SS_USERON && memcmp(&nodesync_user,&useron,sizeof(user_t))) {
// lputc(7);
getusrdirs();
getusrsubs();
memcpy(&nodesync_user,&useron,sizeof(nodesync_user)); }
......
......@@ -191,9 +191,9 @@ size_t sbbs_t::getstr(char *strout, size_t maxlen, long mode)
if(i==maxlen-1)
ins=0; }
if(i<maxlen) {
str1[i++]=7;
str1[i++]=BEL;
if(!(mode&K_NOECHO))
outchar(7); }
outchar(BEL); }
break;
case 8: /* Ctrl-H/Backspace */
if(!i)
......
......@@ -214,7 +214,7 @@ char *readtext(long *line,FILE *stream)
str[j]=BS;
break;
case 'a':
str[j]=7; /* BEL */
str[j]=BEL;
break;
case 'f':
str[j]=FF;
......
......@@ -231,9 +231,11 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
body[bodylen++]=CR;
body[bodylen++]=LF; }
continue; }
if(!fromhub && qwkbuf[k]==7 && useron.rest&FLAG('B')) /* beep res */
/* beep restrict */
if(!fromhub && qwkbuf[k]==BEL && useron.rest&FLAG('B'))
continue;
if(!fromhub && (qwkbuf[k]==1 || qwkbuf[k]==ESC) /* ANSI restriction */
/* ANSI restriction */
if(!fromhub && (qwkbuf[k]==1 || qwkbuf[k]==ESC)
&& useron.rest&FLAG('A'))
continue;
if(qwkbuf[k]!=1 && lastch!=1)
......
......@@ -588,7 +588,7 @@ void sbbs_t::useredit(int usernumber, int local)
user.number=i;
getuserdat(&cfg,&user);
if(chk_ar(ar,&user)) {
outchar(7);
outchar(BEL);
break; } }
if(!i)
user.number=k; }
......@@ -605,7 +605,7 @@ void sbbs_t::useredit(int usernumber, int local)
user.number=i;
getuserdat(&cfg,&user);
if(chk_ar(ar,&user)) {
outchar(7);
outchar(BEL);
break; } }
if(i>j)
user.number=k; }
......@@ -669,7 +669,7 @@ int sbbs_t::searchup(char *search,int usernum)
userdat[U_LEN]=0;
strupr(userdat);
if(strstr(userdat,search)) {
outchar(7);
outchar(BEL);
close(file);
return(i); }
i++; }
......@@ -718,7 +718,7 @@ int sbbs_t::searchdn(char *search,int usernum)
userdat[U_LEN]=0;
strupr(userdat);
if(strstr(userdat,search)) {
outchar(7);
outchar(BEL);
close(file);
return(i); }
i--; }
......
......@@ -265,7 +265,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
return(false); }
if((c==ESC || c==1) && useron.rest&FLAG('A')) /* ANSI restriction */
continue;
if(c==7 && useron.rest&FLAG('B')) /* Beep restriction */
if(c==BEL && useron.rest&FLAG('B')) /* Beep restriction */
continue;
if(!(console&CON_RAW_IN)) /* Ctrl-Z was hit */
break;
......
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