Return el_status_t from el_bind_key() and el_bind_key_in_metamap()

The two functions el_bind_key() and el_bind_key_in_metamap() should
not print status message on stderr, but rather return the status of
the key binding operation.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2013-07-08 16:27:55 +02:00
parent 897a98be55
commit c7a6ff9317
2 changed files with 20 additions and 12 deletions

View File

@@ -31,7 +31,12 @@
/* Command status codes. */
typedef enum {
CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal
CSdone = 0, /* OK */
CSeof, /* Error, or EOF */
CSmove,
CSdispatch,
CSstay,
CSsignal
} el_status_t;
/* Editline specific types, despite rl_ prefix. From Heimdal project. */
@@ -52,8 +57,8 @@ extern void el_print_columns(int ac, char **av);
extern el_status_t el_ring_bell(void);
extern el_status_t el_del_char(void);
extern void el_bind_key(int key, el_keymap_func_t function);
extern void el_bind_key_in_metamap(int key, el_keymap_func_t function);
extern el_status_t el_bind_key(int key, el_keymap_func_t function);
extern el_status_t el_bind_key_in_metamap(int key, el_keymap_func_t function);
extern char *rl_complete(char *token, int *match);
extern int rl_list_possib(char *token, char ***av);