X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fvt102.c;h=35719cadc3e582540945776423b106658485c265;hb=9df8b9cc93fa29a848634af76e71fce6ddda67f0;hp=40bef8eb7deda2d6a9c85e2e935519a3fed5a118;hpb=0ad8b05fb46cbe6263b15f19748fb6aeb91d3c08;p=sympathy.git diff --git a/src/vt102.c b/src/vt102.c index 40bef8e..35719ca 100644 --- a/src/vt102.c +++ b/src/vt102.c @@ -10,6 +10,21 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.18 2008/02/07 01:59:25 james + * *** empty log message *** + * + * Revision 1.17 2008/02/07 01:58:28 james + * *** empty log message *** + * + * Revision 1.16 2008/02/07 01:57:46 james + * *** empty log message *** + * + * Revision 1.15 2008/02/07 00:43:27 james + * *** empty log message *** + * + * Revision 1.14 2008/02/07 00:40:23 james + * *** empty log message *** + * * Revision 1.13 2008/02/07 00:39:59 james * *** empty log message *** * @@ -144,11 +159,6 @@ ESC)0 CTRL-O -ESC7 -ESC8 -ESCH -ESCM -ESC> */ @@ -167,11 +177,10 @@ csi_ender (int c) } static inline int -csi_starter (int c) +scs_starter (int c) { switch (c) { - case '[': case '(': case ')': return 1; @@ -179,6 +188,17 @@ csi_starter (int c) return 0; } +static inline int +csi_starter (int c) +{ + switch (c) + { + case '[': + return 1; + } + return 0; +} + static inline int in_margins (VT102 * v, CRT_Pos p) { @@ -472,8 +492,10 @@ vt102_change_mode (VT102 * v, int private, char *ns, int set) case VT102_PRIVATE_MODE_CURSOR_MODE: if (v->application_keypad_mode) v->private_modes[m] = 0; - fprintf (stderr, "APPLICATION CURSOR MODE %d\n", - v->private_modes[m]); +#if 0 + fprintf (stderr, "APPLICATION CURSOR MODE %d wanted %d\n", + v->private_modes[m],set); +#endif break; case VT102_PRIVATE_MODE_ORIGIN_MODE: vt102_cursor_home (v); @@ -650,6 +672,11 @@ vt102_restore_state (VT102 * v) v->pending_wrap = 0; } +void vt102_scs(VT102 *c,int g,int s) +{ +/*Ignoring charsets*/ +} + void vt102_parse_esc (VT102 * v, int c) { @@ -940,12 +967,20 @@ vt102_parse_char (VT102 * v, int c) p->in_csi++; p->in_escape = 0; } + else if (scs_starter(c)) { + p->in_scs=c; + p->in_escape = 0; + } else { p->in_escape = 0; vt102_parse_esc (v, c); } } + else if (p->in_scs) { + vt102_scs(v,p->in_scs,c); + p->in_scs=0; + } else { @@ -979,7 +1014,13 @@ vt102_parse_char (VT102 * v, int c) vt102_cursor_carriage_return (v); break; /*SO*/ case 14: + /*select G1*/ + /*Ignoring charsets*/ + break; /*SI*/ case 15: + /*select G0*/ + /*Ignoring charsets*/ + break; /*DLE*/ case 16: /*DC1 */ case 17: /*DC2 */ case 18: @@ -1039,6 +1080,7 @@ vt102_parser_reset (VT102_parser * p) p->in_csi = 0; p->in_escape = 0; p->csi_ptr = 0; + p->in_scs=0; } @@ -1047,7 +1089,7 @@ vt102_send (VT102 * v, uint8_t key) { uint8_t c; #if 0 - fprintf(stderr,"vts: %d(%c)\n",key,(key>31)?key:' '); + fprintf (stderr, "vts: %d(%c)\n", key, (key > 31) ? key : ' '); #endif if ((key > 31) && (key < 127)) {