| 1 |
package Atheme; |
| 2 |
|
| 3 |
use Carp; |
| 4 |
use Exporter 'import'; |
| 5 |
|
| 6 |
require DynaLoader; |
| 7 |
our @ISA = qw(DynaLoader); |
| 8 |
|
| 9 |
our @EXPORT = qw( %Services %Users %ChannelRegistrations %Hooks &depends ); |
| 10 |
|
| 11 |
bootstrap Atheme; |
| 12 |
|
| 13 |
use Atheme::Fault; |
| 14 |
use Atheme::Service; |
| 15 |
use Atheme::Account; |
| 16 |
use Atheme::ChannelRegistration; |
| 17 |
use Atheme::ChanAcs; |
| 18 |
use Atheme::ReadOnlyHashWrapper; |
| 19 |
use Atheme::Internal::HookHash; |
| 20 |
use Atheme::Internal::ServiceHash; |
| 21 |
use Atheme::Hooks; |
| 22 |
use Atheme::Log; |
| 23 |
|
| 24 |
our %Services; |
| 25 |
our %Users; |
| 26 |
our %Accounts; |
| 27 |
our %Channels; |
| 28 |
our %ChannelRegistrations; |
| 29 |
our %Hooks; |
| 30 |
|
| 31 |
tie %Services, 'Atheme::Internal::ServiceHash'; |
| 32 |
tie %Users, 'Atheme::ReadOnlyHashWrapper', sub { Atheme::User->find(@_) }; |
| 33 |
tie %Accounts, 'Atheme::ReadOnlyHashWrapper', sub { Atheme::Account->find(@_) }; |
| 34 |
tie %Channels, 'Atheme::ReadOnlyHashWrapper', sub { Atheme::Channel->find(@_) }; |
| 35 |
tie %ChannelRegistrations, 'Atheme::ReadOnlyHashWrapper', sub { Atheme::ChannelRegistration->find(@_) }; |
| 36 |
tie %Hooks, 'Atheme::Internal::HookHash'; |
| 37 |
|
| 38 |
sub depends { |
| 39 |
croak "Use depends entry in \%Info hash instead of depends function\n"; |
| 40 |
} |
| 41 |
|
| 42 |
1; |