138 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
139 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
140 |
"\"register\" function"); |
"\"register\" function"); |
141 |
XSRETURN (0); |
XSRETURN_NO; |
142 |
} |
} |
143 |
|
|
144 |
name = SvPV (ST (0), integer); |
name = SvPV (ST (0), integer); |
154 |
"\"%s\" script (another script " |
"\"%s\" script (another script " |
155 |
"already exists with this name)", |
"already exists with this name)", |
156 |
name); |
name); |
157 |
XSRETURN (0); |
XSRETURN_NO; |
158 |
} |
} |
159 |
|
|
160 |
/* register script */ |
/* register script */ |
176 |
"Perl error: unable to load script " |
"Perl error: unable to load script " |
177 |
"\"%s\" (not enough memory)", |
"\"%s\" (not enough memory)", |
178 |
name); |
name); |
179 |
XSRETURN (0); |
XSRETURN_NO; |
180 |
} |
} |
181 |
|
|
182 |
XSRETURN (1); |
XSRETURN_YES; |
183 |
} |
} |
184 |
|
|
185 |
/* |
/* |
200 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
201 |
"Perl error: unable to print message, " |
"Perl error: unable to print message, " |
202 |
"script not initialized"); |
"script not initialized"); |
203 |
XSRETURN (0); |
XSRETURN_NO; |
204 |
} |
} |
205 |
|
|
206 |
if ((items < 1) || (items > 3)) |
if ((items < 1) || (items > 3)) |
208 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
209 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
210 |
"\"print\" function"); |
"\"print\" function"); |
211 |
XSRETURN (0); |
XSRETURN_NO; |
212 |
} |
} |
213 |
|
|
214 |
channel_name = NULL; |
channel_name = NULL; |
226 |
server_name, channel_name, |
server_name, channel_name, |
227 |
"%s", message); |
"%s", message); |
228 |
|
|
229 |
XSRETURN (1); |
XSRETURN_YES; |
230 |
} |
} |
231 |
|
|
232 |
/* |
/* |
246 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
247 |
"Perl error: unable to print infobar message, " |
"Perl error: unable to print infobar message, " |
248 |
"script not initialized"); |
"script not initialized"); |
249 |
XSRETURN (0); |
XSRETURN_NO; |
250 |
} |
} |
251 |
|
|
252 |
if (items != 2) |
if (items != 2) |
254 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
255 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
256 |
"\"print_infobar\" function"); |
"\"print_infobar\" function"); |
257 |
XSRETURN (0); |
XSRETURN_NO; |
258 |
} |
} |
259 |
|
|
260 |
perl_plugin->infobar_printf (perl_plugin, |
perl_plugin->infobar_printf (perl_plugin, |
261 |
SvIV (ST (0)), |
SvIV (ST (0)), |
262 |
SvPV (ST (1), integer)); |
SvPV (ST (1), integer)); |
263 |
|
|
264 |
XSRETURN (1); |
XSRETURN_YES; |
265 |
} |
} |
266 |
|
|
267 |
/* |
/* |
282 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
283 |
"Perl error: unable to run command, " |
"Perl error: unable to run command, " |
284 |
"script not initialized"); |
"script not initialized"); |
285 |
XSRETURN (0); |
XSRETURN_NO; |
286 |
} |
} |
287 |
|
|
288 |
if ((items < 1) || (items > 3)) |
if ((items < 1) || (items > 3)) |
290 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
291 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
292 |
"\"command\" function"); |
"\"command\" function"); |
293 |
XSRETURN (0); |
XSRETURN_NO; |
294 |
} |
} |
295 |
|
|
296 |
channel_name = NULL; |
channel_name = NULL; |
307 |
server_name, channel_name, |
server_name, channel_name, |
308 |
SvPV (ST (0), integer)); |
SvPV (ST (0), integer)); |
309 |
|
|
310 |
XSRETURN (1); |
XSRETURN_YES; |
311 |
} |
} |
312 |
|
|
313 |
/* |
/* |
328 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
329 |
"Perl error: unable to add message handler, " |
"Perl error: unable to add message handler, " |
330 |
"script not initialized"); |
"script not initialized"); |
331 |
XSRETURN (0); |
XSRETURN_NO; |
332 |
} |
} |
333 |
|
|
334 |
if (items != 2) |
if (items != 2) |
336 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
337 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
338 |
"\"add_message_handler\" function"); |
"\"add_message_handler\" function"); |
339 |
XSRETURN (0); |
XSRETURN_NO; |
340 |
} |
} |
341 |
|
|
342 |
irc_command = SvPV (ST (0), integer); |
irc_command = SvPV (ST (0), integer); |
345 |
if (perl_plugin->msg_handler_add (perl_plugin, irc_command, |
if (perl_plugin->msg_handler_add (perl_plugin, irc_command, |
346 |
weechat_perl_handler, function, |
weechat_perl_handler, function, |
347 |
(void *)perl_current_script)) |
(void *)perl_current_script)) |
348 |
XSRETURN (1); |
XSRETURN_YES; |
349 |
|
|
350 |
XSRETURN (0); |
XSRETURN_NO; |
351 |
} |
} |
352 |
|
|
353 |
/* |
/* |
368 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
369 |
"Perl error: unable to add command handler, " |
"Perl error: unable to add command handler, " |
370 |
"script not initialized"); |
"script not initialized"); |
371 |
XSRETURN (0); |
XSRETURN_NO; |
372 |
} |
} |
373 |
|
|
374 |
if (items < 2) |
if (items < 2) |
376 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
377 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
378 |
"\"add_command_handler\" function"); |
"\"add_command_handler\" function"); |
379 |
XSRETURN (0); |
XSRETURN_NO; |
380 |
} |
} |
381 |
|
|
382 |
command = SvPV (ST (0), integer); |
command = SvPV (ST (0), integer); |
393 |
weechat_perl_handler, |
weechat_perl_handler, |
394 |
function, |
function, |
395 |
(void *)perl_current_script)) |
(void *)perl_current_script)) |
396 |
XSRETURN (1); |
XSRETURN_YES; |
397 |
|
|
398 |
XSRETURN (0); |
XSRETURN_NO; |
399 |
} |
} |
400 |
|
|
401 |
/* |
/* |
416 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
417 |
"Perl error: unable to remove handler, " |
"Perl error: unable to remove handler, " |
418 |
"script not initialized"); |
"script not initialized"); |
419 |
XSRETURN (0); |
XSRETURN_NO; |
420 |
} |
} |
421 |
|
|
422 |
if (items != 2) |
if (items != 2) |
424 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
425 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
426 |
"\"remove_handler\" function"); |
"\"remove_handler\" function"); |
427 |
XSRETURN (0); |
XSRETURN_NO; |
428 |
} |
} |
429 |
|
|
430 |
command = SvPV (ST (0), integer); |
command = SvPV (ST (0), integer); |
433 |
weechat_script_remove_handler (perl_plugin, perl_current_script, |
weechat_script_remove_handler (perl_plugin, perl_current_script, |
434 |
command, function); |
command, function); |
435 |
|
|
436 |
XSRETURN (1); |
XSRETURN_YES; |
437 |
} |
} |
438 |
|
|
439 |
/* |
/* |
454 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
455 |
"Perl error: unable to get info, " |
"Perl error: unable to get info, " |
456 |
"script not initialized"); |
"script not initialized"); |
457 |
XSRETURN (0); |
XSRETURN_NO; |
458 |
} |
} |
459 |
|
|
460 |
if ((items < 1) || (items > 3)) |
if ((items < 1) || (items > 3)) |
462 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
463 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
464 |
"\"get_info\" function"); |
"\"get_info\" function"); |
465 |
XSRETURN (0); |
XSRETURN_NO; |
466 |
} |
} |
467 |
|
|
468 |
server_name = NULL; |
server_name = NULL; |
482 |
{ |
{ |
483 |
XST_mPV (0, info); |
XST_mPV (0, info); |
484 |
free (info); |
free (info); |
485 |
return; |
XSRETURN (1); |
486 |
} |
} |
487 |
} |
} |
488 |
|
|
489 |
XST_mPV (0, ""); |
XST_mPV (0, ""); |
490 |
|
XSRETURN (1); |
491 |
} |
} |
492 |
|
|
493 |
/* |
/* |
509 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
510 |
"Perl error: unable to get DCC info, " |
"Perl error: unable to get DCC info, " |
511 |
"script not initialized"); |
"script not initialized"); |
512 |
XSRETURN (0); |
XSRETURN_NO; |
513 |
} |
} |
514 |
|
|
515 |
dcc_info = perl_plugin->get_dcc_info (perl_plugin); |
dcc_info = perl_plugin->get_dcc_info (perl_plugin); |
516 |
dcc_count = 0; |
dcc_count = 0; |
517 |
|
|
518 |
if (!dcc_info) |
if (!dcc_info) |
519 |
XSRETURN (0); |
XSRETURN_NO; |
520 |
|
|
521 |
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc) |
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc) |
522 |
{ |
{ |
566 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
567 |
"Perl error: unable to get config option, " |
"Perl error: unable to get config option, " |
568 |
"script not initialized"); |
"script not initialized"); |
569 |
XSRETURN (0); |
XSRETURN_NO; |
570 |
} |
} |
571 |
|
|
572 |
if (items != 1) |
if (items != 1) |
574 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
575 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
576 |
"\"get_config\" function"); |
"\"get_config\" function"); |
577 |
XSRETURN (0); |
XSRETURN_NO; |
578 |
} |
} |
579 |
|
|
580 |
option = SvPV (ST (0), integer); |
option = SvPV (ST (0), integer); |
587 |
{ |
{ |
588 |
XST_mPV (0, return_value); |
XST_mPV (0, return_value); |
589 |
free (return_value); |
free (return_value); |
590 |
return; |
XSRETURN (1); |
591 |
} |
} |
592 |
} |
} |
593 |
|
|
594 |
XST_mPV (0, ""); |
XST_mPV (0, ""); |
595 |
|
XSRETURN (1); |
596 |
} |
} |
597 |
|
|
598 |
/* |
/* |
613 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
614 |
"Perl error: unable to set config option, " |
"Perl error: unable to set config option, " |
615 |
"script not initialized"); |
"script not initialized"); |
616 |
XSRETURN (0); |
XSRETURN_NO; |
617 |
} |
} |
618 |
|
|
619 |
if (items != 2) |
if (items != 2) |
621 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
622 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
623 |
"\"set_config\" function"); |
"\"set_config\" function"); |
624 |
XSRETURN (0); |
XSRETURN_NO; |
625 |
} |
} |
626 |
|
|
627 |
option = SvPV (ST (0), integer); |
option = SvPV (ST (0), integer); |
630 |
if (option && value) |
if (option && value) |
631 |
{ |
{ |
632 |
if (perl_plugin->set_config (perl_plugin, option, value)) |
if (perl_plugin->set_config (perl_plugin, option, value)) |
633 |
XSRETURN (1); |
XSRETURN_YES; |
634 |
} |
} |
635 |
|
|
636 |
XSRETURN (0); |
XSRETURN_NO; |
637 |
} |
} |
638 |
|
|
639 |
/* |
/* |
654 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
655 |
"Perl error: unable to get plugin config option, " |
"Perl error: unable to get plugin config option, " |
656 |
"script not initialized"); |
"script not initialized"); |
657 |
XSRETURN (0); |
XSRETURN_NO; |
658 |
} |
} |
659 |
|
|
660 |
if (items != 1) |
if (items != 1) |
662 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
663 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
664 |
"\"get_plugin_config\" function"); |
"\"get_plugin_config\" function"); |
665 |
XSRETURN (0); |
XSRETURN_NO; |
666 |
} |
} |
667 |
|
|
668 |
option = SvPV (ST (0), integer); |
option = SvPV (ST (0), integer); |
677 |
{ |
{ |
678 |
XST_mPV (0, return_value); |
XST_mPV (0, return_value); |
679 |
free (return_value); |
free (return_value); |
680 |
return; |
XSRETURN (1); |
681 |
} |
} |
682 |
} |
} |
683 |
|
|
684 |
XST_mPV (0, ""); |
XST_mPV (0, ""); |
685 |
|
XSRETURN (1); |
686 |
} |
} |
687 |
|
|
688 |
/* |
/* |
703 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
704 |
"Perl error: unable to set plugin config option, " |
"Perl error: unable to set plugin config option, " |
705 |
"script not initialized"); |
"script not initialized"); |
706 |
XSRETURN (0); |
XSRETURN_NO; |
707 |
} |
} |
708 |
|
|
709 |
if (items != 2) |
if (items != 2) |
711 |
perl_plugin->printf_server (perl_plugin, |
perl_plugin->printf_server (perl_plugin, |
712 |
"Perl error: wrong parameters for " |
"Perl error: wrong parameters for " |
713 |
"\"set_plugin_config\" function"); |
"\"set_plugin_config\" function"); |
714 |
XSRETURN (0); |
XSRETURN_NO; |
715 |
} |
} |
716 |
|
|
717 |
option = SvPV (ST (0), integer); |
option = SvPV (ST (0), integer); |
722 |
if (weechat_script_set_plugin_config (perl_plugin, |
if (weechat_script_set_plugin_config (perl_plugin, |
723 |
perl_current_script, |
perl_current_script, |
724 |
option, value)) |
option, value)) |
725 |
XSRETURN (1); |
XSRETURN_YES; |
726 |
} |
} |
727 |
|
|
728 |
XSRETURN (0); |
XSRETURN_NO; |
729 |
} |
} |
730 |
|
|
731 |
/* |
/* |