Lines Matching refs:el
104 keymacro_init(EditLine *el) in keymacro_init() argument
107 el->el_keymacro.buf = el_malloc(KEY_BUFSIZ * in keymacro_init()
108 sizeof(*el->el_keymacro.buf)); in keymacro_init()
109 if (el->el_keymacro.buf == NULL) in keymacro_init()
111 el->el_keymacro.map = NULL; in keymacro_init()
112 keymacro_reset(el); in keymacro_init()
120 keymacro_end(EditLine *el) in keymacro_end() argument
123 el_free(el->el_keymacro.buf); in keymacro_end()
124 el->el_keymacro.buf = NULL; in keymacro_end()
125 node__free(el->el_keymacro.map); in keymacro_end()
133 keymacro_map_cmd(EditLine *el, int cmd) in keymacro_map_cmd() argument
136 el->el_keymacro.val.cmd = (el_action_t) cmd; in keymacro_map_cmd()
137 return &el->el_keymacro.val; in keymacro_map_cmd()
145 keymacro_map_str(EditLine *el, Char *str) in keymacro_map_str() argument
148 el->el_keymacro.val.str = str; in keymacro_map_str()
149 return &el->el_keymacro.val; in keymacro_map_str()
159 keymacro_reset(EditLine *el) in keymacro_reset() argument
162 node__put(el, el->el_keymacro.map); in keymacro_reset()
163 el->el_keymacro.map = NULL; in keymacro_reset()
177 keymacro_get(EditLine *el, Char *ch, keymacro_value_t *val) in keymacro_get() argument
180 return node_trav(el, el->el_keymacro.map, ch, val); in keymacro_get()
191 keymacro_add(EditLine *el, const Char *key, keymacro_value_t *val, int ntype) in keymacro_add() argument
195 (void) fprintf(el->el_errfile, in keymacro_add()
200 (void) fprintf(el->el_errfile, in keymacro_add()
204 if (el->el_keymacro.map == NULL) in keymacro_add()
206 el->el_keymacro.map = node__get(key[0]); in keymacro_add()
210 (void) node__try(el, el->el_keymacro.map, key, val, ntype); in keymacro_add()
219 keymacro_clear(EditLine *el, el_action_t *map, const Char *in) in keymacro_clear() argument
226 ((map == el->el_map.key && in keymacro_clear()
227 el->el_map.alt[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN) || in keymacro_clear()
228 (map == el->el_map.alt && in keymacro_clear()
229 el->el_map.key[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN))) in keymacro_clear()
230 (void) keymacro_delete(el, in); in keymacro_clear()
239 keymacro_delete(EditLine *el, const Char *key) in keymacro_delete() argument
243 (void) fprintf(el->el_errfile, in keymacro_delete()
247 if (el->el_keymacro.map == NULL) in keymacro_delete()
250 (void) node__delete(el, &el->el_keymacro.map, key); in keymacro_delete()
260 keymacro_print(EditLine *el, const Char *key) in keymacro_print() argument
264 if (el->el_keymacro.map == NULL && *key == 0) in keymacro_print()
267 el->el_keymacro.buf[0] = '"'; in keymacro_print()
268 if (node_lookup(el, key, el->el_keymacro.map, (size_t)1) <= -1) in keymacro_print()
270 (void) fprintf(el->el_errfile, "Unbound extended key \"" FSTR in keymacro_print()
281 node_trav(EditLine *el, keymacro_node_t *ptr, Char *ch, keymacro_value_t *val) in node_trav() argument
288 if (FUN(el,getc)(el, ch) != 1) {/* if EOF or error */ in node_trav() local
293 return node_trav(el, ptr->next, ch, val); in node_trav()
304 return node_trav(el, ptr->sibling, ch, val); in node_trav()
318 node__try(EditLine *el, keymacro_node_t *ptr, const Char *str, in node__try() argument
335 node__put(el, ptr->next); in node__try()
349 EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", in node__try()
364 EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype)); in node__try()
371 (void) node__try(el, ptr->next, str, val, ntype); in node__try()
381 node__delete(EditLine *el, keymacro_node_t **inptr, const Char *str) in node__delete() argument
406 node__put(el, ptr); in node__delete()
409 node__delete(el, &ptr->next, str) == 1) { in node__delete()
417 node__put(el, ptr); in node__delete()
429 node__put(EditLine *el, keymacro_node_t *ptr) in node__put() argument
435 node__put(el, ptr->next); in node__put()
438 node__put(el, ptr->sibling); in node__put()
450 EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ptr->type)); in node__put()
491 node_lookup(EditLine *el, const Char *str, keymacro_node_t *ptr, size_t cnt) in node_lookup() argument
500 (void) node_enum(el, ptr, cnt); in node_lookup()
506 used = ct_visual_char(el->el_keymacro.buf + cnt, in node_lookup()
512 return (node_lookup(el, str + 1, ptr->next, in node_lookup()
518 el->el_keymacro.buf[px] = '"'; in node_lookup()
519 el->el_keymacro.buf[px + 1] = '\0'; in node_lookup()
520 keymacro_kprint(el, el->el_keymacro.buf, in node_lookup()
530 return (node_lookup(el, str, ptr->sibling, in node_lookup()
543 node_enum(EditLine *el, keymacro_node_t *ptr, size_t cnt) in node_enum() argument
548 el->el_keymacro.buf[++cnt] = '"'; in node_enum()
549 el->el_keymacro.buf[++cnt] = '\0'; in node_enum()
550 (void) fprintf(el->el_errfile, in node_enum()
552 (void) fprintf(el->el_errfile, " \"" FSTR "...\"\n", in node_enum()
553 el->el_keymacro.buf); in node_enum()
558 (void) fprintf(el->el_errfile, in node_enum()
564 used = ct_visual_char(el->el_keymacro.buf + cnt, KEY_BUFSIZ - cnt, in node_enum()
568 el->el_keymacro.buf[cnt + (size_t)used ] = '"'; in node_enum()
569 el->el_keymacro.buf[cnt + (size_t)used + 1] = '\0'; in node_enum()
570 keymacro_kprint(el, el->el_keymacro.buf, &ptr->val, ptr->type); in node_enum()
572 (void) node_enum(el, ptr->next, cnt + (size_t)used); in node_enum()
576 (void) node_enum(el, ptr->sibling, cnt); in node_enum()
586 keymacro_kprint(EditLine *el, const Char *key, keymacro_value_t *val, int ntype) in keymacro_kprint() argument
599 (void) fprintf(el->el_outfile, fmt, in keymacro_kprint()
600 ct_encode_string(key, &el->el_scratch), unparsbuf); in keymacro_kprint()
603 for (fp = el->el_map.help; fp->name; fp++) in keymacro_kprint()
607 (void) fprintf(el->el_outfile, fmt, in keymacro_kprint()
608 ct_encode_string(key, &el->el_scratch), unparsbuf); in keymacro_kprint()
613 (void) fprintf(el->el_outfile, in keymacro_kprint()
619 EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype)); in keymacro_kprint()
623 (void) fprintf(el->el_outfile, fmt, ct_encode_string(key, in keymacro_kprint()
624 &el->el_scratch), "no input"); in keymacro_kprint()