]> jfr.im git - irc/xchat.git/commitdiff
Make xchat_send_modes available from Perl
authorlsitu <redacted>
Fri, 6 Mar 2009 01:27:36 +0000 (01:27 +0000)
committerlsitu <redacted>
Fri, 6 Mar 2009 01:27:36 +0000 (01:27 +0000)
git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1337 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

ChangeLog
plugins/perl/Xchat.pm
plugins/perl/perl.c
plugins/perl/xchat2-perl.html

index 7c154b3a048e370afb39b4f90929b3c8d8deecbc..4719aef5ded056d91df6d292d178cb10bdb7babb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@ highlights. The full CVS log is available at www.xchat.org/cvslog/
     that do not call register() to show up as "" for the name and description
     and "unknown" for the version
   * /reloadall will now reload scripts in the same order they were loaded
+  * Make xchat_send_modes available as Xchat::send_modes
 
 ------------------------------------------------------------------------------
  2.8.6 - 11/Jun/2008
index 1e36f41241cdec21a94b428104a9551cc9bd52b8..fee21332741ddd7f32a7c4a0d82afba9fb35b85f 100644 (file)
@@ -49,7 +49,7 @@ our %EXPORT_TAGS = (
                qw(hook_server hook_command hook_print hook_timer hook_fd unhook),
        ],
        util => [
-               qw(register nickcmp strip_code), # misc
+               qw(register nickcmp strip_code send_modes), # misc
                qw(print prnt printf prntf command commandf emit_print), # output
                qw(find_context get_context set_context), # context
                qw(get_info get_prefs get_list context_info user_info), # input
index 61baee1d81cac1aaf65c714681086569ff7c019c..45f67d9fc9633e109dd97269201d5b2beeb2b984 100644 (file)
@@ -627,6 +627,58 @@ XS (XS_Xchat_emit_print)
                XSRETURN_IV (RETVAL);
        }
 }
+
+static
+XS (XS_Xchat_send_modes)
+{
+       AV *p_targets = NULL;
+       int modes_per_line = 0;
+       char sign;
+       char mode;
+       int i = 0;
+       const char **targets;
+       int target_count = 0;
+       SV **elem;
+
+       dXSARGS;
+       if (items < 3 || items > 4) {
+               xchat_print (ph,
+                       "Usage: Xchat::send_modes( targets, sign, mode, modes_per_line)"
+               );
+       } else {
+               if (SvROK (ST (0))) {
+                       p_targets = (AV*) SvRV (ST (0));
+                       target_count = av_len (p_targets) + 1;
+                       targets = malloc (target_count * sizeof (char *));
+                       for (i = 0; i < target_count; i++ ) {
+                               elem = av_fetch (p_targets, i, 0);
+
+                               if (elem != NULL) {
+                                       targets[i] = SvPV_nolen (*elem);
+                               } else {
+                                       targets[i] = "";
+                               }
+                       }
+               } else{
+                       targets = malloc (sizeof (char *));
+                       targets[0] = SvPV_nolen (ST (0));
+                       target_count = 1;
+               }
+               
+               if (target_count == 0) {
+                       XSRETURN_EMPTY;
+               }
+
+               sign = (SvPV_nolen (ST (1)))[0];
+               mode = (SvPV_nolen (ST (2)))[0];
+
+               if (items == 4 ) {
+                       modes_per_line = (int) SvIV (ST (3)); 
+               }
+
+               xchat_send_modes (ph, targets, target_count, modes_per_line, sign, mode);
+       }
+}
 static
 XS (XS_Xchat_get_info)
 {
@@ -1163,6 +1215,7 @@ xs_init (pTHX)
        newXS ("Xchat::get_context", XS_Xchat_get_context, __FILE__);
        newXS ("Xchat::get_prefs", XS_Xchat_get_prefs, __FILE__);
        newXS ("Xchat::emit_print", XS_Xchat_emit_print, __FILE__);
+       newXS ("Xchat::send_modes", XS_Xchat_send_modes, __FILE__);
        newXS ("Xchat::nickcmp", XS_Xchat_nickcmp, __FILE__);
        newXS ("Xchat::get_list", XS_Xchat_get_list, __FILE__);
 
index 72592b58fa37a3dda665cd941e149c561f01d04d..d1bdaa22b58b7c0385bd85bd60f8b105b11b664a 100644 (file)
@@ -1,8 +1,10 @@
+<?xml version="1.0" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>X-Chat 2 Perl Interface</title>
-<link rev="made" href="mailto:root@vertigo.twi-31o2.org" />
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rev="made" href="mailto:khisanth@miyu.hopto.org" />
 </head>
 
 <body style="background-color: white">
 </td></tr>
 </table>
 
-<p><a name="__index__"></a></p>
+
 <!-- INDEX BEGIN -->
+<div name="index">
+<p><a name="__index__"></a></p>
 
 <ul>
-       <li><a href="#introduction">Introduction</a></li>
-       <li>
-               <a href="#constants">Constants</a>
+
+       <li><a href="#x_chat_2_perl_interface">X-Chat 2 Perl Interface</a></li>
+       <ul>
+
+               <li><a href="#introduction">Introduction</a></li>
+               <li><a href="#constants">Constants</a></li>
                <ul>
+
                        <li><a href="#priorities">Priorities</a></li>
-                       <li>
-                               <a href="#return_values">Return values</a>
-                               <ul>
-                                       <li><a href="#timer_specific">Timer specific</a></li>
-                               </ul>
-                       </li>
+                       <li><a href="#return_values">Return values</a></li>
+                       <ul>
+
+                               <li><a href="#timer_specific">Timer specific</a></li>
+                       </ul>
+
                </ul>
-       </li>
-       <li>
-               <a href="#functions">Functions</a>
+
+               <li><a href="#functions">Functions</a></li>
                <ul>
+
                        <li><a href="#xchat__register___name___version____description___callback____"><code>Xchat::register( $name, $version, [$description,[$callback]] )</code></a></li>
                        <li><a href="#xchat__hook_server___message___callback_____options___"><code>Xchat::hook_server( $message, $callback, [\%options] )</code></a></li>
                        <li><a href="#xchat__hook_command___command___callback_____options___"><code>Xchat::hook_command( $command, $callback, [\%options] )</code></a></li>
                        <li><a href="#xchat__hook_print___event__callback_____options___"><code>Xchat::hook_print( $event,$callback, [\%options] )</code></a></li>
-                       <li>
-                               <a href="#xchat__hook_timer___timeout__callback_____options____data___"><code>Xchat::hook_timer( $timeout,$callback, [\%options | $data] )</code></a>
-                               <ul>
-                                       <li><a href="#when_callbacks_are_invoked">When callbacks are invoked</a></li>
-                                       <li><a href="#callback_arguments">Callback Arguments</a></li>
-                                       <li><a href="#callback_return_values">Callback return values</a></li>
-                                       <li><a href="#miscellaneous_hook_related_information">Miscellaneous Hook Related Information</a></li>
-                               </ul>
-                       </li>
+                       <li><a href="#xchat__hook_timer___timeout__callback_____options____data___"><code>Xchat::hook_timer( $timeout,$callback, [\%options | $data] )</code></a></li>
+                       <ul>
+
+                               <li><a href="#when_callbacks_are_invoked">When callbacks are invoked</a></li>
+                               <li><a href="#callback_arguments">Callback Arguments</a></li>
+                               <li><a href="#callback_return_values">Callback return values</a></li>
+                               <li><a href="#miscellaneous_hook_related_information">Miscellaneous Hook Related Information</a></li>
+                       </ul>
+
                        <li><a href="#xchat__unhook___hook__"><code>Xchat::unhook( $hook )</code></a></li>
                        <li><a href="#xchat__print___text_____lines____channel___server____"><code>Xchat::print( $text | \@lines, [$channel,[$server]] )</code></a></li>
                        <li><a href="#xchat__printf___format__list__"><code>Xchat::printf( $format, LIST )</code></a></li>
-                       <li><a href="#xchat__command___command____channel___server____"><code>Xchat::command( $command, [$channel,[$server]] )</code></a></li>
+                       <li><a href="#xchat__command___command_____commands____channel___server____"><code>Xchat::command( $command | \@commands, [$channel,[$server]] )</code></a></li>
                        <li><a href="#xchat__commandf___format__list__"><code>Xchat::commandf( $format, LIST )</code></a></li>
                        <li><a href="#xchat__find_context____channel____server____"><code>Xchat::find_context( [$channel, [$server]] )</code></a></li>
                        <li><a href="#xchat__get_context__"><code>Xchat::get_context()</code></a></li>
                        <li><a href="#xchat__get_info___id__"><code>Xchat::get_info( $id )</code></a></li>
                        <li><a href="#xchat__get_prefs___name__"><code>Xchat::get_prefs( $name )</code></a></li>
                        <li><a href="#xchat__emit_print___event__list__"><code>Xchat::emit_print( $event, LIST )</code></a></li>
+                       <li><a href="#xchat__send_modes___target_____targets___sign___mode_____modes_per_line____"><code>Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )</code></a></li>
                        <li><a href="#xchat__nickcmp___nick1___nick2__"><code>Xchat::nickcmp( $nick1, $nick2 )</code></a></li>
                        <li><a href="#xchat__get_list___name__"><code>Xchat::get_list( $name )</code></a></li>
                        <li><a href="#xchat__user_info____nick___"><code>Xchat::user_info( [$nick] )</code></a></li>
                        <li><a href="#xchat__context_info____context___"><code>Xchat::context_info( [$context] )</code></a></li>
                        <li><a href="#xchat__strip_code___string__"><code>Xchat::strip_code( $string )</code></a></li>
                </ul>
