mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Add new functions in plugin API (hashtable_get_string, hook_info_hashtable, info_get_hashtable), add IRC info_hashtable "irc_parse_message"
Note: tcl >= 8.5 is now required (for tcl plugin).
This commit is contained in:
@@ -1064,7 +1064,8 @@ weechat_python_api_config_reload_cb (void *data,
|
||||
struct t_config_file *config_file)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1073,12 +1074,11 @@ weechat_python_api_config_reload_cb (void *data,
|
||||
{
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (config_file);
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_READ_FILE_NOT_FOUND;
|
||||
@@ -1146,7 +1146,8 @@ weechat_python_api_config_read_cb (void *data,
|
||||
const char *option_name, const char *value)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[6], empty_arg[1] = { '\0' };
|
||||
void *python_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1158,12 +1159,11 @@ weechat_python_api_config_read_cb (void *data,
|
||||
python_argv[2] = script_ptr2str (section);
|
||||
python_argv[3] = (option_name) ? (char *)option_name : empty_arg;
|
||||
python_argv[4] = (value) ? (char *)value : empty_arg;
|
||||
python_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
|
||||
@@ -1193,7 +1193,8 @@ weechat_python_api_config_section_write_cb (void *data,
|
||||
const char *section_name)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1203,12 +1204,11 @@ weechat_python_api_config_section_write_cb (void *data,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (config_file);
|
||||
python_argv[2] = (section_name) ? (char *)section_name : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_WRITE_ERROR;
|
||||
@@ -1237,7 +1237,8 @@ weechat_python_api_config_section_write_default_cb (void *data,
|
||||
const char *section_name)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1247,12 +1248,11 @@ weechat_python_api_config_section_write_default_cb (void *data,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (config_file);
|
||||
python_argv[2] = (section_name) ? (char *)section_name : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_WRITE_ERROR;
|
||||
@@ -1282,7 +1282,8 @@ weechat_python_api_config_section_create_option_cb (void *data,
|
||||
const char *value)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[6], empty_arg[1] = { '\0' };
|
||||
void *python_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1294,12 +1295,11 @@ weechat_python_api_config_section_create_option_cb (void *data,
|
||||
python_argv[2] = script_ptr2str (section);
|
||||
python_argv[3] = (option_name) ? (char *)option_name : empty_arg;
|
||||
python_argv[4] = (value) ? (char *)value : empty_arg;
|
||||
python_argv[5] = NULL;
|
||||
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
|
||||
@@ -1330,7 +1330,8 @@ weechat_python_api_config_section_delete_option_cb (void *data,
|
||||
struct t_config_option *option)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[5], empty_arg[1] = { '\0' };
|
||||
void *python_argv[4];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1341,12 +1342,11 @@ weechat_python_api_config_section_delete_option_cb (void *data,
|
||||
python_argv[1] = script_ptr2str (config_file);
|
||||
python_argv[2] = script_ptr2str (section);
|
||||
python_argv[3] = script_ptr2str (option);
|
||||
python_argv[4] = NULL;
|
||||
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_CONFIG_OPTION_UNSET_ERROR;
|
||||
@@ -1488,7 +1488,8 @@ weechat_python_api_config_option_check_value_cb (void *data,
|
||||
const char *value)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1498,12 +1499,11 @@ weechat_python_api_config_option_check_value_cb (void *data,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (option);
|
||||
python_argv[2] = (value) ? (char *)value : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = 0;
|
||||
@@ -1530,7 +1530,8 @@ weechat_python_api_config_option_change_cb (void *data,
|
||||
struct t_config_option *option)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1539,12 +1540,11 @@ weechat_python_api_config_option_change_cb (void *data,
|
||||
{
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (option);
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
|
||||
if (python_argv[1])
|
||||
free (python_argv[1]);
|
||||
@@ -1563,7 +1563,8 @@ weechat_python_api_config_option_delete_cb (void *data,
|
||||
struct t_config_option *option)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1572,12 +1573,11 @@ weechat_python_api_config_option_delete_cb (void *data,
|
||||
{
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (option);
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
|
||||
if (python_argv[1])
|
||||
free (python_argv[1]);
|
||||
@@ -2903,7 +2903,8 @@ weechat_python_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
|
||||
int argc, char **argv, char **argv_eol)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -2916,12 +2917,11 @@ weechat_python_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (buffer);
|
||||
python_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -2997,7 +2997,8 @@ weechat_python_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
|
||||
const char *command)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3007,12 +3008,11 @@ weechat_python_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (buffer);
|
||||
python_argv[2] = (command) ? (char *)command : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3077,7 +3077,8 @@ int
|
||||
weechat_python_api_hook_timer_cb (void *data, int remaining_calls)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], str_remaining_calls[32], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char str_remaining_calls[32], empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3089,12 +3090,11 @@ weechat_python_api_hook_timer_cb (void *data, int remaining_calls)
|
||||
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = str_remaining_calls;
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3163,7 +3163,8 @@ int
|
||||
weechat_python_api_hook_fd_cb (void *data, int fd)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], str_fd[32], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3174,12 +3175,11 @@ weechat_python_api_hook_fd_cb (void *data, int fd)
|
||||
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = str_fd;
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3252,7 +3252,8 @@ weechat_python_api_hook_process_cb (void *data,
|
||||
const char *out, const char *err)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[6], str_rc[32], empty_arg[1] = { '\0' };
|
||||
void *python_argv[5];
|
||||
char str_rc[32], empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3266,12 +3267,11 @@ weechat_python_api_hook_process_cb (void *data,
|
||||
python_argv[2] = str_rc;
|
||||
python_argv[3] = (out) ? (char *)out : empty_arg;
|
||||
python_argv[4] = (err) ? (char *)err : empty_arg;
|
||||
python_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3338,8 +3338,8 @@ weechat_python_api_hook_connect_cb (void *data, int status, int gnutls_rc,
|
||||
const char *error, const char *ip_address)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[6], str_status[32], str_gnutls_rc[32];
|
||||
char empty_arg[1] = { '\0' };
|
||||
void *python_argv[5];
|
||||
char str_status[32], str_gnutls_rc[32], empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3354,12 +3354,11 @@ weechat_python_api_hook_connect_cb (void *data, int status, int gnutls_rc,
|
||||
python_argv[2] = str_gnutls_rc;
|
||||
python_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
python_argv[4] = (error) ? (char *)error : empty_arg;
|
||||
python_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3441,7 +3440,8 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
|
||||
const char *prefix, const char *message)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[9], empty_arg[1] = { '\0' };
|
||||
void *python_argv[8];
|
||||
char empty_arg[1] = { '\0' };
|
||||
static char timebuffer[64];
|
||||
int *rc, ret;
|
||||
|
||||
@@ -3464,12 +3464,11 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
|
||||
python_argv[5] = (highlight) ? strdup ("1") : strdup ("0");
|
||||
python_argv[6] = (prefix) ? (char *)prefix : empty_arg;
|
||||
python_argv[7] = (message) ? (char *)message : empty_arg;
|
||||
python_argv[8] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssssssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3549,7 +3548,8 @@ weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *t
|
||||
void *signal_data)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
static char value_str[64];
|
||||
int *rc, ret, free_needed;
|
||||
|
||||
@@ -3577,12 +3577,11 @@ weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *t
|
||||
}
|
||||
else
|
||||
python_argv[2] = empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3701,7 +3700,8 @@ int
|
||||
weechat_python_api_hook_config_cb (void *data, const char *option, const char *value)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3711,12 +3711,11 @@ weechat_python_api_hook_config_cb (void *data, const char *option, const char *v
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = (option) ? (char *)option : empty_arg;
|
||||
python_argv[2] = (value) ? (char *)value : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3781,7 +3780,8 @@ weechat_python_api_hook_completion_cb (void *data, const char *completion_item,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[5], empty_arg[1] = { '\0' };
|
||||
void *python_argv[4];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3792,12 +3792,11 @@ weechat_python_api_hook_completion_cb (void *data, const char *completion_item,
|
||||
python_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
|
||||
python_argv[2] = script_ptr2str (buffer);
|
||||
python_argv[3] = script_ptr2str (completion);
|
||||
python_argv[4] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -3907,7 +3906,8 @@ weechat_python_api_hook_modifier_cb (void *data, const char *modifier,
|
||||
const char *modifier_data, const char *string)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[5], empty_arg[1] = { '\0' };
|
||||
void *python_argv[4];
|
||||
char empty_arg[1] = { '\0' };
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
|
||||
@@ -3917,12 +3917,11 @@ weechat_python_api_hook_modifier_cb (void *data, const char *modifier,
|
||||
python_argv[1] = (modifier) ? (char *)modifier : empty_arg;
|
||||
python_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
|
||||
python_argv[3] = (string) ? (char *)string : empty_arg;
|
||||
python_argv[4] = NULL;
|
||||
|
||||
return (char *)weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssss", python_argv);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -4010,7 +4009,8 @@ weechat_python_api_hook_info_cb (void *data, const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
|
||||
@@ -4019,12 +4019,11 @@ weechat_python_api_hook_info_cb (void *data, const char *info_name,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = (info_name) ? (char *)info_name : empty_arg;
|
||||
python_argv[2] = (arguments) ? (char *)arguments : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
return (const char *)weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -4074,6 +4073,89 @@ weechat_python_api_hook_info (PyObject *self, PyObject *args)
|
||||
PYTHON_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_hook_info_hashtable_cb: callback for info_hashtable hooked
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
weechat_python_api_hook_info_hashtable_cb (void *data, const char *info_name,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
struct t_hashtable *ret_hashtable;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
|
||||
if (script_callback && script_callback->function && script_callback->function[0])
|
||||
{
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = (info_name) ? (char *)info_name : empty_arg;
|
||||
python_argv[2] = weechat_python_hashtable_to_dict (hashtable);
|
||||
|
||||
ret_hashtable = weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_HASHTABLE,
|
||||
script_callback->function,
|
||||
"ssO", python_argv);
|
||||
|
||||
if (python_argv[2])
|
||||
Py_XDECREF(python_argv[2]);
|
||||
|
||||
return ret_hashtable;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_hook_info_hashtable: hook an info_hashtable
|
||||
*/
|
||||
|
||||
static PyObject *
|
||||
weechat_python_api_hook_info_hashtable (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *info_name, *description, *args_description, *output_description;
|
||||
char *function, *data, *result;
|
||||
PyObject *object;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) self;
|
||||
|
||||
if (!python_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "hook_info_hashtable");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
info_name = NULL;
|
||||
description = NULL;
|
||||
args_description = NULL;
|
||||
output_description = NULL;
|
||||
function = NULL;
|
||||
data = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "ssssss", &info_name, &description,
|
||||
&args_description, &output_description,
|
||||
&function, &data))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "hook_info_hashtable");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str(script_api_hook_info_hashtable (weechat_python_plugin,
|
||||
python_current_script,
|
||||
info_name,
|
||||
description,
|
||||
args_description,
|
||||
output_description,
|
||||
&weechat_python_api_hook_info_hashtable_cb,
|
||||
function,
|
||||
data));
|
||||
|
||||
PYTHON_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_hook_infolist_cb: callback for infolist hooked
|
||||
*/
|
||||
@@ -4083,7 +4165,8 @@ weechat_python_api_hook_infolist_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[5], empty_arg[1] = { '\0' };
|
||||
void *python_argv[4];
|
||||
char empty_arg[1] = { '\0' };
|
||||
struct t_infolist *result;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -4094,12 +4177,11 @@ weechat_python_api_hook_infolist_cb (void *data, const char *infolist_name,
|
||||
python_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
|
||||
python_argv[2] = script_ptr2str (pointer);
|
||||
python_argv[3] = (arguments) ? (char *)arguments : empty_arg;
|
||||
python_argv[4] = NULL;
|
||||
|
||||
result = (struct t_infolist *)weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssss", python_argv);
|
||||
|
||||
if (python_argv[2])
|
||||
free (python_argv[2]);
|
||||
@@ -4222,7 +4304,8 @@ weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer
|
||||
const char *input_data)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' };
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -4232,12 +4315,11 @@ weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (buffer);
|
||||
python_argv[2] = (input_data) ? (char *)input_data : empty_arg;
|
||||
python_argv[3] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
else
|
||||
@@ -4262,7 +4344,8 @@ int
|
||||
weechat_python_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3], empty_arg[1] = { '\0' };
|
||||
void *python_argv[2];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -4271,12 +4354,11 @@ weechat_python_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
{
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (buffer);
|
||||
python_argv[2] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ss", python_argv);
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
else
|
||||
@@ -5177,7 +5259,8 @@ weechat_python_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[4], empty_arg[1] = { '\0' }, *ret;
|
||||
void *python_argv[3];
|
||||
char empty_arg[1] = { '\0' }, *ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
|
||||
@@ -5186,12 +5269,11 @@ weechat_python_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = script_ptr2str (item);
|
||||
python_argv[2] = script_ptr2str (window);
|
||||
python_argv[3] = NULL;
|
||||
|
||||
ret = (char *)weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"sss", python_argv);
|
||||
|
||||
if (python_argv[1])
|
||||
free (python_argv[1]);
|
||||
@@ -5537,7 +5619,7 @@ weechat_python_api_command (PyObject *self, PyObject *args)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_info_get: get info about WeeChat
|
||||
* weechat_python_api_info_get: get info (as string)
|
||||
*/
|
||||
|
||||
static PyObject *
|
||||
@@ -5568,6 +5650,47 @@ weechat_python_api_info_get (PyObject *self, PyObject *args)
|
||||
PYTHON_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_info_get_hashtable: get info (as hashtable)
|
||||
*/
|
||||
|
||||
static PyObject *
|
||||
weechat_python_api_info_get_hashtable (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *info_name;
|
||||
struct t_hashtable *hashtable, *result_hashtable;
|
||||
PyObject *dict, *result_dict;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) self;
|
||||
|
||||
if (!python_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "info_get_hashtable");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
info_name = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "sO", &info_name, &dict))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "info_get_hashtable");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
}
|
||||
hashtable = weechat_python_dict_to_hashtable (dict,
|
||||
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
|
||||
|
||||
result_hashtable = weechat_info_get_hashtable (info_name, hashtable);
|
||||
result_dict = weechat_python_hashtable_to_dict (result_hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
return result_dict;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_infolist_new: create new infolist
|
||||
*/
|
||||
@@ -6158,7 +6281,8 @@ weechat_python_api_upgrade_read_cb (void *data,
|
||||
struct t_infolist *infolist)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[5], empty_arg[1] = { '\0' }, str_object_id[32];
|
||||
void *python_argv[4];
|
||||
char empty_arg[1] = { '\0' }, str_object_id[32];
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -6171,12 +6295,11 @@ weechat_python_api_upgrade_read_cb (void *data,
|
||||
python_argv[1] = script_ptr2str (upgrade_file);
|
||||
python_argv[2] = str_object_id;
|
||||
python_argv[3] = script_ptr2str (infolist);
|
||||
python_argv[4] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script_callback->function,
|
||||
python_argv);
|
||||
"ssss", python_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
@@ -6357,6 +6480,7 @@ PyMethodDef weechat_python_funcs[] =
|
||||
{ "hook_modifier", &weechat_python_api_hook_modifier, METH_VARARGS, "" },
|
||||
{ "hook_modifier_exec", &weechat_python_api_hook_modifier_exec, METH_VARARGS, "" },
|
||||
{ "hook_info", &weechat_python_api_hook_info, METH_VARARGS, "" },
|
||||
{ "hook_info_hashtable", &weechat_python_api_hook_info_hashtable, METH_VARARGS, "" },
|
||||
{ "hook_infolist", &weechat_python_api_hook_infolist, METH_VARARGS, "" },
|
||||
{ "unhook", &weechat_python_api_unhook, METH_VARARGS, "" },
|
||||
{ "unhook_all", &weechat_python_api_unhook_all, METH_VARARGS, "" },
|
||||
@@ -6396,6 +6520,7 @@ PyMethodDef weechat_python_funcs[] =
|
||||
{ "bar_remove", &weechat_python_api_bar_remove, METH_VARARGS, "" },
|
||||
{ "command", &weechat_python_api_command, METH_VARARGS, "" },
|
||||
{ "info_get", &weechat_python_api_info_get, METH_VARARGS, "" },
|
||||
{ "info_get_hashtable", &weechat_python_api_info_get_hashtable, METH_VARARGS, "" },
|
||||
{ "infolist_new", &weechat_python_api_infolist_new, METH_VARARGS, "" },
|
||||
{ "infolist_new_item", &weechat_python_api_infolist_new_item, METH_VARARGS, "" },
|
||||
{ "infolist_new_var_integer", &weechat_python_api_infolist_new_var_integer, METH_VARARGS, "" },
|
||||
|
||||
@@ -68,12 +68,100 @@ char python_buffer_output[128];
|
||||
|
||||
|
||||
/*
|
||||
* weechat_python_exec: execute a Python script
|
||||
* weechat_python_hashtable_map_cb: callback called for each key/value in a
|
||||
* hashtable
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_python_hashtable_map_cb (void *data,
|
||||
struct t_hashtable *hashtable,
|
||||
const void *key,
|
||||
const void *value)
|
||||
{
|
||||
PyObject *dict, *dict_key, *dict_value;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) hashtable;
|
||||
|
||||
dict = (PyObject *)data;
|
||||
|
||||
dict_key = Py_BuildValue ("s", (const char *)key);
|
||||
dict_value = Py_BuildValue ("s", (const char *)value);
|
||||
|
||||
PyDict_SetItem (dict, dict_key, dict_value);
|
||||
|
||||
Py_DECREF (dict_key);
|
||||
Py_DECREF (dict_value);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_hashtable_to_dict: get python dictionary with a WeeChat
|
||||
* hashtable
|
||||
*/
|
||||
|
||||
PyObject *
|
||||
weechat_python_hashtable_to_dict (struct t_hashtable *hashtable)
|
||||
{
|
||||
PyObject *dict;
|
||||
|
||||
dict = PyDict_New ();
|
||||
if (!dict)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
weechat_hashtable_map (hashtable,
|
||||
&weechat_python_hashtable_map_cb,
|
||||
dict);
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_dict_to_hashtable: get WeeChat hashtable with python
|
||||
* dictionary
|
||||
* Hashtable returned has type string for
|
||||
* both keys and values
|
||||
* Note: hashtable has to be released after
|
||||
* use with call to weechat_hashtable_free()
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
weechat_python_dict_to_hashtable (PyObject *dict, int hashtable_size)
|
||||
{
|
||||
struct t_hashtable *hashtable;
|
||||
PyObject *key, *value;
|
||||
Py_ssize_t pos;
|
||||
char *str_key, *str_value;
|
||||
|
||||
hashtable = weechat_hashtable_new (hashtable_size,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
if (!hashtable)
|
||||
return NULL;
|
||||
|
||||
pos = 0;
|
||||
while (PyDict_Next (dict, &pos, &key, &value))
|
||||
{
|
||||
str_key = PyString_AsString (key);
|
||||
str_value = PyString_AsString (value);
|
||||
weechat_hashtable_set (hashtable, (void *)str_key, (void *)str_value);
|
||||
}
|
||||
|
||||
return hashtable;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_exec: execute a python function
|
||||
*/
|
||||
|
||||
void *
|
||||
weechat_python_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function, char **argv)
|
||||
int ret_type, const char *function,
|
||||
char *format, void **argv)
|
||||
{
|
||||
struct t_plugin_script *old_python_current_script;
|
||||
PyThreadState *old_interpreter;
|
||||
@@ -81,8 +169,8 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
PyObject *evDict;
|
||||
PyObject *evFunc;
|
||||
PyObject *rc;
|
||||
void *ret_value;
|
||||
int *ret_i;
|
||||
void *argv2[16], *ret_value;
|
||||
int i, argc, *ret_int;
|
||||
|
||||
/* PyEval_AcquireLock (); */
|
||||
|
||||
@@ -110,78 +198,28 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
}
|
||||
|
||||
python_current_script = script;
|
||||
|
||||
|
||||
if (argv && argv[0])
|
||||
{
|
||||
if (argv[1])
|
||||
argc = strlen (format);
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
if (argv[2])
|
||||
{
|
||||
if (argv[3])
|
||||
{
|
||||
if (argv[4])
|
||||
{
|
||||
if (argv[5])
|
||||
{
|
||||
if (argv[6])
|
||||
{
|
||||
if (argv[7])
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "ssssssss",
|
||||
argv[0], argv[1],
|
||||
argv[2], argv[3],
|
||||
argv[4], argv[5],
|
||||
argv[6], argv[7]);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "sssssss",
|
||||
argv[0], argv[1],
|
||||
argv[2], argv[3],
|
||||
argv[4], argv[5],
|
||||
argv[6]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "ssssss",
|
||||
argv[0], argv[1],
|
||||
argv[2], argv[3],
|
||||
argv[4], argv[5]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "sssss",
|
||||
argv[0], argv[1],
|
||||
argv[2], argv[3],
|
||||
argv[4]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "ssss", argv[0],
|
||||
argv[1], argv[2], argv[3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "sss", argv[0],
|
||||
argv[1], argv[2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "ss", argv[0], argv[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "s", argv[0]);
|
||||
argv2[i] = (i < argc) ? argv[i] : NULL;
|
||||
}
|
||||
rc = PyObject_CallFunction (evFunc, format,
|
||||
argv2[0], argv2[1],
|
||||
argv2[2], argv2[3],
|
||||
argv2[4], argv2[5],
|
||||
argv2[6], argv2[7],
|
||||
argv2[8], argv2[9],
|
||||
argv2[10], argv2[11],
|
||||
argv2[12], argv2[13],
|
||||
argv2[14], argv2[15]);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, NULL);
|
||||
}
|
||||
|
||||
ret_value = NULL;
|
||||
|
||||
@@ -197,22 +235,26 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
PyErr_Print ();
|
||||
Py_XDECREF(rc);
|
||||
}
|
||||
else if (PyString_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_STRING))
|
||||
else if ((ret_type == WEECHAT_SCRIPT_EXEC_STRING) && (PyString_Check (rc)))
|
||||
{
|
||||
if (PyString_AsString (rc))
|
||||
ret_value = strdup (PyString_AsString(rc));
|
||||
else
|
||||
ret_value = NULL;
|
||||
|
||||
Py_XDECREF(rc);
|
||||
}
|
||||
else if (PyInt_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_INT))
|
||||
else if ((ret_type == WEECHAT_SCRIPT_EXEC_INT) && (PyInt_Check (rc)))
|
||||
{
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = (int) PyInt_AsLong(rc);
|
||||
ret_value = ret_i;
|
||||
|
||||
ret_int = malloc (sizeof (*ret_int));
|
||||
if (ret_int)
|
||||
*ret_int = (int) PyInt_AsLong(rc);
|
||||
ret_value = ret_int;
|
||||
Py_XDECREF(rc);
|
||||
}
|
||||
else if (ret_type == WEECHAT_SCRIPT_EXEC_HASHTABLE)
|
||||
{
|
||||
ret_value = weechat_python_dict_to_hashtable (rc,
|
||||
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
|
||||
Py_XDECREF(rc);
|
||||
}
|
||||
else
|
||||
@@ -241,7 +283,7 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_output : redirection for stdout and stderr
|
||||
* weechat_python_output: redirection for stdout and stderr
|
||||
*/
|
||||
|
||||
static PyObject *
|
||||
@@ -552,7 +594,7 @@ weechat_python_unload (struct t_plugin_script *script)
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func, NULL);
|
||||
script->shutdown_func, NULL, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,11 @@ extern struct t_plugin_script *python_current_script;
|
||||
extern struct t_plugin_script *python_registered_script;
|
||||
extern const char *python_current_script_filename;
|
||||
|
||||
extern PyObject *weechat_python_hashtable_to_dict (struct t_hashtable *hashtable);
|
||||
extern struct t_hashtable *weechat_python_dict_to_hashtable (PyObject *dict,
|
||||
int hashtable_size);
|
||||
extern void *weechat_python_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function,
|
||||
char **argv);
|
||||
char *format, void **argv);
|
||||
|
||||
#endif /* __WEECHAT_PYTHON_H */
|
||||
|
||||
Reference in New Issue
Block a user