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

Function el_editmode

extern/editline/src/el.c:625–648  ·  view source on GitHub ↗

el_editmode() * Set the state of EDIT_DISABLED from the `edit' command. */

Source from the content-addressed store, hash-verified

623 * Set the state of EDIT_DISABLED from the `edit' command.
624 */
625protected int
626/*ARGSUSED*/
627el_editmode(EditLine *el, int argc, const Char **argv)
628{
629 const Char *how;
630
631 if (argv == NULL || argc != 2 || argv[1] == NULL)
632 return -1;
633
634 how = argv[1];
635 if (Strcmp(how, STR("on")) == 0) {
636 el->el_flags &= ~EDIT_DISABLED;
637 tty_rawmode(el);
638 } else if (Strcmp(how, STR("off")) == 0) {
639 tty_cookedmode(el);
640 el->el_flags |= EDIT_DISABLED;
641 }
642 else {
643 (void) fprintf(el->el_errfile, "edit: Bad value `" FSTR "'.\n",
644 how);
645 return -1;
646 }
647 return 0;
648}

Callers

nothing calls this directly

Calls 2

tty_rawmodeFunction · 0.85
tty_cookedmodeFunction · 0.85

Tested by

no test coverage detected