1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

Add function "hook_completion_get_string" in plugin API

This commit is contained in:
Sebastien Helleu
2010-11-09 15:45:14 +01:00
parent 25879ca189
commit 8c129779ac
10 changed files with 224 additions and 6 deletions
+21
View File
@@ -1161,6 +1161,27 @@ gui_completion_search (struct t_gui_completion *completion, int direction,
free (old_word_found);
}
/*
* gui_completion_get_string: get a completion property as string
*/
const char *
gui_completion_get_string (struct t_gui_completion *completion,
const char *property)
{
if (completion)
{
if (string_strcasecmp (property, "base_command") == 0)
return completion->base_command;
else if (string_strcasecmp (property, "base_word") == 0)
return completion->base_word;
else if (string_strcasecmp (property, "args") == 0)
return completion->args;
}
return NULL;
}
/*
* gui_completion_print_log: print completion list in log (usually for crash dump)
*/
+2
View File
@@ -76,6 +76,8 @@ extern void gui_completion_list_add (struct t_gui_completion *completion,
extern void gui_completion_search (struct t_gui_completion *completion,
int direction, const char *data, int size,
int pos);
extern const char *gui_completion_get_string (struct t_gui_completion *completion,
const char *property);
extern void gui_completion_print_log (struct t_gui_completion *completion);
#endif /* __WEECHAT_GUI_COMPLETION_H */