fix broken gotos for Catalyst::Plugin::C3, added slightly modified next::method tests...
[gitmo/Class-C3-XS.git] / lib / Class / C3 / XS.pm
index 6bdf0eb..10e41fe 100644 (file)
@@ -1,7 +1,10 @@
-
 package Class::C3::XS;
 
-our $VERSION = '0.15_01';
+use 5.006_000;
+use strict;
+use warnings;
+
+our $VERSION = '0.06';
 
 =pod
 
@@ -16,22 +19,25 @@ Class::C3::XS - XS speedups for Class::C3
 
 =head1 DESCRIPTION
 
-This contains XS performance enhancers for L<Class::C3>.
-The main L<Class::C3> package will use this package automatically
-if it can find it.  Do not use this package directly, use
-L<Class::C3> instead.
-
-=head1 AUTHOR
+This contains XS performance enhancers for L<Class::C3> version
+0.16 and higher.  The main L<Class::C3> package will use this
+package automatically if it can find it.  Do not use this
+package directly, use L<Class::C3> instead.
 
-Stevan Little, E<lt>stevan@iinteractive.comE<gt>
+The test suite here is not complete, although it does verify
+a few basic things.  The best testing comes from running the
+L<Class::C3> test suite *after* this module is installed.
 
-Brandon L. Black, E<lt>blblack@gmail.comE<gt>
+This module won't do anything for you if you're running a
+version of L<Class::C3> older than 0.16.  (It's not a
+dependency because it would be circular with the optional
+dep from that package to this one).
 
-=head1 COPYRIGHT AND LICENSE
+=head1 AUTHOR
 
-Copyright 2005, 2006 by Infinity Interactive, Inc.
+Brandon L. Black, E<lt>blblack@gmail.comE<gt>
 
-L<http://www.iinteractive.com>
+=head1 LICENSE
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
@@ -41,4 +47,23 @@ it under the same terms as Perl itself.
 require XSLoader;
 XSLoader::load('Class::C3::XS', $VERSION);
 
+package # hide me from PAUSE
+    next;
+
+sub can { Class::C3::XS::_nextcan($_[0], 0) }
+
+sub method {
+    my $method = Class::C3::XS::_nextcan($_[0], 1);
+    goto &$method;
+}
+
+package # hide me from PAUSE
+    maybe::next;
+
+sub method {
+    my $method = Class::C3::XS::_nextcan($_[0], 0);
+    goto &$method if defined $method;
+    return;
+}
+
 1;