Sun, 24 Aug 2003 02:43:27 +0000
[gaim-migrate @ 7115]
Added the perl API for the conversation framework. Untested.. Should work.
We'll see.
| 6508 | 1 | package Gaim; |
| 2 | ||
| 3 | use 5.008; | |
| 4 | use strict; | |
| 5 | use warnings; | |
|
6588
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
6 | use Carp; |
| 6508 | 7 | |
| 8 | require Exporter; | |
|
6588
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
9 | use AutoLoader; |
| 6508 | 10 | |
| 11 | our @ISA = qw(Exporter); | |
| 12 | ||
| 13 | # Items to export into callers namespace by default. Note: do not export | |
| 14 | # names by default without a very good reason. Use EXPORT_OK instead. | |
| 15 | # Do not simply export all your public functions/methods/constants. | |
| 16 | ||
| 17 | # This allows declaration use Gaim ':all'; | |
| 18 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | |
| 19 | # will save memory. | |
| 20 | our %EXPORT_TAGS = ( 'all' => [ qw( | |
| 21 | ||
| 22 | ) ] ); | |
| 23 | ||
| 24 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |
| 25 | ||
| 26 | our @EXPORT = qw( | |
| 27 | ||
| 28 | ); | |
| 29 | ||
| 30 | our $VERSION = '0.01'; | |
| 31 | ||
|
6588
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
32 | sub AUTOLOAD { |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
33 | # This AUTOLOAD is used to 'autoload' constants from the constant() |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
34 | # XS function. |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
35 | |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
36 | my $constname; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
37 | our $AUTOLOAD; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
38 | ($constname = $AUTOLOAD) =~ s/.*:://; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
39 | croak "&Gaim::constant not defined" if $constname eq 'constant'; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
40 | my ($error, $val) = constant($constname); |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
41 | if ($error) { croak $error; } |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
42 | { |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
43 | no strict 'refs'; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
44 | |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
45 | *$AUTOLOAD = sub { $val }; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
46 | } |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
47 | |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
48 | goto &$AUTOLOAD; |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
49 | } |
|
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
50 | |
| 6508 | 51 | require XSLoader; |
| 52 | XSLoader::load('Gaim', $VERSION); | |
| 53 | ||
| 54 | # Preloaded methods go here. | |
| 55 | ||
| 56 | 1; | |
| 57 | __END__ | |
| 58 | # Below is stub documentation for your module. You'd better edit it! | |
| 59 | ||
| 60 | =head1 NAME | |
| 61 | ||
| 62 | Gaim - Perl extension for blah blah blah | |
| 63 | ||
| 64 | =head1 SYNOPSIS | |
| 65 | ||
| 66 | use Gaim; | |
| 67 | blah blah blah | |
| 68 | ||
| 69 | =head1 ABSTRACT | |
| 70 | ||
| 71 | This should be the abstract for Gaim. | |
| 72 | The abstract is used when making PPD (Perl Package Description) files. | |
| 73 | If you don't want an ABSTRACT you should also edit Makefile.PL to | |
| 74 | remove the ABSTRACT_FROM option. | |
| 75 | ||
| 76 | =head1 DESCRIPTION | |
| 77 | ||
| 78 | Stub documentation for Gaim, created by h2xs. It looks like the | |
| 79 | author of the extension was negligent enough to leave the stub | |
| 80 | unedited. | |
| 81 | ||
| 82 | Blah blah blah. | |
| 83 | ||
| 84 | =head2 EXPORT | |
| 85 | ||
| 86 | None by default. | |
| 87 | ||
| 88 | ||
| 89 | ||
| 90 | =head1 SEE ALSO | |
| 91 | ||
| 92 | Mention other useful documentation such as the documentation of | |
| 93 | related modules or operating system documentation (such as man pages | |
| 94 | in UNIX), or any relevant external documentation such as RFCs or | |
| 95 | standards. | |
| 96 | ||
| 97 | If you have a mailing list set up for your module, mention it here. | |
| 98 | ||
| 99 | If you have a web site set up for your module, mention it here. | |
| 100 | ||
| 101 | =head1 AUTHOR | |
| 102 | ||
|
6588
187c6026c574
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
103 | Christian Hammond, E<lt>chipx86@gnupdate.orgE<gt> |
| 6508 | 104 | |
| 105 | =head1 COPYRIGHT AND LICENSE | |
| 106 | ||
| 107 | Copyright 2003 by Christian Hammond | |
| 108 | ||
| 109 | This library is free software; you can redistribute it and/or modify | |
| 110 | it under the same terms as Perl itself. | |
| 111 | ||
| 112 | =cut |