aboutsummaryrefslogtreecommitdiffstats
path: root/src/vt102.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vt102.c')
-rw-r--r--src/vt102.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/vt102.c b/src/vt102.c
index 1b875da..4fd111d 100644
--- a/src/vt102.c
+++ b/src/vt102.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.59 2008/03/06 16:49:05 james
+ * *** empty log message ***
+ *
* Revision 1.58 2008/03/06 01:41:48 james
* *** empty log message ***
*
@@ -1711,9 +1714,17 @@ pre_parse_cmd (int ch, VT102_parser * p)
}
}
-void
+int vt102_rx_hook(Context *c, int ch)
+{
+if (!c->r) return 0;
+if (!c->r->rx) return 0;
+return c->r->rx(c->r,ch);
+}
+
+int
vt102_parse_char (Context * c, int ch)
{
+ int err=0;
VT102 *v = c->v;
VT102_parser *p = &v->parser;
@@ -1828,18 +1839,22 @@ vt102_parse_char (Context * c, int ch)
break;
/*BS*/ case 8:
vt102_cursor_retreat (c->v);
+ err+=vt102_rx_hook(c,ch);
break;
/*HT*/ case 9:
vt102_cursor_advance_tab (c->v);
+ err+=vt102_rx_hook(c,ch);
break;
/*LF*/ case 10:
/*VT*/ case 11:
/*FF*/ case 12:
vt102_cursor_advance_line (c);
+ err+=vt102_rx_hook(c,10);
if (!v->modes[VT102_MODE_NEWLINE_MODE])
break;
/*CR*/ case 13:
vt102_cursor_carriage_return (v);
+ err+=vt102_rx_hook(c,13);
break;
/*SO*/ case 14:
/*select G1 */
@@ -1865,7 +1880,7 @@ vt102_parse_char (Context * c, int ch)
#endif
/*ESC*/ case 27:
p->in_escape++;
- return;
+ break;
#if 0
/*FS*/ case 28:
/*GS*/ case 29:
@@ -1876,6 +1891,7 @@ vt102_parse_char (Context * c, int ch)
#endif
/*regular character */ default:
vt102_regular_char (c, v, ch);
+ err+=vt102_rx_hook(c,ch);
}
#ifdef DEBUG
@@ -1887,8 +1903,9 @@ vt102_parse_char (Context * c, int ch)
vt102_crt_update (c);
-
+return err;
}
+
void
vt102_send (Context * c, uint8_t key)