mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
script: add info "script_languages"
This commit is contained in:
@@ -17,6 +17,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
### Added
|
||||
|
||||
- relay: add option relay.network.unix_socket_permissions ([#2317](https://github.com/weechat/weechat/issues/2317))
|
||||
- script: add info "script_languages"
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -159,6 +159,37 @@ script_info_info_script_loaded_cb (const void *pointer, void *data,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return script info "script_languages".
|
||||
*/
|
||||
|
||||
char *
|
||||
script_info_info_languages_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char **output;
|
||||
int i;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
(void) arguments;
|
||||
|
||||
output = weechat_string_dyn_alloc (256);
|
||||
for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
weechat_string_dyn_concat (output, ",", -1);
|
||||
weechat_string_dyn_concat (output, script_language[i], -1);
|
||||
weechat_string_dyn_concat (output, ":", -1);
|
||||
weechat_string_dyn_concat (output, script_extension[i], -1);
|
||||
}
|
||||
|
||||
return weechat_string_dyn_free (output, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return script infolist "script_script".
|
||||
*/
|
||||
@@ -235,6 +266,11 @@ script_info_init (void)
|
||||
N_("1 if script is loaded"),
|
||||
N_("script name with extension"),
|
||||
&script_info_info_script_loaded_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"script_languages",
|
||||
N_("comma-separated list of plugin:extension with supported languages"),
|
||||
NULL,
|
||||
&script_info_info_languages_cb, NULL, NULL);
|
||||
|
||||
/* infolist hooks */
|
||||
weechat_hook_infolist (
|
||||
|
||||
Reference in New Issue
Block a user