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

api: add info "weechat_headless"

This commit is contained in:
Matthew Horan
2019-12-13 10:55:30 -05:00
committed by Sébastien Helleu
parent 5ae0485404
commit f966329862
7 changed files with 36 additions and 0 deletions
+24
View File
@@ -315,6 +315,27 @@ plugin_api_info_weechat_upgrading_cb (const void *pointer, void *data,
return strdup (value);
}
/*
* Returns WeeChat info "weechat_headless".
*/
char *
plugin_api_info_weechat_headless_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
{
char value[32];
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
(void) arguments;
snprintf (value, sizeof (value), "%d", weechat_headless);
return strdup (value);
}
/*
* Returns WeeChat info "charset_terminal".
*/
@@ -1736,6 +1757,9 @@ plugin_api_info_init ()
hook_info (NULL, "weechat_upgrading",
N_("1 if WeeChat is upgrading (command `/upgrade`)"),
NULL, &plugin_api_info_weechat_upgrading_cb, NULL, NULL);
hook_info (NULL, "weechat_headless",
N_("1 if WeeChat is running headless"),
NULL, &plugin_api_info_weechat_headless_cb, NULL, NULL);
hook_info (NULL, "charset_terminal",
N_("terminal charset"),
NULL, &plugin_api_info_charset_terminal_cb, NULL, NULL);