- Timestamp:
- Oct 27, 2009, 2:15:08 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 7ca5d3e
- Parents:
- e7f5970 (diff), f1a2736 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- perl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
r3c428d4 rffc4df6 13 13 error debug 14 14 create_style getnumcolors wordwrap 15 add_dispath remove_dispatch 15 add_dispatch remove_dispatch 16 add_io_dispatch remove_io_dispatch 16 17 new_command 17 18 new_variable_int new_variable_bool new_variable_string … … 62 63 Returns the current message as a C<BarnOwl::Message> subclass, or 63 64 undef if there is no message selected 64 65 65 =head2 getnumcols 66 66 … … 160 160 read from C<FD>. 161 161 162 C<add_dispatch> has been deprecated in favor of C<add_io_dispatch>, 163 and is now a wrapper for it called with C<mode> set to C<'r'>. 164 165 =cut 166 167 sub add_dispatch { 168 my $fd = shift; 169 my $cb = shift; 170 add_io_dispatch($fd, 'r', $cb); 171 } 172 162 173 =head2 remove_dispatch FD 163 174 164 175 Remove a file descriptor previously registered via C<add_dispatch> 176 177 C<remove_dispatch> has been deprecated in favor of 178 C<remove_io_dispatch>. 179 180 =cut 181 182 *remove_dispatch = \&remove_io_dispatch; 183 184 =head2 add_io_dispatch FD MODE CB 185 186 Adds a file descriptor to C<BarnOwl>'s internal C<select()> 187 loop. <MODE> can be 'r', 'w', or 'rw'. C<CALLBACK> will be invoked 188 whenever C<FD> becomes ready, as specified by <MODE>. 189 190 Only one callback can be registered per FD. If a new callback is 191 registered, the old one is removed. 192 193 =cut 194 195 sub add_io_dispatch { 196 my $fd = shift; 197 my $modeStr = shift; 198 my $cb = shift; 199 my $mode = 0; 200 201 $mode |= 0x1 if ($modeStr =~ /r/i); # Read 202 $mode |= 0x2 if ($modeStr =~ /w/i); # Write 203 if ($mode) { 204 $mode |= 0x4; # Exceptional 205 BarnOwl::Internal::add_io_dispatch($fd, $mode, $cb); 206 } else { 207 die("Invalid I/O Dispatch mode: $modeStr"); 208 } 209 } 210 211 =head2 remove_io_dispatch FD 212 213 Remove a file descriptor previously registered via C<add_io_dispatch> 165 214 166 215 =head2 create_style NAME OBJECT -
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rda554da rf1a2736 381 381 $ircnets{$alias} = $conn; 382 382 my $fd = $conn->getSocket()->fileno(); 383 BarnOwl::add_ dispatch($fd, \&OwlProcess);383 BarnOwl::add_io_dispatch($fd, 'r', \&OwlProcess); 384 384 $conn->{FD} = $fd; 385 385 } else { -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r7cfb1df rf1a2736 210 210 } 211 211 } 212 BarnOwl::remove_ dispatch($self->{FD});212 BarnOwl::remove_io_dispatch($self->{FD}); 213 213 BarnOwl::admin_message('IRC', 214 214 "[" . $self->alias . "] Disconnected from server"); -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
rf3678c3 rf1a2736 471 471 $conn->renameConnection($jidStr, $fullJid); 472 472 queue_admin_msg("Connected to jabber as $fullJid"); 473 # The remove_ dispatch() method is called from the473 # The remove_io_dispatch() method is called from the 474 474 # ConnectionManager's removeConnection() method. 475 475 $client->{fileno} = $client->getSocket()->fileno(); 476 476 #queue_admin_msg("Connected to jabber as $fullJid ($client->{fileno})"); 477 BarnOwl::add_ dispatch($client->{fileno}, sub { $client->OwlProcess($fullJid) });477 BarnOwl::add_io_dispatch($client->{fileno}, 'r', sub { $client->OwlProcess($fullJid) }); 478 478 479 479 # populate completion from roster. -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber/ConnectionManager.pm
r8590774 rf1a2736 37 37 return 0 unless exists $self->{$jidStr}; 38 38 39 BarnOwl::remove_ dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno};39 BarnOwl::remove_io_dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno}; 40 40 $self->{$jidStr}->{Client}->Disconnect() 41 41 if $self->{$jidStr}->{Client}; … … 55 55 } 56 56 57 BarnOwl::remove_ dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno};57 BarnOwl::remove_io_dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno}; 58 58 $self->{$jidStr}->{Client}->Disconnect() 59 59 if $self->{$jidStr}->{Client}; -
perl/lib/BarnOwl/Complete/Client.pm
ra3a9eb7 r02a72bf 24 24 commands => undef, 25 25 command => \&complete_command, 26 errors => undef, 26 27 filters => undef, 27 28 filter => \&complete_filter_name, 28 29 license => undef, 30 keymaps => undef, 31 keymap => \&complete_keymap, 29 32 quickstart => undef, 30 33 startup => undef, … … 45 48 sub complete_variable { return @{BarnOwl::all_variables()}; } 46 49 sub complete_style { return @{BarnOwl::all_styles()}; } 50 sub complete_keymap { return @{BarnOwl::all_keymaps()}; } 47 51 48 52 sub complete_help {
Note: See TracChangeset
for help on using the changeset viewer.