From 80750632d0e9d13e88e73826c239f3ca0bd2cfc0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 27 Jul 2014 19:18:00 +0000 Subject: [PATCH] Moving strtokeytype() next to its sister function. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5080 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/global.c | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d2a39fd..3c566f4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2014-07-27 Benno Schulenberg * src/global.c (add_to_sclist): Remove the now unused and unneeded addition ability from this builder function of the shortcut list. + * src/global.c (strtokeytype): Move this to a better place. 2014-07-24 Jordi Mallach * doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix. diff --git a/src/global.c b/src/global.c index 9db4a433..5b2924a0 100644 --- a/src/global.c +++ b/src/global.c @@ -285,21 +285,7 @@ void flip_execute_void(void) { } -/* Set the type of command key based on the string. */ -key_type strtokeytype(const char *str) -{ - if (str[0] == '^') - return CONTROL; - else if (str[0] == 'M') - return META; - else if (str[0] == 'F') - return FKEY; - else - return RAWINPUT; -} - -/* Add a string to the function list struct. - * Does not allow updates, not yet anyway. */ +/* Add a function to the function list. */ void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help, bool blank_after, bool viewok) { @@ -405,6 +391,19 @@ functionptrtype func_from_key(int *kbinput) return NULL; } +/* Return the type of command key based on the given string. */ +key_type strtokeytype(const char *str) +{ + if (str[0] == '^') + return CONTROL; + else if (str[0] == 'M') + return META; + else if (str[0] == 'F') + return FKEY; + else + return RAWINPUT; +} + /* Assign the info to the shortcut struct. * Assumes keystr is already assigned, naturally. */ void assign_keyinfo(sc *s)