void Processor::script_word(const zchar *s) { int width; int i; if (*s == ZC_INDENT && script_width != 0) script_char(*s++); for (i = 0, width = 0; s[i] != 0; i++) { if (s[i] == ZC_NEW_STYLE || s[i] == ZC_NEW_FONT) i++; else if (s[i] == ZC_GAP) width += 3; else if (s[i] == ZC_INDENT) width += 2; else width += 1; } if (_script_cols != 0 && script_width + width > _script_cols) { if (*s == ' ' || *s == ZC_INDENT || *s == ZC_GAP) s++; script_new_line(); } for (i = 0; s[i] != 0; i++) { if (s[i] == ZC_NEW_FONT || s[i] == ZC_NEW_STYLE) i++; else script_char(s[i]); } }
void Processor::stream_char(zchar c) { if (ostream_screen) screen_char(c); if (ostream_script && enable_scripting) script_char(c); if (enable_scripting) scrollback_char(c); }
void script_mssg_on (void) { if (script_width != 0) script_new_line (); script_char (ZC_INDENT); }/* script_mssg_on */
void script_string( const char *s ) { /* Write string */ while ( *s ) { script_char( *s++ ); } } /* script_string */
void stream_char (zchar c) { if (ostream_screen) screen_char (c); if (ostream_script && enable_scripting) script_char (c); }/* stream_char */
void script_char (zchar c) { if (c == ZC_INDENT && script_width != 0) c = ' '; if (c == ZC_INDENT) { script_char (' '); script_char (' '); script_char (' '); return; } if (c == ZC_GAP) { script_char (' '); script_char (' '); return; } #ifdef __MSDOS__ if (c >= ZC_LATIN1_MIN) c = latin1_to_ibm[c - ZC_LATIN1_MIN]; #endif fputc (c, sfp); script_width++; }/* script_char */
void Processor::script_char(zchar c) { if (c == ZC_INDENT && script_width != 0) c = ' '; if (c == ZC_INDENT) { script_char(' '); script_char(' '); script_char(' '); return; } if (c == ZC_GAP) { script_char(' '); script_char(' '); return; } sfp->putCharUni(c); script_width++; }
void Processor::script_write_input(const zchar *buf, zchar key) { int width; int i; for (i = 0, width = 0; buf[i] != 0; i++) width++; if (_script_cols != 0 && script_width + width > _script_cols) script_new_line(); for (i = 0; buf[i] != 0; i++) script_char(buf[i]); if (key == ZC_RETURN) script_new_line(); }
void script_write_input (const zchar *buf, zchar key) { int width; int i; for (i = 0, width = 0; buf[i] != 0; i++) width++; if (f_setup.script_cols != 0 && script_width + width > f_setup.script_cols) script_new_line (); for (i = 0; buf[i] != 0; i++) script_char (buf[i]); if (key == ZC_RETURN) script_new_line (); }/* script_write_input */
void script_new_line( void ) { script_char( '\n' ); } /* script_new_line */
void Processor::script_mssg_on() { if (script_width != 0) script_new_line(); script_char(ZC_INDENT); }
void Processor::script_new_line() { script_char('\n'); script_width = 0; }