95 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
96 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
97 |
"\"register\" function"); |
"\"register\" function"); |
98 |
return Qnil; |
return INT2FIX (0); |
99 |
} |
} |
100 |
|
|
101 |
Check_Type (name, T_STRING); |
Check_Type (name, T_STRING); |
116 |
"\"%s\" script (another script " |
"\"%s\" script (another script " |
117 |
"already exists with this name)", |
"already exists with this name)", |
118 |
c_name); |
c_name); |
119 |
return Qnil; |
return INT2FIX (0); |
120 |
} |
} |
121 |
|
|
122 |
/* register script */ |
/* register script */ |
139 |
"Ruby error: unable to load script " |
"Ruby error: unable to load script " |
140 |
"\"%s\" (not enough memory)", |
"\"%s\" (not enough memory)", |
141 |
c_name); |
c_name); |
142 |
return Qnil; |
return INT2FIX (0); |
143 |
} |
} |
144 |
|
|
145 |
return INT2FIX (1); |
return INT2FIX (1); |
158 |
/* make gcc happy */ |
/* make gcc happy */ |
159 |
(void) class; |
(void) class; |
160 |
|
|
161 |
|
if (!ruby_current_script) |
162 |
|
{ |
163 |
|
ruby_plugin->printf_server (ruby_plugin, |
164 |
|
"Ruby error: unable to print message, " |
165 |
|
"script not initialized"); |
166 |
|
return INT2FIX (0); |
167 |
|
} |
168 |
|
|
169 |
c_message = NULL; |
c_message = NULL; |
170 |
c_channel_name = NULL; |
c_channel_name = NULL; |
171 |
c_server_name = NULL; |
c_server_name = NULL; |
175 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
176 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
177 |
"\"print\" function"); |
"\"print\" function"); |
178 |
return Qnil; |
return INT2FIX (0); |
179 |
} |
} |
180 |
|
|
181 |
Check_Type (message, T_STRING); |
Check_Type (message, T_STRING); |
210 |
/* make gcc happy */ |
/* make gcc happy */ |
211 |
(void) class; |
(void) class; |
212 |
|
|
213 |
|
if (!ruby_current_script) |
214 |
|
{ |
215 |
|
ruby_plugin->printf_server (ruby_plugin, |
216 |
|
"Ruby error: unable to print infobar message, " |
217 |
|
"script not initialized"); |
218 |
|
return INT2FIX (0); |
219 |
|
} |
220 |
|
|
221 |
c_delay = 1; |
c_delay = 1; |
222 |
c_message = NULL; |
c_message = NULL; |
223 |
|
|
226 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
227 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
228 |
"\"print_infobar\" function"); |
"\"print_infobar\" function"); |
229 |
return Qnil; |
return INT2FIX (0); |
230 |
} |
} |
231 |
|
|
232 |
Check_Type (delay, T_FIXNUM); |
Check_Type (delay, T_FIXNUM); |
253 |
/* make gcc happy */ |
/* make gcc happy */ |
254 |
(void) class; |
(void) class; |
255 |
|
|
256 |
|
if (!ruby_current_script) |
257 |
|
{ |
258 |
|
ruby_plugin->printf_server (ruby_plugin, |
259 |
|
"Ruby error: unable to run command, " |
260 |
|
"script not initialized"); |
261 |
|
return INT2FIX (0); |
262 |
|
} |
263 |
|
|
264 |
c_command = NULL; |
c_command = NULL; |
265 |
c_channel_name = NULL; |
c_channel_name = NULL; |
266 |
c_server_name = NULL; |
c_server_name = NULL; |
270 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
271 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
272 |
"\"command\" function"); |
"\"command\" function"); |
273 |
return Qnil; |
return INT2FIX (0); |
274 |
} |
} |
275 |
|
|
276 |
Check_Type (command, T_STRING); |
Check_Type (command, T_STRING); |
288 |
ruby_plugin->exec_command (ruby_plugin, |
ruby_plugin->exec_command (ruby_plugin, |
289 |
c_server_name, c_channel_name, |
c_server_name, c_channel_name, |
290 |
c_command); |
c_command); |
291 |
|
|
292 |
return INT2FIX (1); |
return INT2FIX (1); |
293 |
} |
} |
294 |
|
|
304 |
/* make gcc happy */ |
/* make gcc happy */ |
305 |
(void) class; |
(void) class; |
306 |
|
|
307 |
|
if (!ruby_current_script) |
308 |
|
{ |
309 |
|
ruby_plugin->printf_server (ruby_plugin, |
310 |
|
"Ruby error: unable to add message handler, " |
311 |
|
"script not initialized"); |
312 |
|
return INT2FIX (0); |
313 |
|
} |
314 |
|
|
315 |
c_message = NULL; |
c_message = NULL; |
316 |
c_function = NULL; |
c_function = NULL; |
317 |
|
|
320 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
321 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
322 |
"\"add_message_handler\" function"); |
"\"add_message_handler\" function"); |
323 |
return Qnil; |
return INT2FIX (0); |
324 |
} |
} |
325 |
|
|
326 |
Check_Type (message, T_STRING); |
Check_Type (message, T_STRING); |
329 |
c_message = STR2CSTR (message); |
c_message = STR2CSTR (message); |
330 |
c_function = STR2CSTR (function); |
c_function = STR2CSTR (function); |
331 |
|
|
332 |
if (ruby_current_script) |
if (ruby_plugin->msg_handler_add (ruby_plugin, c_message, |
|
ruby_plugin->msg_handler_add (ruby_plugin, c_message, |
|
333 |
weechat_ruby_handler, c_function, |
weechat_ruby_handler, c_function, |
334 |
(void *)ruby_current_script); |
(void *)ruby_current_script)) |
335 |
else |
return INT2FIX (1); |
|
{ |
|
|
ruby_plugin->printf_server (ruby_plugin, |
|
|
"Ruby error: unable to add message handler, " |
|
|
"script not initialized"); |
|
|
return Qnil; |
|
|
} |
|
336 |
|
|
337 |
return INT2FIX (1); |
return INT2FIX (0); |
338 |
} |
} |
339 |
|
|
340 |
/* |
/* |
346 |
VALUE description, VALUE arguments, |
VALUE description, VALUE arguments, |
347 |
VALUE arguments_description) |
VALUE arguments_description) |
348 |
{ |
{ |
349 |
char *c_command, *c_function,*c_description, *c_arguments; |
char *c_command, *c_function, *c_description, *c_arguments; |
350 |
char *c_arguments_description; |
char *c_arguments_description; |
351 |
|
|
352 |
/* make gcc happy */ |
/* make gcc happy */ |
353 |
(void) class; |
(void) class; |
354 |
|
|
355 |
|
if (!ruby_current_script) |
356 |
|
{ |
357 |
|
ruby_plugin->printf_server (ruby_plugin, |
358 |
|
"Ruby error: unable to add command handler, " |
359 |
|
"script not initialized"); |
360 |
|
return INT2FIX (0); |
361 |
|
} |
362 |
|
|
363 |
c_command = NULL; |
c_command = NULL; |
364 |
c_function = NULL; |
c_function = NULL; |
365 |
c_description = NULL; |
c_description = NULL; |
371 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
372 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
373 |
"\"add_command_handler\" function"); |
"\"add_command_handler\" function"); |
374 |
return Qnil; |
return INT2FIX (0); |
375 |
} |
} |
376 |
|
|
377 |
Check_Type (command, T_STRING); |
Check_Type (command, T_STRING); |
392 |
if (!NIL_P (arguments_description)) |
if (!NIL_P (arguments_description)) |
393 |
c_arguments_description = STR2CSTR (arguments_description); |
c_arguments_description = STR2CSTR (arguments_description); |
394 |
|
|
395 |
if (ruby_current_script) |
if (ruby_plugin->cmd_handler_add (ruby_plugin, |
|
ruby_plugin->cmd_handler_add (ruby_plugin, |
|
396 |
c_command, |
c_command, |
397 |
c_description, |
c_description, |
398 |
c_arguments, |
c_arguments, |
399 |
c_arguments_description, |
c_arguments_description, |
400 |
weechat_ruby_handler, |
weechat_ruby_handler, |
401 |
c_function, |
c_function, |
402 |
(void *)ruby_current_script); |
(void *)ruby_current_script)) |
403 |
else |
return INT2FIX (1); |
404 |
|
|
405 |
|
return INT2FIX (0); |
406 |
|
} |
407 |
|
|
408 |
|
/* |
409 |
|
* weechat_remove_handler: remove a handler |
410 |
|
*/ |
411 |
|
|
412 |
|
static VALUE |
413 |
|
weechat_ruby_remove_handler (VALUE class, VALUE command, VALUE function) |
414 |
|
{ |
415 |
|
char *c_command, *c_function; |
416 |
|
|
417 |
|
/* make gcc happy */ |
418 |
|
(void) class; |
419 |
|
|
420 |
|
if (!ruby_current_script) |
421 |
{ |
{ |
422 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
423 |
"Ruby error: unable to add command handler, " |
"Ruby error: unable to remove handler, " |
424 |
"script not initialized"); |
"script not initialized"); |
425 |
return Qnil; |
return INT2FIX (0); |
426 |
} |
} |
427 |
|
|
428 |
|
c_command = NULL; |
429 |
|
c_function = NULL; |
430 |
|
|
431 |
|
if (NIL_P (command) || NIL_P (function)) |
432 |
|
{ |
433 |
|
ruby_plugin->printf_server (ruby_plugin, |
434 |
|
"Ruby error: wrong parameters for " |
435 |
|
"\"remove_handler\" function"); |
436 |
|
return INT2FIX (0); |
437 |
|
} |
438 |
|
|
439 |
|
Check_Type (command, T_STRING); |
440 |
|
Check_Type (function, T_STRING); |
441 |
|
|
442 |
|
c_command = STR2CSTR (command); |
443 |
|
c_function = STR2CSTR (function); |
444 |
|
|
445 |
|
weechat_script_remove_handler (ruby_plugin, ruby_current_script, |
446 |
|
c_command, c_function); |
447 |
|
|
448 |
return INT2FIX (1); |
return INT2FIX (1); |
449 |
} |
} |
450 |
|
|
462 |
/* make gcc happy */ |
/* make gcc happy */ |
463 |
(void) class; |
(void) class; |
464 |
|
|
465 |
|
if (!ruby_current_script) |
466 |
|
{ |
467 |
|
ruby_plugin->printf_server (ruby_plugin, |
468 |
|
"Ruby error: unable to get info, " |
469 |
|
"script not initialized"); |
470 |
|
return INT2FIX (0); |
471 |
|
} |
472 |
|
|
473 |
c_arg = NULL; |
c_arg = NULL; |
474 |
c_server_name = NULL; |
c_server_name = NULL; |
475 |
c_channel_name = NULL; |
c_channel_name = NULL; |
479 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
480 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
481 |
"\"get_info\" function"); |
"\"get_info\" function"); |
482 |
return Qnil; |
return INT2FIX (0); |
483 |
} |
} |
484 |
|
|
485 |
Check_Type (arg, T_STRING); |
Check_Type (arg, T_STRING); |
505 |
free (info); |
free (info); |
506 |
return return_value; |
return return_value; |
507 |
} |
} |
|
else |
|
|
return rb_str_new2 (""); |
|
508 |
} |
} |
509 |
|
|
510 |
return INT2FIX (1); |
return rb_str_new2 (""); |
511 |
} |
} |
512 |
|
|
513 |
/* |
/* |
520 |
/* make gcc happy */ |
/* make gcc happy */ |
521 |
(void) class; |
(void) class; |
522 |
|
|
523 |
|
if (!ruby_current_script) |
524 |
|
{ |
525 |
|
ruby_plugin->printf_server (ruby_plugin, |
526 |
|
"Ruby error: unable to get DCC info, " |
527 |
|
"script not initialized"); |
528 |
|
return INT2FIX (0); |
529 |
|
} |
530 |
|
|
531 |
/* TODO: get dcc info for Ruby */ |
/* TODO: get dcc info for Ruby */ |
532 |
return INT2FIX (1); |
return INT2FIX (1); |
533 |
} |
} |
534 |
|
|
535 |
/* |
/* |
536 |
* weechat_ruby_get_config: get value of a config option |
* weechat_ruby_get_config: get value of a WeeChat config option |
537 |
*/ |
*/ |
538 |
|
|
539 |
static VALUE |
static VALUE |
540 |
weechat_ruby_get_config (VALUE class, VALUE option) |
weechat_ruby_get_config (VALUE class, VALUE option) |
541 |
{ |
{ |
542 |
char *c_option, *value; |
char *c_option, *return_value; |
543 |
VALUE return_value; |
VALUE ruby_return_value; |
544 |
|
|
545 |
/* make gcc happy */ |
/* make gcc happy */ |
546 |
(void) class; |
(void) class; |
547 |
|
|
548 |
|
if (!ruby_current_script) |
549 |
|
{ |
550 |
|
ruby_plugin->printf_server (ruby_plugin, |
551 |
|
"Ruby error: unable to get config option, " |
552 |
|
"script not initialized"); |
553 |
|
return INT2FIX (0); |
554 |
|
} |
555 |
|
|
556 |
c_option = NULL; |
c_option = NULL; |
557 |
|
|
558 |
if (NIL_P (option)) |
if (NIL_P (option)) |
560 |
ruby_plugin->printf_server (ruby_plugin, |
ruby_plugin->printf_server (ruby_plugin, |
561 |
"Ruby error: wrong parameters for " |
"Ruby error: wrong parameters for " |
562 |
"\"get_config\" function"); |
"\"get_config\" function"); |
563 |
return Qnil; |
return INT2FIX (0); |
564 |
} |
} |
565 |
|
|
566 |
Check_Type (option, T_STRING); |
Check_Type (option, T_STRING); |
568 |
|
|
569 |
if (c_option) |
if (c_option) |
570 |
{ |
{ |
571 |
value = ruby_plugin->get_config (ruby_plugin, c_option); |
return_value = ruby_plugin->get_config (ruby_plugin, c_option); |
572 |
|
|
573 |
if (value) |
if (return_value) |
574 |
{ |
{ |
575 |
return_value = rb_str_new2 (value); |
ruby_return_value = rb_str_new2 (return_value); |
576 |
free (value); |
free (return_value); |
577 |
return return_value; |
return ruby_return_value; |
578 |
} |
} |
|
else |
|
|
return rb_str_new2 (""); |
|
579 |
} |
} |
580 |
|
|
581 |
return INT2FIX (1); |
return rb_str_new2 (""); |
582 |
|
} |
583 |
|
|
584 |
|
/* |
585 |
|
* weechat_ruby_set_config: set value of a WeeChat config option |
586 |
|
*/ |
587 |
|
|
588 |
|
static VALUE |
589 |
|
weechat_ruby_set_config (VALUE class, VALUE option, VALUE value) |
590 |
|
{ |
591 |
|
char *c_option, *c_value; |
592 |
|
|
593 |
|
/* make gcc happy */ |
594 |
|
(void) class; |
595 |
|
|
596 |
|
if (!ruby_current_script) |
597 |
|
{ |
598 |
|
ruby_plugin->printf_server (ruby_plugin, |
599 |
|
"Ruby error: unable to set config option, " |
600 |
|
"script not initialized"); |
601 |
|
return INT2FIX (0); |
602 |
|
} |
603 |
|
|
604 |
|
c_option = NULL; |
605 |
|
c_value = NULL; |
606 |
|
|
607 |
|
if (NIL_P (option)) |
608 |
|
{ |
609 |
|
ruby_plugin->printf_server (ruby_plugin, |
610 |
|
"Ruby error: wrong parameters for " |
611 |
|
"\"set_config\" function"); |
612 |
|
return INT2FIX (0); |
613 |
|
} |
614 |
|
|
615 |
|
Check_Type (option, T_STRING); |
616 |
|
Check_Type (value, T_STRING); |
617 |
|
|
618 |
|
c_option = STR2CSTR (option); |
619 |
|
c_value = STR2CSTR (value); |
620 |
|
|
621 |
|
if (c_option && c_value) |
622 |
|
{ |
623 |
|
if (ruby_plugin->set_config (ruby_plugin, c_option, c_value)) |
624 |
|
return INT2FIX (1); |
625 |
|
} |
626 |
|
|
627 |
|
return INT2FIX (0); |
628 |
|
} |
629 |
|
|
630 |
|
/* |
631 |
|
* weechat_ruby_get_plugin_config: get value of a plugin config option |
632 |
|
*/ |
633 |
|
|
634 |
|
static VALUE |
635 |
|
weechat_ruby_get_plugin_config (VALUE class, VALUE option) |
636 |
|
{ |
637 |
|
char *c_option, *return_value; |
638 |
|
VALUE ruby_return_value; |
639 |
|
|
640 |
|
/* make gcc happy */ |
641 |
|
(void) class; |
642 |
|
|
643 |
|
if (!ruby_current_script) |
644 |
|
{ |
645 |
|
ruby_plugin->printf_server (ruby_plugin, |
646 |
|
"Ruby error: unable to get plugin config option, " |
647 |
|
"script not initialized"); |
648 |
|
return INT2FIX (0); |
649 |
|
} |
650 |
|
|
651 |
|
c_option = NULL; |
652 |
|
|
653 |
|
if (NIL_P (option)) |
654 |
|
{ |
655 |
|
ruby_plugin->printf_server (ruby_plugin, |
656 |
|
"Ruby error: wrong parameters for " |
657 |
|
"\"get_plugin_config\" function"); |
658 |
|
return INT2FIX (0); |
659 |
|
} |
660 |
|
|
661 |
|
Check_Type (option, T_STRING); |
662 |
|
c_option = STR2CSTR (option); |
663 |
|
|
664 |
|
if (c_option) |
665 |
|
{ |
666 |
|
return_value = weechat_script_get_plugin_config (ruby_plugin, |
667 |
|
ruby_current_script, |
668 |
|
c_option); |
669 |
|
|
670 |
|
if (return_value) |
671 |
|
{ |
672 |
|
ruby_return_value = rb_str_new2 (return_value); |
673 |
|
free (return_value); |
674 |
|
return ruby_return_value; |
675 |
|
} |
676 |
|
} |
677 |
|
|
678 |
|
return rb_str_new2 (""); |
679 |
|
} |
680 |
|
|
681 |
|
/* |
682 |
|
* weechat_ruby_set_plugin_config: set value of a plugin config option |
683 |
|
*/ |
684 |
|
|
685 |
|
static VALUE |
686 |
|
weechat_ruby_set_plugin_config (VALUE class, VALUE option, VALUE value) |
687 |
|
{ |
688 |
|
char *c_option, *c_value; |
689 |
|
|
690 |
|
/* make gcc happy */ |
691 |
|
(void) class; |
692 |
|
|
693 |
|
if (!ruby_current_script) |
694 |
|
{ |
695 |
|
ruby_plugin->printf_server (ruby_plugin, |
696 |
|
"Ruby error: unable to set plugin config option, " |
697 |
|
"script not initialized"); |
698 |
|
return INT2FIX (0); |
699 |
|
} |
700 |
|
|
701 |
|
c_option = NULL; |
702 |
|
c_value = NULL; |
703 |
|
|
704 |
|
if (NIL_P (option)) |
705 |
|
{ |
706 |
|
ruby_plugin->printf_server (ruby_plugin, |
707 |
|
"Ruby error: wrong parameters for " |
708 |
|
"\"set_plugin_config\" function"); |
709 |
|
return INT2FIX (0); |
710 |
|
} |
711 |
|
|
712 |
|
Check_Type (option, T_STRING); |
713 |
|
Check_Type (value, T_STRING); |
714 |
|
|
715 |
|
c_option = STR2CSTR (option); |
716 |
|
c_value = STR2CSTR (value); |
717 |
|
|
718 |
|
if (c_option && c_value) |
719 |
|
{ |
720 |
|
if (weechat_script_set_plugin_config (ruby_plugin, |
721 |
|
ruby_current_script, |
722 |
|
c_option, c_value)) |
723 |
|
return INT2FIX (1); |
724 |
|
} |
725 |
|
|
726 |
|
return INT2FIX (0); |
727 |
} |
} |
728 |
|
|
729 |
/* |
/* |
799 |
{ |
{ |
800 |
int argc, path_length, handler_found; |
int argc, path_length, handler_found; |
801 |
char **argv, *path_script, *dir_home; |
char **argv, *path_script, *dir_home; |
802 |
t_plugin_script *ptr_plugin_script; |
t_plugin_script *ptr_script; |
803 |
t_plugin_msg_handler *ptr_msg_handler; |
t_plugin_handler *ptr_handler; |
|
t_plugin_cmd_handler *ptr_cmd_handler; |
|
804 |
|
|
805 |
/* make gcc happy */ |
/* make gcc happy */ |
806 |
(void) server; |
(void) server; |
824 |
plugin->printf_server (plugin, "Registered Ruby scripts:"); |
plugin->printf_server (plugin, "Registered Ruby scripts:"); |
825 |
if (ruby_scripts) |
if (ruby_scripts) |
826 |
{ |
{ |
827 |
for (ptr_plugin_script = ruby_scripts; ptr_plugin_script; |
for (ptr_script = ruby_scripts; |
828 |
ptr_plugin_script = ptr_plugin_script->next_script) |
ptr_script; ptr_script = ptr_script->next_script) |
829 |
{ |
{ |
830 |
plugin->printf_server (plugin, " %s v%s%s%s", |
plugin->printf_server (plugin, " %s v%s%s%s", |
831 |
ptr_plugin_script->name, |
ptr_script->name, |
832 |
ptr_plugin_script->version, |
ptr_script->version, |
833 |
(ptr_plugin_script->description[0]) ? " - " : "", |
(ptr_script->description[0]) ? " - " : "", |
834 |
ptr_plugin_script->description); |
ptr_script->description); |
835 |
} |
} |
836 |
} |
} |
837 |
else |
else |
841 |
plugin->printf_server (plugin, ""); |
plugin->printf_server (plugin, ""); |
842 |
plugin->printf_server (plugin, "Ruby message handlers:"); |
plugin->printf_server (plugin, "Ruby message handlers:"); |
843 |
handler_found = 0; |
handler_found = 0; |
844 |
for (ptr_msg_handler = plugin->msg_handlers; ptr_msg_handler; |
for (ptr_handler = plugin->handlers; |
845 |
ptr_msg_handler = ptr_msg_handler->next_handler) |
ptr_handler; ptr_handler = ptr_handler->next_handler) |
846 |
{ |
{ |
847 |
if (ptr_msg_handler->msg_handler_args) |
if ((ptr_handler->type == HANDLER_MESSAGE) |
848 |
|
&& (ptr_handler->handler_args)) |
849 |
{ |
{ |
850 |
handler_found = 1; |
handler_found = 1; |
851 |
plugin->printf_server (plugin, " IRC(%s) => Ruby(%s)", |
plugin->printf_server (plugin, " IRC(%s) => Ruby(%s)", |
852 |
ptr_msg_handler->irc_command, |
ptr_handler->irc_command, |
853 |
ptr_msg_handler->msg_handler_args); |
ptr_handler->handler_args); |
854 |
} |
} |
855 |
} |
} |
856 |
if (!handler_found) |
if (!handler_found) |
860 |
plugin->printf_server (plugin, ""); |
plugin->printf_server (plugin, ""); |
861 |
plugin->printf_server (plugin, "Ruby command handlers:"); |
plugin->printf_server (plugin, "Ruby command handlers:"); |
862 |
handler_found = 0; |
handler_found = 0; |
863 |
for (ptr_cmd_handler = plugin->cmd_handlers; ptr_cmd_handler; |
for (ptr_handler = plugin->handlers; |
864 |
ptr_cmd_handler = ptr_cmd_handler->next_handler) |
ptr_handler; ptr_handler = ptr_handler->next_handler) |
865 |
{ |
{ |
866 |
if (ptr_cmd_handler->cmd_handler_args) |
if ((ptr_handler->type == HANDLER_COMMAND) |
867 |
|
&& (ptr_handler->handler_args)) |
868 |
{ |
{ |
869 |
handler_found = 1; |
handler_found = 1; |
870 |
plugin->printf_server (plugin, " /%s => Ruby(%s)", |
plugin->printf_server (plugin, " /%s => Ruby(%s)", |
871 |
ptr_cmd_handler->command, |
ptr_handler->command, |
872 |
ptr_cmd_handler->cmd_handler_args); |
ptr_handler->handler_args); |
873 |
} |
} |
874 |
} |
} |
875 |
if (!handler_found) |
if (!handler_found) |