-       </li>
-       <li><a href="#contact_information">Contact Information</a></li>
+
+               <li><a href="#contact_information">Contact Information</a></li>
+       </ul>
 
 </ul>
+
+<hr name="index" />
+</div>
 <!-- INDEX END -->
 
-<hr />
 <p>
 </p>
-<h1><a name="xchat_2_perl_interface">X-Chat 2 Perl Interface</a></h1>
+<h1><a name="x_chat_2_perl_interface">X-Chat 2 Perl Interface</a></h1>
 <p>
 </p>
 <h2><a name="introduction">Introduction</a></h2>
@@ -87,38 +99,38 @@ on the bottom of this page.</p>
 </p>
 <h3><a name="priorities">Priorities</a></h3>
 <ul>
-<li><strong><a name="item_c_3cxchat_3a_3apri_highest_3e"><code>Xchat::PRI_HIGHEST</code></a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3apri_high_3e"><code>Xchat::PRI_HIGH</code></a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3apri_norm_3e"><code>Xchat::PRI_NORM</code></a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3apri_low_3e"><code>Xchat::PRI_LOW</code></a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3apri_lowest_3e"><code>Xchat::PRI_LOWEST</code></a></strong><br />
-</li>
+<li><strong><a name="xchat_pri_highest" class="item"><code>Xchat::PRI_HIGHEST</code></a></strong>
+
+<li><strong><a name="xchat_pri_high" class="item"><code>Xchat::PRI_HIGH</code></a></strong>
+
+<li><strong><a name="xchat_pri_norm" class="item"><code>Xchat::PRI_NORM</code></a></strong>
+
+<li><strong><a name="xchat_pri_low" class="item"><code>Xchat::PRI_LOW</code></a></strong>
+
+<li><strong><a name="xchat_pri_lowest" class="item"><code>Xchat::PRI_LOWEST</code></a></strong>
+
 </ul>
 <p>
 </p>
 <h3><a name="return_values">Return values</a></h3>
 <ul>
-<li><strong><a name="item_c_3cxchat_3a_3aeat_none_3e_pass_the_event_along"><code>Xchat::EAT_NONE</code>                pass the event along</a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3aeat_xchat_3e_don_27t_let_xchat_see_"><code>Xchat::EAT_XCHAT</code>            don't let xchat see this event</a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3aeat_plugin_3e_don_27t_let_other_scr"><code>Xchat::EAT_PLUGIN</code>   don't let other scripts and plugins see this event</a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3aeat_all_3e_don_27t_let_anything_see"><code>Xchat::EAT_ALL</code>              don't let anything see this event</a></strong><br />
-</li>
+<li><strong><a name="xchat_eat_none_pass_the_event_along" class="item"><code>Xchat::EAT_NONE</code>            pass the event along</a></strong>
+
+<li><strong><a name="xchat_eat_xchat_don_t_let_xchat_see_this_event" class="item"><code>Xchat::EAT_XCHAT</code>                don't let xchat see this event</a></strong>
+
+<li><strong><a name="xchat_eat_plugin_don_t_let_other_scripts_and_plugins_see_this_event" class="item"><code>Xchat::EAT_PLUGIN</code>  don't let other scripts and plugins see this event</a></strong>
+
+<li><strong><a name="xchat_eat_all_don_t_let_anything_see_this_event" class="item"><code>Xchat::EAT_ALL</code>                 don't let anything see this event</a></strong>
+
 </ul>
 <p>
 </p>
 <h4><a name="timer_specific">Timer specific</a></h4>
 <ul>
-<li><strong><a name="item_c_3cxchat_3a_3akeep_3e_keep_the_timer_going"><code>Xchat::KEEP</code>                                keep the timer going</a></strong><br />
-</li>
-<li><strong><a name="item_c_3cxchat_3a_3aremove_3e_remove_the_timer"><code>Xchat::REMOVE</code>                        remove the timer</a></strong><br />
-</li>
+<li><strong><a name="xchat_keep_keep_the_timer_going" class="item"><code>Xchat::KEEP</code>                            keep the timer going</a></strong>
+
+<li><strong><a name="xchat_remove_remove_the_timer" class="item"><code>Xchat::REMOVE</code>                    remove the timer</a></strong>
+
 </ul>
 <p>
 </p>
