This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Following change 31410, also re-align the column title.
[perl5.git] / pod / perlintern.pod
index 4e6119d..198ec58 100644 (file)
@@ -1,3 +1,9 @@
+-*- buffer-read-only: t -*-
+
+!!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
+This file is built by autodoc.pl extracting documentation from the C source
+files.
+
 =head1 NAME
 
 perlintern - autogenerated documentation of purely B<internal>
@@ -136,7 +142,7 @@ Found in file pad.h
 X<PAD_COMPNAME_GEN>
 
 The generation number of the name at offset C<po> in the current
-compiling pad (lvalue). Note that C<SvCUR> is hijacked for this purpose.
+compiling pad (lvalue). Note that C<SvUVX> is hijacked for this purpose.
 
        STRLEN  PAD_COMPNAME_GEN(PADOFFSET po)
 
@@ -147,7 +153,7 @@ Found in file pad.h
 X<PAD_COMPNAME_GEN_set>
 
 Sets the generation number of the name at offset C<po> in the current
-ling pad (lvalue) to C<gen>.  Note that C<SvCUR_set> is hijacked for this purpose.
+ling pad (lvalue) to C<gen>.  Note that C<SvUV_set> is hijacked for this purpose.
 
        STRLEN  PAD_COMPNAME_GEN_set(PADOFFSET po, int gen)
 
@@ -325,186 +331,188 @@ Found in file pad.h
 
 =back
 
-=head1 Functions in file pp_ctl.c
-
+=head1 GV Functions
 
 =over 8
 
-=item find_runcv
-X<find_runcv>
-
-Locate the CV corresponding to the currently executing sub or eval.
-If db_seqp is non_null, skip CVs that are in the DB package and populate
-*db_seqp with the cop sequence number at the point that the DB:: code was
-entered. (allows debuggers to eval in the scope of the breakpoint rather
-than in the scope of the debugger itself).
+=item is_gv_magical
+X<is_gv_magical>
 
-       CV*     find_runcv(U32 *db_seqp)
+Returns C<TRUE> if given the name of a magical GV.
 
-=for hackers
-Found in file pp_ctl.c
+Currently only useful internally when determining if a GV should be
+created even in rvalue contexts.
 
+C<flags> is not used at present but available for future extension to
+allow selecting particular classes of magical variable.
 
-=back
+Currently assumes that C<name> is NUL terminated (as well as len being valid).
+This assumption is met by all callers within the perl core, which all pass
+pointers returned by SvPV.
 
-=head1 Global Variables
+       bool    is_gv_magical(const char *name, STRLEN len, U32 flags)
 
-=over 8
+=for hackers
+Found in file gv.c
 
-=item PL_DBsingle
-X<PL_DBsingle>
+=item is_gv_magical_sv
+X<is_gv_magical_sv>
 
-When Perl is run in debugging mode, with the B<-d> switch, this SV is a
-boolean which indicates whether subs are being single-stepped.
-Single-stepping is automatically turned on after every step.  This is the C
-variable which corresponds to Perl's $DB::single variable.  See
-C<PL_DBsub>.
+Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
 
-       SV *    PL_DBsingle
+       bool    is_gv_magical_sv(SV *name, U32 flags)
 
 =for hackers
-Found in file intrpvar.h
+Found in file gv.c
 
-=item PL_DBsub
-X<PL_DBsub>
 
-When Perl is run in debugging mode, with the B<-d> switch, this GV contains
-the SV which holds the name of the sub being debugged.  This is the C
-variable which corresponds to Perl's $DB::sub variable.  See
-C<PL_DBsingle>.
+=back
 
-       GV *    PL_DBsub
+=head1 Hash Manipulation Functions
 
-=for hackers
-Found in file intrpvar.h
+=over 8
 
-=item PL_DBtrace
-X<PL_DBtrace>
+=item refcounted_he_chain_2hv
+X<refcounted_he_chain_2hv>
 
