Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 284778fd authored by rswindell's avatar rswindell

Added support for ^A+ and ^A- to push (save) and pop (restore) attributes.

This will be handy for correctly converting colored HTML text to ANSI.
parent ca1a6bec
......@@ -412,7 +412,14 @@ void sbbs_t::ctrl_a(char x)
case ')': /* turn echo back on */
console&=~CON_ECHO_OFF;
break;
case '-': /* turn off all attributes if */
case '+': /* push current attribte */
if(attr_sp<sizeof(attr_stack))
attr_stack[attr_sp++]=curatr;
break;
case '-': /* pop current attribute OR optimized "normal" */
if(attr_sp>0)
attr(attr_stack[--attr_sp]);
else /* turn off all attributes if */
if(atr&(HIGH|BLINK|BG_LIGHTGRAY)) /* high intensity, blink or */
attr(LIGHTGRAY); /* background bits are set */
break;
......
......@@ -2077,6 +2077,7 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
telnet_last_rxch=0;
sys_status=lncntr=tos=criterrs=keybufbot=keybuftop=lbuflen=slcnt=0L;
curatr=LIGHTGRAY;
attr_sp=0; /* attribute stack pointer */
errorlevel=0;
logcol=1;
logfile_fp=NULL;
......
......@@ -54,6 +54,7 @@ char sbbs_t::putmsg(char HUGE16 *str, long mode)
int orgcon=console,i;
ulong l=0,sys_status_sav=sys_status;
attr_sp=0; /* clear any saved attributes */
tmpatr=curatr; /* was lclatr(-1) */
if(!(mode&P_SAVEATR))
attr(LIGHTGRAY);
......@@ -250,6 +251,7 @@ char sbbs_t::putmsg(char HUGE16 *str, long mode)
if(mode&P_HTML)
putcom("\x02");
attr_sp=0; /* clear any saved attributes */
/* Restore original settings of Forced Pause On/Off */
sys_status&=~(SS_PAUSEOFF|SS_PAUSEON);
sys_status|=(sys_status_sav&(SS_PAUSEOFF|SS_PAUSEON));
......
......@@ -244,6 +244,8 @@ public:
time_t timeout; /* User inactivity timeout reference */
ulong timeleft_warn; /* low timeleft warning flag */
uchar curatr; /* Current Text Attributes Always */
uchar attr_stack[64]; /* Saved attributes (stack) */
int attr_sp; /* Attribute stack pointer */
long lncntr; /* Line Counter - for PAUSE */
long tos; /* Top of Screen */
long rows; /* Current number of Rows for User */
......
......@@ -442,7 +442,8 @@ BOOL DLLCALL validattr(char a)
{
switch(toupper(a)) {
case '-': /* clear */
case '+': /* push attr */
case '-': /* pop attr */
case '_': /* clear */
case 'B': /* blue fg */
case 'C': /* cyan fg */
......
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