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

Using macros for ctrl key constants.

parent edd297d5
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,7 @@ int sbbs_t::stripattr(char *strin)
e=strlen(strin);
for(a=c=d=0;c<e && d<sizeof(str)-1;c++) {
if(strin[c]==1) {
if(strin[c]==CTRL_A) {
a++;
if(!validattr(strin[c+1])) {
c++;
......
......@@ -371,7 +371,7 @@ int sbbs_t::exec_function(csi_t *csi)
}
continue;
}
if(ch==16) { /* Ctrl-P Private node-node comm */
if(ch==CTRL_P) { /* Private node-node comm */
lncntr=0; /* defeat pause */
spy_socket[i-1]=INVALID_SOCKET; /* disable spy output */
nodesync(); /* read waiting messages */
......@@ -379,7 +379,7 @@ int sbbs_t::exec_function(csi_t *csi)
spy_socket[i-1]=client_socket; /* enable spy output */
continue;
}
if(ch==21) { /* Ctrl-U Users online */
if(ch==CTRL_U) { /* Users online */
lncntr=0; /* defeat pause */
whos_online(true); /* list users */
continue;
......
......@@ -321,7 +321,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
l=0L;
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++;
else if(buf[l]!=LF) {
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)
l++; }
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++;
else if(qwkbuf[l]!=LF) {
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
continue;
if(qwkbuf[k]!=1 && lastch!=1)
col++;
if(lastch==1 && !validattr(qwkbuf[k])) {
if(lastch==CTRL_A && !validattr(qwkbuf[k])) {
if(taillen) taillen--;
else bodylen--;
lastch=0;
......
......@@ -51,7 +51,7 @@ char* DLLCALL remove_ctrl_a(char *instr, char *outstr)
j=strlen(instr);
for(k=i=0;i<j;i++) {
if(instr[i]==1)
if(instr[i]==CTRL_A)
i++;
else str[k++]=instr[i]; }
str[k]=0;
......@@ -490,7 +490,7 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode)
outchar(BS);
bputs(" \b");
continue; }
if(ch==24) { /* Ctrl-X */
if(ch==CTRL_X) {
for(;c;c--) {
outchar(BS);
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
if(sys_status&SS_ABORT) { /* Ctrl-C */
LFREE(buf);
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;
if(c==BEL && useron.rest&FLAG('B')) /* Beep restriction */
continue;
......
......@@ -53,7 +53,7 @@ BYTE* wwiv_expand(BYTE* buf, ulong buflen, BYTE* outbuf, ulong& newlen
ulong i,j,k;
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;
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment