diff options
author | Matthew Horan <matt@matthoran.com> | 2019-12-13 10:55:30 -0500 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-12-13 21:30:54 +0100 |
commit | f966329862d92b5feffceaef5b960583461a18b1 (patch) | |
tree | bfc758e56bb72def2b05e3eb57ada1aad493843e /src/plugins | |
parent | 5ae0485404a1a30c83c8ecf18d9466daca0e60a6 (diff) | |
download | weechat-f966329862d92b5feffceaef5b960583461a18b1.zip |
api: add info "weechat_headless"
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/plugin-api-info.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/plugin-api-info.c b/src/plugins/plugin-api-info.c index d0fe9c66f..105d14bee 100644 --- a/src/plugins/plugin-api-info.c +++ b/src/plugins/plugin-api-info.c @@ -316,6 +316,27 @@ plugin_api_info_weechat_upgrading_cb (const void *pointer, void *data, } /* + * 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); |