-Trace variable used when Perl is run in debugging mode, with the B<-d>
-switch.  This is the C variable which corresponds to Perl's $DB::trace
-variable.  See C<PL_DBsingle>.
+Generates and returns a C<HV *> by walking up the tree starting at the passed
+in C<struct refcounted_he *>.
 
-       SV *    PL_DBtrace
+       HV *    refcounted_he_chain_2hv(const struct refcounted_he *c)
 
 =for hackers
-Found in file intrpvar.h
+Found in file hv.c
 
-=item PL_dowarn
-X<PL_dowarn>
+=item refcounted_he_free
+X<refcounted_he_free>
 
-The C variable which corresponds to Perl's $^W warning variable.
+Decrements the reference count of the passed in C<struct refcounted_he *>
+by one. If the reference count reaches zero the structure's memory is freed,
+and C<refcounted_he_free> iterates onto the parent node.
 
-       bool    PL_dowarn
+       void    refcounted_he_free(struct refcounted_he *he)
 
 =for hackers
-Found in file intrpvar.h
+Found in file hv.c
 
-=item PL_last_in_gv
-X<PL_last_in_gv>
+=item refcounted_he_new
+X<refcounted_he_new>
 
-The GV which was last used for a filehandle input operation. (C<< <FH> >>)
+Creates a new C<struct refcounted_he>. As S<key> is copied, and value is
+stored in a compact form, all references remain the property of the caller.
+The C<struct refcounted_he> is returned with a reference count of 1.
 
-       GV*     PL_last_in_gv
+       struct refcounted_he *  refcounted_he_new(struct refcounted_he *const parent, SV *const key, SV *const value)
 
 =for hackers
-Found in file thrdvar.h
+Found in file hv.c
 
-=item PL_ofs_sv
-X<PL_ofs_sv>
 
-The output field separator - C<$,> in Perl space.
+=back
 
-       SV*     PL_ofs_sv
+=head1 IO Functions
 
-=for hackers
-Found in file thrdvar.h
+=over 8
 
-=item PL_rs
-X<PL_rs>
+=item start_glob
+X<start_glob>
 
-The input record separator - C<$/> in Perl space.
+Function called by C<do_readline> to spawn a glob (or do the glob inside
+perl on VMS). This code used to be inline, but now perl uses C<File::Glob>
+this glob starter is only used by miniperl during the build process.
+Moving it away shrinks pp_hot.c; shrinking pp_hot.c helps speed perl up.
 
-       SV*     PL_rs
+       PerlIO* start_glob(SV* pattern, IO *io)
 
 =for hackers
-Found in file thrdvar.h
+Found in file doio.c
 
 
 =back
 
-=head1 GV Functions
+=head1 Magical Functions
 
 =over 8
 
-=item is_gv_magical
-X<is_gv_magical>
-
-Returns C<TRUE> if given the name of a magical GV.
+=item magic_sethint
+X<magic_sethint>
 
-Currently only useful internally when determining if a GV should be
-created even in rvalue contexts.
+Triggered by a delete from %^H, records the key to
+C<PL_compiling.cop_hints_hash>.
 
-C<flags> is not used at present but available for future extension to
-allow selecting particular classes of magical variable.
-
-Currently assumes that C<name> is NUL terminated (as well as len being valid).
-This assumption is met by all callers within the perl core, which all pass
-pointers returned by SvPV.
-
-       bool    is_gv_magical(const char *name, STRLEN len, U32 flags)
+       int     magic_sethint(SV* sv, MAGIC* mg)
 
 =for hackers
-Found in file gv.c
+Found in file mg.c
 
-=item is_gv_magical_sv
-X<is_gv_magical_sv>
+=item mg_localize
+X<mg_localize>
 
-Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
+Copy some of the magic from an existing SV to new localized version of
+that SV. Container magic (eg %ENV, $1, tie) gets copied, value magic
+doesn't (eg taint, pos).
 
-       bool    is_gv_magical_sv(SV *name, U32 flags)
+       void    mg_localize(SV* sv, SV* nsv)
 
 =for hackers
