void color(int colornum)
{
static int is_bold = 0;
+ static int hold_color, current_color;
+ if (colornum == COLOR_PUSH) {
+ hold_color = current_color;
+ return;
+ }
+
+ if (colornum == COLOR_POP) {
+ color(hold_color);
+ return;
+ }
+
+ current_color = colornum;
if (enable_color) {
printf("\033[3%dm", (colornum % 8));
if ((colornum >= 8) && (is_bold == 0)) {
#define BRIGHT_MAGENTA 13
#define BRIGHT_CYAN 14
#define BRIGHT_WHITE 15
+#define COLOR_PUSH 16 /* Save current color */
+#define COLOR_POP 17 /* Restore saved color */
/*
* declarations
}
}
printf("\n");
- if (pagin == 1 ) color(DIM_WHITE);
+ if (pagin == 1) color(BRIGHT_WHITE);
++lines_printed;
lines_printed = checkpagin(lines_printed,pagin,screenheight);
void hit_any_key(void) { /* hit any key to continue */
int a,b;
+ color(COLOR_PUSH);
+ color(DIM_RED);
printf("%s\r",serv_info.serv_moreprompt);
+ color(COLOR_POP);
sttybbs(0);
b=inkey();
for (a=0; a<strlen(serv_info.serv_moreprompt); ++a)