}
}
+void EscapeExpand(char *p, char *q)
+{ // [HGM] initstring: routine to shape up string arguments
+ while(*p++ = *q++) if(p[-1] == '\\')
+ switch(*q++) {
+ case 'n': p[-1] = '\n'; break;
+ case 'r': p[-1] = '\r'; break;
+ case 't': p[-1] = '\t'; break;
+ case '\\': p[-1] = '\\'; break;
+ case 0: *p = 0; return;
+ default: p[-1] = q[-1]; break;
+ }
+}
+
void
show_bytes(fp, buf, count)
FILE *fp;
* Look for communication commands
*/
if (!strncmp(message, "telluser ", 9)) {
+ EscapeExpand(message+9, message+9); // [HGM] esc: allow escape sequences in popup box
DisplayNote(message + 9);
return;
}
if (!strncmp(message, "tellusererror ", 14)) {
cps->userError = 1;
+ EscapeExpand(message+14, message+14); // [HGM] esc: allow escape sequences in popup box
DisplayError(message + 14, 0);
return;
}
void EditPositionMenuEvent P((ChessSquare selection, int x, int y));
void DropMenuEvent P((ChessSquare selection, int x, int y));
int ParseTimeControl P((char *tc, int ti, int mps));
+void EscapeExpand(char *p, char *q);
void ProcessICSInitScript P((FILE * f));
void EditCommentEvent P((void));
void ReplaceComment P((int index, char *text));
}
#endif
-void EscapeExpand(char *p, char *q)
-{ // [HGM] initstring: routine to shape up string arguments
- while(*p++ = *q++) if(p[-1] == '\\')
- switch(*q++) {
- case 'n': p[-1] = '\n'; break;
- case 'r': p[-1] = '\r'; break;
- case 't': p[-1] = '\t'; break;
- case '\\': p[-1] = '\\'; break;
- case 0: *p = 0; return;
- default: p[-1] = q[-1]; break;
- }
-}
-
int
main(argc, argv)
int argc;