This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document calling convention for Perl_mro_register
authorFather Chrysostomos <sprout@cpan.org>
Tue, 11 Oct 2011 06:28:19 +0000 (23:28 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 11 Oct 2011 06:36:32 +0000 (23:36 -0700)
I had to look in embed.fnc to find this out when I wanted to use it.

mro.c
pod/perlmroapi.pod

diff --git a/mro.c b/mro.c
index 386f898..e0ab5bc 100644 (file)
--- a/mro.c
+++ b/mro.c
@@ -114,6 +114,11 @@ Perl_mro_get_from_name(pTHX_ SV *name) {
     return INT2PTR(const struct mro_alg *, SvUVX(*data));
 }
 
+/*
+=for apidoc mro_register
+Registers a custom mro plugin.  See L<perlmroapi> for details.
+*/
+
 void
 Perl_mro_register(pTHX_ const struct mro_alg *mro) {
     SV *wrapper = newSVuv(PTR2UV(mro));
index 74bd9b2..54da7dd 100644 (file)
@@ -9,7 +9,7 @@ resolution orders other than the default (linear depth first search).
 The C3 method resolution order added in 5.10.0 has been re-implemented as
 a plugin, without changing its Perl-space interface.
 
-Each plugin should register itself with C<Perl_mro_register> by providing
+Each plugin should register itself by providing
 the following structure
 
     struct mro_alg {
@@ -20,6 +20,10 @@ the following structure
         U32 hash;
     };
 
+and calling C<Perl_mro_register>:
+
+    Perl_mro_register(aTHX_ &my_mro_alg);
+
 =over 4
 
 =item resolve