diff options
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r-- | src/command/cmd_defs.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 100f044e..9669f4b6 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -105,6 +105,8 @@ GHashTable *commands = NULL; +static gboolean _cmd_has_tag(Command *pcmd, const char *const tag); + /* * Command list */ @@ -2226,19 +2228,6 @@ cmd_valid_tag(const char *const str) (g_strcmp0(str, CMD_TAG_PLUGINS) == 0)); } -gboolean -cmd_has_tag(Command *pcmd, const char *const tag) -{ - int i = 0; - for (i = 0; pcmd->help.tags[i] != NULL; i++) { - if (g_strcmp0(tag, pcmd->help.tags[i]) == 0) { - return TRUE; - } - } - - return FALSE; -} - Command* cmd_get(const char *const command) { @@ -2262,7 +2251,7 @@ cmd_get_ordered(const char *const tag) while (g_hash_table_iter_next(&iter, &key, &value)) { Command *pcmd = (Command *)value; if (tag) { - if (cmd_has_tag(pcmd, tag)) { + if (_cmd_has_tag(pcmd, tag)) { ordered_commands = g_list_insert_sorted(ordered_commands, pcmd->cmd, (GCompareFunc)g_strcmp0); } } else { @@ -2273,6 +2262,19 @@ cmd_get_ordered(const char *const tag) return ordered_commands; } +static gboolean +_cmd_has_tag(Command *pcmd, const char *const tag) +{ + int i = 0; + for (i = 0; pcmd->help.tags[i] != NULL; i++) { + if (g_strcmp0(tag, pcmd->help.tags[i]) == 0) { + return TRUE; + } + } + + return FALSE; +} + static int _cmp_command(Command *cmd1, Command *cmd2) { |