MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / keymacro_add

Function keymacro_add

extern/editline/src/keymacro.c:190–212  ·  view source on GitHub ↗

keymacro_add(): * Adds key to the el->el_keymacro.map and associates the value in * val with it. If key is already is in el->el_keymacro.map, the new * code is applied to the existing key. Ntype specifies if code is a * command, an out str or a unix command. */

Source from the content-addressed store, hash-verified

188 * command, an out str or a unix command.
189 */
190protected void
191keymacro_add(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
192{
193
194 if (key[0] == '\0') {
195 (void) fprintf(el->el_errfile,
196 "keymacro_add: Null extended-key not allowed.\n");
197 return;
198 }
199 if (ntype == XK_CMD && val->cmd == ED_SEQUENCE_LEAD_IN) {
200 (void) fprintf(el->el_errfile,
201 "keymacro_add: sequence-lead-in command not allowed\n");
202 return;
203 }
204 if (el->el_keymacro.map == NULL)
205 /* tree is initially empty. Set up new node to match key[0] */
206 el->el_keymacro.map = node__get(key[0]);
207 /* it is properly initialized */
208
209 /* Now recurse through el->el_keymacro.map */
210 (void) node__try(el, el->el_keymacro.map, key, val, ntype);
211 return;
212}
213
214
215/* keymacro_clear():

Callers 5

map_init_metaFunction · 0.85
map_init_emacsFunction · 0.85
map_bindFunction · 0.85
terminal_reset_arrowFunction · 0.85
terminal_bind_arrowFunction · 0.85

Calls 2

node__getFunction · 0.85
node__tryFunction · 0.85

Tested by

no test coverage detected