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

Function map_bind

extern/editline/src/map.c:1243–1389  ·  view source on GitHub ↗

map_bind(): * Add/remove/change bindings */

Source from the content-addressed store, hash-verified

1241 * Add/remove/change bindings
1242 */
1243protected int
1244map_bind(EditLine *el, int argc, const Char **argv)
1245{
1246 el_action_t *map;
1247 int ntype, rem;
1248 const Char *p;
1249 Char inbuf[EL_BUFSIZ];
1250 Char outbuf[EL_BUFSIZ];
1251 const Char *in = NULL;
1252 Char *out;
1253 el_bindings_t *bp, *ep;
1254 int cmd;
1255 int key;
1256
1257 if (argv == NULL)
1258 return -1;
1259
1260 map = el->el_map.key;
1261 ntype = XK_CMD;
1262 key = rem = 0;
1263 for (argc = 1; (p = argv[argc]) != NULL; argc++)
1264 if (p[0] == '-')
1265 switch (p[1]) {
1266 case 'a':
1267 map = el->el_map.alt;
1268 break;
1269
1270 case 's':
1271 ntype = XK_STR;
1272 break;
1273#ifdef notyet
1274 case 'c':
1275 ntype = XK_EXE;
1276 break;
1277#endif
1278 case 'k':
1279 key = 1;
1280 break;
1281
1282 case 'r':
1283 rem = 1;
1284 break;
1285
1286 case 'v':
1287 map_init_vi(el);
1288 return 0;
1289
1290 case 'e':
1291 map_init_emacs(el);
1292 return 0;
1293
1294 case 'l':
1295 ep = &el->el_map.help[el->el_map.nfunc];
1296 for (bp = el->el_map.help; bp < ep; bp++)
1297 (void) fprintf(el->el_outfile,
1298 "" FSTR "\n\t" FSTR "\n",
1299 bp->name, bp->description);
1300 return 0;

Callers 2

el_setFunction · 0.85
FUN(el,set)Function · 0.85

Calls 14

map_init_viFunction · 0.85
map_init_emacsFunction · 0.85
map_print_all_keysFunction · 0.85
parse__stringFunction · 0.85
terminal_clear_arrowFunction · 0.85
keymacro_deleteFunction · 0.85
terminal_print_arrowFunction · 0.85
map_print_keyFunction · 0.85
terminal_set_arrowFunction · 0.85
keymacro_map_strFunction · 0.85
keymacro_addFunction · 0.85
parse_cmdFunction · 0.85

Tested by

no test coverage detected