commit e40e6bbf1027d1ce708a93aa5b152d87f94b7f56
parent 2147e161bf7936f5c812266f9922e7d6721e9c71
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 11 Aug 2018 09:51:33 +0200
tweaks: rename a function to better match its counterpart
Also rename its parameter, to describe what it ought to be.
Diffstat:
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1699,13 +1699,13 @@ sc *strtosc(const char *input)
return s;
}
-/* Interpret a menu name and return the corresponding menu flag. */
-int strtomenu(const char *input)
+/* Return the symbol that corresponds to the given menu name. */
+int name_to_menu(const char *name)
{
int index = -1;
while (++index < NUMBER_OF_MENUS)
- if (strcasecmp(input, menunames[index]) == 0)
+ if (strcasecmp(name, menunames[index]) == 0)
return menusymbols[index];
return -1;
diff --git a/src/proto.h b/src/proto.h
@@ -328,9 +328,11 @@ void set_speller_shortcut(void);
#endif
const subnfunc *sctofunc(const sc *s);
const char *flagtostr(int flag);
+#ifdef ENABLE_NANORC
sc *strtosc(const char *input);
-int strtomenu(const char *input);
+int name_to_menu(const char *name);
char *menu_to_name(int menu);
+#endif
#ifdef DEBUG
void thanks_for_all_the_fish(void);
#endif
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -422,7 +422,7 @@ void parse_binding(char *ptr, bool dobind)
}
}
- menu = strtomenu(menuptr);
+ menu = name_to_menu(menuptr);
if (menu < 1) {
rcfile_error(N_("Cannot map name \"%s\" to a menu"), menuptr);
goto free_things;