Changes in keybinding.c [8a921b5:920201c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
keybinding.c
r8a921b5 r920201c 14 14 int owl_keybinding_init(owl_keybinding *kb, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc) 15 15 { 16 char **ktokens; 17 int nktokens, i; 18 16 19 owl_function_debugmsg("owl_keybinding_init: creating binding for <%s> with desc: <%s>", keyseq, desc); 17 20 if (command && !function_fn) { … … 22 25 return(-1); 23 26 } 24 25 if (owl_keybinding_make_keys(kb, keyseq) != 0) {26 return(-1);27 }28 29 if (command) kb->command = owl_strdup(command);30 kb->function_fn = function_fn;31 if (desc) kb->desc = owl_strdup(desc);32 else kb->desc = NULL;33 return(0);34 }35 36 int owl_keybinding_make_keys(owl_keybinding *kb, const char *keyseq)37 {38 char **ktokens;39 int nktokens, i;40 27 41 28 ktokens = atokenize(keyseq, " ", &nktokens); … … 55 42 } 56 43 kb->len = nktokens; 44 57 45 atokenize_delete(ktokens, nktokens); 46 47 if (command) kb->command = owl_strdup(command); 48 kb->function_fn = function_fn; 49 if (desc) kb->desc = owl_strdup(desc); 50 else kb->desc = NULL; 58 51 return(0); 59 52 }
Note: See TracChangeset
for help on using the changeset viewer.