summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-04-27 22:18:03 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-04-27 22:18:03 +0200
commit2bd8e91b54625a8758d7ed6e272db7c291cafb3b (patch)
tree23cb4619c283994dbfe5be108d9098857cfe9bca /src/gui
parentd3020976d59e5e329c851f104c633427eafe2cf3 (diff)
downloadweechat-2bd8e91b54625a8758d7ed6e272db7c291cafb3b.zip
api: add hdata "completion_word" (issue #1484)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-completion.c24
-rw-r--r--src/gui/gui-completion.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 615785eea..c36ab940a 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -1510,6 +1510,30 @@ gui_completion_hdata_completion_cb (const void *pointer, void *data,
}
/*
+ * Returns hdata for completion word.
+ */
+
+struct t_hdata *
+gui_completion_hdata_completion_word_cb (const void *pointer, void *data,
+ const char *hdata_name)
+{
+ struct t_hdata *hdata;
+
+ /* make C compiler happy */
+ (void) pointer;
+ (void) data;
+
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
+ if (hdata)
+ {
+ HDATA_VAR(struct t_gui_completion_word, word, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion_word, nick_completion, CHAR, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion_word, count, INTEGER, 0, NULL, NULL);
+ }
+ return hdata;
+}
+
+/*
* Prints list of completion words in WeeChat log file (usually for crash dump).
*/
diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h
index 6f5d85ae0..8056d1bf8 100644
--- a/src/gui/gui-completion.h
+++ b/src/gui/gui-completion.h
@@ -96,6 +96,9 @@ extern const char *gui_completion_get_string (struct t_gui_completion *completio
extern struct t_hdata *gui_completion_hdata_completion_cb (const void *pointer,
void *data,
const char *hdata_name);
+extern struct t_hdata *gui_completion_hdata_completion_word_cb (const void *pointer,
+ void *data,
+ const char *hdata_name);
extern void gui_completion_print_log ();
#endif /* WEECHAT_GUI_COMPLETION_H */