Commit b96bf998 authored by rswindell's avatar rswindell
Browse files

Using macros for ctrl key constants.

parent edd297d5
...@@ -82,7 +82,7 @@ int sbbs_t::stripattr(char *strin) ...@@ -82,7 +82,7 @@ int sbbs_t::stripattr(char *strin)
e=strlen(strin); e=strlen(strin);
for(a=c=d=0;c<e && d<sizeof(str)-1;c++) { for(a=c=d=0;c<e && d<sizeof(str)-1;c++) {
if(strin[c]==1) { if(strin[c]==CTRL_A) {
a++; a++;
if(!validattr(strin[c+1])) { if(!validattr(strin[c+1])) {
c++; c++;
......
...@@ -371,7 +371,7 @@ int sbbs_t::exec_function(csi_t *csi) ...@@ -371,7 +371,7 @@ int sbbs_t::exec_function(csi_t *csi)
} }
continue; continue;
} }
if(ch==16) { /* Ctrl-P Private node-node comm */ if(ch==CTRL_P) { /* Private node-node comm */
lncntr=0; /* defeat pause */ lncntr=0; /* defeat pause */
spy_socket[i-1]=INVALID_SOCKET; /* disable spy output */ spy_socket[i-1]=INVALID_SOCKET; /* disable spy output */
nodesync(); /* read waiting messages */ nodesync(); /* read waiting messages */
...@@ -379,7 +379,7 @@ int sbbs_t::exec_function(csi_t *csi) ...@@ -379,7 +379,7 @@ int sbbs_t::exec_function(csi_t *csi)
spy_socket[i-1]=client_socket; /* enable spy output */ spy_socket[i-1]=client_socket; /* enable spy output */
continue; continue;
} }
if(ch==21) { /* Ctrl-U Users online */ if(ch==CTRL_U) { /* Users online */
lncntr=0; /* defeat pause */ lncntr=0; /* defeat pause */
whos_online(true); /* list users */ whos_online(true); /* list users */
continue; continue;
......
...@@ -321,7 +321,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode) ...@@ -321,7 +321,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
l=0L; l=0L;
while(l<length) { while(l<length) {
if(buf[l]==1) /* Ctrl-A, so skip it and the next char */ if(buf[l]==CTRL_A) /* Ctrl-A, so skip it and the next char */
l++; l++;
else if(buf[l]!=LF) { else if(buf[l]!=LF) {
if((uchar)buf[l]==0x8d) /* r0dent i converted to normal i */ if((uchar)buf[l]==0x8d) /* r0dent i converted to normal i */
...@@ -836,7 +836,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub) ...@@ -836,7 +836,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
l++; } l++; }
while(l<n*128L) { while(l<n*128L) {
if(qwkbuf[l]==1) /* Ctrl-A, so skip it and the next char */ if(qwkbuf[l]==CTRL_A) /* Ctrl-A, so skip it and the next char */
l++; l++;
else if(qwkbuf[l]!=LF) { else if(qwkbuf[l]!=LF) {
if((uchar)qwkbuf[l]==0xe3) /* QWK cr/lf char converted to hard CR */ if((uchar)qwkbuf[l]==0xe3) /* QWK cr/lf char converted to hard CR */
......
...@@ -240,7 +240,7 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum ...@@ -240,7 +240,7 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
continue; continue;
if(qwkbuf[k]!=1 && lastch!=1) if(qwkbuf[k]!=1 && lastch!=1)
col++; col++;
if(lastch==1 && !validattr(qwkbuf[k])) { if(lastch==CTRL_A && !validattr(qwkbuf[k])) {
if(taillen) taillen--; if(taillen) taillen--;
else bodylen--; else bodylen--;
lastch=0; lastch=0;
......
...@@ -51,7 +51,7 @@ char* DLLCALL remove_ctrl_a(char *instr, char *outstr) ...@@ -51,7 +51,7 @@ char* DLLCALL remove_ctrl_a(char *instr, char *outstr)
j=strlen(instr); j=strlen(instr);
for(k=i=0;i<j;i++) { for(k=i=0;i<j;i++) {
if(instr[i]==1) if(instr[i]==CTRL_A)
i++; i++;
else str[k++]=instr[i]; } else str[k++]=instr[i]; }
str[k]=0; str[k]=0;
...@@ -490,7 +490,7 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode) ...@@ -490,7 +490,7 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode)
outchar(BS); outchar(BS);
bputs(" \b"); bputs(" \b");
continue; } continue; }
if(ch==24) { /* Ctrl-X */ if(ch==CTRL_X) {
for(;c;c--) { for(;c;c--) {
outchar(BS); outchar(BS);
if(tmplt[c-1]=='N' || tmplt[c-1]=='A' || tmplt[c-1]=='!') if(tmplt[c-1]=='N' || tmplt[c-1]=='A' || tmplt[c-1]=='!')
......
...@@ -264,7 +264,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum ...@@ -264,7 +264,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
if(sys_status&SS_ABORT) { /* Ctrl-C */ if(sys_status&SS_ABORT) { /* Ctrl-C */
LFREE(buf); LFREE(buf);
return(false); } return(false); }
if((c==ESC || c==1) && useron.rest&FLAG('A')) /* ANSI restriction */ if((c==ESC || c==CTRL_A) && useron.rest&FLAG('A')) /* ANSI restriction */
continue; continue;
if(c==BEL && useron.rest&FLAG('B')) /* Beep restriction */ if(c==BEL && useron.rest&FLAG('B')) /* Beep restriction */
continue; continue;
......
...@@ -53,7 +53,7 @@ BYTE* wwiv_expand(BYTE* buf, ulong buflen, BYTE* outbuf, ulong& newlen ...@@ -53,7 +53,7 @@ BYTE* wwiv_expand(BYTE* buf, ulong buflen, BYTE* outbuf, ulong& newlen
ulong i,j,k; ulong i,j,k;
for(i=j=0;i<buflen;i++) { for(i=j=0;i<buflen;i++) {
if(buf[i]==3) { /* ctrl-c, WWIV color escape char */ if(buf[i]==CTRL_C) { /* WWIV color escape char */
ctrl_c=true; ctrl_c=true;
continue; continue;
} }
......
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