comparison plugins/perl/common/Gaim.pm @ 6588:7f5f57dd5cac

[gaim-migrate @ 7110] I'm breaking debug. I cannot for the life of me figure out the enum stuff in perl XSUB. Everything is ending up 0 (in other words, it's probably not finding them). So, people can use debug_info and such. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 24 Aug 2003 01:08:32 +0000
parents cbd24b37350d
children 47744949513f
comparison
equal deleted inserted replaced
6587:ed11e3f8ba21 6588:7f5f57dd5cac
1 package Gaim; 1 package Gaim;
2 2
3 use 5.008; 3 use 5.008;
4 use strict; 4 use strict;
5 use warnings; 5 use warnings;
6 use Carp;
6 7
7 require Exporter; 8 require Exporter;
9 use AutoLoader;
8 10
9 our @ISA = qw(Exporter); 11 our @ISA = qw(Exporter);
10 12
11 # Items to export into callers namespace by default. Note: do not export 13 # Items to export into callers namespace by default. Note: do not export
12 # names by default without a very good reason. Use EXPORT_OK instead. 14 # names by default without a very good reason. Use EXPORT_OK instead.
24 our @EXPORT = qw( 26 our @EXPORT = qw(
25 27
26 ); 28 );
27 29
28 our $VERSION = '0.01'; 30 our $VERSION = '0.01';
31
32 sub AUTOLOAD {
33 # This AUTOLOAD is used to 'autoload' constants from the constant()
34 # XS function.
35
36 my $constname;
37 our $AUTOLOAD;
38 ($constname = $AUTOLOAD) =~ s/.*:://;
39 croak "&Gaim::constant not defined" if $constname eq 'constant';
40 my ($error, $val) = constant($constname);
41 if ($error) { croak $error; }
42 {
43 no strict 'refs';
44
45 *$AUTOLOAD = sub { $val };
46 }
47
48 goto &$AUTOLOAD;
49 }
29 50
30 require XSLoader; 51 require XSLoader;
31 XSLoader::load('Gaim', $VERSION); 52 XSLoader::load('Gaim', $VERSION);
32 53
33 # Preloaded methods go here. 54 # Preloaded methods go here.
77 98
78 If you have a web site set up for your module, mention it here. 99 If you have a web site set up for your module, mention it here.
79 100
80 =head1 AUTHOR 101 =head1 AUTHOR
81 102
82 Christian Hammond, E<lt>chipx86@localdomainE<gt> 103 Christian Hammond, E<lt>chipx86@gnupdate.orgE<gt>
83 104
84 =head1 COPYRIGHT AND LICENSE 105 =head1 COPYRIGHT AND LICENSE
85 106
86 Copyright 2003 by Christian Hammond 107 Copyright 2003 by Christian Hammond
87 108