mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Added IRC::command function for Perl scripts
This commit is contained in:
@@ -5,6 +5,7 @@ ChangeLog - 2004-10-03
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
|
||||
@@ -540,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, server->name, ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
t_irc_channel *current_channel = NULL;
|
||||
char *channel_modes = "iklmnst";
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
|
||||
if (irc_commands[i].recv_function != NULL)
|
||||
{
|
||||
return_code = (int) (irc_commands[i].recv_function) (server, host, arguments);
|
||||
plugin_event_msg (irc_commands[i].command_name, entire_line);
|
||||
plugin_event_msg (irc_commands[i].command_name, server->name, entire_line);
|
||||
return return_code;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
t_irc_server *irc_servers = NULL;
|
||||
t_irc_server *last_irc_server = NULL;
|
||||
t_irc_server *current_irc_server = NULL;
|
||||
|
||||
t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
|
||||
@@ -686,8 +685,7 @@ server_connect (t_irc_server *server)
|
||||
server->sock4 = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
current_irc_server = server;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -198,9 +198,8 @@ struct t_dcc
|
||||
};
|
||||
|
||||
extern t_irc_command irc_commands[];
|
||||
extern t_irc_server *irc_servers, *current_irc_server;
|
||||
extern t_irc_server *irc_servers;
|
||||
extern t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
extern t_irc_channel *current_channel;
|
||||
extern t_dcc *dcc_list;
|
||||
extern char *dcc_status_string[6];
|
||||
extern char *channel_modes;
|
||||
|
||||
+86
-13
@@ -226,6 +226,55 @@ static XS (XS_IRC_print_infobar)
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::command: send command to server
|
||||
*/
|
||||
|
||||
static XS (XS_IRC_command)
|
||||
{
|
||||
int integer;
|
||||
char *server, *command, *command2;
|
||||
t_irc_server *ptr_server;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) cv;
|
||||
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
command = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::command Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
command = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (ptr_server)
|
||||
{
|
||||
command2 = (char *) malloc (strlen (command) + 8);
|
||||
strcpy (command2, command);
|
||||
if (!strstr (command2, "\r\n"))
|
||||
strcat (command2, "\r\n");
|
||||
server_sendf (ptr_server, command2);
|
||||
free (command2);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::add_message_handler: add handler for messages (privmsg, ...)
|
||||
*/
|
||||
@@ -284,17 +333,37 @@ static XS (XS_IRC_add_command_handler)
|
||||
|
||||
static XS (XS_IRC_get_info)
|
||||
{
|
||||
char *arg, *info = NULL;
|
||||
char *arg, *info = NULL, *server;
|
||||
t_irc_server *ptr_server;
|
||||
int integer;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) items;
|
||||
(void) cv;
|
||||
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
arg = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::get_info Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
arg = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (arg)
|
||||
if (ptr_server && arg)
|
||||
{
|
||||
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
@@ -303,7 +372,8 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
{
|
||||
info = current_irc_server->nick;
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
@@ -312,7 +382,8 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
{
|
||||
info = current_irc_server->name;
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
@@ -320,7 +391,7 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
{
|
||||
XST_mIV (0, current_irc_server->is_away);
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
@@ -346,6 +417,7 @@ xs_init (pTHX)
|
||||
newXS ("IRC::print", XS_IRC_print, "IRC");
|
||||
newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
|
||||
newXS ("IRC::print_infobar", XS_IRC_print_infobar, "IRC");
|
||||
newXS ("IRC::command", XS_IRC_command, "IRC");
|
||||
newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
|
||||
newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
|
||||
newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
|
||||
@@ -424,9 +496,9 @@ wee_perl_search (char *name)
|
||||
*/
|
||||
|
||||
int
|
||||
wee_perl_exec (char *function, char *arguments)
|
||||
wee_perl_exec (char *function, char *server, char *arguments)
|
||||
{
|
||||
char *argv[2];
|
||||
char *argv[3];
|
||||
int count, return_code;
|
||||
SV *sv;
|
||||
|
||||
@@ -435,8 +507,9 @@ wee_perl_exec (char *function, char *arguments)
|
||||
ENTER;
|
||||
SAVETMPS;
|
||||
PUSHMARK(sp);
|
||||
argv[0] = arguments;
|
||||
argv[1] = NULL;
|
||||
argv[0] = server;
|
||||
argv[1] = arguments;
|
||||
argv[2] = NULL;
|
||||
count = perl_call_argv (function, G_EVAL | G_SCALAR, argv);
|
||||
SPAGAIN;
|
||||
|
||||
@@ -482,7 +555,7 @@ wee_perl_load (char *filename)
|
||||
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
|
||||
irc_display_prefix (NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -535,7 +608,7 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
|
||||
|
||||
/* call shutdown callback function */
|
||||
if (ptr_perl_script->shutdown_func[0])
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "");
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "", "");
|
||||
wee_perl_script_free (ptr_perl_script);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
extern void wee_perl_init ();
|
||||
extern t_plugin_script *wee_perl_search (char *);
|
||||
extern int wee_perl_exec (char *, char *);
|
||||
extern int wee_perl_exec (char *, char *, char *);
|
||||
extern int wee_perl_load (char *);
|
||||
extern void wee_perl_unload (t_plugin_script *);
|
||||
extern void wee_perl_unload_all ();
|
||||
|
||||
@@ -273,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_event_msg (char *irc_command, char *arguments)
|
||||
plugin_event_msg (char *irc_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -285,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_exec_command (char *user_command, char *arguments)
|
||||
plugin_exec_command (char *user_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -313,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
|
||||
/* command executed */
|
||||
|
||||
@@ -68,8 +68,8 @@ extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
|
||||
int, char *, char *);
|
||||
extern void plugin_handler_free_all_type (t_plugin_handler **,
|
||||
t_plugin_handler **, int);
|
||||
extern void plugin_event_msg (char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *);
|
||||
extern void plugin_event_msg (char *, char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
|
||||
extern void plugin_end ();
|
||||
|
||||
#endif /* plugins.h */
|
||||
|
||||
@@ -5,6 +5,7 @@ ChangeLog - 2004-10-03
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
|
||||
@@ -540,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, server->name, ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
t_irc_channel *current_channel = NULL;
|
||||
char *channel_modes = "iklmnst";
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
|
||||
if (irc_commands[i].recv_function != NULL)
|
||||
{
|
||||
return_code = (int) (irc_commands[i].recv_function) (server, host, arguments);
|
||||
plugin_event_msg (irc_commands[i].command_name, entire_line);
|
||||
plugin_event_msg (irc_commands[i].command_name, server->name, entire_line);
|
||||
return return_code;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
t_irc_server *irc_servers = NULL;
|
||||
t_irc_server *last_irc_server = NULL;
|
||||
t_irc_server *current_irc_server = NULL;
|
||||
|
||||
t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
|
||||
@@ -686,8 +685,7 @@ server_connect (t_irc_server *server)
|
||||
server->sock4 = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
current_irc_server = server;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,9 +198,8 @@ struct t_dcc
|
||||
};
|
||||
|
||||
extern t_irc_command irc_commands[];
|
||||
extern t_irc_server *irc_servers, *current_irc_server;
|
||||
extern t_irc_server *irc_servers;
|
||||
extern t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
extern t_irc_channel *current_channel;
|
||||
extern t_dcc *dcc_list;
|
||||
extern char *dcc_status_string[6];
|
||||
extern char *channel_modes;
|
||||
|
||||
@@ -226,6 +226,55 @@ static XS (XS_IRC_print_infobar)
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::command: send command to server
|
||||
*/
|
||||
|
||||
static XS (XS_IRC_command)
|
||||
{
|
||||
int integer;
|
||||
char *server, *command, *command2;
|
||||
t_irc_server *ptr_server;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) cv;
|
||||
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
command = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::command Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
command = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (ptr_server)
|
||||
{
|
||||
command2 = (char *) malloc (strlen (command) + 8);
|
||||
strcpy (command2, command);
|
||||
if (!strstr (command2, "\r\n"))
|
||||
strcat (command2, "\r\n");
|
||||
server_sendf (ptr_server, command2);
|
||||
free (command2);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::add_message_handler: add handler for messages (privmsg, ...)
|
||||
*/
|
||||
@@ -284,17 +333,37 @@ static XS (XS_IRC_add_command_handler)
|
||||
|
||||
static XS (XS_IRC_get_info)
|
||||
{
|
||||
char *arg, *info = NULL;
|
||||
char *arg, *info = NULL, *server;
|
||||
t_irc_server *ptr_server;
|
||||
int integer;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) items;
|
||||
(void) cv;
|
||||
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
arg = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::get_info Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
arg = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (arg)
|
||||
if (ptr_server && arg)
|
||||
{
|
||||
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
@@ -303,7 +372,8 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
{
|
||||
info = current_irc_server->nick;
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
@@ -312,7 +382,8 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
{
|
||||
info = current_irc_server->name;
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
@@ -320,7 +391,7 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
{
|
||||
XST_mIV (0, current_irc_server->is_away);
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
@@ -346,6 +417,7 @@ xs_init (pTHX)
|
||||
newXS ("IRC::print", XS_IRC_print, "IRC");
|
||||
newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
|
||||
newXS ("IRC::print_infobar", XS_IRC_print_infobar, "IRC");
|
||||
newXS ("IRC::command", XS_IRC_command, "IRC");
|
||||
newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
|
||||
newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
|
||||
newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
|
||||
@@ -424,9 +496,9 @@ wee_perl_search (char *name)
|
||||
*/
|
||||
|
||||
int
|
||||
wee_perl_exec (char *function, char *arguments)
|
||||
wee_perl_exec (char *function, char *server, char *arguments)
|
||||
{
|
||||
char *argv[2];
|
||||
char *argv[3];
|
||||
int count, return_code;
|
||||
SV *sv;
|
||||
|
||||
@@ -435,8 +507,9 @@ wee_perl_exec (char *function, char *arguments)
|
||||
ENTER;
|
||||
SAVETMPS;
|
||||
PUSHMARK(sp);
|
||||
argv[0] = arguments;
|
||||
argv[1] = NULL;
|
||||
argv[0] = server;
|
||||
argv[1] = arguments;
|
||||
argv[2] = NULL;
|
||||
count = perl_call_argv (function, G_EVAL | G_SCALAR, argv);
|
||||
SPAGAIN;
|
||||
|
||||
@@ -482,7 +555,7 @@ wee_perl_load (char *filename)
|
||||
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
|
||||
irc_display_prefix (NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -535,7 +608,7 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
|
||||
|
||||
/* call shutdown callback function */
|
||||
if (ptr_perl_script->shutdown_func[0])
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "");
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "", "");
|
||||
wee_perl_script_free (ptr_perl_script);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
extern void wee_perl_init ();
|
||||
extern t_plugin_script *wee_perl_search (char *);
|
||||
extern int wee_perl_exec (char *, char *);
|
||||
extern int wee_perl_exec (char *, char *, char *);
|
||||
extern int wee_perl_load (char *);
|
||||
extern void wee_perl_unload (t_plugin_script *);
|
||||
extern void wee_perl_unload_all ();
|
||||
|
||||
@@ -273,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_event_msg (char *irc_command, char *arguments)
|
||||
plugin_event_msg (char *irc_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -285,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_exec_command (char *user_command, char *arguments)
|
||||
plugin_exec_command (char *user_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -313,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
|
||||
/* command executed */
|
||||
|
||||
@@ -68,8 +68,8 @@ extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
|
||||
int, char *, char *);
|
||||
extern void plugin_handler_free_all_type (t_plugin_handler **,
|
||||
t_plugin_handler **, int);
|
||||
extern void plugin_event_msg (char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *);
|
||||
extern void plugin_event_msg (char *, char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
|
||||
extern void plugin_end ();
|
||||
|
||||
#endif /* plugins.h */
|
||||
|
||||
Reference in New Issue
Block a user