@@ -127,16 +139,16 @@ on the bottom of this page.</p>
 </p>
 <h3><a name="xchat__register___name___version____description___callback____"><code>Xchat::register( $name, $version, [$description,[$callback]] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24name_3e__2d_the_name_of_this_script"><code>$name</code>                               -       The name of this script</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24version_3e__2d_this_script_27s_version"><code>$version</code>                         -       This script's version</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24description_3e__2d_a_description_for_this_s"><code>$description</code>        -       A description for this script</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24callback_3e__2d_this_is_a_function_that_wil"><code>$callback</code>           -       This is a function that will be called when the is script
+<li><strong><a name="_name" class="item"><code>$name</code>                            -       The name of this script</a></strong>
+
+<li><strong><a name="_version" class="item"><code>$version</code>                      -       This script's version</a></strong>
+
+<li><strong><a name="_description" class="item"><code>$description</code>      -       A description for this script</a></strong>
+
+<li><strong><a name="_callback" class="item"><code>$callback</code>            -       This is a function that will be called when the is script
                                                        unloaded. This can be either a reference to a
-                                                       function or an anonymous sub reference.</a></strong><br />
-</li>
+                                                       function or an anonymous sub reference.</a></strong>
+
 </ul>
 <p>This is the first thing to call in every script.</p>
 <p>
@@ -157,22 +169,22 @@ hook_command can be used to intercept any command, if the command doesn't curren
 hook_print can be used to intercept any of the events listed in Setttings-&gt;Advanced-&gt;Text Events
 hook_timer can be used to create a new timer</p>
 <ul>
-<li><strong><a name="item_c_3c_24message_3e__2d_server_message_to_hook_such_"><code>$message</code>            -       server message to hook such as PRIVMSG</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24command_3e__2d_command_to_intercept_2c_with"><code>$command</code>            -       command to intercept, without the leading /</a></strong><br />
-</li>
-<li><strong><a name="item_advanced"><code>$event</code>                -       one of the events listed in Settings-&gt;Advanced-&gt;Text Events</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24timeout_3e__2d_timeout_in_milliseconds"><code>$timeout</code>                 -       timeout in milliseconds</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24callback_3e__2d_callback_function_2c_this_i"><code>$callback</code>   -       callback function, this is called whenever
+<li><strong><a name="_message" class="item"><code>$message</code>              -       server message to hook such as PRIVMSG</a></strong>
+
+<li><strong><a name="_command" class="item"><code>$command</code>              -       command to intercept, without the leading /</a></strong>
+
+<li><strong><a name="advanced" class="item"><code>$event</code>                -       one of the events listed in Settings-&gt;Advanced-&gt;Text Events</a></strong>
+
+<li><strong><a name="_timeout" class="item"><code>$timeout</code>              -       timeout in milliseconds</a></strong>
+
+<li><strong><code>$callback</code>     -       callback function, this is called whenever
                                                the hooked event is trigged, the following are
                                                the conditions that will trigger        the different hooks.
                                                This can be either a reference to a
-                                               function or an anonymous sub reference.</a></strong><br />
-</li>
-<li><strong><a name="item__5c_25options__2d_a_hash_reference_containing_addi">\%options        -       a hash reference containing addional options for the hooks</a></strong><br />
-</li>
+                                               function or an anonymous sub reference.</strong>
+
+<li><strong><a name="options_a_hash_reference_containing_addional_options_for_the_hooks" class="item">\%options        -       a hash reference containing addional options for the hooks</a></strong>
+
 </ul>
 <p>Valid keys for \%options:</p>
 <table border="1">     <tr>
@@ -282,9 +294,9 @@ the timer or Xchat::KEEP to keep it going</p>
 <p>
 </p>
 <h4><a name="miscellaneous_hook_related_information">Miscellaneous Hook Related Information</a></h4>
-<p>For server hooks, if <code>$message</code> is ``RAW LINE'' then <code>$cb</code> will be called for
-every IRC message that X-Chat receives.</p>
-<p>For command hooks if <code>$command</code> is ``'' then <code>$cb</code> will be called for
+<p>For server hooks, if <a href="#_message"><code>$message</code></a> is &quot;RAW LINE&quot; then <code>$cb</code> will be called for
+every IRC message than X-Chat receives.</p>
+<p>For command hooks if <a href="#_command"><code>$command</code></a> is &quot;&quot; then <code>$cb</code> will be called for
 messages entered by the user that is not a command.</p>
 <p>For print hooks besides those events listed in 
 Settings-&gt;Advanced-&gt;Text Events, these additional events can be used.</p>
@@ -309,24 +321,15 @@ Settings-&gt;Advanced-&gt;Text Events, these additional events can be used.</p>
                                                                                        <code>$_[0][2]</code>   -       Nick<br />
                                                                                        <code>$_[0][3]</code>   -       Message<br />
                                                                                        </td>
-       </tr> <tr>
-               <td>"Key Press"</td>
-               <td>
-                       used for intercepting key presses<br />
-                       the key value is in $_[0][0]<br />
-                       the modifier value is in $_[0][1]<br />
-                       both are integers<br />
-                       <br />
-                       if the key is a printable character such as abcde... then that letter can be found in $_[0][2]<br />
-                       the length of $_[0][2], may be 0 for unprintable keys
-               </td>
+       </tr>   <tr>
+               <td>"Key Press"</td>    <td>used for intercepting key presses, the key value is in $_[0][0]</td>
+       </tr>
 </table><p>
 </p>
 <h3><a name="xchat__unhook___hook__"><code>Xchat::unhook( $hook )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24hook_3e__2d_the_hook_that_was_previously_re"><code>$hook</code>       -       the hook that was previously returned by one of
-                                       the <code>Xchat::hook_*</code>  functions</a></strong><br />
-</li>
+<li><strong><a name="_hook" class="item"><code>$hook</code>    -       the hook that was previously returned by one of the <code>Xchat::hook_*</code>  functions</a></strong>
+
 </ul>
 <p>This function is used to removed a hook previously added with one of
 the <code>Xchat::hook_*</code> functions</p>
@@ -336,111 +339,110 @@ the hook was added</p>
 </p>
 <h3><a name="xchat__print___text_____lines____channel___server____"><code>Xchat::print( $text | \@lines, [$channel,[$server]] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24text_3e__2d_the_text_to_print"><code>$text</code>             -       the text to print</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_5c_40lines_3e__2d_array_reference_containing_"><code>\@lines</code>     -       array reference containing lines of text to be printed
-                                       all the elements will be joined together before printing</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24channel_3e__2d_channel_or_tab_with_the_give"><code>$channel</code>    -       channel or tab with the given name where <code>$text</code>
-                                       will be printed</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24server_3e__2d_specifies_that_the_text_will_"><code>$server</code>     -       specifies that the text will be printed in a channel or tab
-                                       that is associated with <code>$server</code></a></strong><br />
-</li>
+<li><strong><a name="_text" class="item"><code>$text</code>            -       the text to print</a></strong>
+
+<li><strong><a name="lines_array_reference_containing_lines_of_text_to_be_printed_all_the_elements_will_be_joined_together_before_printing" class="item"><code>\@lines</code>  -       array reference containing lines of text to be printed
+                                       all the elements will be joined together before printing</a></strong>
+
+<li><strong><a name="_channel" class="item"><code>$channel</code>      -       channel or tab with the given name where <a href="#_text"><code>$text</code></a>
+                                       will be printed</a></strong>
+
+<li><strong><a name="_server" class="item"><code>$server</code>        -       specifies that the text will be printed in a channel or tab
+                                       that is associated with <code>$server</code></a></strong>
+
 </ul>
-<p>The first argument can either be a string or an array reference of strings.<br />
-Either or both of <code>$channel</code> and <code>$server</code> can be undef.</p>
+<p>The first argument can either be a string or an array reference of strings.
+Either or both of <a href="#_channel"><code>$channel</code></a> and <a href="#_server"><code>$server</code></a> can be undef.</p>
 <p>If called as <code>Xchat::print( $text )</code>, it will always return true.
 If called with either the channel or the channel and the server
 specified then it will return true if a context is found and
 false otherwise. The text will not be printed if the context
-is not found.  The meaning of setting <code>$channel</code> or <code>$server</code> to
+is not found.  The meaning of setting <a href="#_channel"><code>$channel</code></a> or <a href="#_server"><code>$server</code></a> to
 undef is the same as
-<a href="#xchat__find_context____channel____server____">find_context</a>.</p>
+<a href="#xchat__find_context____channel_____server____">find_context</a>.</p>
 <p>
 </p>
 <h3><a name="xchat__printf___format__list__"><code>Xchat::printf( $format, LIST )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24format_3e__2d_a_format_string_2c_see__22per"><code>$format</code>     -       a format string, see ``perldoc -f sprintf'' for further detail</a></strong><br />
-</li>
-<li><strong><a name="item_list__2d_list_of_values_for_the_format_fields">LIST          -       list of values for the format fields</a></strong><br />
-</li>
+<li><strong><a name="_format" class="item"><code>$format</code>        -       a format string, see &quot;perldoc -f sprintf&quot; for further detail</a></strong>
+
+<li><strong><a name="list_list_of_values_for_the_format_fields" class="item">LIST              -       list of values for the format fields</a></strong>
+
 </ul>
 <p>
 </p>
-<h3><a name="xchat__command___command____channel___server____"><code>Xchat::command( $command | \@commands, [$channel,[$server]] )</code></a></h3>
+<h3><a name="xchat__command___command_____commands____channel___server____"><code>Xchat::command( $command | \@commands, [$channel,[$server]] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24command_3e__2d_the_command_to_execute_2c_wi"><code>$command</code>    -       the command to execute, without the leading /</a></strong><br />
-<li><strong><code>\@command</code>     -       array reference containing a list of commands to execute</strong><br />
-</li>
-</li>
-<li><strong><code>$channel</code>      -       channel or tab with the given name where <code>$command</code> will be executed</strong><br />
-</li>
-<li><strong><a name="item_c_3c_24server_3e__2d_specifies_that_the_command_wi"><code>$server</code>     -       specifies that the command will be executed in a channel or tab
-                                       that is associated with <code>$server</code></a></strong><br />
-</li>
+<li><strong><code>$command</code>      -       the command to execute, without the leading /</strong>
+
+<li><strong><a name="commands_array_reference_containing_a_list_of_commands_to_execute" class="item"><code>\@commands</code>   -       array reference containing a list of commands to execute</a></strong>
+
+<li><strong><code>$channel</code>      -       channel or tab with the given name where <a href="#_command"><code>$command</code></a> will be executed</strong>
+
+<li><strong><code>$server</code>       -       specifies that the command will be executed in a channel or tab that is associated with <code>$server</code></strong>
+
 </ul>
-<p>The first argument can either be a string or an array reference of strings.<br />
-Either or both of <code>$channel</code> and <code>$server</code> can be undef.</p>
+<p>The first argument can either be a string or an array reference of strings.
+Either or both of <a href="#_channel"><code>$channel</code></a> and <a href="#_server"><code>$server</code></a> can be undef.</p>
 <p>If called as <code>Xchat::command( $command )</code>, it will always return true.
 If called with either the channel or the channel and the server
 specified then it will return true if a context is found and false
 otherwise. The command will not be executed if the context is not found.
-The meaning of setting <code>$channel</code> or <code>$server</code> to undef is the same
+The meaning of setting <a href="#_channel"><code>$channel</code></a> or <a href="#_server"><code>$server</code></a> to undef is the same
 as find_context.</p>
 <p>
 </p>
 <h3><a name="xchat__commandf___format__list__"><code>Xchat::commandf( $format, LIST )</code></a></h3>
 <ul>
-<li><strong><code>$format</code> -  a format string, see ``perldoc -f sprintf'' for further detail</strong><br />
-</li>
-<li><strong>LIST               -       list of values for the format fields</strong><br />
-</li>
+<li><strong><code>$format</code> -  a format string, see &quot;perldoc -f sprintf&quot; for further detail</strong>
+
+<li><strong><a name="list_list_of_values_for_the_format_fields2" class="item">LIST             -       list of values for the format fields</a></strong>
+
 </ul>
 <p>
 </p>
 <h3><a name="xchat__find_context____channel____server____"><code>Xchat::find_context( [$channel, [$server]] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24channel_3e__2d_name_of_a_channel"><code>$channel</code>       -       name of a channel</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24server_3e__2d_name_of_a_server"><code>$server</code>  -       name of a server</a></strong><br />
-</li>
+<li><strong><code>$channel</code>      -       name of a channel</strong>
+
+<li><strong><code>$server</code>       -       name of a server</strong>
+
 </ul>
-<p>Either or both of <code>$channel</code> and $server can be undef. Calling
+<p>Either or both of <a href="#_channel"><code>$channel</code></a> and $server can be undef. Calling
 <code>Xchat::find_context()</code> is the same as calling
 <code>Xchat::find_context( undef, undef)</code> and
 <code>Xchat::find_context( $channel )</code> is
 the same as <code>Xchat::find_context( $channel, undef )</code>.</p>
-<p>If <code>$server</code> is undef, find any channel named $channel.
-If <code>$channel</code> is undef, find the front most window
-or tab named <code>$server</code>.If both $channel and
-<code>$server</code> are undef, find the currently focused tab or window.</p>
+<p>If <a href="#_server"><code>$server</code></a> is undef, find any channel named $channel.
+If <a href="#_channel"><code>$channel</code></a> is undef, find the front most window
+or tab named <a href="#_server"><code>$server</code></a>.If both $channel and
+<a href="#_server"><code>$server</code></a> are undef, find the currently focused tab or window.</p>
 <p>Return the context found for one of the above situations or undef if such
 a context cannot be found.</p>
 <p>
 </p>
-<h3><a name="xchat__get_context__"><code>Xchat::get_context()</code></a></h3>
+<h3><a name="xchat__get_context__"><a href="#get_context"><code>Xchat::get_context()</code></a></a></h3>
 <p>Returns the current context.</p>
 <p>
 </p>
 <h3><a name="xchat__set_context___context____channel___server___"><code>Xchat::set_context( $context | $channel,[$server] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24context_3e__2d_context_value_as_returned_fr"><code>$context</code>    -       context value as returned from get_context,find_context or one
-                                       of the fields in the list of hashrefs returned by list_get</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24channel_3e__2d_name_of_a_channel_you_want_t"><code>$channel</code>    -       name of a channel you want to switch context to</a></strong><br />
-</li>
-<li><strong><a name="item_c_3c_24server_3e__2d_name_of_a_server_you_want_to_"><code>$server</code>     -       name of a server you want to switch context to</a></strong><br />
-</li>
+<li><strong><a name="get_context" class="item"><code>$context</code>   -       context value as returned from <a href="#get_context">get_context</a>,<a href="#xchat__find_context____channel___server____">find_context</a> or one
+                                       of the fields in the list of hashrefs returned by list_get</a></strong>
+
+<li><strong><code>$channel</code>      -       name of a channel you want to switch context to</strong>
+
+<li><strong><code>$server</code>       -       name of a server you want to switch context to</strong>
+
 </ul>
-<p>See <a href="#xchat__find_context____channel____server____">find_context</a> for more details on <code>$channel</code> and <code>$server</code>.</p>
+<p>See <a href="#xchat__find_context____channel____server____">find_context</a> for more details on <a href="#_channel"><code>$channel</code></a> and <a href="#_server"><code>$server</code></a>.</p>
 <p>Returns true on success, false on failure</p>
 <p>
 </p>
 <h3><a name="xchat__get_info___id__"><code>Xchat::get_info( $id )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24id_3e__2d_one_of_the_following_case_sensiti"><code>$id</code> -       one of the following case sensitive values</a></strong><br />
-</li>
+<li><strong><a name="_id" class="item"><code>$id</code>        -       one of the following case sensitive values</a></strong>
+
 </ul>
 <table border="1">     <tr style="background-color: #dddddd">
                <td>ID</td>                             <td>Return value</td>
@@ -451,23 +453,13 @@ a context cannot be found.</p>
        </tr>   <tr>
                <td>charset</td>        <td>character-set used in the current context</td>
        </tr>
-       <tr>
-               <td>event_text &lt;name&gt;</td>
-               <td>text event format string for <em>name</em>. This is whatever the user has under the Text column of Settings-&gt;Advanced-&gt;Text Events.</td>
-       </tr>
+       
        <tr>
                <td>host</td>   <td>real hostname of the current server</td>
        </tr>   <tr>
-       <tr>
-               <td>id</td>     <td>unique server id</td>
-       </tr> <tr>
                <td>inputbox</td>       <td>contents of the inputbox</td>
        </tr>
-
-       <tr>
-               <td>modes</td> <td>channel modes, if known or undef</td>
-       </tr>
-
+       
        <tr>
                <td>libdirfs</td>
                <td>the system wide directory where xchat will look for plugins.
@@ -481,14 +473,9 @@ a context cannot be found.</p>
        </tr>   <tr>
                <td>nickserv</td>       <td>nickserv password for this network or undef</td>
        </tr>   <tr>
-               <td>server</td>
-               <td>
-                       current server name <br />
-                       (what the server claims to be) undef if not connected
-               </td>
-       </tr> <tr>
-               <td>state_cursor</td>
-               <td>current inputbox cursor position in characters</td>
+               <td>server</td> <td>current server name <br />
+                                                               (what the server claims to be) undef if not connected
+                                                               </td>
        </tr>   <tr>
                <td>topic</td>  <td>current channel topic</td>
        </tr>   <tr>
@@ -500,8 +487,8 @@ a context cannot be found.</p>
        </tr>
        
        <tr>
-               <td>win_ptr</td> <td>native window pointer, GtkWindow * on Unix, HWND on Win32.<br />
-               On Unix if you have the Glib module installed you can use my $window = Glib::Object->new_from_pointer( Xchat::get_info( "win_ptr" ) ); to get a Gtk2::Window object.</td>
+     <td>win_ptr</td> <td>native window pointer, GtkWindow * on Unix, HWND on Win32.<br />
+     On Unix if you have the Glib module installed you can use my $window = Glib::Object->new_from_pointer( Xchat::get_info( "win_ptr" ) ); to get a Gtk2::Window object.</td>
        </tr>
        <tr>
                <td>xchatdir</td>       <td>xchat config directory encoded in UTF-8<br />
@@ -509,41 +496,70 @@ a context cannot be found.</p>
                                                                /home/user/.xchat2<br />
                                                                C:\Documents and Settings\user\Application Data\X-Chat 2
                                                                </td>
-       </tr>
-       <tr>
-               <td>xchatdirfs</td> <td>xchat config directory encoded in the local file system encoding</td>
+       </tr>   <tr>
+               <td>state_cursor</td>
+               <td>current inputbox cursor position in characters</td>
        </tr>
 </table><p>This function is used to retrieve certain information about the current
 context.</p><p>
 </p>
 <h3><a name="xchat__get_prefs___name__"><code>Xchat::get_prefs( $name )</code></a></h3>
 <ul>
-<li><strong><a name="item_setting"><code>$name</code>  -       name of a X-Chat setting (available through the /set command)</a></strong><br />
-</li>
+<li><strong><a name="setting" class="item"><a href="#_name"><code>$name</code></a>     -       name of a X-Chat setting (available through the /set command)</a></strong>
+
 </ul>
 <p>This function provides a way to retrieve X-Chat's setting information.</p>
-<p>Returns <code>undef</code> if there is no setting called <code>$name</code>.</p>
+<p>Returns <code>undef</code> if there is no setting called called <a href="#_name"><code>$name</code></a>.</p>
 <p>
 </p>
 <h3><a name="xchat__emit_print___event__list__"><code>Xchat::emit_print( $event, LIST )</code></a></h3>
 <ul>
-<li><strong><a name="item_lists"><code>$event</code>   -       name from the Event column in Settings-&gt;Advanced-&gt;Text Events</a></strong><br />
-</li>
-<li><strong>LIST               -       this depends on the Description column on the bottom of
-                               Settings-&gt;Advanced-&gt;Text Events</strong><br />
-</li>
+<li><strong><code>$event</code>        -       name from the Event column in Settings-&gt;Advanced-&gt;Text Events</strong>
+
+<li><strong>LIST               -       this depends on the Description column on the bottom of Settings-&gt;Advanced-&gt;Text Events</strong>
+
 </ul>
 <p>This functions is used to generate one of the events listed under
 Settings-&gt;Advanced-&gt;Text Events</p>
 <p>Returns true on success, false on failure</p>
 <p>
 </p>
+<h3><a name="xchat__send_modes___target_____targets___sign___mode_____modes_per_line____"><code>Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )</code></a></h3>
+<ul>
+<li><strong><a name="_target" class="item"><code>$target</code>        -       a single nick to set the mode on</a></strong>
+
+<li><strong><a name="targets_an_array_reference_of_the_nicks_to_set_the_mode_on_item_sign_the_mode_sign_either_or" class="item"><code>\@targets</code> -       an array reference of the nicks to set the mode on
+=item *
+<code>$sign</code>     - the mode sign, either '+' or '-'</a></strong>
+
+<li><strong><a name="_mode" class="item"><code>$mode</code> - the mode character such as 'o' and 'v', this can only be one character long</a></strong>
+
+<li><strong><a name="maximum" class="item"><code>$modes_per_line</code>        -       an optional argument maximum number of modes to send per at once, pass 0 use the current server's maximum (default)</a></strong>
+
+</ul>
+<p>Send multiple mode changes for the current channel. It may send multiple MODE lines if the request doesn't fit on one.</p>
+<p>Example:</p>
+<code>
+<pre>
+use strict;
+use warning;
+use Xchat qw(:all);hook_command( "MODES", sub {
+   my (undef, $who, $sign, $mode) = @{$_[0]};   my @targets = split /,/, $who;
+   if( @targets &gt; 1 ) {
+      send_modes( \@targets, $sign, $mode, 1 );
+   } else {
+      send_modes( $who, $sign, $mode );
+   }   return EAT_XCHAT;
+});
+</pre>
+</code><p>
+</p>
 <h3><a name="xchat__nickcmp___nick1___nick2__"><code>Xchat::nickcmp( $nick1, $nick2 )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24nick1_2c__24nick2_3e__2d_the_two_nicks_or_c"><code>$nick1, $nick2</code>      -       the two nicks or channel names that are to be compared</a></strong><br />
-</li>
+<li><strong><a name="_nick1_" class="item"><code>$nick1, $nick2</code> -       the two nicks or channel names that are to be compared</a></strong>
+
 </ul>
-<p>The comparsion is based on the current server. Either a RFC1459 compliant
+<p>The comparsion is based on the current server. Either a <a href="http://www.ietf.org/rfc/rfc1459.txt" class="rfc">RFC1459</a> compliant
 string compare or plain ascii will be using depending on the server. The
 comparison is case insensitive.</p>
 <p>Returns a number less than, equal to or greater than zero if
@@ -554,9 +570,9 @@ found respectively, to be less than, to match, or be greater than
 </p>
 <h3><a name="xchat__get_list___name__"><code>Xchat::get_list( $name )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24name_3e__2d_name_of_the_list_2c_one_of_the_"><code>$name</code> -     name of the list, one of the following:
-``channels'', ``dcc'', ``ignore'', ``notify'', ``users''</a></strong><br />
-</li>
+<li><strong><code>$name</code> -       name of the list, one of the following:
+&quot;channels&quot;, &quot;dcc&quot;, &quot;ignore&quot;, &quot;notify&quot;, &quot;users&quot;</strong>
+
 </ul>
 <p>This function will return a list of hash references.  The hash references
 will have different keys depend on the list.  An empty list is returned
@@ -565,50 +581,45 @@ if there is no such list.</p>
                <td>Key</td>    <td>Description</td>
        </tr>   <tr>
                <td>channel</td>        <td>tab name</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>chantypes</td>
-               <td>channel types supported by the server, typically "#&amp;"</td>
-       </tr>
-       <tr>
+               <td><channel types supported by the server, typically "#&amp;"</td>
+       </tr>   <tr>
                <td>context</td>        <td>can be used with set_context</td>
        </tr>   <tr>
                <td>flags</td>  <td>Server Bits:<br />
-                                                       0  - Connected<br />
-                                                       1  - Connecting<br />
-                                                       2  - Away<br />
-                                                       3  - EndOfMotd(Login complete)<br />
-                                                       4  - Has WHOX (ircu)<br />
-                                                       5  - Has IDMSG (FreeNode)<br />
-                                                       <br />
-                                                       <p>The following correspond to the /chanopt command</p>
-                                                       6  - Hide Join/Part Message (text_hidejoinpart)<br />
-                                                       7  - unused (was for color paste)<br />
-                                                       8  - Beep on message (alert_beep)<br />
-                                                       9  - Blink Tray (alert_tray)<br />
-                                                       10 - Blink Task Bar (alert_taskbar)<br />
+                                                       0 - Connected<br />
+                                                       1 - Connecting<br />
+                                                       2 - Away<br />
+                                                       3 - EndOfMotd(Login complete)<br />
+                                                       4 - Has WHOX<br />
+                                                       5 - Has IDMSG (FreeNode)<br />
+                    <br />
+                    <p>The following correspond to the /chanopt command</p>
+                    6  - Hide Join/Part Message (text_hidejoinpart)<br />
+                    7  - unused (was for color paste)<br />
+                    8  - Beep on message (alert_beep)<br />
+                    9  - Blink Tray (alert_tray)<br />
+                    10 - Blink Task Bar (alert_taskbar)<br />
 <p>Example of checking if the current context has Hide Join/Part messages set:<br />
 <code>
 <pre>
 if( Xchat::context_info-&gt;{flags} & (1 &lt;&lt; 6) ) {
-       Xchat::print( "Hide Join/Part messages is enabled" );
+  Xchat::print( "Hide Join/Part messages is enabled" );
 }
 </pre>
 </code>
-</p>
-                                                       </td>
+</p>                                                   </td>
        </tr>   <tr>
                <td>id</td>     <td>Unique server ID    </td>
        </tr>
        
        <tr>
                <td>maxmodes</td>       <td>Maximum modes per line</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>lag</td>
                <td>lag in milliseconds</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>network</td>        <td>network name to which this channel belongs</td>
        </tr>   <tr>
                <td>nickprefixes</td>   <td>Nickname prefixes e.g. "+@"</td>
@@ -616,11 +627,11 @@ if( Xchat::context_info-&gt;{flags} & (1 &lt;&lt; 6) ) {
        
        <tr>
                <td>nickmodes</td>      <td>Nickname mode chars e.g. "vo"</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>queue</td>
                <td>number of bytes in the send queue</td>
        </tr>
+       
        <tr>
                <td>server</td> <td>server name to which this channel belongs</td>
        </tr>   <tr>
@@ -692,12 +703,10 @@ if( Xchat::context_info-&gt;{flags} & (1 &lt;&lt; 6) ) {
 <table border="1">
        <tr style="background-color: #dddddd">
                <td>Key</td>    <td>Value</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>networks</td>
                <td>comma separated list of networks where you will be notfified about this user's online/offline status or undef if you will be notificed on every network you are connected to</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>nick</td>   <td>nickname</td>
        </tr>   <tr>
                <td>flags</td>  <td>0 = is online</td>
@@ -715,71 +724,66 @@ detail</p><p>"users"              -       list of users in the current channel</p>
                <td>Key</td>    <td>Value</td>
        </tr>   <tr>
                <td>away</td>   <td>away status(boolean)</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>lasttalk</td>
                <td>last time a user was seen talking, this is the an epoch time(number of seconds since a certain date, that date depends on the OS)</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>nick</td>   <td>nick name</td>
        </tr>   <tr>
                <td>host</td>
                <td>host name in the form: user@host or undef if not known</td>
        </tr>   <tr>
                <td>prefix</td> <td>prefix character, .e.g: @ or +</td>
-       </tr>
-       <tr>
+       </tr>   <tr>
                <td>realname</td>
-               <td>Real name or undef</td>
-       </tr>
-       <tr>
+                <td>Real name or undef</td>
+       </tr>   <tr>
                <td>selected</td>
                <td>selected status in the user list, only works when retrieving the user list of the focused tab. You can use the /USELECT command to select the nicks</td>
+       </tr>
 </table><p>
 </p>
 <h3><a name="xchat__user_info____nick___"><code>Xchat::user_info( [$nick] )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24nick_3e__2d_the_nick_to_look_for_2c_if_this"><code>$nick</code>       -       the nick to look for, if this is not given your own nick will be
-                               used as default</a></strong><br />
-</li>
+<li><strong><a name="_nick" class="item"><code>$nick</code>    -       the nick to look for, if this is not given your own nick will be
+                               used as default</a></strong>
+
 </ul>
 <p>This function is mainly intended to be used as a shortcut for when you need
 to retrieve some information about only one user in a channel. Otherwise it
 is to use <a href="#xchat__get_list___name__">get_list</a>.
-If <code>$nick</code> is found a hash reference containing the same keys as those in the
-``users'' list of <a href="#xchat__get_list___name__">get_list</a> is returned otherwise undef is returned.</p>
+If <a href="#_nick"><code>$nick</code></a> is found a hash reference containing the same keys as those in the
+&quot;users&quot; list of <a href="#xchat__get_list___name__">get_list</a> is returned otherwise undef is returned.</p>
 <p>
 </p>
 <h3><a name="xchat__context_info____context___"><code>Xchat::context_info( [$context] )</code></a></h3>
 <ul>
-<li><strong><code>$context</code>      -       context returned from <a href="#xchat__get_context__">get_context</a>, <a href="#xchat__find_context____channel____server____">find_context</a> and <a href="#xchat__get_list___name__">get_list</a>, this is the context that you want infomation about. If this is omitted, it will default to current context.</strong><br />
-</li>
+<li><strong><code>$context</code>      -       context returned from <a href="#get_context">get_context</a>, <a href="#xchat__find_context____channel____server____">find_context</a> and <a href="#xchat__get_list___name__">get_list</a>, this is the context that you want infomation about. If this is omitted, it will default to current context.</strong>
+
 </ul>
-<p>This function will return the information normally retrieved with <a href="#xchat__get_info___id__">get_info</a>, except this is for the context that is passed in. The information will be returned in the form of a hash. The keys of the hash are the $id you would normally supply to <a href="#xchat__get_info___id__">get_info</a>. It also includes all the keys are valid <code>Xchat::get_list( "channels" )</code></p>
+<p>This function will return the information normally retrieved with <a href="#xchat__get_info___id__">get_info</a>, except this is for the context that is passed in. The information will be returned in the form of a hash. The keys of the hash are the $id you would normally supply to <a href="#xchat__get_info___id__">get_info</a>.</p>
 <p>Example:
 <code>
 <pre>
 use strict;
 use warnings;
 use Xchat qw(:all); # imports all the functions documented on this page
-
 register( "User Count", "0.1", "Print out the number of users on the current channel" );
 hook_command( "UCOUNT", \&amp;display_count );
 sub display_count {
-       prnt "There are " . context_info()->{users} . " users in this channel.";
-       return EAT_XCHAT;
+  prnt "There are " . context_info()->{users} . " users in this channel.";
+  return EAT_XCHAT;
 }
 </pre>
 </code>
-</p>
-<p>
+</p><p>
 </p>
 <h3><a name="xchat__strip_code___string__"><code>Xchat::strip_code( $string )</code></a></h3>
 <ul>
-<li><strong><a name="item_c_3c_24string_3e__2d_string_to_remove_codes_from"><code>$string</code>       -       string to remove codes from</a></strong><br />
-</li>
+<li><strong><a name="_string" class="item"><code>$string</code>        -       string to remove codes from</a></strong>
+
 </ul>
-<p>This function will remove bold, color, beep, reset, reverse and underline codes from <code>$string</code>. If it is called in void context $string will be modified otherwise a modified copy of <code>$string</code> is returned.</p>
+<p>This function will remove bold, color, beep, reset, reverse and underline codes from <a href="#_string"><code>$string</code></a>. If it is called in void context $string will be modified otherwise a modified copy of <a href="#_string"><code>$string</code></a> is returned.</p>
 <p>
 </p>
 <h2><a name="contact_information">Contact Information</a></h2>