-Found in file gv.c
+Found in file mg.c
 
 
 =back
 
-=head1 IO Functions
+=head1 MRO Functions
 
 =over 8
 
-=item start_glob
-X<start_glob>
+=item mro_get_linear_isa_c3
+X<mro_get_linear_isa_c3>
 
-Function called by C<do_readline> to spawn a glob (or do the glob inside
-perl on VMS). This code used to be inline, but now perl uses C<File::Glob>
-this glob starter is only used by miniperl during the build process.
-Moving it away shrinks pp_hot.c; shrinking pp_hot.c helps speed perl up.
+Returns the C3 linearization of @ISA
+the given stash.  The return value is a read-only AV*.
+C<level> should be 0 (it is used internally in this
+function's recursion).
 
-       PerlIO* start_glob(SV* pattern, IO *io)
+You are responsible for C<SvREFCNT_inc()> on the
+return value if you plan to store it anywhere
+semi-permanently (otherwise it might be deleted
+out from under you the next time the cache is
+invalidated).
+
+       AV*     mro_get_linear_isa_c3(HV* stash, I32 level)
 
 =for hackers
-Found in file doio.c
+Found in file mro.c
 
+=item mro_get_linear_isa_dfs
+X<mro_get_linear_isa_dfs>
 
-=back
+Returns the Depth-First Search linearization of @ISA
+the given stash.  The return value is a read-only AV*.
+C<level> should be 0 (it is used internally in this
+function's recursion).
 
-=head1 Magical Functions
+You are responsible for C<SvREFCNT_inc()> on the
+return value if you plan to store it anywhere
+semi-permanently (otherwise it might be deleted
+out from under you the next time the cache is
+invalidated).
 
-=over 8
+       AV*     mro_get_linear_isa_dfs(HV* stash, I32 level)
 
-=item mg_localize
-X<mg_localize>
+=for hackers
+Found in file mro.c
 
-Copy some of the magic from an existing SV to new localized version of
-that SV. Container magic (eg %ENV, $1, tie) gets copied, value magic
-doesn't (eg taint, pos).
+=item mro_isa_changed_in
+X<mro_isa_changed_in>
 
-       void    mg_localize(SV* sv, SV* nsv)
+Takes the necessary steps (cache invalidations, mostly)
+when the @ISA of the given package has changed.  Invoked
+by the C<setisa> magic, should not need to invoke directly.
+
+       void    mro_isa_changed_in(HV* stash)
 
 =for hackers
-Found in file mg.c
+Found in file mro.c
 
 
 =back
@@ -560,19 +568,19 @@ but only by their index allocated at compile time (which is usually
 in PL_op->op_targ), wasting a name SV for them doesn't make sense.
 
 The SVs in the names AV have their PV being the name of the variable.
-NV+1..IV inclusive is a range of cop_seq numbers for which the name is
-valid.  For typed lexicals name SV is SVt_PVMG and SvSTASH points at the
-type.  For C<our> lexicals, the type is SVt_PVGV, and GvSTASH points at the
-stash of the associated global (so that duplicate C<our> declarations in the
-same package can be detected).  SvCUR is sometimes hijacked to
-store the generation number during compilation.
+xlow+1..xhigh inclusive in the NV union is a range of cop_seq numbers for
+which the name is valid.  For typed lexicals name SV is SVt_PVMG and SvSTASH
+points at the type.  For C<our> lexicals, the type is also SVt_PVMG, with the
+SvOURSTASH slot pointing at the stash of the associated global (so that
+duplicate C<our> declarations in the same package can be detected).  SvUVX is
+sometimes hijacked to store the generation number during compilation.
 
 If SvFAKE is set on the name SV, then that slot in the frame AV is
 a REFCNT'ed reference to a lexical from "outside". In this case,
-the name SV does not use NVX and IVX to store a cop_seq range, since it is
-in scope throughout. Instead IVX stores some flags containing info about
+the name SV does not use xlow and xhigh to store a cop_seq range, since it is
+in scope throughout. Instead xhigh stores some flags containing info about
 the real lexical (is it declared in an anon, and is it capable of being
-instantiated multiple times?), and for fake ANONs, NVX contains the index
+instantiated multiple times?), and for fake ANONs, xlow contains the index
 within the parent's pad where the lexical's value is stored, to make
 cloning quicker.
 
@@ -655,11 +663,11 @@ offset.
 If C<typestash> is valid, the name is for a typed lexical; set the
 name's stash to that value.
 If C<ourstash> is valid, it's an our lexical, set the name's
-GvSTASH to that value
+SvOURSTASH to that value
 
 If fake, it means we're cloning an existing entry
 
-       PADOFFSET       pad_add_name(const char *name, HV* typestash, HV* ourstash, bool clone)
+       PADOFFSET       pad_add_name(const char *name, HV* typestash, HV* ourstash, bool clone, bool state)
 
 =for hackers
 Found in file pad.c
@@ -717,7 +725,7 @@ associated with the IVX field of a fake namesv.
 
 Note that pad_findlex() is recursive; it recurses up the chain of CVs,
 then comes back down, adding fake entries as it goes. It has to be this way
-because fake namesvs in anon protoypes have to store in NVX the index into
+because fake namesvs in anon protoypes have to store in xlow the index into
 the parent pad.
 
        PADOFFSET       pad_findlex(const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags)
@@ -865,6 +873,92 @@ Found in file pad.c
 
 =back
 
+=head1 Per-Interpreter Variables
+
+=over 8
+
+=item PL_DBsingle
+X<PL_DBsingle>
+
+When Perl is run in debugging mode, with the B<-d> switch, this SV is a
+boolean which indicates whether subs are being single-stepped.
+Single-stepping is automatically turned on after every step.  This is the C
+variable which corresponds to Perl's $DB::single variable.  See
+C<PL_DBsub>.
+
+       SV *    PL_DBsingle
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_DBsub
+X<PL_DBsub>
+
+When Perl is run in debugging mode, with the B<-d> switch, this GV contains
+the SV which holds the name of the sub being debugged.  This is the C
+variable which corresponds to Perl's $DB::sub variable.  See
+C<PL_DBsingle>.
+
+       GV *    PL_DBsub
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_DBtrace
+X<PL_DBtrace>
+
+Trace variable used when Perl is run in debugging mode, with the B<-d>
+switch.  This is the C variable which corresponds to Perl's $DB::trace
+variable.  See C<PL_DBsingle>.
+
+       SV *    PL_DBtrace
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_dowarn
+X<PL_dowarn>
+
+The C variable which corresponds to Perl's $^W warning variable.
+
+       bool    PL_dowarn
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_last_in_gv
+X<PL_last_in_gv>
+
+The GV which was last used for a filehandle input operation. (C<< <FH> >>)
+
+       GV*     PL_last_in_gv
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_ofs_sv
+X<PL_ofs_sv>
+
+The output field separator - C<$,> in Perl space.
+
+       SV*     PL_ofs_sv
+
+=for hackers
+Found in file intrpvar.h
+
+=item PL_rs
+X<PL_rs>
+
+The input record separator - C<$/> in Perl space.
+
+       SV*     PL_rs
+
+=for hackers
+Found in file intrpvar.h
+
+
+=back
+
 =head1 Stack Manipulation Macros
 
 =over 8
@@ -944,6 +1038,25 @@ Found in file sv.c
 
 =back
 
+=head1 SV-Body Allocation
+
+=over 8
+
+=item sv_2num
+X<sv_2num>
+
+Return an SV with the numeric value of the source SV, doing any necessary
+reference or overload conversion.  You must use the C<SvNUM(sv)> macro to
+access this function.
+
+       SV*     sv_2num(SV* sv)
+
+=for hackers
+Found in file sv.c
+
+
+=back
+
 =head1 Unicode Support
 
 =over 8
@@ -993,3 +1106,6 @@ document their functions.
 
 perlguts(1), perlapi(1)
 
+=cut
+
+ ex: set ro: