Lines Matching refs:vt

10 static void do_control(VTerm *vt, unsigned char control)  in do_control()  argument
12 if(vt->parser_callbacks && vt->parser_callbacks->control) in do_control()
13 if((*vt->parser_callbacks->control)(control, vt->cbdata)) in do_control()
19 static void do_string_csi(VTerm *vt, const char *args, size_t arglen, char command) in do_string_csi() argument
99 if(vt->parser_callbacks && vt->parser_callbacks->csi) in do_string_csi()
100 …if((*vt->parser_callbacks->csi)(leaderlen ? leader : NULL, csi_args, argcount, intermedlen ? inter… in do_string_csi()
106 static void append_strbuffer(VTerm *vt, const char *str, size_t len) in append_strbuffer() argument
108 if(len > vt->strbuffer_len - vt->strbuffer_cur) { in append_strbuffer()
109 len = vt->strbuffer_len - vt->strbuffer_cur; in append_strbuffer()
114 strncpy(vt->strbuffer + vt->strbuffer_cur, str, len); in append_strbuffer()
115 vt->strbuffer_cur += len; in append_strbuffer()
119 static size_t do_string(VTerm *vt, const char *str_frag, size_t len) in do_string() argument
121 if(vt->strbuffer_cur) { in do_string()
123 append_strbuffer(vt, str_frag, len); in do_string()
125 str_frag = vt->strbuffer; in do_string()
126 len = vt->strbuffer_cur; in do_string()
133 vt->strbuffer_cur = 0; in do_string()
137 switch(vt->parser_state) { in do_string()
139 if(vt->parser_callbacks && vt->parser_callbacks->text) in do_string()
140 if((eaten = (*vt->parser_callbacks->text)(str_frag, len, vt->cbdata))) in do_string()
150 do_control(vt, str_frag[0] + 0x40); in do_string()
154 if(vt->parser_callbacks && vt->parser_callbacks->escape) in do_string()
155 if((*vt->parser_callbacks->escape)(str_frag, len, vt->cbdata)) in do_string()
162 do_string_csi(vt, str_frag, len - 1, str_frag[len - 1]); in do_string()
166 if(vt->parser_callbacks && vt->parser_callbacks->osc) in do_string()
167 if((*vt->parser_callbacks->osc)(str_frag, len, vt->cbdata)) in do_string()
174 if(vt->parser_callbacks && vt->parser_callbacks->dcs) in do_string()
175 if((*vt->parser_callbacks->dcs)(str_frag, len, vt->cbdata)) in do_string()
190 void vterm_push_bytes(VTerm *vt, const char *bytes, size_t len) in vterm_push_bytes() argument
195 switch(vt->parser_state) { in vterm_push_bytes()
209 #define ENTER_STRING_STATE(st) do { vt->parser_state = st; string_start = bytes + pos + 1; } while(… in vterm_push_bytes()
210 #define ENTER_NORMAL_STATE() do { vt->parser_state = NORMAL; string_start = NULL; } while(0) in vterm_push_bytes()
216 if(vt->parser_state != NORMAL) { in vterm_push_bytes()
217 append_strbuffer(vt, string_start, bytes + pos - string_start); in vterm_push_bytes()
227 if(vt->parser_state == OSC) in vterm_push_bytes()
228 vt->parser_state = ESC_IN_OSC; in vterm_push_bytes()
229 else if(vt->parser_state == DCS) in vterm_push_bytes()
230 vt->parser_state = ESC_IN_DCS; in vterm_push_bytes()
236 (vt->parser_state == OSC || vt->parser_state == DCS)) { in vterm_push_bytes()
240 if(vt->parser_state != NORMAL) in vterm_push_bytes()
241 append_strbuffer(vt, string_start, bytes + pos - string_start); in vterm_push_bytes()
242 do_control(vt, c); in vterm_push_bytes()
243 if(vt->parser_state != NORMAL) in vterm_push_bytes()
249 switch(vt->parser_state) { in vterm_push_bytes()
253 switch(vt->parser_state) { in vterm_push_bytes()
254 case ESC_IN_OSC: vt->parser_state = OSC; break; in vterm_push_bytes()
255 case ESC_IN_DCS: vt->parser_state = DCS; break; in vterm_push_bytes()
258 do_string(vt, string_start, bytes + pos - string_start - 1); in vterm_push_bytes()
262 vt->parser_state = ESC; in vterm_push_bytes()
280 do_string(vt, string_start, bytes + pos - string_start + 1); in vterm_push_bytes()
295 do_string(vt, string_start, bytes + pos - string_start + 1); in vterm_push_bytes()
302 if(c == 0x07 || (c == 0x9c && !vt->mode.utf8)) { in vterm_push_bytes()
303 do_string(vt, string_start, bytes + pos - string_start); in vterm_push_bytes()
309 if(c >= 0x80 && c < 0xa0 && !vt->mode.utf8) { in vterm_push_bytes()
321 do_control(vt, c); in vterm_push_bytes()
326 size_t text_eaten = do_string(vt, bytes + pos, len - pos); in vterm_push_bytes()
342 append_strbuffer(vt, string_start, remaining); in vterm_push_bytes()