summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-05-19 09:35:14 -0600
committerKarl Williamson <khw@cpan.org>2022-05-28 14:59:35 -0600
commitdf91ed1f415ca48d067005116ac554c99bb257be (patch)
treee64ebdd6eeb0ef9239962f05c638532820cc3f6e /gv.c
parent2356f8bb5077e29623007d815dab58f43473a56d (diff)
downloadperl-df91ed1f415ca48d067005116ac554c99bb257be.tar.gz
perlapi: Document gv_autoload*
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 32b00bb851..0c8edcd554 100644
--- a/gv.c
+++ b/gv.c
@@ -1293,6 +1293,36 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
return gv;
}
+
+/*
+=for apidoc gv_autoload_pv
+=for apidoc_item gv_autoload_pvn
+=for apidoc_item gv_autoload_sv
+
+These each search for an C<AUTOLOAD> method, returning NULL if not found, or
+else returning a pointer to its GV, while setting the package
+L<C<$AUTOLOAD>|perlobj/AUTOLOAD> variable to C<name> (fully qualified). Also,
+if found and the GV's CV is an XSUB, the CV's PV will be set to C<name>, and
+its stash will be set to the stash of the GV.
+
+Searching is done in L<C<MRO> order|perlmroapi>, as specified in
+L</C<gv_fetchmeth>>, beginning with C<stash> if it isn't NULL.
+
+The forms differ only in how C<name> is specified.
+
+In C<gv_autoload_pv>, C<namepv> is a C language NUL-terminated string.
+
+In C<gv_autoload_pvn>, C<name> points to the first byte of the name, and an
+additional parameter, C<len>, specifies its length in bytes. Hence, C<*name>
+may contain embedded-NUL characters.
+
+In C<gv_autoload_sv>, C<*namesv> is an SV, and the name is the PV extracted
+from that using L</C<SvPV>>. If the SV is marked as being in UTF-8, the
+extracted PV will also be.
+
+=cut
+*/
+
GV*
Perl_gv_autoload_sv(pTHX_ HV *stash, SV* namesv, U32 flags)
{