Subject: PATCH 5.10 documentation
[p5sagit/p5-mst-13.2.git] / pod / perlintern.pod
index 2d0c3a7..e622841 100644 (file)
@@ -119,10 +119,9 @@ Found in file pad.h
 =item PAD_CLONE_VARS
 X<PAD_CLONE_VARS>
 
-|CLONE_PARAMS* param
 Clone the state variables associated with running and compiling pads.
 
-       void    PAD_CLONE_VARS(PerlInterpreter *proto_perl \)
+       void    PAD_CLONE_VARS(PerlInterpreter *proto_perl, CLONE_PARAMS* param)
 
 =for hackers
 Found in file pad.h
@@ -331,120 +330,12 @@ Found in file pad.h
 
 =back
 
-=head1 Functions in file pp_ctl.c
-
-
-=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).
-
-       CV*     find_runcv(U32 *db_seqp)
-
-=for hackers
-Found in file pp_ctl.c
-
-
-=back
-
-=head1 Global 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 thrdvar.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 thrdvar.h
-
-=item PL_rs
-X<PL_rs>
-
-The input record separator - C<$/> in Perl space.
-
-       SV*     PL_rs
-
-=for hackers
-Found in file thrdvar.h
-
-
-=back
-
 =head1 GV Functions
 
 =over 8
 
-=item is_gv_magical
-X<is_gv_magical>
+=item is_gv_magical_sv
+X<is_gv_magical_sv>
 
 Returns C<TRUE> if given the name of a magical GV.
 
@@ -458,17 +349,7 @@ 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)
-
-=for hackers
-Found in file gv.c
-
-=item is_gv_magical_sv
-X<is_gv_magical_sv>
-
-Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
-
-       bool    is_gv_magical_sv(SV *name, U32 flags)
+       bool    is_gv_magical_sv(SV *const name_sv, U32 flags)
 
 =for hackers
 Found in file gv.c
@@ -530,7 +411,7 @@ 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.
 
-       PerlIO* start_glob(SV* pattern, IO *io)
+       PerlIO* start_glob(SV *tmpglob, IO *io)
 
 =for hackers
 Found in file doio.c
@@ -542,12 +423,25 @@ Found in file doio.c
 
 =over 8
 
-=item magic_sethint
-X<magic_sethint>
+=item magic_clearhint
+X<magic_clearhint>
 
 Triggered by a delete from %^H, records the key to
 C<PL_compiling.cop_hints_hash>.
 
+       int     magic_clearhint(SV* sv, MAGIC* mg)
+
+=for hackers
+Found in file mg.c
+
+=item magic_sethint
+X<magic_sethint>
+
+Triggered by a store to %^H, records the key/value pair to
+C<PL_compiling.cop_hints_hash>.  It is assumed that hints aren't storing
+anything that would need a deep copy.  Maybe we should warn if we find a
+reference.
+
        int     magic_sethint(SV* sv, MAGIC* mg)
 
 =for hackers
@@ -556,11 +450,15 @@ Found in file mg.c
 =item mg_localize
 X<mg_localize>
 
-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).
+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).
 
-       void    mg_localize(SV* sv, SV* nsv)
+If setmagic is false then no set magic will be called on the new (empty) SV.
+This typically means that assignment will soon follow (e.g. 'local $x = $y'),
+and that will handle the magic.
+
+       void    mg_localize(SV* sv, SV* nsv, bool setmagic)
 
 =for hackers
 Found in file mg.c
@@ -572,6 +470,44 @@ Found in file mg.c
 
 =over 8
 
+=item mro_get_linear_isa_c3
+X<mro_get_linear_isa_c3>
+
+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).
+
+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, U32 level)
+
+=for hackers
+Found in file mro.c
+
+=item mro_get_linear_isa_dfs
+X<mro_get_linear_isa_dfs>
+
+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).
+
+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_dfs(HV* stash, U32 level)
+
+=for hackers
+Found in file mro.c
+
 =item mro_isa_changed_in
 X<mro_isa_changed_in>
 
@@ -668,6 +604,8 @@ to be generated in evals, such as
 
     { my $x = 1; sub f { eval '$x'} } f();
 
+For state vars, SVf_PADSTALE is overloaded to mean 'not yet initialised'
+
        AV *    CvPADLIST(CV *cv)
 
 =for hackers
@@ -943,6 +881,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_ofsgv
+X<PL_ofsgv>
+
+The glob containing the output field separator - C<*,> in Perl space.
+
+       GV*     PL_ofsgv
+
+=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
@@ -981,7 +1005,7 @@ X<sv_add_arena>
 Given a chunk of memory, link it to the head of the list of arenas,
 and split it into a list of free SVs.
 
-       void    sv_add_arena(char* ptr, U32 size, U32 flags)
+       void    sv_add_arena(char *const ptr, const U32 size, const U32 flags)
 
 =for hackers
 Found in file sv.c
@@ -1022,6 +1046,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 *const sv)
+
+=for hackers
+Found in file sv.c
+
+
+=back
+
 =head1 Unicode Support
 
 =over 8
@@ -1043,7 +1086,7 @@ The name is returned as a mortal SV.
 Assumes that PL_op is the op that originally triggered the error, and that
 PL_comppad/PL_curpad points to the currently executing pad.
 
-       SV*     find_uninit_var(OP* obase, SV* uninit_sv, bool top)
+       SV*     find_uninit_var(const OP *const obase, const SV *const uninit_sv, bool top)
 
 =for hackers
 Found in file sv.c
@@ -1053,7 +1096,7 @@ X<report_uninit>
 
 Print appropriate "Use of uninitialized variable" warning
 
-       void    report_uninit(SV* uninit_sv)
+       void    report_uninit(const SV *uninit_sv)
 
 =for hackers
 Found in file sv.c