-*- mode: Pod; buffer-read-only: t -*-
!!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
This file is built by autodoc.pl extracting documentation from the C source
files.
Any changes made here will be lost!

=encoding UTF-8

=head1 NAME

perlapi - autogenerated documentation for the perl public API

=head1 DESCRIPTION
X<Perl API> X<API> X<api>

This file contains most of the documentation of the perl public API, as
generated by F<embed.pl>.  Specifically, it is a listing of functions,
macros, flags, and variables that may be used by extension writers.  Besides
L<perlintern> and F<config.h>, some items are listed here as being actually
documented in another pod.

L<At the end|/Undocumented elements> is a list of functions which have yet
to be documented.  Patches welcome!  The interfaces of these are subject to
change without notice.

Some of the functions documented here are consolidated so that a single entry
serves for multiple functions which all do basically the same thing, but have
some slight differences.  For example, one form might process magic, while
another doesn't.  The name of each variation is listed at the top of the
single entry.

The names of all API functions begin with the prefix C<Perl_> so as to
prevent any name collisions with your code.  But, unless
C<-Accflags=-DPERL_NO_SHORT_NAMES> has been specified in compiling your code
(see L<perlembed/Hiding Perl_>), synonymous macros are also available to you
that don't have this prefix, and also hide from you the need (or not) to have
a thread context parameter passed to the function.  Generally, code is easier
to write and to read when the short form is used, so in practice that
compilation flag is not used.  Not all functions have the short form; both
are listed here when available.

Anything not listed here or in the other mentioned pods is not part of the
public API, and should not be used by extension writers at all.  For these
reasons, blindly using functions listed in F<proto.h> is to be avoided when
writing extensions.

In Perl, unlike C, a string of characters may generally contain embedded
C<NUL> characters.  Sometimes in the documentation a Perl string is referred
to as a "buffer" to distinguish it from a C string, but sometimes they are
both just referred to as strings.

Note that all Perl API global variables must be referenced with the C<PL_>
prefix.  Again, those not listed here are not to be used by extension writers,
and may be changed or removed without notice; same with macros.
Some macros are provided for compatibility with the older,
unadorned names, but this support may be disabled in a future release.

Perl was originally written to handle US-ASCII only (that is characters
whose ordinal numbers are in the range 0 - 127).
And documentation and comments may still use the term ASCII, when
sometimes in fact the entire range from 0 - 255 is meant.

The non-ASCII characters below 256 can have various meanings, depending on
various things.  (See, most notably, L<perllocale>.)  But usually the whole
range can be referred to as ISO-8859-1.  Often, the term "Latin-1" (or
"Latin1") is used as an equivalent for ISO-8859-1.  But some people treat
"Latin1" as referring just to the characters in the range 128 through 255, or
sometimes from 160 through 255.
This documentation uses "Latin1" and "Latin-1" to refer to all 256 characters.

Note that Perl can be compiled and run under either ASCII or EBCDIC (See
L<perlebcdic>).  Most of the documentation (and even comments in the code)
ignore the EBCDIC possibility.
For almost all purposes the differences are transparent.
As an example, under EBCDIC,
instead of UTF-8, UTF-EBCDIC is used to encode Unicode strings, and so
whenever this documentation refers to C<utf8>
(and variants of that name, including in function names),
it also (essentially transparently) means C<UTF-EBCDIC>.
But the ordinals of characters differ between ASCII, EBCDIC, and
the UTF- encodings, and a string encoded in UTF-EBCDIC may occupy a different
number of bytes than in UTF-8.

The organization of this document is tentative and subject to change.
Suggestions and patches welcome
L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>.

The API elements are grouped by functionality into sections, as follows.
Within sections the elements are ordered alphabetically, ignoring case, with
non-leading underscores sorted first, and leading underscores and digits
sorted last.

=over 4

=item L</AV Handling>

=item L</Callback Functions>

=item L</Casting>

=item L</Character case changing>

=item L</Character classification>

=item L</Compiler and Preprocessor information>

=item L</Compiler directives>

=item L</Compile-time scope hooks>

=item L</Concurrency>

=item L</COPs and Hint Hashes>

=item L</Custom Operators>

=item L</CV Handling>

=item L</Debugging>

=item L</Display functions>

=item L</Embedding, Threads, and Interpreter Cloning>

=item L</Errno>

=item L</Exception Handling (simple) Macros>

=item L</Filesystem configuration values>

=item L</Floating point>

=item L</General Configuration>

=item L</Global Variables>

=item L</GV Handling and Stashes>

=item L</Hook manipulation>

=item L</HV Handling>

=item L</Input/Output>

=item L</Integer>

=item L</I/O Formats>

=item L</Lexer interface>

=item L</Locales>

=item L</Magic>

=item L</Memory Management>

=item L</MRO>

=item L</Multicall Functions>

=item L</Numeric Functions>

=item L</Optrees>

=item L</Pack and Unpack>

=item L</Pad Data Structures>

=item L</Password and Group access>

=item L</Paths to system commands>

=item L</Prototype information>

=item L</Reference-counted stack manipulation>

=item L</REGEXP Functions>

=item L</Reports and Formats>

=item L</Signals>

=item L</Site configuration>

=item L</Sockets configuration values>

=item L</Source Filters>

=item L</Stack Manipulation Macros>

=item L</String Handling>

=item L</SV Flags>

=item L</SV Handling>

=item L</Tainting>

=item L</Time>

=item L</Typedef names>

=item L</Unicode Support>

=item L</Utility Functions>

=item L</Versioning>

=item L</Warning and Dieing>

=item L</XS>

=item L</Undocumented elements>

=back

The listing below is alphabetical, case insensitive.


=head1 AV Handling

=over 4

=item C<AV>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 30

=over 4

=item C<av_clear>
X<av_clear>

Frees all the elements of an array, leaving it empty.
The XS equivalent of C<@array = ()>.  See also L</av_undef>.

Note that it is possible that the actions of a destructor called directly
or indirectly by freeing an element of the array could cause the reference
count of the array itself to be reduced (e.g. by deleting an entry in the
symbol table). So it is a possibility that the AV could have been freed
(or even reallocated) on return from the call unless you hold a reference
to it.

=over 3

 void       av_clear(      AV *av)
 void  Perl_av_clear(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 618

=over 4

=item C<av_count>
X<av_count>

Returns the number of elements in the array C<av>.  This is the true length of
the array, including any undefined elements.  It is always the same as
S<C<av_top_index(av) + 1>>.

=over 3

 Size_t       av_count(      AV *av)
 Size_t  Perl_av_count(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 48

=over 4

=item C<av_create_and_push>
X<av_create_and_push>

Push an SV onto the end of the array, creating the array if necessary.
A small internal helper function to remove a commonly duplicated idiom.

=over 3

 void  Perl_av_create_and_push(pTHX_ AV ** const avp,
                                     SV * const val)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 751

=over 4

=item C<av_create_and_unshift_one>
X<av_create_and_unshift_one>

Unshifts an SV onto the beginning of the array, creating the array if
necessary.
A small internal helper function to remove a commonly duplicated idiom.

=over 3

 SV **  Perl_av_create_and_unshift_one(pTHX_ AV ** const avp,
                                             SV * const val)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 849

=over 4

=item C<av_delete>
X<av_delete>

Deletes the element indexed by C<key> from the array, makes the element
mortal, and returns it.  If C<flags> equals C<G_DISCARD>, the element is
freed and NULL is returned. NULL is also returned if C<key> is out of
range.

Perl equivalent: S<C<splice(@myarray, $key, 1, undef)>> (with the
C<splice> in void context if C<G_DISCARD> is present).

=over 3

 SV *       av_delete(      AV *av, SSize_t key, I32 flags)
 SV *  Perl_av_delete(pTHX_ AV *av, SSize_t key, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 1065

=over 4

=item C<av_exists>
X<av_exists>

Returns true if the element indexed by C<key> has been initialized.

This relies on the fact that uninitialized array elements are set to
C<NULL>.

Perl equivalent: C<exists($myarray[$key])>.

=over 3

 bool       av_exists(      AV *av, SSize_t key)
 bool  Perl_av_exists(pTHX_ AV *av, SSize_t key)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 1143

=over 4

=item C<av_extend>
X<av_extend>

Pre-extend an array so that it is capable of storing values at indexes
C<0..key>. Thus C<av_extend(av,99)> guarantees that the array can store 100
elements, i.e. that C<av_store(av, 0, sv)> through C<av_store(av, 99, sv)>
on a plain array will work without any further memory allocation.

If the av argument is a tied array then will call the C<EXTEND> tied
array method with an argument of C<(key+1)>.

=over 3

 void       av_extend(      AV *av, SSize_t key)
 void  Perl_av_extend(pTHX_ AV *av, SSize_t key)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 52

=over 4

=item C<av_fetch>
X<av_fetch>

Returns the SV at the specified index in the array.  The C<key> is the
index.  If C<lval> is true, you are guaranteed to get a real SV back (in case
it wasn't real before), which you can then modify.  Check that the return
value is non-NULL before dereferencing it to a C<SV*>.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
more information on how to use this function on tied arrays. 

The rough perl equivalent is C<$myarray[$key]>.

=over 3

 SV **       av_fetch(      AV *av, SSize_t key, I32 lval)
 SV **  Perl_av_fetch(pTHX_ AV *av, SSize_t key, I32 lval)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 227

=over 4

=item C<av_fill>
X<av_fill>

Set the highest index in the array to the given number, equivalent to
Perl's S<C<$#array = $fill;>>.

The number of elements in the array will be S<C<fill + 1>> after
C<av_fill()> returns.  If the array was previously shorter, then the
additional elements appended are set to NULL.  If the array
was longer, then the excess elements are freed.  S<C<av_fill(av, -1)>> is
the same as C<av_clear(av)>.

=over 3

 void       av_fill(      AV *av, SSize_t fill)
 void  Perl_av_fill(pTHX_ AV *av, SSize_t fill)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 1011

=over 4

=item C<av_len*>

Described under C<L</av_top_index>>

=back

=over 4

=item C<av_make>
X<av_make>

Creates a new AV and populates it with a list (C<**strp>, length C<size>) of
SVs.  A copy is made of each SV, so their refcounts are not changed.  The new
AV will have a reference count of 1.

Perl equivalent: C<my @new_array = ($scalar1, $scalar2, $scalar3...);>

=over 3

 AV *       av_make(      SSize_t size, SV **strp)
 AV *  Perl_av_make(pTHX_ SSize_t size, SV **strp)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 454

=over 4

=item C<av_pop>
X<av_pop>

Removes one SV from the end of the array, reducing its size by one and
returning the SV (transferring control of one reference count) to the
caller.  Returns C<&PL_sv_undef> if the array is empty.

Perl equivalent: C<pop(@myarray);>

=over 3

 SV *       av_pop(      AV *av)
 SV *  Perl_av_pop(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 810

=over 4

=item C<av_push>

=item C<av_push_simple>
X<av_push>X<av_push_simple>

These each push an SV (transferring control of one reference count) onto the
end of the array.  The array will grow automatically to accommodate the
addition.

Perl equivalent: C<push @myarray, $val;>.

C<av_push> is the general purpose form, suitable for all situations.

C<av_push_simple> is a cut-down version of C<av_push> that assumes that the
array is very straightforward, with no magic, not readonly, and is AvREAL
(see L<perlguts/Real AVs - and those that are not>), and that C<key> is not
less than -1. This function MUST NOT be used in situations where any of those
assumptions may not hold.

=over 3

 void       av_push       (      AV *av, SV *val)
 void  Perl_av_push       (pTHX_ AV *av, SV *val)
 void       av_push_simple(      AV *av, SV *val)
 void  Perl_av_push_simple(pTHX_ AV *av, SV *val)

=back

=back

=for hackers
av_push declared in embed.fnc; all in group documented at av.c, line 770
av_push_simple declared in embed.fnc

=over 4

=item C<av_shift>
X<av_shift>

Removes one SV from the start of the array, reducing its size by one and
returning the SV (transferring control of one reference count) to the
caller.  Returns C<&PL_sv_undef> if the array is empty.

Perl equivalent: C<shift(@myarray);>

=over 3

 SV *       av_shift(      AV *av)
 SV *  Perl_av_shift(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 936

=over 4

=item C<av_store>
X<av_store>

Stores an SV in an array.  The array index is specified as C<key>.  The
return value will be C<NULL> if the operation failed or if the value did not
need to be actually stored within the array (as in the case of tied
arrays).  Otherwise, it can be dereferenced
to get the C<SV*> that was stored
there (= C<val>)).

Note that the caller is responsible for suitably incrementing the reference
count of C<val> before the call, and decrementing it if the function
returned C<NULL>.

Approximate Perl equivalent: C<splice(@myarray, $key, 1, $val)>.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
more information on how to use this function on tied arrays.

=over 3

 SV **       av_store(      AV *av, SSize_t key, SV *val)
 SV **  Perl_av_store(pTHX_ AV *av, SSize_t key, SV *val)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 318

=over 4

=item C<av_top_index>

=item C<av_tindex>

=item C<AvFILL>

=item C<av_len>
X<av_len>X<av_tindex>X<av_top_index>X<AvFILL>

These behave identically.
If the array C<av> is empty, these return -1; otherwise they return the maximum
value of the indices of all the array elements which are currently defined in
C<av>.

They process 'get' magic.

The Perl equivalent for these is C<$#av>.

Note that, unlike what the name C<av_len> implies, it returns
the maximum index in the array.  This is unlike L</sv_len>, which returns what
you would expect.  To get the actual number of elements in an array, use
C<L</av_count>>.

=over 3

 SSize_t       av_top_index(      AV *av)
 SSize_t       av_tindex   (      AV *av)
 SSize_t       AvFILL      (      AV* av)
 SSize_t       av_len      (      AV *av)
 SSize_t  Perl_av_len      (pTHX_ AV *av)

=back

=back

=for hackers
av_top_index declared at av.h, line 114; all in group documented at av.c, line 980
av_tindex declared at av.h, line 113
AvFILL declared at av.h, line 112
av_len declared in embed.fnc

=over 4

=item C<av_undef>
X<av_undef>

Undefines the array. The XS equivalent of C<undef(@array)>.

As well as freeing all the elements of the array (like C<av_clear()>), this
also frees the memory used by the av to store its list of scalars.

See L</av_clear> for a note about the array possibly being invalid on
return.

=over 3

 void       av_undef(      AV *av)
 void  Perl_av_undef(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 694

=over 4

=item C<av_unshift>
X<av_unshift>

Unshift the given number of C<undef> values onto the beginning of the
array.  The array will grow automatically to accommodate the addition.

Perl equivalent: S<C<unshift @myarray, ((undef) x $num);>>

=over 3

 void       av_unshift(      AV *av, SSize_t num)
 void  Perl_av_unshift(pTHX_ AV *av, SSize_t num)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 870

=over 4

=item C<AvALLOC>

Described in L<perlguts>.

=over 3

   AvALLOC(AV* av)

=back

=back

=for hackers
Documented at pod/perlguts.pod, line 512

=over 4

=item C<AvARRAY>
X<AvARRAY>

Returns a pointer to the AV's internal SV* array.

This is useful for doing pointer arithmetic on the array.
If all you need is to look up an array element, then prefer C<av_fetch>.

=over 3

 SV**  AvARRAY(AV* av)

=back

=back

=for hackers
Declared and documented at av.h, line 80

=over 4

=item C<AvFILL*>

Described under C<L</av_top_index>>

=back

=over 4

=item C<AvREFCNT_inc>

=item C<AvREFCNT_inc_simple>

=item C<AvREFCNT_inc_simple_NN>
X<AvREFCNT_inc>X<AvREFCNT_inc_simple>X<AvREFCNT_inc_simple_NN>

These all increment the reference count of the given SV, which must be an AV.
They are useful when assigning the result into a typed pointer as they avoid
the need to cast the result to the appropriate type.

=over 3

 AV *  AvREFCNT_inc          (AV *av)
 AV *  AvREFCNT_inc_simple   (AV *av)
 AV *  AvREFCNT_inc_simple_NN(AV *av)

=back

=back

=for hackers
AvREFCNT_inc declared at av.h, line 22; all in group documented at av.h, line 22
AvREFCNT_inc_simple declared at av.h, line 23
AvREFCNT_inc_simple_NN declared at av.h, line 24

=over 4

=item C<get_av>
X<get_av>

Returns the AV of the specified Perl global or package array with the given
name (so it won't work on lexical variables).  C<flags> are passed
to C<gv_fetchpv>.  If C<GV_ADD> is set and the
Perl variable does not exist then it will be created.  If C<flags> is zero
(ignoring C<SVf_UTF8>) and the variable does not exist then C<NULL> is
returned.

Perl equivalent: C<@{"$name"}>.

NOTE: the C<perl_get_av()> form is B<deprecated>.

=over 3

 AV *       get_av(      const char *name, I32 flags)
 AV *  Perl_get_av(pTHX_ const char *name, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 2919

=over 4

=item C<newAV>

=item C<newAV_mortal>

=item C<newAV_alloc_x>

=item C<newAV_alloc_xz>
X<newAV>X<newAV_alloc_x>X<newAV_alloc_xz>X<newAV_mortal>

These all create a new AV, setting the reference count to 1.  If you also know
the initial elements of the array with, see L</C<av_make>>.

As background, an array consists of three things:

=over

=item 1.

A data structure containing information about the array as a whole, such as its
size and reference count.

=item 2.

A C language array of pointers to the individual elements.  These are treated
as pointers to SVs, so all must be castable to SV*.

=item 3.

The individual elements themselves.  These could be, for instance, SVs and/or
AVs and/or HVs, etc.

=back

An empty array need only have the first data structure, and all these functions
create that.  They differ in what else they do, as follows:

=over

=item C<newAV> form

=for comment
'form' above and below is because otherwise have two =items with the same name,
can't link to them.

This does nothing beyond creating the whole-array data structure.
The Perl equivalent is approximately S<C<my @array;>>

This is useful when the minimum size of the array could be zero (perhaps there
are likely code paths that will entirely skip using it).

If the array does get used, the pointers data structure will need to be
allocated at that time.  This will end up being done by L</av_extend>>,
either explicitly:

    av_extend(av, len);

or implicitly when the first element is stored:

    (void)av_store(av, 0, sv);

Unused array elements are typically initialized by C<av_extend>.

=item C<newAV_mortal> form

This also creates the whole-array data structure, but also mortalises it.
(That is to say, a reference to the AV is added to the C<temps> stack.)

=item C<newAV_alloc_x> form

This effectively does a C<newAV> followed by also allocating (uninitialized)
space for the pointers array.  This is used when you know ahead of time the
likely minimum size of the array.  It is more efficient to do this than doing a
plain C<newAV> followed by an C<av_extend>.

Of course the array can be extended later should it become necessary.

C<size> must be at least 1.

=item C<newAV_alloc_xz> form

This is C<newAV_alloc_x>, but initializes each pointer in it to NULL.  This
gives added safety to guard against them being read before being set.

C<size> must be at least 1.

=back

The following examples all result in an array that can fit four elements
(indexes 0 .. 3):

    AV *av = newAV();
    av_extend(av, 3);

    AV *av = newAV_alloc_x(4);

    AV *av = newAV_alloc_xz(4);

In contrast, the following examples allocate an array that is only guaranteed
to fit one element without extending:

    AV *av = newAV_alloc_x(1);
    AV *av = newAV_alloc_xz(1);

=over 3

 AV *       newAV         ()
 AV *  Perl_newAV         (pTHX)
 AV *       newAV_mortal  ()
 AV *       newAV_alloc_x (SSize_t size)
 AV *       newAV_alloc_xz(SSize_t size)

=back

=back

=for hackers
newAV declared in embed.fnc; all in group documented at av.h, line 136
newAV_mortal declared in embed.fnc
newAV_alloc_x declared in embed.fnc
newAV_alloc_xz declared in embed.fnc

=over 4

=item C<newAVav>
X<newAVav>

Creates a new AV and populates it with values copied from an existing AV.  The
new AV will have a reference count of 1, and will contain newly created SVs
copied from the original SV.  The original source will remain unchanged.

Perl equivalent: C<my @new_array = @existing_array;>

=over 3

 AV *       newAVav(      AV *oav)
 AV *  Perl_newAVav(pTHX_ AV *oav)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 511

=over 4

=item C<newAVhv>
X<newAVhv>

Creates a new AV and populates it with keys and values copied from an existing
HV.  The new AV will have a reference count of 1, and will contain newly
created SVs copied from the original HV.  The original source will remain
unchanged.

Perl equivalent: C<my @new_array = %existing_hash;>

=over 3

 AV *       newAVhv(      HV *ohv)
 AV *  Perl_newAVhv(pTHX_ HV *ohv)

=back

=back

=for hackers
Declared in embed.fnc; documented at av.c, line 562

=over 4

=item C<Nullav>
X<Nullav>

C<B<DEPRECATED!>>  It is planned to remove C<Nullav>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Null AV pointer.

(deprecated - use C<(AV *)NULL> instead)

=back

=for hackers
Declared and documented at av.h, line 69

=head1 Callback Functions
X<G_METHOD>X<G_METHOD_NAMED>X<G_RETHROW>X<G_USEHINTS>X<SAVEf_KEEPOLDELEM>
X<SAVEf_SETMAGIC>

=over 4

=item C<call_argv>
X<call_argv>

Performs a callback to the specified named and package-scoped Perl subroutine
with C<argv> (a C<NULL>-terminated array of strings) as arguments.  See
L<perlcall>.

Approximate Perl equivalent: C<&{"$sub_name"}(@$argv)>.

NOTE: the C<perl_call_argv()> form is B<deprecated>.

=over 3

 SSize_t       call_argv(      const char *sub_name, I32 flags,
                               char **argv)
 SSize_t  Perl_call_argv(pTHX_ const char *sub_name, I32 flags,
                               char **argv)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3037

=over 4

=item C<call_method>
X<call_method>

Performs a callback to the specified Perl method.  The blessed object must
be on the stack.  See L<perlcall>.

NOTE: the C<perl_call_method()> form is B<deprecated>.

=over 3

 SSize_t       call_method(      const char *methname, I32 flags)
 SSize_t  Perl_call_method(pTHX_ const char *methname, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3111

=over 4

=item C<call_pv>
X<call_pv>

Performs a callback to the specified Perl sub.  See L<perlcall>.

NOTE: the C<perl_call_pv()> form is B<deprecated>.

=over 3

 SSize_t       call_pv(      const char *sub_name, I32 flags)
 SSize_t  Perl_call_pv(pTHX_ const char *sub_name, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3093

=over 4

=item C<call_sv>
X<call_sv>

Performs a callback to the Perl sub specified by the SV.

If neither the C<G_METHOD> nor C<G_METHOD_NAMED> flag is supplied, the
SV may be any of a CV, a GV, a reference to a CV, a reference to a GV
or C<SvPV(sv)> will be used as the name of the sub to call.

If the C<G_METHOD> flag is supplied, the SV may be a reference to a CV or
C<SvPV(sv)> will be used as the name of the method to call.

If the C<G_METHOD_NAMED> flag is supplied, C<SvPV(sv)> will be used as
the name of the method to call.

Some other values are treated specially for internal use and should
not be depended on.

See L<perlcall>.

NOTE: the C<perl_call_sv()> form is B<deprecated>.

=over 3

 SSize_t       call_sv(      SV *sv, I32 flags)
 SSize_t  Perl_call_sv(pTHX_ SV *sv, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3138

=over 4

=item C<DESTRUCTORFUNC_NOCONTEXT_t>

=item C<DESTRUCTORFUNC_t>

Described in L<perlguts>.

=back

=for hackers
DESTRUCTORFUNC_NOCONTEXT_t all in group documented at pod/perlguts.pod, line 2088
DESTRUCTORFUNC_t 

=over 4

=item C<ENTER>
X<ENTER>

Opening bracket on a callback.  See C<L</LEAVE>> and L<perlcall>.

=over 3

   ENTER;

=back

=back

=for hackers
Declared and documented at scope.h, line 97

=over 4

=item C<ENTER_with_name>
X<ENTER_with_name>

Same as C<L</ENTER>>, but when debugging is enabled it also associates the
given literal string with the new scope.

=over 3

   ENTER_with_name("name");

=back

=back

=for hackers
Declared and documented at scope.h, line 103

=over 4

=item C<eval_pv>
X<eval_pv>

Tells Perl to C<eval> the given string in scalar context and return an SV* result.

NOTE: the C<perl_eval_pv()> form is B<deprecated>.

=over 3

 SV *       eval_pv(      const char *p, I32 croak_on_error)
 SV *  Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3466

=over 4

=item C<eval_sv>
X<eval_sv>

Tells Perl to C<eval> the string in the SV.  It supports the same flags
as C<call_sv>, with the obvious exception of C<G_EVAL>.  See L<perlcall>.

The C<G_RETHROW> flag can be used if you only need eval_sv() to
execute code specified by a string, but not catch any errors.

By default the code is compiled and executed with the default hints,
such as strict and features.  Set C<G_USEHINTS> in flags to use the
current hints from C<PL_curcop>.

NOTE: the C<perl_eval_sv()> form is B<deprecated>.

=over 3

 SSize_t       eval_sv(      SV *sv, I32 flags)
 SSize_t  Perl_eval_sv(pTHX_ SV *sv, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3319

=over 4

=item C<FREETMPS>
X<FREETMPS>

Closing bracket for temporaries on a callback.  See C<L</SAVETMPS>> and
L<perlcall>.

=over 3

   FREETMPS;

=back

=back

=for hackers
Declared and documented at scope.h, line 93

=over 4

=item C<G_DISCARD>

=item C<G_EVAL>

=item C<G_KEEPERR>

=item C<G_LIST>

=item C<G_NOARGS>

=item C<G_SCALAR>

=item C<G_VOID>

Described in L<perlcall>.

=back

=for hackers
G_DISCARD all in group documented at pod/perlcall.pod, line 233
G_EVAL 
G_KEEPERR 
G_LIST 
G_NOARGS 
G_SCALAR 
G_VOID 

=over 4

=item C<GIMME>
X<GIMME>

C<B<DEPRECATED!>>  It is planned to remove C<GIMME>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

A backward-compatible version of C<GIMME_V> which can only return
C<G_SCALAR> or C<G_LIST>; in a void context, it returns C<G_SCALAR>.
Deprecated.  Use C<GIMME_V> instead.

=over 3

 U32  GIMME

=back

=back

=for hackers
Declared and documented at op.h, line 94

=over 4

=item C<GIMME_V>
X<GIMME_V>

The XSUB-writer's equivalent to Perl's C<wantarray>.  Returns C<G_VOID>,
C<G_SCALAR> or C<G_LIST> for void, scalar or list context,
respectively.  See L<perlcall> for a usage example.

=over 3

 U32  GIMME_V

=back

=back

=for hackers
Declared and documented at op.h, line 89

=over 4

=item C<is_lvalue_sub>
X<is_lvalue_sub>

Returns non-zero if the sub calling this function is being called in an lvalue
context.  Returns 0 otherwise.

=over 3

 I32       is_lvalue_sub()
 I32  Perl_is_lvalue_sub(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_ctl.c, line 1663

=over 4

=item C<LEAVE>
X<LEAVE>

Closing bracket on a callback.  See C<L</ENTER>> and L<perlcall>.

=over 3

   LEAVE;

=back

=back

=for hackers
Declared and documented at scope.h, line 100

=over 4

=item C<LEAVE_with_name>
X<LEAVE_with_name>

Same as C<L</LEAVE>>, but when debugging is enabled it first checks that the
scope has the given name. C<name> must be a literal string.

=over 3

   LEAVE_with_name("name");

=back

=back

=for hackers
Declared and documented at scope.h, line 108

=over 4

=item C<mortal_destructor_sv>
X<mortal_destructor_sv>

This function arranges for either a Perl code reference, or a C function
reference to be called at the B<end of the current statement>.

The C<coderef> argument determines the type of function that will be
called. If it is C<SvROK()> it is assumed to be a reference to a CV and
will arrange for the coderef to be called. If it is not SvROK() then it
is assumed to be a C<SvIV()> which is C<SvIOK()> whose value is a pointer
to a C function of type C<DESTRUCTORFUNC_t> created using C<PTR2INT()>.
Either way the C<args> parameter will be provided to the callback as a
parameter, although the rules for doing so differ between the Perl and
C mode. Normally this function is only used directly for the Perl case
and the wrapper C<mortal_destructor_x()> is used for the C function case.

When operating in Perl callback mode the C<args> parameter may be NULL
in which case the code reference is called with no arguments, otherwise
if it is an AV (SvTYPE(args) == SVt_PVAV) then the contents of the AV
will be used as the arguments to the code reference, and if it is any
other type then the C<args> SV will be provided as a single argument to
the code reference.

When operating in a C callback mode the C<args> parameter will be passed
directly to the C function as a C<void *> pointer. No additional
processing of the argument will be performed, and it is the callers
responsibility to free the C<args> parameter if necessary.

Be aware that there is a significant difference in timing between the
I<end of the current statement> and the I<end of the current pseudo
block>. If you are looking for a mechanism to trigger a function at the
end of the B<current pseudo block> you should look at
L<perlapi/C<SAVEDESTRUCTOR_X>> instead of this function.

=over 3

 void       mortal_destructor_sv(      SV *coderef, SV *args)
 void  Perl_mortal_destructor_sv(pTHX_ SV *coderef, SV *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at scope.c, line 1879

=over 4

=item C<MORTALDESTRUCTOR_SV>

=item C<MORTALSVFUNC_X>

Described in L<perlguts>.

=over 3

   MORTALDESTRUCTOR_SV(SV *coderef, SV *args)
   MORTALSVFUNC_X     (SVFUNC_t f, SV *sv)

=back

=back

=for hackers
MORTALDESTRUCTOR_SV all in group documented at pod/perlguts.pod, line 2131
MORTALSVFUNC_X 

=over 4

=item C<PL_errgv>

Described in L<perlcall>.

=back

=for hackers
Documented at pod/perlcall.pod, line 1011

=over 4

=item C<save_aelem>

=item C<save_aelem_flags>
X<save_aelem>X<save_aelem_flags>

These each arrange for the value of the array element C<av[idx]> to be restored
at the end of the enclosing I<pseudo-block>.

In C<save_aelem>, the SV at C**sptr> will be replaced by a new C<undef>
scalar.  That scalar will inherit any magic from the original C<**sptr>,
and any 'set' magic will be processed.

In C<save_aelem_flags>, C<SAVEf_KEEPOLDELEM> being set in C<flags> causes
the function to forgo all that:  the scalar at C<**sptr> is untouched.
If C<SAVEf_KEEPOLDELEM> is not set, the SV at C**sptr> will be replaced by a
new C<undef> scalar.  That scalar will inherit any magic from the original
C<**sptr>.  Any 'set' magic will be processed if and only if C<SAVEf_SETMAGIC>
is set in in C<flags>.

=over 3

 void       save_aelem      (      AV *av, SSize_t idx, SV **sptr)
 void       save_aelem_flags(      AV *av, SSize_t idx, SV **sptr,
                                   const U32 flags)
 void  Perl_save_aelem_flags(pTHX_ AV *av, SSize_t idx, SV **sptr,
                                   const U32 flags)

=back

=back

=for hackers
save_aelem declared in embed.fnc; all in group documented at scope.c, line 940
save_aelem_flags declared in embed.fnc

=over 4

=item C<save_aptr>

=item C<save_ary>

=item C<save_hash>

Described in L<perlguts>.

=over 3

 void       save_aptr(      AV **aptr)
 void  Perl_save_aptr(pTHX_ AV **aptr)
 AV *       save_ary (      GV *gv)
 AV *  Perl_save_ary (pTHX_ GV *gv)
 HV *       save_hash(      GV *gv)
 HV *  Perl_save_hash(pTHX_ GV *gv)

=back

=back

=for hackers
save_aptr declared in embed.fnc; all in group documented at pod/perlguts.pod, line 2187
save_ary declared in embed.fnc
save_hash declared in embed.fnc

=over 4

=item C<save_helem>

=item C<save_helem_flags>
X<save_helem>X<save_helem_flags>

These each arrange for the value of the hash element (in Perlish terms)
C<$hv{key}]> to be restored at the end of the enclosing I<pseudo-block>.

In C<save_helem>, the SV at C**sptr> will be replaced by a new C<undef>
scalar.  That scalar will inherit any magic from the original C<**sptr>,
and any 'set' magic will be processed.

In C<save_helem_flags>, C<SAVEf_KEEPOLDELEM> being set in C<flags> causes
the function to forgo all that:  the scalar at C<**sptr> is untouched.
If C<SAVEf_KEEPOLDELEM> is not set, the SV at C**sptr> will be replaced by a
new C<undef> scalar.  That scalar will inherit any magic from the original
C<**sptr>.  Any 'set' magic will be processed if and only if C<SAVEf_SETMAGIC>
is set in in C<flags>.

=over 3

 void       save_helem      (      HV *hv, SV *key, SV **sptr)
 void       save_helem_flags(      HV *hv, SV *key, SV **sptr,
                                   const U32 flags)
 void  Perl_save_helem_flags(pTHX_ HV *hv, SV *key, SV **sptr,
                                   const U32 flags)

=back

=back

=for hackers
save_helem declared in embed.fnc; all in group documented at scope.c, line 993
save_helem_flags declared in embed.fnc

=over 4

=item C<save_hptr>

=item C<save_item>

=item C<save_scalar>

=item C<save_svref>

=item C<SAVEBOOL>

=item C<SAVEDELETE>

=item C<SAVEDESTRUCTOR>

=item C<SAVEDESTRUCTOR_X>

=item C<SAVEFREEOP>

=item C<SAVEFREEPV>

=item C<SAVEFREERCPV>

=item C<SAVEFREESV>

=item C<SAVEGENERICSV>

=item C<SAVEINT>

=item C<SAVEIV>

=item C<SAVEI8>

=item C<SAVEI16>

=item C<SAVEI32>

=item C<SAVEMORTALIZESV>

=item C<SAVEPPTR>

=item C<SAVERCPV>

=item C<SAVESPTR>

=item C<SAVESTACK_POS>

=item C<SAVESTRLEN>

Described in L<perlguts>.

=over 3

 void       save_hptr       (      HV **hptr)
 void  Perl_save_hptr       (pTHX_ HV **hptr)
 void       save_item       (      SV *item)
 void  Perl_save_item       (pTHX_ SV *item)
 SV *       save_scalar     (      GV *gv)
 SV *  Perl_save_scalar     (pTHX_ GV *gv)
 SV *       save_svref      (      SV **sptr)
 SV *  Perl_save_svref      (pTHX_ SV **sptr)
            SAVEBOOL        (      bool i)
            SAVEDELETE      (      HV * hv, char * key,
                                   I32 length)
            SAVEDESTRUCTOR  (      DESTRUCTORFUNC_NOCONTEXT_t f,
                                   void *p)
            SAVEDESTRUCTOR_X(      DESTRUCTORFUNC_t f, void *p)
            SAVEFREEOP      (      OP *op)
            SAVEFREEPV      (      char *pv)
            SAVEFREERCPV    (      char *pv)
            SAVEFREESV      (      SV* sv)
            SAVEGENERICSV   (      char **psv)
            SAVEINT         (      int i)
            SAVEIV          (      IV i)
            SAVEI8          (      I8 i)
            SAVEI16         (      I16 i)
            SAVEI32         (      I32 i)
            SAVEMORTALIZESV (      SV* sv)
            SAVEPPTR        (      char * p)
            SAVERCPV        (      char *pv)
            SAVESPTR        (      SV * s)
            SAVESTACK_POS   ()
            SAVESTRLEN      (      STRLEN i)

=back

=back

=for hackers
save_hptr declared in embed.fnc; all in group documented at pod/perlguts.pod, line 2188
save_item declared in embed.fnc
save_scalar declared in embed.fnc
save_svref declared in embed.fnc
SAVEBOOL 
SAVEDELETE 
SAVEDESTRUCTOR 
SAVEDESTRUCTOR_X 
SAVEFREEOP 
SAVEFREEPV 
SAVEFREERCPV 
SAVEFREESV 
SAVEGENERICSV 
SAVEINT 
SAVEIV 
SAVEI8 
SAVEI16 
SAVEI32 
SAVEMORTALIZESV 
SAVEPPTR 
SAVERCPV 
SAVESPTR 
SAVESTACK_POS 
SAVESTRLEN 

=over 4

=item C<SAVETMPS>
X<SAVETMPS>

Opening bracket for temporaries on a callback.  See C<L</FREETMPS>> and
L<perlcall>.

=over 3

   SAVETMPS;

=back

=back

=for hackers
Declared and documented at scope.h, line 89

=head1 Casting

=over 4

=item C<cBOOL>
X<cBOOL>

Cast-to-bool.  When Perl was able to be compiled on pre-C99 compilers, a
C<(bool)> cast didn't necessarily do the right thing, so this macro was
created (and made somewhat complicated to work around bugs in old
compilers).  Now, many years later, and C99 is used, this is no longer
required, but is kept for backwards compatibility.

=over 3

 bool  cBOOL(bool expr)

=back

=back

=for hackers
Declared and documented at handy.h, line 143

=over 4

=item C<I_V>
X<I_V>

Cast an NV to IV while avoiding undefined C behavior

=over 3

 IV  I_V(NV what)

=back

=back

=for hackers
Declared and documented at perl.h, line 4695

=over 4

=item C<I_32>
X<I_32>

Cast an NV to I32 while avoiding undefined C behavior

=over 3

 I32  I_32(NV what)

=back

=back

=for hackers
Declared and documented at perl.h, line 4689

=over 4

=item C<INT2PTR>

=item C<PTRV>

=item C<PTR2IV>

=item C<PTR2nat>

=item C<PTR2NV>

=item C<PTR2ul>

=item C<PTR2UV>

Described in L<perlguts>.

=over 3

 type           INT2PTR(type, int value)
 IV             PTR2IV (void * ptr)
 IV             PTR2nat(void *)
 NV             PTR2NV (void * ptr)
 unsigned long  PTR2ul (void *)
 UV             PTR2UV (void * ptr)

=back

=back

=for hackers
INT2PTR all in group documented at pod/perlguts.pod, line 3371
PTRV 
PTR2IV 
PTR2nat 
PTR2NV 
PTR2ul 
PTR2UV 

=over 4

=item C<U_V>
X<U_V>

Cast an NV to UV while avoiding undefined C behavior

=over 3

 UV  U_V(NV what)

=back

=back

=for hackers
Declared and documented at perl.h, line 4698

=over 4

=item C<U_32>
X<U_32>

Cast an NV to U32 while avoiding undefined C behavior

=over 3

 U32  U_32(NV what)

=back

=back

=for hackers
Declared and documented at perl.h, line 4692

=head1 Character case changing


Perl uses "full" Unicode case mappings.  This means that converting a single
character to another case may result in a sequence of more than one character.
For example, the uppercase of C<E<223>> (LATIN SMALL LETTER SHARP S) is the two
character sequence C<SS>.  This presents some complications   The lowercase of
all characters in the range 0..255 is a single character, and thus
C<L</toLOWER_L1>> is furnished.  But, C<toUPPER_L1> can't exist, as it couldn't
return a valid result for all legal inputs.  Instead C<L</toUPPER_uvchr>> has
an API that does allow every possible legal result to be returned.)  Likewise
no other function that is crippled by not being able to give the correct
results for the full range of possible inputs has been implemented here.


=over 4

=item C<toFOLD>

=item C<toFOLD_A>

=item C<toFOLD_utf8>

=item C<toFOLD_utf8_safe>

=item C<toFOLD_uvchr>
X<toFOLD>X<toFOLD_A>X<toFOLD_utf8>X<toFOLD_utf8_safe>X<toFOLD_uvchr>

These all return the foldcase of a character.  "foldcase" is an internal case
for C</i> pattern matching. If the foldcase of character A and the foldcase of
character B are the same, they match caselessly; otherwise they don't.

The differences in the forms are what domain they operate on, and whether the
input is specified as a code point (those forms with a C<cp> parameter) or as a
UTF-8 string (the others).  In the latter case, the code point to use is the
first one in the buffer of UTF-8 encoded code points, delineated by the
arguments S<C<p .. e - 1>>.

C<toFOLD> and C<toFOLD_A> are synonyms of each other.  They return the
foldcase of any ASCII-range code point.  In this range, the foldcase is
identical to the lowercase.  All other inputs are returned unchanged.  Since
these are macros, the input type may be any integral one, and the output will
occupy the same number of bits as the input.

There is no C<toFOLD_L1> nor C<toFOLD_LATIN1> as the foldcase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toFOLD_uvchr>.

C<toFOLD_uvchr> returns the foldcase of any Unicode code point.  The return
value is identical to that of C<toFOLD_A> for input code points in the ASCII
range.  The foldcase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the foldcase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire foldcase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toFOLD_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toFOLD_utf8> and C<toFOLD_utf8_safe> are synonyms of each other.  The only
difference between these and C<toFOLD_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=over 3

 UV  toFOLD          (UV cp)
 UV  toFOLD_A        (UV cp)
 UV  toFOLD_utf8     (U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toFOLD_utf8_safe(U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toFOLD_uvchr    (UV cp, U8* s, STRLEN* lenp)

=back

=back

=for hackers
toFOLD declared at handy.h, line 1227; all in group documented at handy.h, line 1227
toFOLD_A declared at handy.h, line 1228
toFOLD_utf8 declared at handy.h, line 1229
toFOLD_utf8_safe declared at handy.h, line 1230
toFOLD_uvchr declared at handy.h, line 1231

=over 4

=item C<toLOWER>

=item C<toLOWER_A>

=item C<toLOWER_LATIN1>

=item C<toLOWER_LC>

=item C<toLOWER_L1>

=item C<toLOWER_utf8>

=item C<toLOWER_utf8_safe>

=item C<toLOWER_uvchr>
X<toLOWER>X<toLOWER_A>X<toLOWER_LATIN1>X<toLOWER_LC>X<toLOWER_L1>
X<toLOWER_utf8>X<toLOWER_utf8_safe>X<toLOWER_uvchr>

These all return the lowercase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toLOWER> and C<toLOWER_A> are synonyms of each other.  They return the
lowercase of any uppercase ASCII-range code point.  All other inputs are
returned unchanged.  Since these are macros, the input type may be any integral
one, and the output will occupy the same number of bits as the input.

C<toLOWER_L1> and C<toLOWER_LATIN1> are synonyms of each other.  They behave
identically as C<toLOWER> for ASCII-range input.  But additionally will return
the lowercase of any uppercase code point in the entire 0..255 range, assuming
a Latin-1 encoding (or the EBCDIC equivalent on such platforms).

C<toLOWER_LC> returns the lowercase of the input code point according to the
rules of the current POSIX locale.  Input code points outside the range 0..255
are returned unchanged.

C<toLOWER_uvchr> returns the lowercase of any Unicode code point.  The return
value is identical to that of C<toLOWER_L1> for input code points in the 0..255
range.  The lowercase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the lowercase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire lowercase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toLOWER_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toLOWER_utf8> and C<toLOWER_utf8_safe> are synonyms of each other.  The only
difference between these and C<toLOWER_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=over 3

 UV  toLOWER          (UV cp)
 UV  toLOWER_A        (UV cp)
 UV  toLOWER_LATIN1   (UV cp)
 UV  toLOWER_LC       (UV cp)
 UV  toLOWER_L1       (UV cp)
 UV  toLOWER_utf8     (U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toLOWER_utf8_safe(U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toLOWER_uvchr    (UV cp, U8* s, STRLEN* lenp)

=back

=back

=for hackers
toLOWER declared at handy.h, line 1281; all in group documented at handy.h, line 1281
toLOWER_A declared at handy.h, line 1282
toLOWER_LATIN1 declared at handy.h, line 1283
toLOWER_LC declared at handy.h, line 1284
toLOWER_L1 declared at handy.h, line 1285
toLOWER_utf8 declared at handy.h, line 1286
toLOWER_utf8_safe declared at handy.h, line 1287
toLOWER_uvchr declared at handy.h, line 1288

=over 4

=item C<toTITLE>

=item C<toTITLE_A>

=item C<toTITLE_utf8>

=item C<toTITLE_utf8_safe>

=item C<toTITLE_uvchr>
X<toTITLE>X<toTITLE_A>X<toTITLE_utf8>X<toTITLE_utf8_safe>X<toTITLE_uvchr>

These all return the titlecase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toTITLE> and C<toTITLE_A> are synonyms of each other.  They return the
titlecase of any lowercase ASCII-range code point.  In this range, the
titlecase is identical to the uppercase.  All other inputs are returned
unchanged.  Since these are macros, the input type may be any integral one, and
the output will occupy the same number of bits as the input.

There is no C<toTITLE_L1> nor C<toTITLE_LATIN1> as the titlecase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toTITLE_uvchr>.

C<toTITLE_uvchr> returns the titlecase of any Unicode code point.  The return
value is identical to that of C<toTITLE_A> for input code points in the ASCII
range.  The titlecase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the titlecase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire titlecase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toTITLE_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toTITLE_utf8> and C<toTITLE_utf8_safe> are synonyms of each other.  The only
difference between these and C<toTITLE_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=over 3

 UV  toTITLE          (UV cp)
 UV  toTITLE_A        (UV cp)
 UV  toTITLE_utf8     (U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toTITLE_utf8_safe(U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toTITLE_uvchr    (UV cp, U8* s, STRLEN* lenp)

=back

=back

=for hackers
toTITLE declared at handy.h, line 1338; all in group documented at handy.h, line 1338
toTITLE_A declared at handy.h, line 1339
toTITLE_utf8 declared at handy.h, line 1340
toTITLE_utf8_safe declared at handy.h, line 1341
toTITLE_uvchr declared at handy.h, line 1342

=over 4

=item C<toUPPER>

=item C<toUPPER_A>

=item C<toUPPER_utf8>

=item C<toUPPER_utf8_safe>

=item C<toUPPER_uvchr>
X<toUPPER>X<toUPPER_A>X<toUPPER_utf8>X<toUPPER_utf8_safe>X<toUPPER_uvchr>

These all return the uppercase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toUPPER> and C<toUPPER_A> are synonyms of each other.  They return the
uppercase of any lowercase ASCII-range code point.  All other inputs are
returned unchanged.  Since these are macros, the input type may be any integral
one, and the output will occupy the same number of bits as the input.

There is no C<toUPPER_L1> nor C<toUPPER_LATIN1> as the uppercase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toUPPER_uvchr>.

C<toUPPER_uvchr> returns the uppercase of any Unicode code point.  The return
value is identical to that of C<toUPPER_A> for input code points in the ASCII
range.  The uppercase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the uppercase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire uppercase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toUPPER_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toUPPER_utf8> and C<toUPPER_utf8_safe> are synonyms of each other.  The only
difference between these and C<toUPPER_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=over 3

 UV  toUPPER          (UV cp)
 UV  toUPPER_A        (UV cp)
 UV  toUPPER_utf8     (U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toUPPER_utf8_safe(U8* p, U8* e, U8* s, STRLEN* lenp)
 UV  toUPPER_uvchr    (UV cp, U8* s, STRLEN* lenp)

=back

=back

=for hackers
toUPPER declared at handy.h, line 1178; all in group documented at handy.h, line 1178
toUPPER_A declared at handy.h, line 1179
toUPPER_utf8 declared at handy.h, line 1180
toUPPER_utf8_safe declared at handy.h, line 1181
toUPPER_uvchr declared at handy.h, line 1182

=head1 Character classification


This section is about functions (really macros) that classify characters
into types, such as punctuation versus alphabetic, etc.  Most of these are
analogous to regular expression character classes.  (See
L<perlrecharclass/POSIX Character Classes>.)  There are several variants for
each class.  (Not all macros have all variants; each item below lists the
ones valid for it.)  None are affected by C<use bytes>, and only the ones
with C<LC> in the name are affected by the current locale.

The base function, e.g., C<isALPHA()>, takes any signed or unsigned value,
treating it as a code point, and returns a boolean as to whether or not the
character represented by it is (or on non-ASCII platforms, corresponds to) an
ASCII character in the named class based on platform, Unicode, and Perl rules.
If the input is a number that doesn't fit in an octet, FALSE is returned.

Variant C<isI<FOO>_A> (e.g., C<isALPHA_A()>) is identical to the base function
with no suffix C<"_A">.  This variant is used to emphasize by its name that
only ASCII-range characters can return TRUE.

Variant C<isI<FOO>_L1> imposes the Latin-1 (or EBCDIC equivalent) character set
onto the platform.  That is, the code points that are ASCII are unaffected,
since ASCII is a subset of Latin-1.  But the non-ASCII code points are treated
as if they are Latin-1 characters.  For example, C<isWORDCHAR_L1()> will return
true when called with the code point 0xDF, which is a word character in both
ASCII and EBCDIC (though it represents different characters in each).
If the input is a number that doesn't fit in an octet, FALSE is returned.
(Perl's documentation uses a colloquial definition of Latin-1, to include all
code points below 256.)

Variant C<isI<FOO>_uvchr> is exactly like the C<isI<FOO>_L1> variant, for
inputs below 256, but if the code point is larger than 255, Unicode rules are
used to determine if it is in the character class.  For example,
C<isWORDCHAR_uvchr(0x100)> returns TRUE, since 0x100 is LATIN CAPITAL LETTER A
WITH MACRON in Unicode, and is a word character.

Variants C<isI<FOO>_utf8> and C<isI<FOO>_utf8_safe> are like C<isI<FOO>_uvchr>,
but are used for UTF-8 encoded strings.  The two forms are different names for
the same thing.  Each call to one of these classifies the first character of
the string starting at C<p>.  The second parameter, C<e>, points to anywhere in
the string beyond the first character, up to one byte past the end of the
entire string.  Although both variants are identical, the suffix C<_safe> in
one name emphasizes that it will not attempt to read beyond S<C<e - 1>>,
provided that the constraint S<C<s E<lt> e>> is true (this is asserted for in
C<-DDEBUGGING> builds).  If the UTF-8 for the input character is malformed in
some way, the program may croak, or the function may return FALSE, at the
discretion of the implementation, and subject to change in future releases.

Variant C<isI<FOO>_LC> is like the C<isI<FOO>_A> and C<isI<FOO>_L1> variants,
but the result is based on the current locale, which is what C<LC> in the name
stands for.  If Perl can determine that the current locale is a UTF-8 locale,
it uses the published Unicode rules; otherwise, it uses the C library function
that gives the named classification.  For example, C<isDIGIT_LC()> when not in
a UTF-8 locale returns the result of calling C<isdigit()>.  FALSE is always
returned if the input won't fit into an octet.  On some platforms where the C
library function is known to be defective, Perl changes its result to follow
the POSIX standard's rules.

Variant C<isI<FOO>_LC_uvchr> acts exactly like C<isI<FOO>_LC> for inputs less
than 256, but for larger ones it returns the Unicode classification of the code
point.

Variants C<isI<FOO>_LC_utf8> and C<isI<FOO>_LC_utf8_safe> are like
C<isI<FOO>_LC_uvchr>, but are used for UTF-8 encoded strings.  The two forms
are different names for the same thing.  Each call to one of these classifies
the first character of the string starting at C<p>.  The second parameter,
C<e>, points to anywhere in the string beyond the first character, up to one
byte past the end of the entire string.  Although both variants are identical,
the suffix C<_safe> in one name emphasizes that it will not attempt to read
beyond S<C<e - 1>>, provided that the constraint S<C<s E<lt> e>> is true (this
is asserted for in C<-DDEBUGGING> builds).  If the UTF-8 for the input
character is malformed in some way, the program may croak, or the function may
return FALSE, at the discretion of the implementation, and subject to change in
future releases.


=over 4

=item C<isALNUM>

=item C<isALNUM_A>

=item C<isALNUM_LC>

=item C<isALNUM_LC_uvchr>
X<isALNUM>X<isALNUM_A>X<isALNUM_LC>X<isALNUM_LC_uvchr>

These are each a synonym for their respectively named L</C<isWORDCHAR>>
variant.

They are provided for backward compatibility, even though a word character
includes more than the standard C language meaning of alphanumeric.
To get the C language definition, use the corresponding L</C<isALPHANUMERIC>>
variant.

=over 3

 bool  isALNUM         (UV ch)
 bool  isALNUM_A       (UV ch)
 bool  isALNUM_LC      (UV ch)
 bool  isALNUM_LC_uvchr(UV ch)

=back

=back

=for hackers
isALNUM declared at handy.h, line 1101; all in group documented at handy.h, line 1101
isALNUM_A declared at handy.h, line 1102
isALNUM_LC declared at handy.h, line 1103
isALNUM_LC_uvchr declared at handy.h, line 1104

=over 4

=item C<isALNUMC>

=item C<isALNUMC_A>

=item C<isALNUMC_LC>

=item C<isALNUMC_LC_uvchr>

=item C<isALNUMC_L1>
X<isALNUMC>X<isALNUMC_A>X<isALNUMC_LC>X<isALNUMC_LC_uvchr>X<isALNUMC_L1>

These are discouraged, backward compatibility macros for L</C<isALPHANUMERIC>>.
That is, each returns a boolean indicating whether the specified character is
one of C<[A-Za-z0-9]>, analogous to C<m/[[:alnum:]]/>.

The C<C> suffix in the names was meant to indicate that they correspond to the
C language C<L<isalnum(3)>>.

=over 3

 bool  isALNUMC         (UV ch)
 bool  isALNUMC_A       (UV ch)
 bool  isALNUMC_LC      (UV ch)
 bool  isALNUMC_LC_uvchr(UV ch)
 bool  isALNUMC_L1      (UV ch)

=back

=back

=for hackers
isALNUMC declared at handy.h, line 868; all in group documented at handy.h, line 868
isALNUMC_A declared at handy.h, line 869
isALNUMC_LC declared at handy.h, line 870
isALNUMC_LC_uvchr declared at handy.h, line 871
isALNUMC_L1 declared at handy.h, line 872

=over 4

=item C<isALPHA>

=item C<isALPHA_A>

=item C<isALPHA_LC>

=item C<isALPHA_LC_utf8_safe>

=item C<isALPHA_LC_uvchr>

=item C<isALPHA_L1>

=item C<isALPHA_utf8>

=item C<isALPHA_utf8_safe>

=item C<isALPHA_uvchr>
X<isALPHA>X<isALPHA_A>X<isALPHA_LC>X<isALPHA_LC_utf8_safe>
X<isALPHA_LC_uvchr>X<isALPHA_L1>X<isALPHA_utf8>X<isALPHA_utf8_safe>
X<isALPHA_uvchr>

Returns a boolean indicating whether the specified input is one of C<[A-Za-z]>,
analogous to C<m/[[:alpha:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isALPHA             (UV ch)
 bool  isALPHA_A           (UV ch)
 bool  isALPHA_LC          (UV ch)
 bool  isALPHA_LC_utf8_safe(U8 * s, U8 *end)
 bool  isALPHA_LC_uvchr    (UV ch)
 bool  isALPHA_L1          (UV ch)
 bool  isALPHA_utf8        (U8 * s, U8 * end)
 bool  isALPHA_utf8_safe   (U8 * s, U8 * end)
 bool  isALPHA_uvchr       (UV ch)

=back

=back

=for hackers
isALPHA declared at handy.h, line 835; all in group documented at handy.h, line 835
isALPHA_A declared at handy.h, line 836
isALPHA_LC declared at handy.h, line 837
isALPHA_LC_utf8_safe declared at handy.h, line 838
isALPHA_LC_uvchr declared at handy.h, line 839
isALPHA_L1 declared at handy.h, line 840
isALPHA_utf8 declared at handy.h, line 841
isALPHA_utf8_safe declared at handy.h, line 842
isALPHA_uvchr declared at handy.h, line 843

=over 4

=item C<isALPHANUMERIC>

=item C<isALPHANUMERIC_A>

=item C<isALPHANUMERIC_LC>

=item C<isALPHANUMERIC_LC_utf8_safe>

=item C<isALPHANUMERIC_LC_uvchr>

=item C<isALPHANUMERIC_L1>

=item C<isALPHANUMERIC_utf8>

=item C<isALPHANUMERIC_utf8_safe>

=item C<isALPHANUMERIC_uvchr>
X<isALPHANUMERIC>X<isALPHANUMERIC_A>X<isALPHANUMERIC_LC>
X<isALPHANUMERIC_LC_utf8_safe>X<isALPHANUMERIC_LC_uvchr>
X<isALPHANUMERIC_L1>X<isALPHANUMERIC_utf8>X<isALPHANUMERIC_utf8_safe>
X<isALPHANUMERIC_uvchr>

Returns a boolean indicating whether the specified character is one of
C<[A-Za-z0-9]>, analogous to C<m/[[:alnum:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isALPHANUMERIC             (UV ch)
 bool  isALPHANUMERIC_A           (UV ch)
 bool  isALPHANUMERIC_LC          (UV ch)
 bool  isALPHANUMERIC_LC_utf8_safe(U8 * s, U8 *end)
 bool  isALPHANUMERIC_LC_uvchr    (UV ch)
 bool  isALPHANUMERIC_L1          (UV ch)
 bool  isALPHANUMERIC_utf8        (U8 * s, U8 * end)
 bool  isALPHANUMERIC_utf8_safe   (U8 * s, U8 * end)
 bool  isALPHANUMERIC_uvchr       (UV ch)

=back

=back

=for hackers
isALPHANUMERIC declared at handy.h, line 854; all in group documented at handy.h, line 854
isALPHANUMERIC_A declared at handy.h, line 855
isALPHANUMERIC_LC declared at handy.h, line 856
isALPHANUMERIC_LC_utf8_safe declared at handy.h, line 857
isALPHANUMERIC_LC_uvchr declared at handy.h, line 858
isALPHANUMERIC_L1 declared at handy.h, line 859
isALPHANUMERIC_utf8 declared at handy.h, line 860
isALPHANUMERIC_utf8_safe declared at handy.h, line 861
isALPHANUMERIC_uvchr declared at handy.h, line 862

=over 4

=item C<isASCII>

=item C<isASCII_A>

=item C<isASCII_LC>

=item C<isASCII_LC_utf8_safe>

=item C<isASCII_LC_uvchr>

=item C<isASCII_L1>

=item C<isASCII_utf8>

=item C<isASCII_utf8_safe>

=item C<isASCII_uvchr>
X<isASCII>X<isASCII_A>X<isASCII_LC>X<isASCII_LC_utf8_safe>
X<isASCII_LC_uvchr>X<isASCII_L1>X<isASCII_utf8>X<isASCII_utf8_safe>
X<isASCII_uvchr>

Returns a boolean indicating whether the specified character is one of the 128
characters in the ASCII character set, analogous to C<m/[[:ascii:]]/>.
On non-ASCII platforms, it returns TRUE iff this
character corresponds to an ASCII character.  Variants C<isASCII_A()> and
C<isASCII_L1()> are identical to C<isASCII()>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
Note, however, that some platforms do not have the C library routine
C<isascii()>.  In these cases, the variants whose names contain C<LC> are the
same as the corresponding ones without.

Also note, that because all ASCII characters are UTF-8 invariant (meaning they
have the exact same representation (always a single byte) whether encoded in
UTF-8 or not), C<isASCII> will give the correct results when called with any
byte in any string encoded or not in UTF-8.  And similarly C<isASCII_utf8> and
C<isASCII_utf8_safe> will work properly on any string encoded or not in UTF-8.

=over 3

 bool  isASCII             (UV ch)
 bool  isASCII_A           (UV ch)
 bool  isASCII_LC          (UV ch)
 bool  isASCII_LC_utf8_safe(U8 * s, U8 *end)
 bool  isASCII_LC_uvchr    (UV ch)
 bool  isASCII_L1          (UV ch)
 bool  isASCII_utf8        (U8 * s, U8 * end)
 bool  isASCII_utf8_safe   (U8 * s, U8 * end)
 bool  isASCII_uvchr       (UV ch)

=back

=back

=for hackers
isASCII declared at handy.h, line 880; all in group documented at handy.h, line 880
isASCII_A declared at handy.h, line 881
isASCII_LC declared at handy.h, line 882
isASCII_LC_utf8_safe declared at handy.h, line 883
isASCII_LC_uvchr declared at handy.h, line 884
isASCII_L1 declared at handy.h, line 885
isASCII_utf8 declared at handy.h, line 886
isASCII_utf8_safe declared at handy.h, line 887
isASCII_uvchr declared at handy.h, line 888

=over 4

=item C<isBLANK>

=item C<isBLANK_A>

=item C<isBLANK_LC>

=item C<isBLANK_LC_utf8_safe>

=item C<isBLANK_LC_uvchr>

=item C<isBLANK_L1>

=item C<isBLANK_utf8>

=item C<isBLANK_utf8_safe>

=item C<isBLANK_uvchr>
X<isBLANK>X<isBLANK_A>X<isBLANK_LC>X<isBLANK_LC_utf8_safe>
X<isBLANK_LC_uvchr>X<isBLANK_L1>X<isBLANK_utf8>X<isBLANK_utf8_safe>
X<isBLANK_uvchr>

Returns a boolean indicating whether the specified character is a
character considered to be a blank, analogous to C<m/[[:blank:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
Note,
however, that some platforms do not have the C library routine
C<isblank()>.  In these cases, the variants whose names contain C<LC> are
the same as the corresponding ones without.

=over 3

 bool  isBLANK             (UV ch)
 bool  isBLANK_A           (UV ch)
 bool  isBLANK_LC          (UV ch)
 bool  isBLANK_LC_utf8_safe(U8 * s, U8 *end)
 bool  isBLANK_LC_uvchr    (UV ch)
 bool  isBLANK_L1          (UV ch)
 bool  isBLANK_utf8        (U8 * s, U8 * end)
 bool  isBLANK_utf8_safe   (U8 * s, U8 * end)
 bool  isBLANK_uvchr       (UV ch)

=back

=back

=for hackers
isBLANK declared at handy.h, line 906; all in group documented at handy.h, line 906
isBLANK_A declared at handy.h, line 907
isBLANK_LC declared at handy.h, line 908
isBLANK_LC_utf8_safe declared at handy.h, line 909
isBLANK_LC_uvchr declared at handy.h, line 910
isBLANK_L1 declared at handy.h, line 911
isBLANK_utf8 declared at handy.h, line 912
isBLANK_utf8_safe declared at handy.h, line 913
isBLANK_uvchr declared at handy.h, line 914

=over 4

=item C<isCNTRL>

=item C<isCNTRL_A>

=item C<isCNTRL_LC>

=item C<isCNTRL_LC_utf8_safe>

=item C<isCNTRL_LC_uvchr>

=item C<isCNTRL_L1>

=item C<isCNTRL_utf8>

=item C<isCNTRL_utf8_safe>

=item C<isCNTRL_uvchr>
X<isCNTRL>X<isCNTRL_A>X<isCNTRL_LC>X<isCNTRL_LC_utf8_safe>
X<isCNTRL_LC_uvchr>X<isCNTRL_L1>X<isCNTRL_utf8>X<isCNTRL_utf8_safe>
X<isCNTRL_uvchr>

Returns a boolean indicating whether the specified character is a
control character, analogous to C<m/[[:cntrl:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
On EBCDIC platforms, you almost always want to use the C<isCNTRL_L1> variant.

=over 3

 bool  isCNTRL             (UV ch)
 bool  isCNTRL_A           (UV ch)
 bool  isCNTRL_LC          (UV ch)
 bool  isCNTRL_LC_utf8_safe(U8 * s, U8 *end)
 bool  isCNTRL_LC_uvchr    (UV ch)
 bool  isCNTRL_L1          (UV ch)
 bool  isCNTRL_utf8        (U8 * s, U8 * end)
 bool  isCNTRL_utf8_safe   (U8 * s, U8 * end)
 bool  isCNTRL_uvchr       (UV ch)

=back

=back

=for hackers
isCNTRL declared at handy.h, line 924; all in group documented at handy.h, line 924
isCNTRL_A declared at handy.h, line 925
isCNTRL_LC declared at handy.h, line 926
isCNTRL_LC_utf8_safe declared at handy.h, line 927
isCNTRL_LC_uvchr declared at handy.h, line 928
isCNTRL_L1 declared at handy.h, line 929
isCNTRL_utf8 declared at handy.h, line 930
isCNTRL_utf8_safe declared at handy.h, line 931
isCNTRL_uvchr declared at handy.h, line 932

=over 4

=item C<isDIGIT>

=item C<isDIGIT_A>

=item C<isDIGIT_LC>

=item C<isDIGIT_LC_utf8_safe>

=item C<isDIGIT_LC_uvchr>

=item C<isDIGIT_L1>

=item C<isDIGIT_utf8>

=item C<isDIGIT_utf8_safe>

=item C<isDIGIT_uvchr>
X<isDIGIT>X<isDIGIT_A>X<isDIGIT_LC>X<isDIGIT_LC_utf8_safe>
X<isDIGIT_LC_uvchr>X<isDIGIT_L1>X<isDIGIT_utf8>X<isDIGIT_utf8_safe>
X<isDIGIT_uvchr>

Returns a boolean indicating whether the specified character is a
digit, analogous to C<m/[[:digit:]]/>.
Variants C<isDIGIT_A> and C<isDIGIT_L1> are identical to C<isDIGIT>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isDIGIT             (UV ch)
 bool  isDIGIT_A           (UV ch)
 bool  isDIGIT_LC          (UV ch)
 bool  isDIGIT_LC_utf8_safe(U8 * s, U8 *end)
 bool  isDIGIT_LC_uvchr    (UV ch)
 bool  isDIGIT_L1          (UV ch)
 bool  isDIGIT_utf8        (U8 * s, U8 * end)
 bool  isDIGIT_utf8_safe   (U8 * s, U8 * end)
 bool  isDIGIT_uvchr       (UV ch)

=back

=back

=for hackers
isDIGIT declared at handy.h, line 940; all in group documented at handy.h, line 940
isDIGIT_A declared at handy.h, line 941
isDIGIT_LC declared at handy.h, line 942
isDIGIT_LC_utf8_safe declared at handy.h, line 943
isDIGIT_LC_uvchr declared at handy.h, line 944
isDIGIT_L1 declared at handy.h, line 945
isDIGIT_utf8 declared at handy.h, line 946
isDIGIT_utf8_safe declared at handy.h, line 947
isDIGIT_uvchr declared at handy.h, line 948

=over 4

=item C<isGRAPH>

=item C<isGRAPH_A>

=item C<isGRAPH_LC>

=item C<isGRAPH_LC_utf8_safe>

=item C<isGRAPH_LC_uvchr>

=item C<isGRAPH_L1>

=item C<isGRAPH_utf8>

=item C<isGRAPH_utf8_safe>

=item C<isGRAPH_uvchr>
X<isGRAPH>X<isGRAPH_A>X<isGRAPH_LC>X<isGRAPH_LC_utf8_safe>
X<isGRAPH_LC_uvchr>X<isGRAPH_L1>X<isGRAPH_utf8>X<isGRAPH_utf8_safe>
X<isGRAPH_uvchr>

Returns a boolean indicating whether the specified character is a
graphic character, analogous to C<m/[[:graph:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isGRAPH             (UV ch)
 bool  isGRAPH_A           (UV ch)
 bool  isGRAPH_LC          (UV ch)
 bool  isGRAPH_LC_utf8_safe(U8 * s, U8 *end)
 bool  isGRAPH_LC_uvchr    (UV ch)
 bool  isGRAPH_L1          (UV ch)
 bool  isGRAPH_utf8        (U8 * s, U8 * end)
 bool  isGRAPH_utf8_safe   (U8 * s, U8 * end)
 bool  isGRAPH_uvchr       (UV ch)

=back

=back

=for hackers
isGRAPH declared at handy.h, line 956; all in group documented at handy.h, line 956
isGRAPH_A declared at handy.h, line 957
isGRAPH_LC declared at handy.h, line 958
isGRAPH_LC_utf8_safe declared at handy.h, line 959
isGRAPH_LC_uvchr declared at handy.h, line 960
isGRAPH_L1 declared at handy.h, line 961
isGRAPH_utf8 declared at handy.h, line 962
isGRAPH_utf8_safe declared at handy.h, line 963
isGRAPH_uvchr declared at handy.h, line 964

=over 4

=item C<isIDCONT>

=item C<isIDCONT_A>

=item C<isIDCONT_LC>

=item C<isIDCONT_LC_utf8_safe>

=item C<isIDCONT_LC_uvchr>

=item C<isIDCONT_L1>

=item C<isIDCONT_utf8>

=item C<isIDCONT_utf8_safe>

=item C<isIDCONT_uvchr>
X<isIDCONT>X<isIDCONT_A>X<isIDCONT_LC>X<isIDCONT_LC_utf8_safe>
X<isIDCONT_LC_uvchr>X<isIDCONT_L1>X<isIDCONT_utf8>X<isIDCONT_utf8_safe>
X<isIDCONT_uvchr>

Returns a boolean indicating whether the specified character can be the
second or succeeding character of an identifier.  This is very close to, but
not quite the same as the official Unicode property C<XID_Continue>.  The
difference is that this returns true only if the input character also matches
L</isWORDCHAR>.  See the L<top of this section|/Character classification> for
an explanation of the variants.

=over 3

 bool  isIDCONT             (UV ch)
 bool  isIDCONT_A           (UV ch)
 bool  isIDCONT_LC          (UV ch)
 bool  isIDCONT_LC_utf8_safe(U8 * s, U8 *end)
 bool  isIDCONT_LC_uvchr    (UV ch)
 bool  isIDCONT_L1          (UV ch)
 bool  isIDCONT_utf8        (U8 * s, U8 * end)
 bool  isIDCONT_utf8_safe   (U8 * s, U8 * end)
 bool  isIDCONT_uvchr       (UV ch)

=back

=back

=for hackers
isIDCONT declared at handy.h, line 1144; all in group documented at handy.h, line 1144
isIDCONT_A declared at handy.h, line 1145
isIDCONT_LC declared at handy.h, line 1146
isIDCONT_LC_utf8_safe declared at handy.h, line 1147
isIDCONT_LC_uvchr declared at handy.h, line 1148
isIDCONT_L1 declared at handy.h, line 1149
isIDCONT_utf8 declared at handy.h, line 1150
isIDCONT_utf8_safe declared at handy.h, line 1151
isIDCONT_uvchr declared at handy.h, line 1152

=over 4

=item C<isIDFIRST>

=item C<isIDFIRST_A>

=item C<isIDFIRST_LC>

=item C<isIDFIRST_LC_utf8_safe>

=item C<isIDFIRST_LC_uvchr>

=item C<isIDFIRST_L1>

=item C<isIDFIRST_utf8>

=item C<isIDFIRST_utf8_safe>

=item C<isIDFIRST_uvchr>
X<isIDFIRST>X<isIDFIRST_A>X<isIDFIRST_LC>X<isIDFIRST_LC_utf8_safe>
X<isIDFIRST_LC_uvchr>X<isIDFIRST_L1>X<isIDFIRST_utf8>
X<isIDFIRST_utf8_safe>X<isIDFIRST_uvchr>

Returns a boolean indicating whether the specified character can be the first
character of an identifier.  This is very close to, but not quite the same as
the official Unicode property C<XID_Start>.  The difference is that this
returns true only if the input character also matches L</isWORDCHAR>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isIDFIRST             (UV ch)
 bool  isIDFIRST_A           (UV ch)
 bool  isIDFIRST_LC          (UV ch)
 bool  isIDFIRST_LC_utf8_safe(U8 * s, U8 *end)
 bool  isIDFIRST_LC_uvchr    (UV ch)
 bool  isIDFIRST_L1          (UV ch)
 bool  isIDFIRST_utf8        (U8 * s, U8 * end)
 bool  isIDFIRST_utf8_safe   (U8 * s, U8 * end)
 bool  isIDFIRST_uvchr       (UV ch)

=back

=back

=for hackers
isIDFIRST declared at handy.h, line 1128; all in group documented at handy.h, line 1128
isIDFIRST_A declared at handy.h, line 1129
isIDFIRST_LC declared at handy.h, line 1130
isIDFIRST_LC_utf8_safe declared at handy.h, line 1131
isIDFIRST_LC_uvchr declared at handy.h, line 1132
isIDFIRST_L1 declared at handy.h, line 1133
isIDFIRST_utf8 declared at handy.h, line 1134
isIDFIRST_utf8_safe declared at handy.h, line 1135
isIDFIRST_uvchr declared at handy.h, line 1136

=over 4

=item C<isLOWER>

=item C<isLOWER_A>

=item C<isLOWER_LC>

=item C<isLOWER_LC_utf8_safe>

=item C<isLOWER_LC_uvchr>

=item C<isLOWER_L1>

=item C<isLOWER_utf8>

=item C<isLOWER_utf8_safe>

=item C<isLOWER_uvchr>
X<isLOWER>X<isLOWER_A>X<isLOWER_LC>X<isLOWER_LC_utf8_safe>
X<isLOWER_LC_uvchr>X<isLOWER_L1>X<isLOWER_utf8>X<isLOWER_utf8_safe>
X<isLOWER_uvchr>

Returns a boolean indicating whether the specified character is a
lowercase character, analogous to C<m/[[:lower:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants

=over 3

 bool  isLOWER             (UV ch)
 bool  isLOWER_A           (UV ch)
 bool  isLOWER_LC          (UV ch)
 bool  isLOWER_LC_utf8_safe(U8 * s, U8 *end)
 bool  isLOWER_LC_uvchr    (UV ch)
 bool  isLOWER_L1          (UV ch)
 bool  isLOWER_utf8        (U8 * s, U8 * end)
 bool  isLOWER_utf8_safe   (U8 * s, U8 * end)
 bool  isLOWER_uvchr       (UV ch)

=back

=back

=for hackers
isLOWER declared at handy.h, line 970; all in group documented at handy.h, line 970
isLOWER_A declared at handy.h, line 971
isLOWER_LC declared at handy.h, line 972
isLOWER_LC_utf8_safe declared at handy.h, line 973
isLOWER_LC_uvchr declared at handy.h, line 974
isLOWER_L1 declared at handy.h, line 975
isLOWER_utf8 declared at handy.h, line 976
isLOWER_utf8_safe declared at handy.h, line 977
isLOWER_uvchr declared at handy.h, line 978

=over 4

=item C<isOCTAL>

=item C<isOCTAL_A>

=item C<isOCTAL_L1>
X<isOCTAL>X<isOCTAL_A>X<isOCTAL_L1>

Returns a boolean indicating whether the specified character is an
octal digit, [0-7].
The only two variants are C<isOCTAL_A> and C<isOCTAL_L1>; each is identical to
C<isOCTAL>.

=over 3

 bool  isOCTAL   (UV ch)
 bool  isOCTAL_A (UV ch)
 bool  isOCTAL_L1(UV ch)

=back

=back

=for hackers
isOCTAL declared at handy.h, line 984; all in group documented at handy.h, line 984
isOCTAL_A declared at handy.h, line 985
isOCTAL_L1 declared at handy.h, line 986

=over 4

=item C<isPRINT>

=item C<isPRINT_A>

=item C<isPRINT_LC>

=item C<isPRINT_LC_utf8_safe>

=item C<isPRINT_LC_uvchr>

=item C<isPRINT_L1>

=item C<isPRINT_utf8>

=item C<isPRINT_utf8_safe>

=item C<isPRINT_uvchr>
X<isPRINT>X<isPRINT_A>X<isPRINT_LC>X<isPRINT_LC_utf8_safe>
X<isPRINT_LC_uvchr>X<isPRINT_L1>X<isPRINT_utf8>X<isPRINT_utf8_safe>
X<isPRINT_uvchr>

Returns a boolean indicating whether the specified character is a
printable character, analogous to C<m/[[:print:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isPRINT             (UV ch)
 bool  isPRINT_A           (UV ch)
 bool  isPRINT_LC          (UV ch)
 bool  isPRINT_LC_utf8_safe(U8 * s, U8 *end)
 bool  isPRINT_LC_uvchr    (UV ch)
 bool  isPRINT_L1          (UV ch)
 bool  isPRINT_utf8        (U8 * s, U8 * end)
 bool  isPRINT_utf8_safe   (U8 * s, U8 * end)
 bool  isPRINT_uvchr       (UV ch)

=back

=back

=for hackers
isPRINT declared at handy.h, line 1064; all in group documented at handy.h, line 1064
isPRINT_A declared at handy.h, line 1065
isPRINT_LC declared at handy.h, line 1066
isPRINT_LC_utf8_safe declared at handy.h, line 1067
isPRINT_LC_uvchr declared at handy.h, line 1068
isPRINT_L1 declared at handy.h, line 1069
isPRINT_utf8 declared at handy.h, line 1070
isPRINT_utf8_safe declared at handy.h, line 1071
isPRINT_uvchr declared at handy.h, line 1072

=over 4

=item C<isPSXSPC>

=item C<isPSXSPC_A>

=item C<isPSXSPC_LC>

=item C<isPSXSPC_LC_utf8_safe>

=item C<isPSXSPC_LC_uvchr>

=item C<isPSXSPC_L1>

=item C<isPSXSPC_utf8>

=item C<isPSXSPC_utf8_safe>

=item C<isPSXSPC_uvchr>
X<isPSXSPC>X<isPSXSPC_A>X<isPSXSPC_LC>X<isPSXSPC_LC_utf8_safe>
X<isPSXSPC_LC_uvchr>X<isPSXSPC_L1>X<isPSXSPC_utf8>X<isPSXSPC_utf8_safe>
X<isPSXSPC_uvchr>

(short for Posix Space)
Starting in 5.18, this is identical in all its forms to the
corresponding C<isSPACE()> macros.
The locale forms of this macro are identical to their corresponding
C<isSPACE()> forms in all Perl releases.  In releases prior to 5.18, the
non-locale forms differ from their C<isSPACE()> forms only in that the
C<isSPACE()> forms don't match a Vertical Tab, and the C<isPSXSPC()> forms do.
Otherwise they are identical.  Thus this macro is analogous to what
C<m/[[:space:]]/> matches in a regular expression.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isPSXSPC             (UV ch)
 bool  isPSXSPC_A           (UV ch)
 bool  isPSXSPC_LC          (UV ch)
 bool  isPSXSPC_LC_utf8_safe(U8 * s, U8 *end)
 bool  isPSXSPC_LC_uvchr    (UV ch)
 bool  isPSXSPC_L1          (UV ch)
 bool  isPSXSPC_utf8        (U8 * s, U8 * end)
 bool  isPSXSPC_utf8_safe   (U8 * s, U8 * end)
 bool  isPSXSPC_uvchr       (UV ch)

=back

=back

=for hackers
isPSXSPC declared at handy.h, line 1029; all in group documented at handy.h, line 1029
isPSXSPC_A declared at handy.h, line 1030
isPSXSPC_LC declared at handy.h, line 1031
isPSXSPC_LC_utf8_safe declared at handy.h, line 1032
isPSXSPC_LC_uvchr declared at handy.h, line 1033
isPSXSPC_L1 declared at handy.h, line 1034
isPSXSPC_utf8 declared at handy.h, line 1035
isPSXSPC_utf8_safe declared at handy.h, line 1036
isPSXSPC_uvchr declared at handy.h, line 1037

=over 4

=item C<isPUNCT>

=item C<isPUNCT_A>

=item C<isPUNCT_LC>

=item C<isPUNCT_LC_utf8_safe>

=item C<isPUNCT_LC_uvchr>

=item C<isPUNCT_L1>

=item C<isPUNCT_utf8>

=item C<isPUNCT_utf8_safe>

=item C<isPUNCT_uvchr>
X<isPUNCT>X<isPUNCT_A>X<isPUNCT_LC>X<isPUNCT_LC_utf8_safe>
X<isPUNCT_LC_uvchr>X<isPUNCT_L1>X<isPUNCT_utf8>X<isPUNCT_utf8_safe>
X<isPUNCT_uvchr>

Returns a boolean indicating whether the specified character is a
punctuation character, analogous to C<m/[[:punct:]]/>.
Note that the definition of what is punctuation isn't as
straightforward as one might desire.  See L<perlrecharclass/POSIX Character
Classes> for details.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isPUNCT             (UV ch)
 bool  isPUNCT_A           (UV ch)
 bool  isPUNCT_LC          (UV ch)
 bool  isPUNCT_LC_utf8_safe(U8 * s, U8 *end)
 bool  isPUNCT_LC_uvchr    (UV ch)
 bool  isPUNCT_L1          (UV ch)
 bool  isPUNCT_utf8        (U8 * s, U8 * end)
 bool  isPUNCT_utf8_safe   (U8 * s, U8 * end)
 bool  isPUNCT_uvchr       (UV ch)

=back

=back

=for hackers
isPUNCT declared at handy.h, line 992; all in group documented at handy.h, line 992
isPUNCT_A declared at handy.h, line 993
isPUNCT_LC declared at handy.h, line 994
isPUNCT_LC_utf8_safe declared at handy.h, line 995
isPUNCT_LC_uvchr declared at handy.h, line 996
isPUNCT_L1 declared at handy.h, line 997
isPUNCT_utf8 declared at handy.h, line 998
isPUNCT_utf8_safe declared at handy.h, line 999
isPUNCT_uvchr declared at handy.h, line 1000

=over 4

=item C<isSPACE>

=item C<isSPACE_A>

=item C<isSPACE_LC>

=item C<isSPACE_LC_utf8_safe>

=item C<isSPACE_LC_uvchr>

=item C<isSPACE_L1>

=item C<isSPACE_utf8>

=item C<isSPACE_utf8_safe>

=item C<isSPACE_uvchr>
X<isSPACE>X<isSPACE_A>X<isSPACE_LC>X<isSPACE_LC_utf8_safe>
X<isSPACE_LC_uvchr>X<isSPACE_L1>X<isSPACE_utf8>X<isSPACE_utf8_safe>
X<isSPACE_uvchr>

Returns a boolean indicating whether the specified character is a
whitespace character.  This is analogous
to what C<m/\s/> matches in a regular expression.  Starting in Perl 5.18
this also matches what C<m/[[:space:]]/> does.  Prior to 5.18, only the
locale forms of this macro (the ones with C<LC> in their names) matched
precisely what C<m/[[:space:]]/> does.  In those releases, the only difference,
in the non-locale variants, was that C<isSPACE()> did not match a vertical tab.
(See L</isPSXSPC> for a macro that matches a vertical tab in all releases.)
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isSPACE             (UV ch)
 bool  isSPACE_A           (UV ch)
 bool  isSPACE_LC          (UV ch)
 bool  isSPACE_LC_utf8_safe(U8 * s, U8 *end)
 bool  isSPACE_LC_uvchr    (UV ch)
 bool  isSPACE_L1          (UV ch)
 bool  isSPACE_utf8        (U8 * s, U8 * end)
 bool  isSPACE_utf8_safe   (U8 * s, U8 * end)
 bool  isSPACE_uvchr       (UV ch)

=back

=back

=for hackers
isSPACE declared at handy.h, line 1009; all in group documented at handy.h, line 1009
isSPACE_A declared at handy.h, line 1010
isSPACE_LC declared at handy.h, line 1011
isSPACE_LC_utf8_safe declared at handy.h, line 1012
isSPACE_LC_uvchr declared at handy.h, line 1013
isSPACE_L1 declared at handy.h, line 1014
isSPACE_utf8 declared at handy.h, line 1015
isSPACE_utf8_safe declared at handy.h, line 1016
isSPACE_uvchr declared at handy.h, line 1017

=over 4

=item C<isUPPER>

=item C<isUPPER_A>

=item C<isUPPER_LC>

=item C<isUPPER_LC_utf8_safe>

=item C<isUPPER_LC_uvchr>

=item C<isUPPER_L1>

=item C<isUPPER_utf8>

=item C<isUPPER_utf8_safe>

=item C<isUPPER_uvchr>
X<isUPPER>X<isUPPER_A>X<isUPPER_LC>X<isUPPER_LC_utf8_safe>
X<isUPPER_LC_uvchr>X<isUPPER_L1>X<isUPPER_utf8>X<isUPPER_utf8_safe>
X<isUPPER_uvchr>

Returns a boolean indicating whether the specified character is an
uppercase character, analogous to C<m/[[:upper:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isUPPER             (UV ch)
 bool  isUPPER_A           (UV ch)
 bool  isUPPER_LC          (UV ch)
 bool  isUPPER_LC_utf8_safe(U8 * s, U8 *end)
 bool  isUPPER_LC_uvchr    (UV ch)
 bool  isUPPER_L1          (UV ch)
 bool  isUPPER_utf8        (U8 * s, U8 * end)
 bool  isUPPER_utf8_safe   (U8 * s, U8 * end)
 bool  isUPPER_uvchr       (UV ch)

=back

=back

=for hackers
isUPPER declared at handy.h, line 1050; all in group documented at handy.h, line 1050
isUPPER_A declared at handy.h, line 1051
isUPPER_LC declared at handy.h, line 1052
isUPPER_LC_utf8_safe declared at handy.h, line 1053
isUPPER_LC_uvchr declared at handy.h, line 1054
isUPPER_L1 declared at handy.h, line 1055
isUPPER_utf8 declared at handy.h, line 1056
isUPPER_utf8_safe declared at handy.h, line 1057
isUPPER_uvchr declared at handy.h, line 1058

=over 4

=item C<isWORDCHAR>

=item C<isWORDCHAR_A>

=item C<isWORDCHAR_LC>

=item C<isWORDCHAR_LC_utf8_safe>

=item C<isWORDCHAR_LC_uvchr>

=item C<isWORDCHAR_L1>

=item C<isWORDCHAR_utf8>

=item C<isWORDCHAR_utf8_safe>

=item C<isWORDCHAR_uvchr>
X<isWORDCHAR>X<isWORDCHAR_A>X<isWORDCHAR_LC>X<isWORDCHAR_LC_utf8_safe>
X<isWORDCHAR_LC_uvchr>X<isWORDCHAR_L1>X<isWORDCHAR_utf8>
X<isWORDCHAR_utf8_safe>X<isWORDCHAR_uvchr>

Returns a boolean indicating whether the specified character is a character
that is a word character, analogous to what C<m/\w/> and C<m/[[:word:]]/> match
in a regular expression.  A word character is an alphabetic character, a
decimal digit, a connecting punctuation character (such as an underscore), or
a "mark" character that attaches to one of those (like some sort of accent).

See the L<top of this section|/Character classification> for an explanation of
the variants.

C<isWORDCHAR_A>, C<isWORDCHAR_L1>, C<isWORDCHAR_uvchr>,
C<isWORDCHAR_LC>, C<isWORDCHAR_LC_uvchr>, C<isWORDCHAR_LC_utf8>, and
C<isWORDCHAR_LC_utf8_safe> are also as described there, but additionally
include the platform's native underscore.

=over 3

 bool  isWORDCHAR             (UV ch)
 bool  isWORDCHAR_A           (UV ch)
 bool  isWORDCHAR_LC          (UV ch)
 bool  isWORDCHAR_LC_utf8_safe(U8 * s, U8 *end)
 bool  isWORDCHAR_LC_uvchr    (UV ch)
 bool  isWORDCHAR_L1          (UV ch)
 bool  isWORDCHAR_utf8        (U8 * s, U8 * end)
 bool  isWORDCHAR_utf8_safe   (U8 * s, U8 * end)
 bool  isWORDCHAR_uvchr       (UV ch)

=back

=back

=for hackers
isWORDCHAR declared at handy.h, line 1078; all in group documented at handy.h, line 1078
isWORDCHAR_A declared at handy.h, line 1079
isWORDCHAR_LC declared at handy.h, line 1080
isWORDCHAR_LC_utf8_safe declared at handy.h, line 1081
isWORDCHAR_LC_uvchr declared at handy.h, line 1082
isWORDCHAR_L1 declared at handy.h, line 1083
isWORDCHAR_utf8 declared at handy.h, line 1084
isWORDCHAR_utf8_safe declared at handy.h, line 1085
isWORDCHAR_uvchr declared at handy.h, line 1086

=over 4

=item C<isXDIGIT>

=item C<isXDIGIT_A>

=item C<isXDIGIT_LC>

=item C<isXDIGIT_LC_utf8_safe>

=item C<isXDIGIT_LC_uvchr>

=item C<isXDIGIT_L1>

=item C<isXDIGIT_utf8>

=item C<isXDIGIT_utf8_safe>

=item C<isXDIGIT_uvchr>
X<isXDIGIT>X<isXDIGIT_A>X<isXDIGIT_LC>X<isXDIGIT_LC_utf8_safe>
X<isXDIGIT_LC_uvchr>X<isXDIGIT_L1>X<isXDIGIT_utf8>X<isXDIGIT_utf8_safe>
X<isXDIGIT_uvchr>

Returns a boolean indicating whether the specified character is a hexadecimal
digit.  In the ASCII range these are C<[0-9A-Fa-f]>.  Variants C<isXDIGIT_A()>
and C<isXDIGIT_L1()> are identical to C<isXDIGIT()>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=over 3

 bool  isXDIGIT             (UV ch)
 bool  isXDIGIT_A           (UV ch)
 bool  isXDIGIT_LC          (UV ch)
 bool  isXDIGIT_LC_utf8_safe(U8 * s, U8 *end)
 bool  isXDIGIT_LC_uvchr    (UV ch)
 bool  isXDIGIT_L1          (UV ch)
 bool  isXDIGIT_utf8        (U8 * s, U8 * end)
 bool  isXDIGIT_utf8_safe   (U8 * s, U8 * end)
 bool  isXDIGIT_uvchr       (UV ch)

=back

=back

=for hackers
isXDIGIT declared at handy.h, line 1113; all in group documented at handy.h, line 1113
isXDIGIT_A declared at handy.h, line 1114
isXDIGIT_LC declared at handy.h, line 1115
isXDIGIT_LC_utf8_safe declared at handy.h, line 1116
isXDIGIT_LC_uvchr declared at handy.h, line 1117
isXDIGIT_L1 declared at handy.h, line 1118
isXDIGIT_utf8 declared at handy.h, line 1119
isXDIGIT_utf8_safe declared at handy.h, line 1120
isXDIGIT_uvchr declared at handy.h, line 1121

=head1 Compiler and Preprocessor information

=over 4

=item C<CPPLAST>
X<CPPLAST>

This symbol is intended to be used along with C<CPPRUN> in the same manner
symbol C<CPPMINUS> is used with C<CPPSTDIN>. It contains either "-" or "".

=back

=for hackers
Declared and documented at config.h, line 1429

=over 4

=item C<CPPMINUS>
X<CPPMINUS>

This symbol contains the second part of the string which will invoke
the C preprocessor on the standard input and produce to standard
output.  This symbol will have the value "-" if C<CPPSTDIN> needs a minus
to specify standard input, otherwise the value is "".

=back

=for hackers
Declared and documented at config.h, line 1427

=over 4

=item C<CPPRUN>
X<CPPRUN>

This symbol contains the string which will invoke a C preprocessor on
the standard input and produce to standard output. It needs to end
with C<CPPLAST>, after all other preprocessor flags have been specified.
The main difference with C<CPPSTDIN> is that this program will never be a
pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
available directly to the user. Note that it may well be different from
the preprocessor used to compile the C program.

=back

=for hackers
Declared and documented at config.h, line 1428

=over 4

=item C<CPPSTDIN>
X<CPPSTDIN>

This symbol contains the first part of the string which will invoke
the C preprocessor on the standard input and produce to standard
output.  Typical value of "cc -E" or "F</lib/cpp>", but it can also
call a wrapper. See C<L</CPPRUN>>.

=back

=for hackers
Declared and documented at config.h, line 1426

=over 4

=item C<HAS_BUILTIN_ADD_OVERFLOW>
X<HAS_BUILTIN_ADD_OVERFLOW>

This symbol, if defined, indicates that the compiler supports
C<__builtin_add_overflow> for adding integers with overflow checks.

=back

=for hackers
Declared and documented at config.h, line 2347

=over 4

=item C<HAS_BUILTIN_CHOOSE_EXPR>
X<HAS_BUILTIN_CHOOSE_EXPR>

Can we handle C<GCC> builtin for compile-time ternary-like expressions

=back

=for hackers
Declared and documented at config.h, line 2333

=over 4

=item C<HAS_BUILTIN_EXPECT>
X<HAS_BUILTIN_EXPECT>

Can we handle C<GCC> builtin for telling that certain values are more
likely

=back

=for hackers
Declared and documented at config.h, line 2332

=over 4

=item C<HAS_BUILTIN_MUL_OVERFLOW>
X<HAS_BUILTIN_MUL_OVERFLOW>

This symbol, if defined, indicates that the compiler supports
C<__builtin_mul_overflow> for multiplying integers with overflow checks.

=back

=for hackers
Declared and documented at config.h, line 2349

=over 4

=item C<HAS_BUILTIN_SUB_OVERFLOW>
X<HAS_BUILTIN_SUB_OVERFLOW>

This symbol, if defined, indicates that the compiler supports
C<__builtin_sub_overflow> for subtracting integers with overflow checks.

=back

=for hackers
Declared and documented at config.h, line 2348

=over 4

=item C<HAS_C99_VARIADIC_MACROS>
X<HAS_C99_VARIADIC_MACROS>

If defined, the compiler supports C99 variadic macros.

=back

=for hackers
Declared and documented at config.h, line 2354

=over 4

=item C<HAS_STATIC_INLINE>
X<HAS_STATIC_INLINE>

This symbol, if defined, indicates that the C compiler supports
C99-style static inline.  That is, the function can't be called
from another translation unit.

=back

=for hackers
Declared and documented at config.h, line 1044

=over 4

=item C<HASATTRIBUTE_ALWAYS_INLINE>
X<HASATTRIBUTE_ALWAYS_INLINE>

Can we handle C<GCC> attribute for functions that should always be
inlined.

=back

=for hackers
Declared and documented at config.h, line 1482

=over 4

=item C<HASATTRIBUTE_DEPRECATED>
X<HASATTRIBUTE_DEPRECATED>

Can we handle C<GCC> attribute for marking deprecated C<APIs>

=back

=for hackers
Declared and documented at config.h, line 1473

=over 4

=item C<HASATTRIBUTE_FORMAT>
X<HASATTRIBUTE_FORMAT>

Can we handle C<GCC> attribute for checking printf-style formats

=back

=for hackers
Declared and documented at config.h, line 1474

=over 4

=item C<HASATTRIBUTE_NONNULL>
X<HASATTRIBUTE_NONNULL>

Can we handle C<GCC> attribute for nonnull function parms.

=back

=for hackers
Declared and documented at config.h, line 1478

=over 4

=item C<HASATTRIBUTE_NORETURN>
X<HASATTRIBUTE_NORETURN>

Can we handle C<GCC> attribute for functions that do not return

=back

=for hackers
Declared and documented at config.h, line 1476

=over 4

=item C<HASATTRIBUTE_PURE>
X<HASATTRIBUTE_PURE>

Can we handle C<GCC> attribute for pure functions

=back

=for hackers
Declared and documented at config.h, line 1479

=over 4

=item C<HASATTRIBUTE_UNUSED>
X<HASATTRIBUTE_UNUSED>

Can we handle C<GCC> attribute for unused variables and arguments

=back

=for hackers
Declared and documented at config.h, line 1480

=over 4

=item C<HASATTRIBUTE_VISIBILITY>
X<HASATTRIBUTE_VISIBILITY>

Can we handle C<GCC> attribute for functions that should have a
different visibility.

=back

=for hackers
Declared and documented at config.h, line 1483

=over 4

=item C<HASATTRIBUTE_WARN_UNUSED_RESULT>
X<HASATTRIBUTE_WARN_UNUSED_RESULT>

Can we handle C<GCC> attribute for warning on unused results

=back

=for hackers
Declared and documented at config.h, line 1481

=over 4

=item C<MEM_ALIGNBYTES>
X<MEM_ALIGNBYTES>

This symbol contains the number of bytes required to align a
double, or a long double when applicable. Usual values are 2,
4 and 8. The default is eight, for safety.  For cross-compiling
or multiarch support, Configure will set a minimum of 8.

=back

=for hackers
Declared and documented at config.h, line 828

=over 4

=item C<PERL_STATIC_INLINE>
X<PERL_STATIC_INLINE>

This symbol gives the best-guess incantation to use for static
inline functions.  If C<HAS_STATIC_INLINE> is defined, this will
give C99-style inline.  If C<HAS_STATIC_INLINE> is not defined,
this will give a plain 'static'.  It will always be defined
to something that gives static linkage.
Possibilities include

 static inline       (c99)
 static __inline__   (gcc -ansi)
 static __inline     (MSVC)
 static _inline      (older MSVC)
 static              (c89 compilers)

=back

=for hackers
Declared and documented at config.h, line 1045

=over 4

=item C<PERL_THREAD_LOCAL>
X<PERL_THREAD_LOCAL>

This symbol, if defined, gives a linkage specification for thread-local
storage. For example, for a C11 compiler this will be C<_Thread_local>.
Beware, some compilers are sensitive to the C language standard they are
told to parse. For example, suncc defaults to C11, so our probe will
report that C<_Thread_local> can be used. However, if the -std=c99 is later
added to the compiler flags, then C<_Thread_local> will become a syntax
error. Hence it is important for these flags to be consistent between
probing and use.

=back

=for hackers
Declared and documented at config.h, line 5222

=over 4

=item C<U32_ALIGNMENT_REQUIRED>
X<U32_ALIGNMENT_REQUIRED>

This symbol, if defined, indicates that you must access
character data through U32-aligned pointers.

=back

=for hackers
Declared and documented at config.h, line 3565

=head1 Compiler directives

=over 4

=item C<__ASSERT_>
X<__ASSERT_>

This is a helper macro to avoid preprocessor issues, replaced by nothing
unless under DEBUGGING, where it expands to an assert of its argument,
followed by a comma (hence the comma operator).  If we just used a straight
assert(), we would get a comma with nothing before it when not DEBUGGING.

=over 3

   __ASSERT_(bool expr)

=back

=back

=for hackers
Declared and documented at handy.h, line 353

=over 4

=item C<ASSUME>
X<ASSUME>

C<ASSUME> is like C<assert()>, but it has a benefit in a release build. It is a
hint to a compiler about a statement of fact in a function call free
expression, which allows the compiler to generate better machine code.  In a
debug build, C<ASSUME(x)> is a synonym for C<assert(x)>. C<ASSUME(0)> means the
control path is unreachable. In a for loop, C<ASSUME> can be used to hint that
a loop will run at least X times. C<ASSUME> is based off MSVC's C<__assume>
intrinsic function, see its documents for more details.

=over 3

   ASSUME(bool expr)

=back

=back

=for hackers
Declared and documented at perl.h, line 4282

=over 4

=item C<dNOOP>
X<dNOOP>

Declare nothing; typically used as a placeholder to replace something that used
to declare something.  Works on compilers that require declarations before any
code.

=over 3

   dNOOP;

=back

=back

=for hackers
Declared and documented at perl.h, line 704

=over 4

=item C<END_EXTERN_C>
X<END_EXTERN_C>

When not compiling using C++, expands to nothing.
Otherwise ends a section of code already begun by a C<L</START_EXTERN_C>>.

=back

=for hackers
Declared and documented at perl.h, line 179

=over 4

=item C<EXTERN_C>
X<EXTERN_C>

When not compiling using C++, expands to nothing.
Otherwise is used in a declaration of a function to indicate the function
should have external C linkage.  This is required for things to work for just
about all functions with external linkage compiled into perl.
Often, you can use C<L</START_EXTERN_C>> ... C<L</END_EXTERN_C>> blocks
surrounding all your code that you need to have this linkage.

Example usage:

 EXTERN_C int flock(int fd, int op);

=back

=for hackers
Declared and documented at perl.h, line 161

=over 4

=item C<LIKELY>
X<LIKELY>

Returns the input unchanged, but at the same time it gives a branch prediction
hint to the compiler that this condition is likely to be true.

=over 3

   LIKELY(bool expr)

=back

=back

=for hackers
Declared and documented at perl.h, line 4211

=over 4

=item C<NOOP>
X<NOOP>

Do nothing; typically used as a placeholder to replace something that used to
do something.

=over 3

   NOOP;

=back

=back

=for hackers
Declared and documented at perl.h, line 700

=over 4

=item C<PERL_UNUSED_ARG>
X<PERL_UNUSED_ARG>

This is used to suppress compiler warnings that a parameter to a function is
not used.  This situation can arise, for example, when a parameter is needed
under some configuration conditions, but not others, so that C preprocessor
conditional compilation causes it be used just sometimes.

=over 3

   PERL_UNUSED_ARG(void x);

=back

=back

=for hackers
Declared and documented at perl.h, line 548

=over 4

=item C<PERL_UNUSED_CONTEXT>
X<PERL_UNUSED_CONTEXT>

This is used to suppress compiler warnings that the thread context parameter to
a function is not used.  This situation can arise, for example, when a
C preprocessor conditional compilation causes it be used just some times.

=over 3

   PERL_UNUSED_CONTEXT;

=back

=back

=for hackers
Declared and documented at perl.h, line 554

=over 4

=item C<PERL_UNUSED_DECL>
X<PERL_UNUSED_DECL>

Tells the compiler that the parameter in the function prototype just before it
is not necessarily expected to be used in the function.  Not that many
compilers understand this, so this should only be used in cases where
C<L</PERL_UNUSED_ARG>> can't conveniently be used.

Example usage:

=over

 Signal_t
 Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
                       void *uap PERL_UNUSED_DECL, bool safe)

=back

=back

=for hackers
Declared and documented at perl.h, line 519

=over 4

=item C<PERL_UNUSED_RESULT>
X<PERL_UNUSED_RESULT>

This macro indicates to discard the return value of the function call inside
it, I<e.g.>,

 PERL_UNUSED_RESULT(foo(a, b))

The main reason for this is that the combination of C<gcc -Wunused-result>
(part of C<-Wall>) and the C<__attribute__((warn_unused_result))> cannot
be silenced with casting to C<void>.  This causes trouble when the system
header files use the attribute.

Use C<PERL_UNUSED_RESULT> sparingly, though, since usually the warning
is there for a good reason: you might lose success/failure information,
or leak resources, or changes in resources.

But sometimes you just want to ignore the return value, I<e.g.>, on
codepaths soon ending up in abort, or in "best effort" attempts,
or in situations where there is no good way to handle failures.

Sometimes C<PERL_UNUSED_RESULT> might not be the most natural way:
another possibility is that you can capture the return value
and use C<L</PERL_UNUSED_VAR>> on that.

=over 3

   PERL_UNUSED_RESULT(void x)

=back

=back

=for hackers
Declared and documented at perl.h, line 594

=over 4

=item C<PERL_UNUSED_VAR>
X<PERL_UNUSED_VAR>

This is used to suppress compiler warnings that the variable I<x> is not used.
This situation can arise, for example, when a C preprocessor conditional
compilation causes it be used just some times.

=over 3

   PERL_UNUSED_VAR(void x);

=back

=back

=for hackers
Declared and documented at perl.h, line 559

=over 4

=item C<START_EXTERN_C>
X<START_EXTERN_C>

When not compiling using C++, expands to nothing.
Otherwise begins a section of code in which every function will effectively
have C<L</EXTERN_C>> applied to it, that is to have external C linkage.  The
section is ended by a C<L</END_EXTERN_C>>.

=back

=for hackers
Declared and documented at perl.h, line 173

=over 4

=item C<STATIC>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 2948

=over 4

=item C<STMT_START>

=item C<STMT_END>
X<STMT_END>X<STMT_START>

These allow a series of statements in a macro to be used as a single statement,
as in

 if (x) STMT_START { ... } STMT_END else ...

Note that you can't return a value out of this construct and cannot use it as
an operand to the comma operator.  These limit its utility.

But, a value could be returned by constructing the API so that a pointer is
passed and the macro dereferences this to set the return.  If the value can be
any of various types, depending on context, you can handle that situation in
some situations by adding the type of the return as an extra accompanying
parameter:

 #define foo(param, type)  STMT_START {
                              type * param; *param = do_calc; ...
                           } STMT_END

This could be awkward, so consider instead using a C language C<static inline>
function.

If you do use this construct, it is easy to forget that it is a macro and not a
function, and hence fall into traps that might not show up until someone
someday writes code which contains names that clash with the ones you chose
here, or calls it with a parameter which is an expression with side effects,
the consequences of which you didn't think about.  See L<perlhacktips/Writing
safer macros> for how to avoid these.

=back

=for hackers
STMT_START declared at perl.h, line 792; all in group documented at perl.h, line 792
STMT_END 

=over 4

=item C<UNLIKELY>
X<UNLIKELY>

Returns the input unchanged, but at the same time it gives a branch prediction
hint to the compiler that this condition is likely to be false.

=over 3

   UNLIKELY(bool expr)

=back

=back

=for hackers
Declared and documented at perl.h, line 4216

=head1 Compile-time scope hooks

=over 4

=item C<BhkDISABLE>
X<BhkDISABLE>

NOTE: C<BhkDISABLE> is B<experimental> and may change or be
removed without notice.

Temporarily disable an entry in this BHK structure, by clearing the
appropriate flag.  C<which> is a preprocessor token indicating which
entry to disable.

=over 3

 void  BhkDISABLE(BHK *hk, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 812

=over 4

=item C<BhkENABLE>
X<BhkENABLE>

NOTE: C<BhkENABLE> is B<experimental> and may change or be
removed without notice.

Re-enable an entry in this BHK structure, by setting the appropriate
flag.  C<which> is a preprocessor token indicating which entry to enable.
This will assert (under -DDEBUGGING) if the entry doesn't contain a valid
pointer.

=over 3

 void  BhkENABLE(BHK *hk, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 817

=over 4

=item C<BhkENTRY_set>
X<BhkENTRY_set>

NOTE: C<BhkENTRY_set> is B<experimental> and may change or be
removed without notice.

Set an entry in the BHK structure, and set the flags to indicate it is
valid.  C<which> is a preprocessing token indicating which entry to set.
The type of C<ptr> depends on the entry.

=over 3

 void  BhkENTRY_set(BHK *hk, token which, void *ptr)

=back

=back

=for hackers
Declared and documented at op.h, line 807

=over 4

=item C<blockhook_register>
X<blockhook_register>

NOTE: C<blockhook_register> is B<experimental> and may change or be
removed without notice.

Register a set of hooks to be called when the Perl lexical scope changes
at compile time.  See L<perlguts/"Compile-time scope hooks">.

=over 3

 void  Perl_blockhook_register(pTHX_ BHK *hk)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 4693

=head1 Concurrency

=over 4

=item C<aTHX>

=item C<aTHX_>

Described in L<perlguts>.

=back

=for hackers
aTHX all in group documented at pod/perlguts.pod, line 2964
aTHX_ 

=over 4

=item C<CPERLscope>
X<CPERLscope>

C<B<DEPRECATED!>>  It is planned to remove C<CPERLscope>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Now a no-op.

=over 3

 void  CPERLscope(void x)

=back

=back

=for hackers
Declared and documented at perl.h, line 265

=over 4

=item C<dTHR>

=item C<dTHX>

Described in L<perlguts>.

=back

=for hackers
dTHR all in group documented at pod/perlguts.pod, line 3017
dTHX 

=over 4

=item C<dTHXa>
X<dTHXa>

On threaded perls, set C<pTHX> to C<a>; on unthreaded perls, do nothing

=back

=for hackers
Declared and documented at perl.h, line 213

=over 4

=item C<dTHXoa>
X<dTHXoa>

Now a synonym for C<L</dTHXa>>.

=back

=for hackers
Declared and documented at perl.h, line 216

=over 4

=item C<dVAR>
X<dVAR>

This is now a synonym for dNOOP: declare nothing

=back

=for hackers
Declared and documented at perl.h, line 739

=over 4

=item C<GETENV_PRESERVES_OTHER_THREAD>
X<GETENV_PRESERVES_OTHER_THREAD>

This symbol, if defined, indicates that the getenv system call doesn't
zap the static buffer of C<getenv()> in a different thread.
The typical C<getenv()> implementation will return a pointer to the proper
position in **environ.  But some may instead copy them to a static
buffer in C<getenv()>.  If there is a per-thread instance of that buffer,
or the return points to **environ, then a many-reader/1-writer mutex
will work; otherwise an exclusive locking mutex is required to prevent
races.

=back

=for hackers
Declared and documented at config.h, line 4674

=over 4

=item C<HAS_PTHREAD_ATFORK>
X<HAS_PTHREAD_ATFORK>

This symbol, if defined, indicates that the C<pthread_atfork> routine
is available to setup fork handlers.

=back

=for hackers
Declared and documented at config.h, line 5010

=over 4

=item C<HAS_PTHREAD_ATTR_SETSCOPE>
X<HAS_PTHREAD_ATTR_SETSCOPE>

This symbol, if defined, indicates that the C<pthread_attr_setscope>
system call is available to set the contention scope attribute of
a thread attribute object.

=back

=for hackers
Declared and documented at config.h, line 3206

=over 4

=item C<HAS_PTHREAD_YIELD>
X<HAS_PTHREAD_YIELD>

This symbol, if defined, indicates that the C<pthread_yield>
routine is available to yield the execution of the current
thread.  C<sched_yield> is preferable to C<pthread_yield>.

=back

=for hackers
Declared and documented at config.h, line 5027

=over 4

=item C<HAS_SCHED_YIELD>
X<HAS_SCHED_YIELD>

This symbol, if defined, indicates that the C<sched_yield>
routine is available to yield the execution of the current
thread.  C<sched_yield> is preferable to C<pthread_yield>.

=back

=for hackers
Declared and documented at config.h, line 5029

=over 4

=item C<I_MACH_CTHREADS>
X<I_MACH_CTHREADS>

This symbol, if defined, indicates to the C program that it should
include F<mach/cthreads.h>.

=over 3

 #ifdef I_MACH_CTHREADS
     #include <mach_cthreads.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 5260

=over 4

=item C<I_PTHREAD>
X<I_PTHREAD>

This symbol, if defined, indicates to the C program that it should
include F<pthread.h>.

=over 3

 #ifdef I_PTHREAD
     #include <pthread.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 5266

=over 4

=item C<MULTIPLICITY>

This symbol, if defined, indicates that Perl should
be built to use multiplicity.

=back

=for hackers
Documented at pod/perlguts.pod, line 2902

=over 4

=item C<OLD_PTHREAD_CREATE_JOINABLE>
X<OLD_PTHREAD_CREATE_JOINABLE>

This symbol, if defined, indicates how to create pthread
in joinable (aka undetached) state.  C<NOTE>: not defined
if F<pthread.h> already has defined C<PTHREAD_CREATE_JOINABLE>
(the new version of the constant).
If defined, known values are C<PTHREAD_CREATE_UNDETACHED>
and C<__UNDETACHED>.

=back

=for hackers
Declared and documented at config.h, line 5004

=over 4

=item C<OLD_PTHREADS_API>
X<OLD_PTHREADS_API>

This symbol, if defined, indicates that Perl should
be built to use the old draft C<POSIX> threads C<API>.

=back

=for hackers
Declared and documented at config.h, line 5289

=over 4

=item C<PERL_IMPLICIT_CONTEXT>

=item C<PERL_NO_GET_CONTEXT>

=item C<pTHX>

=item C<pTHX_>

Described in L<perlguts>.

=back

=for hackers
PERL_IMPLICIT_CONTEXT all in group documented at pod/perlguts.pod, line 2883
PERL_NO_GET_CONTEXT 
pTHX 
pTHX_ 

=over 4

=item C<SCHED_YIELD>
X<SCHED_YIELD>

This symbol defines the way to yield the execution of
the current thread.  Known ways are C<sched_yield>,
C<pthread_yield>, and C<pthread_yield> with C<NULL>.

=back

=for hackers
Declared and documented at config.h, line 5028

=head1 COPs and Hint Hashes
X<COPHH_KEY_UTF8>

=over 4

=item C<cop_fetch_label>
X<cop_fetch_label>

NOTE: C<cop_fetch_label> is B<experimental> and may change or be
removed without notice.

Returns the label attached to a cop, and stores its length in bytes into
C<*len>.
Upon return, C<*flags> will be set to either C<SVf_UTF8> or 0.

Alternatively, use the macro C<L</CopLABEL_len_flags>>;
or if you don't need to know if the label is UTF-8 or not, the macro
C<L</CopLABEL_len>>;
or if you additionally don't need to know the length, C<L</CopLABEL>>.

=over 3

 const char *       cop_fetch_label(      COP * const cop,
                                          STRLEN *len, U32 *flags)
 const char *  Perl_cop_fetch_label(pTHX_ COP * const cop,
                                          STRLEN *len, U32 *flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 4035

=over 4

=item C<cop_hints_exists_pv>

=item C<cop_hints_exists_pvn>

=item C<cop_hints_exists_pvs>

=item C<cop_hints_exists_sv>
X<cop_hints_exists_pv>X<cop_hints_exists_pvn>X<cop_hints_exists_pvs>
X<cop_hints_exists_sv>

These look up the hint entry in the cop C<cop> with the key specified by
C<key> (and C<keylen> in the C<pvn> form), returning true if a value exists,
and false otherwise.

The forms differ in how the key is specified.  In all forms, the key is pointed
to by C<key>.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 bool  cop_hints_exists_pv (const COP *cop, const char *key,
                            U32 hash, U32 flags)
 bool  cop_hints_exists_pvn(const COP *cop, const char *key,
                            STRLEN keylen, U32 hash, U32 flags)
 bool  cop_hints_exists_pvs(const COP *cop, "key", U32 flags)
 bool  cop_hints_exists_sv (const COP *cop, SV *key, U32 hash,
                            U32 flags)

=back

=back

=for hackers
cop_hints_exists_pv declared at cop.h, line 741; all in group documented at cop.h, line 741
cop_hints_exists_pvn declared at cop.h, line 742
cop_hints_exists_pvs declared at cop.h, line 743
cop_hints_exists_sv declared at cop.h, line 744

=over 4

=item C<cop_hints_fetch_pv>

=item C<cop_hints_fetch_pvn>

=item C<cop_hints_fetch_pvs>

=item C<cop_hints_fetch_sv>
X<cop_hints_fetch_pv>X<cop_hints_fetch_pvn>X<cop_hints_fetch_pvs>
X<cop_hints_fetch_sv>

These look up the hint entry in the cop C<cop> with the key specified by
C<key> (and C<keylen> in the C<pvn> form), returning that value as a mortal
scalar copy, or C<&PL_sv_placeholder> if there is no value associated with the
key.

The forms differ in how the key is specified.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 SV *  cop_hints_fetch_pv (const COP *cop, const char *key,
                           U32 hash, U32 flags)
 SV *  cop_hints_fetch_pvn(const COP *cop, const char *key,
                           STRLEN keylen, U32 hash, U32 flags)
 SV *  cop_hints_fetch_pvs(const COP *cop, "key", U32 flags)
 SV *  cop_hints_fetch_sv (const COP *cop, SV *key, U32 hash,
                           U32 flags)

=back

=back

=for hackers
cop_hints_fetch_pv declared at cop.h, line 697; all in group documented at cop.h, line 697
cop_hints_fetch_pvn declared at cop.h, line 698
cop_hints_fetch_pvs declared at cop.h, line 699
cop_hints_fetch_sv declared at cop.h, line 700

=over 4

=item C<cop_hints_2hv>
X<cop_hints_2hv>

Generates and returns a standard Perl hash representing the full set of
hint entries in the cop C<cop>.  C<flags> is currently unused and must
be zero.

=over 3

 HV *  cop_hints_2hv(const COP *cop, U32 flags)

=back

=back

=for hackers
Declared and documented at cop.h, line 785

=over 4

=item C<cop_store_label>
X<cop_store_label>

NOTE: C<cop_store_label> is B<experimental> and may change or be
removed without notice.

Save a label into a C<cop_hints_hash>.
You need to set flags to C<SVf_UTF8>
for a UTF-8 label.  Any other flag is ignored.

=over 3

 void       cop_store_label(      COP * const cop,
                                  const char *label, STRLEN len,
                                  U32 flags)
 void  Perl_cop_store_label(pTHX_ COP * const cop,
                                  const char *label, STRLEN len,
                                  U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 4087

=over 4

=item C<CopFILE>
X<CopFILE>

Returns the name of the file associated with the C<COP> C<c>

=over 3

 const char *  CopFILE(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 480

=over 4

=item C<CopFILE_copy>
X<CopFILE_copy>

Efficiently copies the cop file name from one COP to another. Wraps
the required logic to do a refcounted copy under threads or not.

=over 3

 void  CopFILE_copy(COP * dst, COP * src)

=back

=back

=for hackers
Declared and documented at cop.h, line 506

=over 4

=item C<CopFILE_free>
X<CopFILE_free>

Frees the file data in a cop. Under the hood this is a refcounting
operation.

=over 3

 void  CopFILE_free(COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 510

=over 4

=item C<CopFILE_LEN>
X<CopFILE_LEN>

Returns the length of the file associated with the C<COP> C<c>

=over 3

 const char *  CopFILE_LEN(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 483

=over 4

=item C<CopFILE_set>

=item C<CopFILE_setn>
X<CopFILE_set>X<CopFILE_setn>

These each make C<pv> the name of the file associated with the C<COP> C<c>.
In the plain C<CopFILE_set> form, C<pv> is a C language NUL-terminated string.
In C<CopFILE_setn>, C<len> is the length of C<pv>, which hence may contain
embedded NUL characters.

=over 3

 void  CopFILE_set (COP * c, const char * pv)
 void  CopFILE_setn(COP * c, const char * pv, STRLEN len)

=back

=back

=for hackers
CopFILE_set declared at cop.h, line 499; all in group documented at cop.h, line 499
CopFILE_setn declared at cop.h, line 500

=over 4

=item C<CopFILEAV>
X<CopFILEAV>

Returns the AV associated with the C<COP> C<c>, creating it if necessary.

=over 3

 AV *  CopFILEAV(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 489

=over 4

=item C<CopFILEAVn>
X<CopFILEAVn>

Returns the AV associated with the C<COP> C<c>, returning NULL if it
doesn't already exist.

=over 3

 AV *  CopFILEAVn(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 492

=over 4

=item C<CopFILEGV>
X<CopFILEGV>

Returns the GV associated with the C<COP> C<c>

=over 3

 GV *  CopFILEGV(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 514

=over 4

=item C<CopFILEGV_set>
X<CopFILEGV_set>

Available only on unthreaded perls.  Makes C<pv> the name of the file
associated with the C<COP> C<c>

=over 3

 void  CopFILEGV_set(COP *c, GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at cop.h, line 517

=over 4

=item C<CopFILESV>
X<CopFILESV>

Returns the SV associated with the C<COP> C<c>

=over 3

 SV *  CopFILESV(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 496

=over 4

=item C<cophh_copy>
X<cophh_copy>

NOTE: C<cophh_copy> is B<experimental> and may change or be
removed without notice.

Make and return a complete copy of the cop hints hash C<cophh>.

=over 3

 COPHH *  cophh_copy(COPHH *cophh)

=back

=back

=for hackers
Declared and documented at cop.h, line 305

=over 4

=item C<cophh_delete_pv>

=item C<cophh_delete_pvn>

=item C<cophh_delete_pvs>

=item C<cophh_delete_sv>
X<cophh_delete_pv>X<cophh_delete_pvn>X<cophh_delete_pvs>X<cophh_delete_sv>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

These delete a key and its associated value from the cop hints hash C<cophh>,
and return the modified hash.  The returned hash pointer is in general
not the same as the hash pointer that was passed in.  The input hash is
consumed by the function, and the pointer to it must not be subsequently
used.  Use L</cophh_copy> if you need both hashes.

The forms differ in how the key is specified.  In all forms, the key is pointed
to by C<key>.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 COPHH *  cophh_delete_pv (COPHH *cophh, const char *key,
                           U32 hash, U32 flags)
 COPHH *  cophh_delete_pvn(COPHH *cophh, const char *key,
                           STRLEN keylen, U32 hash, U32 flags)
 COPHH *  cophh_delete_pvs(COPHH *cophh, "key", U32 flags)
 COPHH *  cophh_delete_sv (COPHH *cophh, SV *key, U32 hash,
                           U32 flags)

=back

=back

=for hackers
cophh_delete_pv declared at cop.h, line 388; all in group documented at cop.h, line 388
cophh_delete_pvn declared at cop.h, line 389
cophh_delete_pvs declared at cop.h, line 390
cophh_delete_sv declared at cop.h, line 391

=over 4

=item C<cophh_exists_pvn>
X<cophh_exists_pvn>

NOTE: C<cophh_exists_pvn> is B<experimental> and may change or be
removed without notice.

These look up the hint entry in the cop C<cop> with the key specified by
C<key> (and C<keylen> in the C<pvn> form), returning true if a value exists,
and false otherwise.

The forms differ in how the key is specified.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 bool  cophh_exists_pvn(const COPHH *cophh, const char *key,
                        STRLEN keylen, U32 hash, U32 flags)

=back

=back

=for hackers
Declared and documented at cop.h, line 252

=over 4

=item C<cophh_fetch_pv>

=item C<cophh_fetch_pvn>

=item C<cophh_fetch_pvs>

=item C<cophh_fetch_sv>
X<cophh_fetch_pv>X<cophh_fetch_pvn>X<cophh_fetch_pvs>X<cophh_fetch_sv>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

These look up the entry in the cop hints hash C<cophh> with the key specified by
C<key> (and C<keylen> in the C<pvn> form), returning that value as a mortal
scalar copy, or C<&PL_sv_placeholder> if there is no value associated with the
key.

The forms differ in how the key is specified.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 SV *  cophh_fetch_pv (const COPHH *cophh, const char *key,
                       U32 hash, U32 flags)
 SV *  cophh_fetch_pvn(const COPHH *cophh, const char *key,
                       STRLEN keylen, U32 hash, U32 flags)
 SV *  cophh_fetch_pvs(const COPHH *cophh, "key", U32 flags)
 SV *  cophh_fetch_sv (const COPHH *cophh, SV *key, U32 hash,
                       U32 flags)

=back

=back

=for hackers
cophh_fetch_pv declared at cop.h, line 201; all in group documented at cop.h, line 201
cophh_fetch_pvn declared at cop.h, line 202
cophh_fetch_pvs declared at cop.h, line 203
cophh_fetch_sv declared at cop.h, line 204

=over 4

=item C<cophh_free>
X<cophh_free>

NOTE: C<cophh_free> is B<experimental> and may change or be
removed without notice.

Discard the cop hints hash C<cophh>, freeing all resources associated
with it.

=over 3

 void  cophh_free(COPHH *cophh)

=back

=back

=for hackers
Declared and documented at cop.h, line 315

=over 4

=item C<cophh_new_empty>
X<cophh_new_empty>

NOTE: C<cophh_new_empty> is B<experimental> and may change or be
removed without notice.

Generate and return a fresh cop hints hash containing no entries.

=over 3

 COPHH *  cophh_new_empty()

=back

=back

=for hackers
Declared and documented at cop.h, line 326

=over 4

=item C<cophh_store_pv>

=item C<cophh_store_pvn>

=item C<cophh_store_pvs>

=item C<cophh_store_sv>
X<cophh_store_pv>X<cophh_store_pvn>X<cophh_store_pvs>X<cophh_store_sv>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

These store a value, associated with a key, in the cop hints hash C<cophh>,
and return the modified hash.  The returned hash pointer is in general
not the same as the hash pointer that was passed in.  The input hash is
consumed by the function, and the pointer to it must not be subsequently
used.  Use L</cophh_copy> if you need both hashes.

C<value> is the scalar value to store for this key.  C<value> is copied
by these functions, which thus do not take ownership of any reference
to it, and hence later changes to the scalar will not be reflected in the value
visible in the cop hints hash.  Complex types of scalar will not be stored with
referential integrity, but will be coerced to strings.

The forms differ in how the key is specified.  In all forms, the key is pointed
to by C<key>.
In the plain C<pv> form, the key is a C language NUL-terminated string.
In the C<pvs> form, the key is a C language string literal.
In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
the string, which hence, may contain embedded-NUL characters.
In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
using C<L</SvPV_const>>.

C<hash> is a precomputed hash of the key string, or zero if it has not been
precomputed.  This parameter is omitted from the C<pvs> form, as it is computed
automatically at compile time.

The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
It is illegal to set this in the C<sv> form.  In the C<pv*> forms, it specifies
whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
cleared).  The C<sv> form uses the underlying SV to determine the UTF-8ness of
the octets.

=over 3

 COPHH *  cophh_store_pv (COPHH *cophh, const char *key, U32 hash,
                          SV *value, U32 flags)
 COPHH *  cophh_store_pvn(COPHH *cophh, const char *key,
                          STRLEN keylen, U32 hash, SV *value,
                          U32 flags)
 COPHH *  cophh_store_pvs(COPHH *cophh, "key", SV *value,
                          U32 flags)
 COPHH *  cophh_store_sv (COPHH *cophh, SV *key, U32 hash,
                          SV *value, U32 flags)

=back

=back

=for hackers
cophh_store_pv declared at cop.h, line 336; all in group documented at cop.h, line 336
cophh_store_pvn declared at cop.h, line 337
cophh_store_pvs declared at cop.h, line 338
cophh_store_sv declared at cop.h, line 339

=over 4

=item C<cophh_2hv>
X<cophh_2hv>

NOTE: C<cophh_2hv> is B<experimental> and may change or be
removed without notice.

Generates and returns a standard Perl hash representing the full set of
key/value pairs in the cop hints hash C<cophh>.  C<flags> is currently
unused and must be zero.

=over 3

 HV *  cophh_2hv(const COPHH *cophh, U32 flags)

=back

=back

=for hackers
Declared and documented at cop.h, line 292

=over 4

=item C<CopLABEL>

=item C<CopLABEL_len>

=item C<CopLABEL_len_flags>
X<CopLABEL>X<CopLABEL_len>X<CopLABEL_len_flags>

These return the label attached to a cop.

C<CopLABEL_len> and C<CopLABEL_len_flags> additionally store the number of
bytes comprising the returned label into C<*len>.

C<CopLABEL_len_flags> additionally returns the UTF-8ness of the returned label,
by setting C<*flags> to 0 or C<SVf_UTF8>.

=over 3

 const char *  CopLABEL          (COP *const cop)
 const char *  CopLABEL_len      (COP *const cop, STRLEN *len)
 const char *  CopLABEL_len_flags(COP *const cop, STRLEN *len,
                                  U32 *flags)

=back

=back

=for hackers
CopLABEL declared at cop.h, line 798; all in group documented at cop.h, line 798
CopLABEL_len declared at cop.h, line 799
CopLABEL_len_flags declared at cop.h, line 800

=over 4

=item C<CopLINE>
X<CopLINE>

Returns the line number in the source code associated with the C<COP> C<c>

=over 3

 line_t  CopLINE(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 486

=over 4

=item C<CopSTASH>
X<CopSTASH>

Returns the stash associated with C<c>.

=over 3

 HV *  CopSTASH(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 521

=over 4

=item C<CopSTASH_eq>
X<CopSTASH_eq>

Returns a boolean as to whether or not C<hv> is the stash associated with C<c>.

=over 3

 bool  CopSTASH_eq(const COP * c, const HV * hv)

=back

=back

=for hackers
Declared and documented at cop.h, line 524

=over 4

=item C<CopSTASH_set>
X<CopSTASH_set>

Set the stash associated with C<c> to C<hv>.

=over 3

 bool  CopSTASH_set(COP * c, HV * hv)

=back

=back

=for hackers
Declared and documented at cop.h, line 527

=over 4

=item C<CopSTASHPV>
X<CopSTASHPV>

Returns the package name of the stash associated with C<c>, or C<NULL> if no
associated stash

=over 3

 char *  CopSTASHPV(const COP * c)

=back

=back

=for hackers
Declared and documented at cop.h, line 530

=over 4

=item C<CopSTASHPV_set>
X<CopSTASHPV_set>

Set the package name of the stash associated with C<c>, to the NUL-terminated C
string C<p>, creating the package if necessary.

=over 3

 void  CopSTASHPV_set(COP * c, const char * pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 534

=over 4

=item C<PERL_SI>
X<PERL_SI>

Use this typedef to declare variables that are to hold C<struct stackinfo>.

=back

=for hackers
Declared and documented at cop.h, line 1294

=over 4

=item C<PL_curcop>
X<PL_curcop>

The currently active COP (control op) roughly representing the current
statement in the source.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 COP*  PL_curcop

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 157

=over 4

=item C<RCPV_LEN>
X<RCPV_LEN>

Returns the length of a pv created with C<rcpv_new()>.
Note that this reflects the length of the string from the callers
point of view, it does not include the mandatory null which is
always injected at the end of the string by rcpv_new().
No checks are performed to ensure that C<pv> was actually allocated
with C<rcpv_new()>, it is the callers responsibility to ensure that
this is the case.

=over 3

 RCPV *  RCPV_LEN(char *pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 569

=over 4

=item C<RCPV_REFCNT_dec>
X<RCPV_REFCNT_dec>

Decrements the refcount for a C<char *> pointer which was created
with a call to C<rcpv_new()>. Same as calling rcpv_free().
No checks are performed to ensure that C<pv> was actually allocated
with C<rcpv_new()>, it is the callers responsibility to ensure that
this is the case.

=over 3

 RCPV *  RCPV_REFCNT_dec(char *pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 562

=over 4

=item C<RCPV_REFCNT_inc>
X<RCPV_REFCNT_inc>

Increments the refcount for a C<char *> pointer which was created
with a call to C<rcpv_new()>. Same as calling rcpv_copy().
No checks are performed to ensure that C<pv> was actually allocated
with C<rcpv_new()>, it is the callers responsibility to ensure that
this is the case.

=over 3

 RCPV *  RCPV_REFCNT_inc(char *pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 555

=over 4

=item C<RCPV_REFCOUNT>
X<RCPV_REFCOUNT>

Returns the refcount for a pv created with C<rcpv_new()>. 
No checks are performed to ensure that C<pv> was actually allocated
with C<rcpv_new()>, it is the callers responsibility to ensure that
this is the case.

=over 3

 RCPV *  RCPV_REFCOUNT(char *pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 549

=over 4

=item C<RCPVx>
X<RCPVx>

Returns the RCPV structure (struct rcpv) for a refcounted
string pv created with C<rcpv_new()>.
No checks are performed to ensure that C<pv> was actually allocated
with C<rcpv_new()>, it is the callers responsibility to ensure that
this is the case.

=over 3

 RCPV *  RCPVx(char *pv)

=back

=back

=for hackers
Declared and documented at cop.h, line 542

=head1 Custom Operators

=over 4

=item C<custom_op_register>
X<custom_op_register>

Register a custom op.  See L<perlguts/"Custom Operators">.

=over 3

 void  Perl_custom_op_register(pTHX_ Perl_ppaddr_t ppaddr,
                                     const XOP *xop)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15909

=over 4

=item C<Perl_custom_op_xop>
X<Perl_custom_op_xop>

Return the XOP structure for a given custom op.  This macro should be
considered internal to C<OP_NAME> and the other access macros: use them instead.
This macro does call a function.  Prior
to 5.19.6, this was implemented as a
function.

=over 3

 const XOP *  Perl_custom_op_xop(const OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15748

=over 4

=item C<XopDISABLE>
X<XopDISABLE>

Temporarily disable a member of the XOP, by clearing the appropriate flag.

=over 3

 void  XopDISABLE(XOP *xop, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 918

=over 4

=item C<XopENABLE>
X<XopENABLE>

Reenable a member of the XOP which has been disabled.

=over 3

 void  XopENABLE(XOP *xop, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 921

=over 4

=item C<XopENTRY>
X<XopENTRY>

Return a member of the XOP structure.  C<which> is a cpp token
indicating which entry to return.  If the member is not set
this will return a default value.  The return type depends
on C<which>.  This macro evaluates its arguments more than
once.  If you are using C<Perl_custom_op_xop> to retrieve a
C<XOP *> from a C<OP *>, use the more efficient L</XopENTRYCUSTOM> instead.

=over 3

   XopENTRY(XOP *xop, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 899

=over 4

=item C<XopENTRY_set>
X<XopENTRY_set>

Set a member of the XOP structure.  C<which> is a cpp token
indicating which entry to set.  See L<perlguts/"Custom Operators">
for details about the available members and how
they are used.  This macro evaluates its argument
more than once.

=over 3

 void  XopENTRY_set(XOP *xop, token which, value)

=back

=back

=for hackers
Declared and documented at op.h, line 911

=over 4

=item C<XopENTRYCUSTOM>
X<XopENTRYCUSTOM>

Exactly like C<XopENTRY(XopENTRY(Perl_custom_op_xop(aTHX_ o), which)> but more
efficient.  The C<which> parameter is identical to L</XopENTRY>.

=over 3

   XopENTRYCUSTOM(const OP *o, token which)

=back

=back

=for hackers
Declared and documented at op.h, line 907

=over 4

=item C<XopFLAGS>
X<XopFLAGS>

Return the XOP's flags.

=over 3

 U32  XopFLAGS(XOP *xop)

=back

=back

=for hackers
Declared and documented at op.h, line 896

=head1 CV Handling
X<CV>X<GV_ADD>

This section documents functions to manipulate CVs which are
code-values, meaning subroutines.  For more information, see
L<perlguts>.


=over 4

=item C<caller_cx>
X<caller_cx>

The XSUB-writer's equivalent of L<caller()|perlfunc/caller>.  The
returned C<PERL_CONTEXT> structure can be interrogated to find all the
information returned to Perl by C<caller>.  Note that XSUBs don't get a
stack frame, so C<caller_cx(0, NULL)> will return information for the
immediately-surrounding Perl code.

This function skips over the automatic calls to C<&DB::sub> made on the
behalf of the debugger.  If the stack frame requested was a sub called by
C<DB::sub>, the return value will be the frame for the call to
C<DB::sub>, since that has the correct line number/etc. for the call
site.  If I<dbcxp> is non-C<NULL>, it will be set to a pointer to the
frame for the sub call itself.

=over 3

 const PERL_CONTEXT *       caller_cx(I32 level,
                                       const PERL_CONTEXT **dbcxp)
 const PERL_CONTEXT *  Perl_caller_cx(pTHX_ I32 level,
                                       const PERL_CONTEXT **dbcxp)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_ctl.c, line 2193

=over 4

=item C<CvDEPTH>
X<CvDEPTH>

Returns the recursion level of the CV C<sv>.  Hence >= 2 indicates we are in a
recursive call.

=over 3

 I32 *       CvDEPTH(const CV * const sv)
 I32 *  Perl_CvDEPTH(const CV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 241

=over 4

=item C<CvGV>
X<CvGV>

Returns the GV associated with the CV C<sv>, reifying it if necessary.

=over 3

 GV *       CvGV(      CV *sv)
 GV *  Perl_CvGV(pTHX_ CV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 225

=over 4

=item C<CvREFCNT_inc>

=item C<CvREFCNT_inc_simple>

=item C<CvREFCNT_inc_simple_NN>
X<CvREFCNT_inc>X<CvREFCNT_inc_simple>X<CvREFCNT_inc_simple_NN>

These all increment the reference count of the given SV, which must be a CV.
They are useful when assigning the result into a typed pointer as they avoid
the need to cast the result to the appropriate type.

=over 3

 CV *  CvREFCNT_inc          (CV *cv)
 CV *  CvREFCNT_inc_simple   (CV *cv)
 CV *  CvREFCNT_inc_simple_NN(CV *cv)

=back

=back

=for hackers
CvREFCNT_inc declared at cv.h, line 21; all in group documented at cv.h, line 21
CvREFCNT_inc_simple declared at cv.h, line 22
CvREFCNT_inc_simple_NN declared at cv.h, line 23

=over 4

=item C<CvSTASH>
X<CvSTASH>

Returns the stash of the CV.  A stash is the symbol table hash, containing
the package-scoped variables in the package where the subroutine was defined.
For more information, see L<perlguts>.

This also has a special use with XS AUTOLOAD subs.
See L<perlguts/Autoloading with XSUBs>.

=over 3

 HV*  CvSTASH(CV* cv)

=back

=back

=for hackers
Declared and documented at cv.h, line 44

=over 4

=item C<find_runcv>
X<find_runcv>

Locate the CV corresponding to the currently executing sub or eval.
If C<db_seqp> is non_null, skip CVs that are in the DB package and populate
C<*db_seqp> with the cop sequence number at the point that the DB:: code was
entered.  (This allows debuggers to eval in the scope of the breakpoint
rather than in the scope of the debugger itself.)

=over 3

 CV *       find_runcv(      U32 *db_seqp)
 CV *  Perl_find_runcv(pTHX_ U32 *db_seqp)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_ctl.c, line 3871

=over 4

=item C<get_cv>

=item C<get_cvn_flags>

=item C<get_cvs>
X<get_cv>X<get_cvn_flags>X<get_cvs>

These return the CV of the specified Perl subroutine.  C<flags> are passed to
C<gv_fetchpvn_flags>.  If C<GV_ADD> is set and the Perl subroutine does not
exist then it will be declared (which has the same effect as saying
C<sub name;>).  If C<GV_ADD> is not set and the subroutine does not exist,
then NULL is returned.

The forms differ only in how the subroutine is specified..  With C<get_cvs>,
the name is a literal C string, enclosed in double quotes.  With C<get_cv>, the
name is given by the C<name> parameter, which must be a NUL-terminated C
string.  With C<get_cvn_flags>, the name is also given by the C<name>
parameter, but it is a Perl string (possibly containing embedded NUL bytes),
and its length in bytes is contained in the C<len> parameter.

NOTE: the C<perl_get_cv()> form is B<deprecated>.

=over 3

 CV *       get_cv       (      const char *name, I32 flags)
 CV *  Perl_get_cv       (pTHX_ const char *name, I32 flags)
 CV *       get_cvn_flags(      const char *name, STRLEN len,
                                I32 flags)
 CV *  Perl_get_cvn_flags(pTHX_ const char *name, STRLEN len,
                                I32 flags)
 CV *       get_cvs      (      "name", I32 flags)

=back

=back

=for hackers
get_cv declared in embed.fnc; all in group documented at perl.c, line 2978
get_cvn_flags declared in embed.fnc
get_cvs declared at handy.h, line 480

=over 4

=item C<Nullcv>
X<Nullcv>

C<B<DEPRECATED!>>  It is planned to remove C<Nullcv>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Null CV pointer.

(deprecated - use C<(CV *)NULL> instead)

=back

=for hackers
Declared and documented at cv.h, line 39

=head1 Debugging

=over 4

=item C<av_dump>
X<av_dump>

Dumps the contents of an AV to the C<STDERR> filehandle,
Similar to using Devel::Peek on an arrayref but does not
expect an RV wrapper. Dumps contents to a depth of 3 levels
deep.

=over 3

 void       av_dump(      AV *av)
 void  Perl_av_dump(pTHX_ AV *av)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 2901

=over 4

=item C<deb>

=item C<deb_nocontext>

=item C<vdeb>
X<deb>X<deb_nocontext>X<vdeb>

When perl is compiled with C<-DDEBUGGING>, these each print to STDERR the
information given by the arguments, prefaced by the name of the file containing
the script causing the call, and the line number within that file.

If the C<v> (verbose) debugging option is in effect, the process id is also
printed.

C<deb> and C<deb_nocontext> differ only in that C<deb_nocontext> does not take
a thread context (C<aTHX>) parameter, so is used in situations where the caller
doesn't already have the thread context.

C<vdeb> is the same as C<deb> except C<args> are an encapsulated argument list.

=over 3

 void  Perl_deb          (pTHX_ const char *pat, ...)
 void       deb_nocontext(      const char *pat, ...)
 void  Perl_deb_nocontext(      const char *pat, ...)
 void       vdeb         (      const char *pat, va_list *args)
 void  Perl_vdeb         (pTHX_ const char *pat, va_list *args)

=back

=back

=for hackers
deb declared in embed.fnc; all in group documented at deb.c, line 45
deb_nocontext declared in embed.fnc
vdeb declared in embed.fnc

=over 4

=item C<debstack>
X<debstack>

Dump the current stack

=over 3

 I32       debstack()
 I32  Perl_debstack(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at deb.c, line 193

=over 4

=item C<dump_all>
X<dump_all>

Dumps the entire optree of the current program starting at C<PL_main_root> to 
C<STDERR>.  Also dumps the optrees for all visible subroutines in
C<PL_defstash>.

=over 3

 void       dump_all()
 void  Perl_dump_all(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 799

=over 4

=item C<dump_c_backtrace>
X<dump_c_backtrace>

Dumps the C backtrace to the given C<fp>.

Returns true if a backtrace could be retrieved, false if not.

=over 3

 bool       dump_c_backtrace(      PerlIO *fp, int max_depth,
                                   int skip)
 bool  Perl_dump_c_backtrace(pTHX_ PerlIO *fp, int max_depth,
                                   int skip)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 6685

=over 4

=item C<dump_eval>

Described in L<perlguts>.

=over 3

 void       dump_eval()
 void  Perl_dump_eval(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at pod/perlguts.pod, line 2853

=over 4

=item C<dump_form>
X<dump_form>

Dumps the contents of the format contained in the GV C<gv> to C<STDERR>, or a
message that one doesn't exist.

=over 3

 void       dump_form(      const GV *gv)
 void  Perl_dump_form(pTHX_ const GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 910

=over 4

=item C<dump_packsubs>
X<dump_packsubs>

Dumps the optrees for all visible subroutines in C<stash>.

=over 3

 void       dump_packsubs(      const HV *stash)
 void  Perl_dump_packsubs(pTHX_ const HV *stash)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 824

=over 4

=item C<dump_sub>

Described in L<perlguts>.

=over 3

 void       dump_sub(      const GV *gv)
 void  Perl_dump_sub(pTHX_ const GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at pod/perlguts.pod, line 2861

=over 4

=item C<get_c_backtrace_dump>
X<get_c_backtrace_dump>

Returns a SV containing a dump of C<depth> frames of the call stack, skipping
the C<skip> innermost ones.  C<depth> of 20 is usually enough.

The appended output looks like:

 ...
 1   10e004812:0082   Perl_croak   util.c:1716    /usr/bin/perl
 2   10df8d6d2:1d72   perl_parse   perl.c:3975    /usr/bin/perl
 ...

The fields are tab-separated.  The first column is the depth (zero
being the innermost non-skipped frame).  In the hex:offset, the hex is
where the program counter was in C<S_parse_body>, and the :offset (might
be missing) tells how much inside the C<S_parse_body> the program counter was.

The C<util.c:1716> is the source code file and line number.

The F</usr/bin/perl> is obvious (hopefully).

Unknowns are C<"-">.  Unknowns can happen unfortunately quite easily:
if the platform doesn't support retrieving the information;
if the binary is missing the debug information;
if the optimizer has transformed the code by for example inlining.

=over 3

 SV *       get_c_backtrace_dump(      int max_depth, int skip)
 SV *  Perl_get_c_backtrace_dump(pTHX_ int max_depth, int skip)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 6602

=over 4

=item C<gv_dump>
X<gv_dump>

Dump the name and, if they differ, the effective name of the GV C<gv> to
C<STDERR>.

=over 3

 void       gv_dump(      GV *gv)
 void  Perl_gv_dump(pTHX_ GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 1636

=over 4

=item C<HAS_BACKTRACE>
X<HAS_BACKTRACE>

This symbol, if defined, indicates that the C<backtrace()> routine is
available to get a stack trace.  The F<execinfo.h> header must be
included to use this routine.

=back

=for hackers
Declared and documented at config.h, line 1490

=over 4

=item C<hv_dump>
X<hv_dump>

Dumps the contents of an HV to the C<STDERR> filehandle.
Similar to using Devel::Peek on an hashref but does not
expect an RV wrapper. Dumps contents to a depth of 3 levels
deep.

=over 3

 void       hv_dump(      HV *hv)
 void  Perl_hv_dump(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 2908

=over 4

=item C<magic_dump>
X<magic_dump>

Dumps the contents of the MAGIC C<mg> to C<STDERR>.

=over 3

 void       magic_dump(      const MAGIC *mg)
 void  Perl_magic_dump(pTHX_ const MAGIC *mg)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 1807

=over 4

=item C<op_class>
X<op_class>

Given an op, determine what type of struct it has been allocated as.
Returns one of the OPclass enums, such as OPclass_LISTOP.

=over 3

 OPclass       op_class(      const OP *o)
 OPclass  Perl_op_class(pTHX_ const OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 3355

=over 4

=item C<op_dump>
X<op_dump>

Dumps the optree starting at OP C<o> to C<STDERR>.

=over 3

 void       op_dump(      const OP *o)
 void  Perl_op_dump(pTHX_ const OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 1621

=over 4

=item C<opdump_printf>
X<opdump_printf>

Prints formatted output to C<STDERR> according to the pattern and subsequent
arguments, in the style of C<printf()> et.al. This should only be called by
a function invoked by the C<xop_dump> field of a custom operator, where the
C<ctx> opaque structure pointer should be passed in from the argument given
to the C<xop_dump> callback.

This function handles indentation after linefeeds, so message strings passed
in should not account for it themselves. Multiple lines may be passed to this
function at once, or a single line may be split across multiple calls.

=over 3

 void  Perl_opdump_printf(pTHX_ struct Perl_OpDumpContext *ctx,
                                const char *pat, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 751

=over 4

=item C<PL_op>

Described in L<perlhacktips>.

=back

=for hackers
Documented at pod/perlhacktips.pod, line 1299

=over 4

=item C<PL_runops>

Described in L<perlguts>.

=over 3

 runops_proc_t  PL_runops

=back

=back

=for hackers
Documented at pod/perlguts.pod, line 2759

=over 4

=item C<PL_sv_serial>

Described in L<perlhacktips>.

=back

=for hackers
Documented at pod/perlhacktips.pod, line 1896

=over 4

=item C<pmop_dump>
X<pmop_dump>

Dump an OP that is related to Pattern Matching, such as C<s/foo/bar/>; these require
special handling.

=over 3

 void       pmop_dump(      PMOP *pm)
 void  Perl_pmop_dump(pTHX_ PMOP *pm)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 1097

=over 4

=item C<sv_dump>

=item C<sv_dump_depth>
X<sv_dump>X<sv_dump_depth>

These each dump the contents of an SV to the C<STDERR> filehandle.

C<sv_dump_depth> is a more flexible variant of C<sv_dump>, taking an extra
parameter giving the maximum depth to dump.

C<sv_dump> is limited to dumping items to a depth of 4 if the item is an SvROK,
and dumping only the top level item otherwise.  This means that it will not
dump the contents of an S<C<AV *>> or S<C<HV *>>. For that use C<L</av_dump>>
or C<L</hv_dump>>.

For an example of its output, see L<Devel::Peek>.

In contrast, C<sv_dump_depth> can be used on any SV derived type (GV, HV, AV)
with an appropriate cast:

    HV *hv = ...;
    sv_dump_depth((SV*)hv, 2);

would dump the hv, its keys and values, but would not recurse
into any RV values.

=over 3

 void       sv_dump      (      SV *sv)
 void  Perl_sv_dump      (pTHX_ SV *sv)
 void       sv_dump_depth(      SV *sv, I32 depth)
 void  Perl_sv_dump_depth(pTHX_ SV *sv, I32 depth)

=back

=back

=for hackers
sv_dump declared in embed.fnc; all in group documented at dump.c, line 2877
sv_dump_depth declared in embed.fnc

=over 4

=item C<vdeb*>

Described under C<L</deb>>

=back

=head1 Display functions
X<PERL_PV_ESCAPE_ALL>X<PERL_PV_ESCAPE_FIRSTCHAR>
X<PERL_PV_ESCAPE_NOBACKSLASH>X<PERL_PV_ESCAPE_NOCLEAR>
X<PERL_PV_ESCAPE_NON_WC>X<PERL_PV_ESCAPE_NONASCII>X<PERL_PV_ESCAPE_QUOTE>
X<PERL_PV_ESCAPE_RE>X<PERL_PV_ESCAPE_UNI>X<PERL_PV_ESCAPE_UNI_DETECT>
X<PERL_PV_PRETTY_ELLIPSES>X<PERL_PV_PRETTY_LTGT>X<PERL_PV_PRETTY_QUOTE>

=over 4

=item C<form>

=item C<form_nocontext>

=item C<vform>
X<form>X<form_nocontext>X<vform>

These each take a sprintf-style format pattern and conventional
(non-SV) arguments and return the formatted string.

    (char *) form(const char* pat, ...)

They can be used any place a string (char *) is required:

    char * s = form_nocontext("%d.%d", major, minor);

They each return a temporary that will be freed "soon", automatically by the
system, at the same time that SVs operated on by C<L</sv_2mortal>> are freed.

Use the result immediately, or copy to a stable place for longer retention.
This is contrary to the incorrect previous documentation of these that claimed
that the return was a single per-thread buffer.  That was (and is) actually
true only when these are called during global destruction.

C<form> and C<form_nocontext> differ only in that C<form_nocontext> does
not take a thread context (C<aTHX>) parameter, so is used in situations where
the caller doesn't already have the thread context (and can be called without
the C<Perl_> prefix.

C<vform> is the same as C<form> except the arguments are an encapsulated
argument list.  It does need a thread context parameter, but that is supplied
automatically when called without the C<Perl_> prefix.

=over 3

 char *  Perl_form          (pTHX_ const char *pat, ...)
 char *       form_nocontext(      const char *pat, ...)
 char *  Perl_form_nocontext(      const char *pat, ...)
 char *       vform         (      const char *pat, va_list *args)
 char *  Perl_vform         (pTHX_ const char *pat, va_list *args)

=back

=back

=for hackers
form declared in embed.fnc; all in group documented at util.c, line 1416
form_nocontext declared in embed.fnc
vform declared in embed.fnc

=over 4

=item C<mess>

=item C<mess_nocontext>

=item C<vmess>
X<mess>X<mess_nocontext>X<vmess>

These each take a sprintf-style format pattern and argument list, which are
used to generate a string message.  If the message does not end with a newline,
then it will be extended with some indication of the current location in the
code, as described for C<L</mess_sv>>.

C<mess> and C<mess_nocontext> differ only in that C<mess_nocontext> does
not take a thread context (C<aTHX>) parameter, so is used in situations where
the caller doesn't already have the thread context.

C<vmess> is the same as C<mess> except the arguments are an encapsulated
argument list.  It needs a thread context parameter only when called with the
C<Perl_> prefix.

Normally, the resulting message is returned in a new mortal SV.
But during global destruction a single SV may be shared between uses of
this function.

=over 3

 SV *  Perl_mess          (pTHX_ const char *pat, ...)
 SV *       mess_nocontext(      const char *pat, ...)
 SV *  Perl_mess_nocontext(      const char *pat, ...)
 SV *       vmess         (      const char *pat, va_list *args)
 SV *  Perl_vmess         (pTHX_ const char *pat, va_list *args)

=back

=back

=for hackers
mess declared in embed.fnc; all in group documented at util.c, line 1471
mess_nocontext declared in embed.fnc
vmess declared in embed.fnc

=over 4

=item C<mess_sv>
X<mess_sv>

Expands a message, intended for the user, to include an indication of
the current location in the code, if the message does not already appear
to be complete.

C<basemsg> is the initial message or object.  If it is a reference, it
will be used as-is and will be the result of this function.  Otherwise it
is used as a string, and if it already ends with a newline, it is taken
to be complete, and the result of this function will be the same string.
If the message does not end with a newline, then a segment such as C<at
foo.pl line 37> will be appended, and possibly other clauses indicating
the current state of execution.  The resulting message will end with a
dot and a newline.

Normally, the resulting message is returned in a new mortal SV.
During global destruction a single SV may be shared between uses of this
function.  If C<consume> is true, then the function is permitted (but not
required) to modify and return C<basemsg> instead of allocating a new SV.

=over 3

 SV *       mess_sv(      SV *basemsg, bool consume)
 SV *  Perl_mess_sv(pTHX_ SV *basemsg, bool consume)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1562

=over 4

=item C<pv_display>
X<pv_display>

Similar to

  pv_escape(dsv,pv,cur,pvlim,PERL_PV_ESCAPE_QUOTE);

except that an additional "\0" will be appended to the string when
len > cur and pv[cur] is "\0".

Note that the final string may be up to 7 chars longer than pvlim.

=over 3

 char *       pv_display(      SV *dsv, const char *pv,
                               STRLEN cur, STRLEN len,
                               STRLEN pvlim)
 char *  Perl_pv_display(pTHX_ SV *dsv, const char *pv,
                               STRLEN cur, STRLEN len,
                               STRLEN pvlim)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 431

=over 4

=item C<pv_escape>
X<pv_escape>

Escapes at most the first C<count> chars of C<pv> and puts the results into
C<dsv> such that the size of the escaped string will not exceed C<max> chars
and will not contain any incomplete escape sequences.  The number of bytes
escaped will be returned in the C<STRLEN *escaped> parameter if it is not null.
When the C<dsv> parameter is null no escaping actually occurs, but the number
of bytes that would be escaped were it not null will be calculated.

If flags contains C<PERL_PV_ESCAPE_QUOTE> then any double quotes in the string
will also be escaped.

Normally the SV will be cleared before the escaped string is prepared,
but when C<PERL_PV_ESCAPE_NOCLEAR> is set this will not occur.

If C<PERL_PV_ESCAPE_UNI> is set then the input string is treated as UTF-8.
If C<PERL_PV_ESCAPE_UNI_DETECT> is set then the input string is scanned
using C<is_utf8_string()> to determine if it is UTF-8.

If C<PERL_PV_ESCAPE_ALL> is set then all input chars will be output
using C<\x01F1> style escapes, otherwise if C<PERL_PV_ESCAPE_NONASCII>
is set, only non-ASCII chars will be escaped using this style;
otherwise, only chars above 255 will be so escaped; other non printable
chars will use octal or common escaped patterns like C<\n>. Otherwise,
if C<PERL_PV_ESCAPE_NOBACKSLASH> then all chars below 255 will be
treated as printable and will be output as literals. The
C<PERL_PV_ESCAPE_NON_WC> modifies the previous rules to cause word
chars, unicode or otherwise, to be output as literals, note this uses
the *unicode* rules for deciding on word characters.

If C<PERL_PV_ESCAPE_FIRSTCHAR> is set then only the first char of the
string will be escaped, regardless of max. If the output is to be in
hex, then it will be returned as a plain hex sequence. Thus the output
will either be a single char, an octal escape sequence, a special escape
like C<\n> or a hex value.

If C<PERL_PV_ESCAPE_RE> is set then the escape char used will be a
C<"%"> and not a C<"\\">. This is because regexes very often contain
backslashed sequences, whereas C<"%"> is not a particularly common
character in patterns.

Returns a pointer to the escaped text as held by C<dsv>.

=over 3

 char *       pv_escape(      SV *dsv, char const * const str,
                              const STRLEN count, STRLEN max,
                              STRLEN * const escaped, U32 flags)
 char *  Perl_pv_escape(pTHX_ SV *dsv, char const * const str,
                              const STRLEN count, STRLEN max,
                              STRLEN * const escaped, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 101

=over 4

=item C<pv_pretty>
X<pv_pretty>

Converts a string into something presentable, handling escaping via
C<pv_escape()> and supporting quoting and ellipses.

If the C<PERL_PV_PRETTY_QUOTE> flag is set then the result will be
double quoted with any double quotes in the string escaped.  Otherwise
if the C<PERL_PV_PRETTY_LTGT> flag is set then the result be wrapped in
angle brackets. 

If the C<PERL_PV_PRETTY_ELLIPSES> flag is set and not all characters in
string were output then an ellipsis C<...> will be appended to the
string.  Note that this happens AFTER it has been quoted.

If C<start_color> is non-null then it will be inserted after the opening
quote (if there is one) but before the escaped text.  If C<end_color>
is non-null then it will be inserted after the escaped text but before
any quotes or ellipses.

Returns a pointer to the prettified text as held by C<dsv>.

=over 3

 char *       pv_pretty(      SV *dsv, char const * const str,
                              const STRLEN count,
                              const STRLEN max,
                              char const * const start_color,
                              char const * const end_color,
                              const U32 flags)
 char *  Perl_pv_pretty(pTHX_ SV *dsv, char const * const str,
                              const STRLEN count,
                              const STRLEN max,
                              char const * const start_color,
                              char const * const end_color,
                              const U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at dump.c, line 337

=over 4

=item C<vform*>

Described under C<L</form>>

=back

=over 4

=item C<vmess*>

Described under C<L</mess>>

=back

=head1 Embedding, Threads, and Interpreter Cloning
X<CV_NAME_NOTQUAL>X<NOT_IN_PAD>X<PADNAMEf_OUTER>X<PERL_EXIT_ABORT>
X<PERL_EXIT_DESTRUCT_END>X<PERL_EXIT_EXPECTED>X<PERL_EXIT_WARN>
X<PERL_LOADMOD_DENY>X<PERL_LOADMOD_IMPORT_OPS>X<PERL_LOADMOD_NOIMPORT>

=over 4

=item C<call_atexit>
X<call_atexit>

Add a function C<fn> to the list of functions to be called at global
destruction.  C<ptr> will be passed as an argument to C<fn>; it can point to a
C<struct> so that you can pass anything you want.

Note that under threads, C<fn> may run multiple times.  This is because the
list is executed each time the current or any descendent thread terminates.

=over 3

 void       call_atexit(      ATEXIT_t fn, void *ptr)
 void  Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 1649

=over 4

=item C<cv_clone>
X<cv_clone>

Clone a CV, making a lexical closure.  C<proto> supplies the prototype
of the function: its code, pad structure, and other attributes.
The prototype is combined with a capture of outer lexicals to which the
code refers, which are taken from the currently-executing instance of
the immediately surrounding code.

=over 3

 CV *       cv_clone(      CV *proto)
 CV *  Perl_cv_clone(pTHX_ CV *proto)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 1913

=over 4

=item C<cv_name>
X<cv_name>

Returns an SV containing the name of the CV, mainly for use in error
reporting.  The CV may actually be a GV instead, in which case the returned
SV holds the GV's name.  Anything other than a GV or CV is treated as a
string already holding the sub name, but this could change in the future.

An SV may be passed as a second argument.  If so, the name will be assigned
to it and it will be returned.  Otherwise the returned SV will be a new
mortal.

If C<flags> has the C<CV_NAME_NOTQUAL> bit set, then the package name will not be
included.  If the first argument is neither a CV nor a GV, this flag is
ignored (subject to change).

=over 3

 SV *       cv_name(      NOCHECK CV *cv, SV *sv, U32 flags)
 SV *  Perl_cv_name(pTHX_ NOCHECK CV *cv, SV *sv, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2294

=over 4

=item C<cv_undef>
X<cv_undef>

Clear out all the active components of a CV.  This can happen either
by an explicit C<undef &foo>, or by the reference count going to zero.
In the former case, we keep the C<CvOUTSIDE> pointer, so that any anonymous
children can still follow the full lexical scope chain.

=over 3

 void       cv_undef(      CV *cv)
 void  Perl_cv_undef(pTHX_ CV *cv)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 286

=over 4

=item C<find_rundefsv>
X<find_rundefsv>

Returns the global variable C<$_>.

=over 3

 SV *       find_rundefsv()
 SV *  Perl_find_rundefsv(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 1046

=over 4

=item C<get_op_descs>
X<get_op_descs>

C<B<DEPRECATED!>>  It is planned to remove C<get_op_descs>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Return a pointer to the array of all the descriptions of the various OPs
Given an opcode from the enum in F<opcodes.h>, C<PL_op_desc[opcode]> returns a
pointer to a C language string giving its description.

=over 3

 char **       get_op_descs()
 char **  Perl_get_op_descs(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 3680

=over 4

=item C<get_op_names>
X<get_op_names>

C<B<DEPRECATED!>>  It is planned to remove C<get_op_names>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Return a pointer to the array of all the names of the various OPs
Given an opcode from the enum in F<opcodes.h>, C<PL_op_name[opcode]> returns a
pointer to a C language string giving its name.

=over 3

 char **       get_op_names()
 char **  Perl_get_op_names(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 3663

=over 4

=item C<HAS_SKIP_LOCALE_INIT>

Described in L<perlembed>.

=back

=for hackers
Documented at pod/perlembed.pod, line 1126

=over 4

=item C<intro_my>
X<intro_my>

"Introduce" C<my> variables to visible status.  This is called during parsing
at the end of each statement to make lexical variables visible to subsequent
statements.

=over 3

 U32       intro_my()
 U32  Perl_intro_my(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 1444

=over 4

=item C<load_module>

=item C<load_module_nocontext>
X<load_module>X<load_module_nocontext>

These load the module whose name is pointed to by the string part of C<name>.
Note that the actual module name, not its filename, should be given.
Eg, "Foo::Bar" instead of "Foo/Bar.pm". ver, if specified and not NULL,
provides version semantics similar to C<use Foo::Bar VERSION>. The optional
trailing arguments can be used to specify arguments to the module's C<import()>
method, similar to C<use Foo::Bar VERSION LIST>; their precise handling depends
on the flags. The flags argument is a bitwise-ORed collection of any of
C<PERL_LOADMOD_DENY>, C<PERL_LOADMOD_NOIMPORT>, or C<PERL_LOADMOD_IMPORT_OPS>
(or 0 for no flags).

If C<PERL_LOADMOD_NOIMPORT> is set, the module is loaded as if with an empty
import list, as in C<use Foo::Bar ()>; this is the only circumstance in which
the trailing optional arguments may be omitted entirely. Otherwise, if
C<PERL_LOADMOD_IMPORT_OPS> is set, the trailing arguments must consist of
exactly one C<OP*>, containing the op tree that produces the relevant import
arguments. Otherwise, the trailing arguments must all be C<SV*> values that
will be used as import arguments; and the list must be terminated with C<(SV*)
NULL>. If neither C<PERL_LOADMOD_NOIMPORT> nor C<PERL_LOADMOD_IMPORT_OPS> is
set, the trailing C<NULL> pointer is needed even if no import arguments are
desired. The reference count for each specified C<SV*> argument is
decremented. In addition, the C<name> argument is modified.

If C<PERL_LOADMOD_DENY> is set, the module is loaded as if with C<no> rather
than C<use>.

C<load_module> and C<load_module_nocontext> have the same apparent signature,
but the former hides the fact that it is accessing a thread context parameter.
So use the latter when you get a compilation error about C<pTHX>.

=over 3

 void       load_module          (      U32 flags, SV *name,
                                        SV *ver, ...)
 void  Perl_load_module          (pTHX_ U32 flags, SV *name,
                                        SV *ver, ...)
 void       load_module_nocontext(      U32 flags, SV *name,
                                        SV *ver, ...)
 void  Perl_load_module_nocontext(      U32 flags, SV *name,
                                        SV *ver, ...)

=back

=back

=for hackers
load_module declared in embed.fnc; all in group documented at op.c, line 8373
load_module_nocontext declared in embed.fnc

=over 4

=item C<my_exit>
X<my_exit>

A wrapper for the C library L<exit(3)>, honoring what L<perlapi/PL_exit_flags>
say to do.

=over 3

 void       my_exit(      U32 status)
 void  Perl_my_exit(pTHX_ U32 status)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 5372

=over 4

=item C<my_failure_exit>
X<my_failure_exit>

Exit the running Perl process with an error.

On non-VMS platforms, this is essentially equivalent to L</C<my_exit>>, using
C<errno>, but forces an en error code of 255 if C<errno> is 0.

On VMS, it takes care to set the appropriate severity bits in the exit status.

=over 3

 void       my_failure_exit()
 void  Perl_my_failure_exit(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 5406

=over 4

=item C<newPADNAMELIST>
X<newPADNAMELIST>

NOTE: C<newPADNAMELIST> is B<experimental> and may change or be
removed without notice.

Creates a new pad name list.  C<max> is the highest index for which space
is allocated.

=over 3

 PADNAMELIST *       newPADNAMELIST(size_t max)
 PADNAMELIST *  Perl_newPADNAMELIST(size_t max)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2642

=over 4

=item C<newPADNAMEouter>
X<newPADNAMEouter>

NOTE: C<newPADNAMEouter> is B<experimental> and may change or be
removed without notice.

Constructs and returns a new pad name.  Only use this function for names
that refer to outer lexicals.  (See also L</newPADNAMEpvn>.)  C<outer> is
the outer pad name that this one mirrors.  The returned pad name has the
C<PADNAMEf_OUTER> flag already set.

=over 3

 PADNAME *       newPADNAMEouter(PADNAME *outer)
 PADNAME *  Perl_newPADNAMEouter(PADNAME *outer)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2802

=over 4

=item C<newPADNAMEpvn>
X<newPADNAMEpvn>

NOTE: C<newPADNAMEpvn> is B<experimental> and may change or be
removed without notice.

Constructs and returns a new pad name.  C<s> must be a UTF-8 string.  Do not
use this for pad names that point to outer lexicals.  See
C<L</newPADNAMEouter>>.

=over 3

 PADNAME *       newPADNAMEpvn(const char *s, STRLEN len)
 PADNAME *  Perl_newPADNAMEpvn(const char *s, STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2772

=over 4

=item C<nothreadhook>
X<nothreadhook>

Stub that provides thread hook for perl_destruct when there are
no threads.

=over 3

 int       nothreadhook()
 int  Perl_nothreadhook(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 469

=over 4

=item C<pad_add_anon>
X<pad_add_anon>

Allocates a place in the currently-compiling pad (via L</pad_alloc>)
for an anonymous function that is lexically scoped inside the
currently-compiling function.
The function C<func> is linked into the pad, and its C<CvOUTSIDE> link
to the outer scope is weakened to avoid a reference loop.

One reference count is stolen, so you may need to do C<SvREFCNT_inc(func)>.

C<optype> should be an opcode indicating the type of operation that the
pad entry is to support.  This doesn't affect operational semantics,
but is used for debugging.

=over 3

 PADOFFSET       pad_add_anon(      CV *func, I32 optype)
 PADOFFSET  Perl_pad_add_anon(pTHX_ CV *func, I32 optype)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 792

=over 4

=item C<pad_add_name_pv>

=item C<pad_add_name_pvn>

=item C<pad_add_name_sv>
X<pad_add_name_pv>X<pad_add_name_pvn>X<pad_add_name_sv>

These each allocate a place in the currently-compiling pad for a named lexical
variable.  They store the name and other metadata in the name part of the
pad, and make preparations to manage the variable's lexical scoping.
They return the offset of the allocated pad slot.

They differ only in how the input variable's name is specified.

If C<typestash> is non-null, the name is for a typed lexical, and this
identifies the type.  If C<ourstash> is non-null, it's a lexical reference
to a package variable, and this identifies the package.  The following
flags can be OR'ed together:

 padadd_OUR          redundantly specifies if it's a package var
 padadd_STATE        variable will retain value persistently
 padadd_NO_DUP_CHECK skip check for lexical shadowing
 padadd_FIELD        specifies that the lexical is a field for a class

In all forms, the variable name must include the leading sigil.

In C<pad_add_name_sv>, the input name is taken from the SV parameter using
C<L</SvPVutf8>()>.

In C<pad_add_name_pv>, the input name is a NUL-terminated string, which must be
encoded in UTF-8.

In C<pad_add_name_pvn>, C<namelen> gives the length of the input name in bytes,
which means it may contain embedded NUL characters.  Again, it must be encoded
in UTF-8.

=over 3

 PADOFFSET       pad_add_name_pv (      const char *name,
                                        const U32 flags,
                                        HV *typestash,
                                        HV *ourstash)
 PADOFFSET  Perl_pad_add_name_pv (pTHX_ const char *name,
                                        const U32 flags,
                                        HV *typestash,
                                        HV *ourstash)
 PADOFFSET       pad_add_name_pvn(      const char *namepv,
                                        STRLEN namelen, U32 flags,
                                        HV *typestash,
                                        HV *ourstash)
 PADOFFSET  Perl_pad_add_name_pvn(pTHX_ const char *namepv,
                                        STRLEN namelen, U32 flags,
                                        HV *typestash,
                                        HV *ourstash)
 PADOFFSET       pad_add_name_sv (      SV *name, U32 flags,
                                        HV *typestash,
                                        HV *ourstash)
 PADOFFSET  Perl_pad_add_name_sv (pTHX_ SV *name, U32 flags,
                                        HV *typestash,
                                        HV *ourstash)

=back

=back

=for hackers
pad_add_name_pv declared in embed.fnc; all in group documented at pad.c, line 586
pad_add_name_pvn declared in embed.fnc
pad_add_name_sv declared in embed.fnc

=over 4

=item C<pad_alloc>
X<pad_alloc>

NOTE: C<pad_alloc> is B<experimental> and may change or be
removed without notice.

Allocates a place in the currently-compiling pad,
returning the offset of the allocated pad slot.
No name is initially attached to the pad slot.
C<tmptype> is a set of flags indicating the kind of pad entry required,
which will be set in the value SV for the allocated pad entry:

    SVs_PADMY    named lexical variable ("my", "our", "state")
    SVs_PADTMP   unnamed temporary store
    SVf_READONLY constant shared between recursion levels

C<SVf_READONLY> has been supported here only since perl 5.20.  To work with
earlier versions as well, use C<SVf_READONLY|SVs_PADTMP>.  C<SVf_READONLY>
does not cause the SV in the pad slot to be marked read-only, but simply
tells C<pad_alloc> that it I<will> be made read-only (by the caller), or at
least should be treated as such.

C<optype> should be an opcode indicating the type of operation that the
pad entry is to support.  This doesn't affect operational semantics,
but is used for debugging.

=over 3

 PADOFFSET       pad_alloc(      I32 optype, U32 tmptype)
 PADOFFSET  Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 692

=over 4

=item C<pad_findmy_pv>

=item C<pad_findmy_pvn>

=item C<pad_findmy_pvs>

=item C<pad_findmy_sv>
X<pad_findmy_pv>X<pad_findmy_pvn>X<pad_findmy_pvs>X<pad_findmy_sv>

Given the name of a lexical variable, including its leading sigil, find its
position in the currently-compiling pad.

If it is not in the current pad but appears in the pad of any lexically
enclosing scope, then a pseudo-entry for it is added in the current pad.

These each return the offset in the current pad, or C<NOT_IN_PAD> if no such
lexical is in scope.

The forms differ only in how the variable's name is specified.

In C<pad_findmy_pvs>, the variable name is a C language string literal,
enclosed in double quotes.

In plain C<pad_findmy_pv>, the variable name is a C language NUL-terminated
string.

In C<pad_findmy_pvn>, C<len> gives the length of the variable name in bytes,
so it may contain embedded-NUL characters.  The caller must make sure C<namepv>
contains at least C<len> bytes.

In C<pad_findmy_sv>, the variable name is taken from the SV parameter using
C<L</SvPVutf8>()>.

C<flags> is reserved and must be zero.

=over 3

 PADOFFSET       pad_findmy_pv (      const char *name, U32 flags)
 PADOFFSET  Perl_pad_findmy_pv (pTHX_ const char *name, U32 flags)
 PADOFFSET       pad_findmy_pvn(      const char *namepv,
                                      STRLEN namelen, U32 flags)
 PADOFFSET  Perl_pad_findmy_pvn(pTHX_ const char *namepv,
                                      STRLEN namelen, U32 flags)
 PADOFFSET       pad_findmy_pvs(      "name", U32 flags)
 PADOFFSET       pad_findmy_sv (      SV *name, U32 flags)
 PADOFFSET  Perl_pad_findmy_sv (pTHX_ SV *name, U32 flags)

=back

=back

=for hackers
pad_findmy_pv declared in embed.fnc; all in group documented at pad.c, line 944
pad_findmy_pvn declared in embed.fnc
pad_findmy_pvs declared at pad.h, line 545
pad_findmy_sv declared in embed.fnc

=over 4

=item C<pad_tidy>
X<pad_tidy>

NOTE: C<pad_tidy> is B<experimental> and may change or be
removed without notice.

Tidy up a pad at the end of compilation of the code to which it belongs.
Jobs performed here are: remove most stuff from the pads of anonsub
prototypes; give it a C<@_>; mark temporaries as such.  C<type> indicates
the kind of subroutine:

    padtidy_SUB        ordinary subroutine
    padtidy_SUBCLONE   prototype for lexical closure
    padtidy_FORMAT     format

=over 3

 void       pad_tidy(      padtidy_type type)
 void  Perl_pad_tidy(pTHX_ padtidy_type type)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 1640

=over 4

=item C<padnamelist_fetch>
X<padnamelist_fetch>

NOTE: C<padnamelist_fetch> is B<experimental> and may change or be
removed without notice.

Fetches the pad name from the given index.

=over 3

 PADNAME *       padnamelist_fetch(PADNAMELIST *pnl, SSize_t key)
 PADNAME *  Perl_padnamelist_fetch(PADNAMELIST *pnl, SSize_t key)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2698

=over 4

=item C<padnamelist_store>
X<padnamelist_store>

NOTE: C<padnamelist_store> is B<experimental> and may change or be
removed without notice.

Stores the pad name (which may be null) at the given index, freeing any
existing pad name in that slot.

=over 3

 PADNAME **       padnamelist_store(      PADNAMELIST *pnl,
                                          SSize_t key,
                                          PADNAME *val)
 PADNAME **  Perl_padnamelist_store(pTHX_ PADNAMELIST *pnl,
                                          SSize_t key,
                                          PADNAME *val)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2664

=over 4

=item C<perl_alloc>
X<perl_alloc>

Allocates a new Perl interpreter.  See L<perlembed>.

=over 3

 PerlInterpreter *  perl_alloc()

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 202

=over 4

=item C<PERL_ASYNC_CHECK>

Described in L<perlinterp>.

=over 3

 void  PERL_ASYNC_CHECK()

=back

=back

=for hackers
Documented at pod/perlinterp.pod, line 149

=over 4

=item C<perl_clone>
X<perl_clone>

Create and return a new interpreter by cloning the current one.

C<perl_clone> takes these flags as parameters:

C<CLONEf_COPY_STACKS> - is used to, well, copy the stacks also,
without it we only clone the data and zero the stacks,
with it we copy the stacks and the new perl interpreter is
ready to run at the exact same point as the previous one.
The pseudo-fork code uses C<COPY_STACKS> while the
threads->create doesn't.

C<CLONEf_KEEP_PTR_TABLE> -
C<perl_clone> keeps a ptr_table with the pointer of the old
variable as a key and the new variable as a value,
this allows it to check if something has been cloned and not
clone it again, but rather just use the value and increase the
refcount.
If C<KEEP_PTR_TABLE> is not set then C<perl_clone> will kill the ptr_table
using the function S<C<ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;>>.
A reason to keep it around is if you want to dup some of your own
variables which are outside the graph that perl scans.

C<CLONEf_CLONE_HOST> -
This is a win32 thing, it is ignored on unix, it tells perl's
win32host code (which is c++) to clone itself, this is needed on
win32 if you want to run two threads at the same time,
if you just want to do some stuff in a separate perl interpreter
and then throw it away and return to the original one,
you don't need to do anything.

=over 3

 PerlInterpreter *  perl_clone(PerlInterpreter *proto_perl,
                               UV flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 15559

=over 4

=item C<perl_construct>
X<perl_construct>

Initializes a new Perl interpreter.  See L<perlembed>.

=over 3

 void  perl_construct(PerlInterpreter *my_perl)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 221

=over 4

=item C<perl_destruct>
X<perl_destruct>

Shuts down a Perl interpreter.  See L<perlembed> for a tutorial.

C<my_perl> points to the Perl interpreter.  It must have been previously
created through the use of L</perl_alloc> and L</perl_construct>.  It may
have been initialised through L</perl_parse>, and may have been used
through L</perl_run> and other means.  This function should be called for
any Perl interpreter that has been constructed with L</perl_construct>,
even if subsequent operations on it failed, for example if L</perl_parse>
returned a non-zero value.

If the interpreter's C<PL_exit_flags> word has the
C<PERL_EXIT_DESTRUCT_END> flag set, then this function will execute code
in C<END> blocks before performing the rest of destruction.  If it is
desired to make any use of the interpreter between L</perl_parse> and
L</perl_destruct> other than just calling L</perl_run>, then this flag
should be set early on.  This matters if L</perl_run> will not be called,
or if anything else will be done in addition to calling L</perl_run>.

Returns a value be a suitable value to pass to the C library function
C<exit> (or to return from C<main>), to serve as an exit code indicating
the nature of the way the interpreter terminated.  This takes into account
any failure of L</perl_parse> and any early exit from L</perl_run>.
The exit code is of the type required by the host operating system,
so because of differing exit code conventions it is not portable to
interpret specific numeric values as having specific meanings.

=over 3

 int  perl_destruct(PerlInterpreter *my_perl)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 598

=over 4

=item C<perl_free>
X<perl_free>

Releases a Perl interpreter.  See L<perlembed>.

=over 3

 void  perl_free(PerlInterpreter *my_perl)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 1568

=over 4

=item C<PERL_GET_CONTEXT>

Described in L<perlguts>.

=over 3

 PerlInterpreter*  PERL_GET_CONTEXT

=back

=back

=for hackers
Documented at pod/perlguts.pod, line 3162

=over 4

=item C<perl_parse>
X<perl_parse>

Tells a Perl interpreter to parse a Perl script.  This performs most
of the initialisation of a Perl interpreter.  See L<perlembed> for
a tutorial.

C<my_perl> points to the Perl interpreter that is to parse the script.
It must have been previously created through the use of L</perl_alloc>
and L</perl_construct>.  C<xsinit> points to a callback function that
will be called to set up the ability for this Perl interpreter to load
XS extensions, or may be null to perform no such setup.

C<argc> and C<argv> supply a set of command-line arguments to the Perl
interpreter, as would normally be passed to the C<main> function of
a C program.  C<argv[argc]> must be null.  These arguments are where
the script to parse is specified, either by naming a script file or by
providing a script in a C<-e> option.
If L<C<$0>|perlvar/$0> will be written to in the Perl interpreter, then
the argument strings must be in writable memory, and so mustn't just be
string constants.

C<env> specifies a set of environment variables that will be used by
this Perl interpreter.  If non-null, it must point to a null-terminated
array of environment strings.  If null, the Perl interpreter will use
the environment supplied by the C<environ> global variable.

This function initialises the interpreter, and parses and compiles the
script specified by the command-line arguments.  This includes executing
code in C<BEGIN>, C<UNITCHECK>, and C<CHECK> blocks.  It does not execute
C<INIT> blocks or the main program.

Returns an integer of slightly tricky interpretation.  The correct
use of the return value is as a truth value indicating whether there
was a failure in initialisation.  If zero is returned, this indicates
that initialisation was successful, and it is safe to proceed to call
L</perl_run> and make other use of it.  If a non-zero value is returned,
this indicates some problem that means the interpreter wants to terminate.
The interpreter should not be just abandoned upon such failure; the caller
should proceed to shut the interpreter down cleanly with L</perl_destruct>
and free it with L</perl_free>.

For historical reasons, the non-zero return value also attempts to
be a suitable value to pass to the C library function C<exit> (or to
return from C<main>), to serve as an exit code indicating the nature
of the way initialisation terminated.  However, this isn't portable,
due to differing exit code conventions.  An attempt is made to return
an exit code of the type required by the host operating system, but
because it is constrained to be non-zero, it is not necessarily possible
to indicate every type of exit.  It is only reliable on Unix, where a
zero exit code can be augmented with a set bit that will be ignored.
In any case, this function is not the correct place to acquire an exit
code: one should get that from L</perl_destruct>.

=over 3

 int  perl_parse(PerlInterpreter *my_perl, XSINIT_t xsinit,
                 int argc, char **argv, char **env)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 1719

=over 4

=item C<perl_run>
X<perl_run>

Tells a Perl interpreter to run its main program.  See L<perlembed>
for a tutorial.

C<my_perl> points to the Perl interpreter.  It must have been previously
created through the use of L</perl_alloc> and L</perl_construct>, and
initialised through L</perl_parse>.  This function should not be called
if L</perl_parse> returned a non-zero value, indicating a failure in
initialisation or compilation.

This function executes code in C<INIT> blocks, and then executes the
main program.  The code to be executed is that established by the prior
call to L</perl_parse>.  If the interpreter's C<PL_exit_flags> word
does not have the C<PERL_EXIT_DESTRUCT_END> flag set, then this function
will also execute code in C<END> blocks.  If it is desired to make any
further use of the interpreter after calling this function, then C<END>
blocks should be postponed to L</perl_destruct> time by setting that flag.

Returns an integer of slightly tricky interpretation.  The correct use
of the return value is as a truth value indicating whether the program
terminated non-locally.  If zero is returned, this indicates that
the program ran to completion, and it is safe to make other use of the
interpreter (provided that the C<PERL_EXIT_DESTRUCT_END> flag was set as
described above).  If a non-zero value is returned, this indicates that
the interpreter wants to terminate early.  The interpreter should not be
just abandoned because of this desire to terminate; the caller should
proceed to shut the interpreter down cleanly with L</perl_destruct>
and free it with L</perl_free>.

For historical reasons, the non-zero return value also attempts to
be a suitable value to pass to the C library function C<exit> (or to
return from C<main>), to serve as an exit code indicating the nature of
the way the program terminated.  However, this isn't portable, due to
differing exit code conventions.  An attempt is made to return an exit
code of the type required by the host operating system, but because
it is constrained to be non-zero, it is not necessarily possible to
indicate every type of exit.  It is only reliable on Unix, where a zero
exit code can be augmented with a set bit that will be ignored.  In any
case, this function is not the correct place to acquire an exit code:
one should get that from L</perl_destruct>.

=over 3

 int  perl_run(PerlInterpreter *my_perl)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 2730

=over 4

=item C<PERL_SET_CONTEXT>

Described in L<perlguts>.

=over 3

 void  PERL_SET_CONTEXT(PerlInterpreter* i)

=back

=back

=for hackers
Documented at pod/perlguts.pod, line 3158

=over 4

=item C<PERL_SYS_INIT>

=item C<PERL_SYS_INIT3>
X<PERL_SYS_INIT>X<PERL_SYS_INIT3>

These provide system-specific tune up of the C runtime environment necessary to
run Perl interpreters.  Only one should be used, and it should be called only
once, before creating any Perl interpreters.

They differ in that C<PERL_SYS_INIT3> also initializes C<env>.

=over 3

 void  PERL_SYS_INIT (int *argc, char*** argv)
 void  PERL_SYS_INIT3(int *argc, char*** argv, char*** env)

=back

=back

=for hackers
PERL_SYS_INIT declared at perl.h, line 3561; all in group documented at perl.h, line 3561
PERL_SYS_INIT3 declared at perl.h, line 3562

=over 4

=item C<PERL_SYS_TERM>
X<PERL_SYS_TERM>

Provides system-specific clean up of the C runtime environment after
running Perl interpreters.  This should be called only once, after
freeing any remaining Perl interpreters.

=over 3

 void  PERL_SYS_TERM()

=back

=back

=for hackers
Declared and documented at perl.h, line 3570

=over 4

=item C<PerlInterpreter>

Described in L<perlembed>.

=back

=for hackers
Documented at pod/perlembed.pod, line 101

=over 4

=item C<PL_exit_flags>
X<PL_exit_flags>

Contains flags controlling perl's behaviour on exit():

=over

=item * C<PERL_EXIT_DESTRUCT_END>

If set, END blocks are executed when the interpreter is destroyed.
This is normally set by perl itself after the interpreter is
constructed.

=item * C<PERL_EXIT_ABORT>

Call C<abort()> on exit.  This is used internally by perl itself to
abort if exit is called while processing exit.

=item * C<PERL_EXIT_WARN>

Warn on exit.

=item * C<PERL_EXIT_EXPECTED>

Set by the L<perlfunc/exit> operator.

=back

=over 3

 U8  PL_exit_flags

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 351

=over 4

=item C<PL_origalen>

Described in L<perlembed>.

=back

=for hackers
Documented at pod/perlembed.pod, line 887

=over 4

=item C<PL_perl_destruct_level>
X<PL_perl_destruct_level>

This value may be set when embedding for full cleanup.

Possible values:

=over

=item * 0 - none

=item * 1 - full

=item * 2 or greater - full with checks.

=back

If C<$ENV{PERL_DESTRUCT_LEVEL}> is set to an integer greater than the
value of C<PL_perl_destruct_level> its value is used instead.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 signed char  PL_perl_destruct_level

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 817

=over 4

=item C<ptr_table_fetch>
X<ptr_table_fetch>

Look for C<sv> in the pointer-mapping table C<tbl>, returning its value, or
NULL if not found.

=over 3

 void *       ptr_table_fetch(      PTR_TBL_t * const tbl,
                                    const void * const sv)
 void *  Perl_ptr_table_fetch(pTHX_ PTR_TBL_t * const tbl,
                                    const void * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 14300

=over 4

=item C<ptr_table_free>
X<ptr_table_free>

Clear and free a ptr table

=over 3

 void       ptr_table_free(      PTR_TBL_t * const tbl)
 void  Perl_ptr_table_free(pTHX_ PTR_TBL_t * const tbl)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 14410

=over 4

=item C<ptr_table_new>
X<ptr_table_new>

Create a new pointer-mapping table

=over 3

 PTR_TBL_t *       ptr_table_new()
 PTR_TBL_t *  Perl_ptr_table_new(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 14255

=over 4

=item C<ptr_table_split>
X<ptr_table_split>

Double the hash bucket size of an existing ptr table

=over 3

 void       ptr_table_split(      PTR_TBL_t * const tbl)
 void  Perl_ptr_table_split(pTHX_ PTR_TBL_t * const tbl)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 14367

=over 4

=item C<ptr_table_store>
X<ptr_table_store>

Add a new entry to a pointer-mapping table C<tbl>.
In hash terms, C<oldsv> is the key; Cnewsv> is the value.

The names "old" and "new" are specific to the core's typical use of ptr_tables
in thread cloning.

=over 3

 void       ptr_table_store(      PTR_TBL_t * const tbl,
                                  const void * const oldsv,
                                  void * const newsv)
 void  Perl_ptr_table_store(pTHX_ PTR_TBL_t * const tbl,
                                  const void * const oldsv,
                                  void * const newsv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 14320

=over 4

=item C<require_pv>
X<require_pv>

Tells Perl to C<require> the file named by the string argument.  It is
analogous to the Perl code C<eval "require '$file'">.  It's even
implemented that way; consider using load_module instead.

NOTE: the C<perl_require_pv()> form is B<deprecated>.

=over 3

 void       require_pv(      const char *pv)
 void  Perl_require_pv(pTHX_ const char *pv)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 3508

=over 4

=item C<vload_module>
X<vload_module>

Like C<L</load_module>> but the arguments are an encapsulated argument list.

=over 3

 void       vload_module(      U32 flags, SV *name, SV *ver,
                               va_list *args)
 void  Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver,
                               va_list *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8409

=head1 Errno

=over 4

=item C<sv_string_from_errnum>
X<sv_string_from_errnum>

Generates the message string describing an OS error and returns it as
an SV.  C<errnum> must be a value that C<errno> could take, identifying
the type of error.

If C<tgtsv> is non-null then the string will be written into that SV
(overwriting existing content) and it will be returned.  If C<tgtsv>
is a null pointer then the string will be written into a new mortal SV
which will be returned.

The message will be taken from whatever locale would be used by C<$!>,
and will be encoded in the SV in whatever manner would be used by C<$!>.
The details of this process are subject to future change.  Currently,
the message is taken from the C locale by default (usually producing an
English message), and from the currently selected locale when in the scope
of the C<use locale> pragma.  A heuristic attempt is made to decode the
message from the locale's character encoding, but it will only be decoded
as either UTF-8 or ISO-8859-1.  It is always correctly decoded in a UTF-8
locale, usually in an ISO-8859-1 locale, and never in any other locale.

The SV is always returned containing an actual string, and with no other
OK bits set.  Unlike C<$!>, a message is even yielded for C<errnum> zero
(meaning success), and if no useful message is available then a useless
string (currently empty) is returned.

=over 3

 SV *       sv_string_from_errnum(      int errnum, SV *tgtsv)
 SV *  Perl_sv_string_from_errnum(pTHX_ int errnum, SV *tgtsv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 828

=head1 Exception Handling (simple) Macros

=over 4

=item C<dXCPT>
X<dXCPT>

Set up necessary local variables for exception handling.
See L<perlguts/"Exception Handling">.

=over 3

   dXCPT;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 288

=over 4

=item C<JMPENV_JUMP>

=item C<JMPENV_PUSH>

=item C<PL_restartop>

Described in L<perlinterp>.

=over 3

 void  JMPENV_JUMP (int v)
 void  JMPENV_PUSH (int v)
 OP *  PL_restartop

=back

=back

=for hackers
JMPENV_JUMP all in group documented at pod/perlinterp.pod, line 181
JMPENV_PUSH 
PL_restartop 

=over 4

=item C<XCPT_CATCH>
X<XCPT_CATCH>

Introduces a catch block.  See L<perlguts/"Exception Handling">.

=back

=for hackers
Declared and documented at XSUB.h, line 298

=over 4

=item C<XCPT_RETHROW>
X<XCPT_RETHROW>

Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.

=over 3

   XCPT_RETHROW;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 301

=over 4

=item C<XCPT_TRY_END>
X<XCPT_TRY_END>

Ends a try block.  See L<perlguts/"Exception Handling">.

=back

=for hackers
Declared and documented at XSUB.h, line 295

=over 4

=item C<XCPT_TRY_START>
X<XCPT_TRY_START>

Starts a try block.  See L<perlguts/"Exception Handling">.

=back

=for hackers
Declared and documented at XSUB.h, line 292

=head1 Filesystem configuration values

Also see L</List of capability HAS_foo symbols>.


=over 4

=item C<DIRNAMLEN>
X<DIRNAMLEN>

This symbol, if defined, indicates to the C program that the length
of directory entry names is provided by a C<d_namlen> field.  Otherwise
you need to do C<strlen()> on the C<d_name> field.

=back

=for hackers
Declared and documented at config.h, line 2039

=over 4

=item C<DOSUID>
X<DOSUID>

This symbol, if defined, indicates that the C program should
check the script that it is executing for setuid/setgid bits, and
attempt to emulate setuid/setgid on systems that have disabled
setuid #! scripts because the kernel can't do it securely.
It is up to the package designer to make sure that this emulation
is done securely.  Among other things, it should do an fstat on
the script it just opened to make sure it really is a setuid/setgid
script, it should make sure the arguments passed correspond exactly
to the argument on the #! line, and it should not trust any
subprocesses to which it must pass the filename rather than the
file descriptor of the script to be executed.

=back

=for hackers
Declared and documented at config.h, line 1528

=over 4

=item C<EOF_NONBLOCK>
X<EOF_NONBLOCK>

This symbol, if defined, indicates to the C program that a C<read()> on
a non-blocking file descriptor will return 0 on C<EOF>, and not the value
held in C<RD_NODATA> (-1 usually, in that case!).

=back

=for hackers
Declared and documented at config.h, line 1174

=over 4

=item C<FCNTL_CAN_LOCK>
X<FCNTL_CAN_LOCK>

This symbol, if defined, indicates that C<fcntl()> can be used
for file locking.  Normally on Unix systems this is defined.
It may be undefined on C<VMS>.

=back

=for hackers
Declared and documented at config.h, line 2479

=over 4

=item C<FFLUSH_ALL>
X<FFLUSH_ALL>

This symbol, if defined, tells that to flush
all pending stdio output one must loop through all
the stdio file handles stored in an array and fflush them.
Note that if C<fflushNULL> is defined, fflushall will not
even be probed for and will be left undefined.

=back

=for hackers
Declared and documented at config.h, line 3670

=over 4

=item C<FFLUSH_NULL>
X<FFLUSH_NULL>

This symbol, if defined, tells that C<fflush(NULL)> correctly
flushes all pending stdio output without side effects. In
particular, on some platforms calling C<fflush(NULL)> *still*
corrupts C<STDIN> if it is a pipe.

=back

=for hackers
Declared and documented at config.h, line 3669

=over 4

=item C<FILE_base>
X<FILE_base>

This macro is used to access the C<_base> field (or equivalent) of the
C<FILE> structure pointed to by its argument. This macro will always be
defined if C<USE_STDIO_BASE> is defined.

=over 3

 void *  FILE_base(FILE * f)

=back

=back

=for hackers
Declared at handy.h, line 40; documented at config.h, line 1113

=over 4

=item C<FILE_bufsiz>
X<FILE_bufsiz>

This macro is used to determine the number of bytes in the I/O
buffer pointed to by C<_base> field (or equivalent) of the C<FILE>
structure pointed to its argument. This macro will always be defined
if C<USE_STDIO_BASE> is defined.

=over 3

 Size_t  FILE_bufsiz(FILE *f)

=back

=back

=for hackers
Declared at handy.h, line 41; documented at config.h, line 1114

=over 4

=item C<FILE_cnt>
X<FILE_cnt>

This macro is used to access the C<_cnt> field (or equivalent) of the
C<FILE> structure pointed to by its argument. This macro will always be
defined if C<USE_STDIO_PTR> is defined.

=over 3

 Size_t  FILE_cnt(FILE * f)

=back

=back

=for hackers
Declared at handy.h, line 39; documented at config.h, line 1085

=over 4

=item C<FILE_ptr>
X<FILE_ptr>

This macro is used to access the C<_ptr> field (or equivalent) of the
C<FILE> structure pointed to by its argument. This macro will always be
defined if C<USE_STDIO_PTR> is defined.

=over 3

 void *  FILE_ptr(FILE * f)

=back

=back

=for hackers
Declared at handy.h, line 38; documented at config.h, line 1083

=over 4

=item C<FLEXFILENAMES>
X<FLEXFILENAMES>

This symbol, if defined, indicates that the system supports filenames
longer than 14 characters.

=back

=for hackers
Declared and documented at config.h, line 1570

=over 4

=item C<HAS_DIR_DD_FD>
X<HAS_DIR_DD_FD>

This symbol, if defined, indicates that the C<DIR>* dirstream
structure contains a member variable named C<dd_fd>.

=back

=for hackers
Declared and documented at config.h, line 2416

=over 4

=item C<HAS_DUP2>
X<HAS_DUP2>

This symbol, if defined, indicates that the C<dup2> routine is
available to duplicate file descriptors.

=back

=for hackers
Declared and documented at config.h, line 90

=over 4

=item C<HAS_DUP3>
X<HAS_DUP3>

This symbol, if defined, indicates that the C<dup3> routine is
available to duplicate file descriptors.

=back

=for hackers
Declared and documented at config.h, line 2436

=over 4

=item C<HAS_FAST_STDIO>
X<HAS_FAST_STDIO>

This symbol, if defined, indicates that the "fast stdio"
is available to manipulate the stdio buffers directly.

=back

=for hackers
Declared and documented at config.h, line 2466

=over 4

=item C<HAS_FCHDIR>
X<HAS_FCHDIR>

This symbol, if defined, indicates that the C<fchdir> routine is
available to change directory using a file descriptor.

=back

=for hackers
Declared and documented at config.h, line 2472

=over 4

=item C<HAS_FCNTL>
X<HAS_FCNTL>

This symbol, if defined, indicates to the C program that
the C<fcntl()> function exists.

=back

=for hackers
Declared and documented at config.h, line 108

=over 4

=item C<HAS_FDCLOSE>
X<HAS_FDCLOSE>

This symbol, if defined, indicates that the C<fdclose> routine is
available to free a C<FILE> structure without closing the underlying
file descriptor.  This function appeared in C<FreeBSD> 10.2.

=back

=for hackers
Declared and documented at config.h, line 2486

=over 4

=item C<HAS_FDOPENDIR>
X<HAS_FDOPENDIR>

This symbol, if defined, indicates that the C<fdopendir> routine is
available to open a directory descriptor.

=back

=for hackers
Declared and documented at config.h, line 114

=over 4

=item C<HAS_FPATHCONF>
X<HAS_FPATHCONF>

This symbol, if defined, indicates that C<pathconf()> is available
to determine file-system related limits and options associated
with a given open file descriptor.

=back

=for hackers
Declared and documented at config.h, line 301

=over 4

=item C<HAS_FPOS64_T>
X<HAS_FPOS64_T>

This symbol will be defined if the C compiler supports C<fpos64_t>.

=back

=for hackers
Declared and documented at config.h, line 2649

=over 4

=item C<HAS_FSTATFS>
X<HAS_FSTATFS>

This symbol, if defined, indicates that the C<fstatfs> routine is
available to stat filesystems by file descriptors.

=back

=for hackers
Declared and documented at config.h, line 2695

=over 4

=item C<HAS_FSTATVFS>
X<HAS_FSTATVFS>

This symbol, if defined, indicates that the C<fstatvfs> routine is
available to stat filesystems by file descriptors.

=back

=for hackers
Declared and documented at config.h, line 3407

=over 4

=item C<HAS_GETFSSTAT>
X<HAS_GETFSSTAT>

This symbol, if defined, indicates that the C<getfsstat> routine is
available to stat filesystems in bulk.

=back

=for hackers
Declared and documented at config.h, line 2745

=over 4

=item C<HAS_GETMNT>
X<HAS_GETMNT>

This symbol, if defined, indicates that the C<getmnt> routine is
available to get filesystem mount info by filename.

=back

=for hackers
Declared and documented at config.h, line 2757

=over 4

=item C<HAS_GETMNTENT>
X<HAS_GETMNTENT>

This symbol, if defined, indicates that the C<getmntent> routine is
available to iterate through mounted file systems to get their info.

=back

=for hackers
Declared and documented at config.h, line 2763

=over 4

=item C<HAS_HASMNTOPT>
X<HAS_HASMNTOPT>

This symbol, if defined, indicates that the C<hasmntopt> routine is
available to query the mount options of file systems.

=back

=for hackers
Declared and documented at config.h, line 2787

=over 4

=item C<HAS_LSEEK_PROTO>
X<HAS_LSEEK_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<lseek()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern off_t lseek(int, off_t, int);

=back

=for hackers
Declared and documented at config.h, line 4475

=over 4

=item C<HAS_MKDIR>
X<HAS_MKDIR>

This symbol, if defined, indicates that the C<mkdir> routine is available
to create directories.  Otherwise you should fork off a new process to
exec F</bin/mkdir>.

=back

=for hackers
Declared and documented at config.h, line 250

=over 4

=item C<HAS_OFF64_T>
X<HAS_OFF64_T>

This symbol will be defined if the C compiler supports C<off64_t>.

=back

=for hackers
Declared and documented at config.h, line 3166

=over 4

=item C<HAS_OPENAT>
X<HAS_OPENAT>

This symbol is defined if the C<openat()> routine is available.

=back

=for hackers
Declared and documented at config.h, line 2681

=over 4

=item C<HAS_OPEN3>
X<HAS_OPEN3>

This manifest constant lets the C program know that the three
argument form of C<open(2)> is available.

=back

=for hackers
Declared and documented at config.h, line 951

=over 4

=item C<HAS_POLL>
X<HAS_POLL>

This symbol, if defined, indicates that the C<poll> routine is
available to C<poll> active file descriptors.  Please check C<I_POLL> and
C<I_SYS_POLL> to know which header should be included as well.

=back

=for hackers
Declared and documented at config.h, line 320

=over 4

=item C<HAS_READDIR>
X<HAS_READDIR>

This symbol, if defined, indicates that the C<readdir> routine is
available to read directory entries. You may have to include
F<dirent.h>. See C<L</I_DIRENT>>.

=back

=for hackers
Declared and documented at config.h, line 327

=over 4

=item C<HAS_READDIR64_R>
X<HAS_READDIR64_R>

This symbol, if defined, indicates that the C<readdir64_r> routine
is available to readdir64 re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 5054

=over 4

=item C<HAS_REWINDDIR>
X<HAS_REWINDDIR>

This symbol, if defined, indicates that the C<rewinddir> routine is
available. You may have to include F<dirent.h>. See C<L</I_DIRENT>>.

=back

=for hackers
Declared and documented at config.h, line 345

=over 4

=item C<HAS_RMDIR>
X<HAS_RMDIR>

This symbol, if defined, indicates that the C<rmdir> routine is
available to remove directories. Otherwise you should fork off a
new process to exec F</bin/rmdir>.

=back

=for hackers
Declared and documented at config.h, line 372

=over 4

=item C<HAS_SEEKDIR>
X<HAS_SEEKDIR>

This symbol, if defined, indicates that the C<seekdir> routine is
available. You may have to include F<dirent.h>. See C<L</I_DIRENT>>.

=back

=for hackers
Declared and documented at config.h, line 333

=over 4

=item C<HAS_SELECT>
X<HAS_SELECT>

This symbol, if defined, indicates that the C<select> routine is
available to C<select> active file descriptors. If the timeout field
is used, F<sys/time.h> may need to be included.

=back

=for hackers
Declared and documented at config.h, line 379

=over 4

=item C<HAS_SETVBUF>
X<HAS_SETVBUF>

This symbol, if defined, indicates that the C<setvbuf> routine is
available to change buffering on an open stdio stream.
to a line-buffered mode.

=back

=for hackers
Declared and documented at config.h, line 1886

=over 4

=item C<HAS_STDIO_STREAM_ARRAY>
X<HAS_STDIO_STREAM_ARRAY>

This symbol, if defined, tells that there is an array
holding the stdio streams.

=back

=for hackers
Declared and documented at config.h, line 4280

=over 4

=item C<HAS_STRUCT_FS_DATA>
X<HAS_STRUCT_FS_DATA>

This symbol, if defined, indicates that the C<struct fs_data>
to do C<statfs()> is supported.

=back

=for hackers
Declared and documented at config.h, line 2662

=over 4

=item C<HAS_STRUCT_STATFS>
X<HAS_STRUCT_STATFS>

This symbol, if defined, indicates that the C<struct statfs>
to do C<statfs()> is supported.

=back

=for hackers
Declared and documented at config.h, line 3401

=over 4

=item C<HAS_STRUCT_STATFS_F_FLAGS>
X<HAS_STRUCT_STATFS_F_FLAGS>

This symbol, if defined, indicates that the C<struct statfs>
does have the C<f_flags> member containing the mount flags of
the filesystem containing the file.
This kind of C<struct statfs> is coming from F<sys/mount.h> (C<BSD> 4.3),
not from F<sys/statfs.h> (C<SYSV>).  Older C<BSDs> (like Ultrix) do not
have C<statfs()> and C<struct statfs>, they have C<ustat()> and C<getmnt()>
with C<struct ustat> and C<struct fs_data>.

=back

=for hackers
Declared and documented at config.h, line 3395

=over 4

=item C<HAS_TELLDIR>
X<HAS_TELLDIR>

This symbol, if defined, indicates that the C<telldir> routine is
available. You may have to include F<dirent.h>. See C<L</I_DIRENT>>.

=back

=for hackers
Declared and documented at config.h, line 339

=over 4

=item C<HAS_USTAT>
X<HAS_USTAT>

This symbol, if defined, indicates that the C<ustat> system call is
available to query file system statistics by C<dev_t>.

=back

=for hackers
Declared and documented at config.h, line 3599

=over 4

=item C<I_FCNTL>
X<I_FCNTL>

This manifest constant tells the C program to include F<fcntl.h>.

=over 3

 #ifdef I_FCNTL
     #include <fcntl.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 627

=over 4

=item C<I_SYS_DIR>
X<I_SYS_DIR>

This symbol, if defined, indicates to the C program that it should
include F<sys/dir.h>.

=over 3

 #ifdef I_SYS_DIR
     #include <sys_dir.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 651

=over 4

=item C<I_SYS_FILE>
X<I_SYS_FILE>

This symbol, if defined, indicates to the C program that it should
include F<sys/file.h> to get definition of C<R_OK> and friends.

=over 3

 #ifdef I_SYS_FILE
     #include <sys_file.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 657

=over 4

=item C<I_SYS_NDIR>
X<I_SYS_NDIR>

This symbol, if defined, indicates to the C program that it should
include F<sys/ndir.h>.

=over 3

 #ifdef I_SYS_NDIR
     #include <sys_ndir.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 674

=over 4

=item C<I_SYS_STATFS>
X<I_SYS_STATFS>

This symbol, if defined, indicates that F<sys/statfs.h> exists.

=over 3

 #ifdef I_SYS_STATFS
     #include <sys_statfs.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3843

=over 4

=item C<LSEEKSIZE>
X<LSEEKSIZE>

This symbol holds the number of bytes used by the C<Off_t>.

=back

=for hackers
Declared and documented at config.h, line 5354

=over 4

=item C<RD_NODATA>
X<RD_NODATA>

This symbol holds the return code from C<read()> when no data is present
on the non-blocking file descriptor. Be careful! If C<EOF_NONBLOCK> is
not defined, then you can't distinguish between no data and C<EOF> by
issuing a C<read()>. You'll have to find another way to tell for sure!

=back

=for hackers
Declared and documented at config.h, line 1173

=over 4

=item C<READDIR64_R_PROTO>
X<READDIR64_R_PROTO>

This symbol encodes the prototype of C<readdir64_r>.
It is zero if C<d_readdir64_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_readdir64_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5055

=over 4

=item C<ST_INO_SIGN>
X<ST_INO_SIGN>

This symbol holds the signedness of C<struct stat>'s C<st_ino>.
1 for unsigned, -1 for signed.

=back

=for hackers
Declared and documented at config.h, line 4262

=over 4

=item C<ST_INO_SIZE>
X<ST_INO_SIZE>

This variable contains the size of C<struct stat>'s C<st_ino> in bytes.

=back

=for hackers
Declared and documented at config.h, line 4263

=over 4

=item C<STDCHAR>
X<STDCHAR>

This symbol is defined to be the type of char used in F<stdio.h>.
It has the values "unsigned char" or "char".

=back

=for hackers
Declared and documented at config.h, line 753

=over 4

=item C<STDIO_CNT_LVALUE>
X<STDIO_CNT_LVALUE>

This symbol is defined if the C<FILE_cnt> macro can be used as an
lvalue.

=back

=for hackers
Declared and documented at config.h, line 1086

=over 4

=item C<STDIO_PTR_LVAL_NOCHANGE_CNT>
X<STDIO_PTR_LVAL_NOCHANGE_CNT>

This symbol is defined if using the C<FILE_ptr> macro as an lvalue
to increase the pointer by n leaves C<File_cnt(fp)> unchanged.

=back

=for hackers
Declared and documented at config.h, line 1088

=over 4

=item C<STDIO_PTR_LVAL_SETS_CNT>
X<STDIO_PTR_LVAL_SETS_CNT>

This symbol is defined if using the C<FILE_ptr> macro as an lvalue
to increase the pointer by n has the side effect of decreasing the
value of C<File_cnt(fp)> by n.

=back

=for hackers
Declared and documented at config.h, line 1087

=over 4

=item C<STDIO_PTR_LVALUE>
X<STDIO_PTR_LVALUE>

This symbol is defined if the C<FILE_ptr> macro can be used as an
lvalue.

=back

=for hackers
Declared and documented at config.h, line 1084

=over 4

=item C<STDIO_STREAM_ARRAY>
X<STDIO_STREAM_ARRAY>

This symbol tells the name of the array holding the stdio streams.
Usual values include C<_iob>, C<__iob>, and C<__sF>.

=back

=for hackers
Declared and documented at config.h, line 4282

=over 4

=item C<VAL_EAGAIN>
X<VAL_EAGAIN>

This symbol holds the errno error code set by C<read()> when no data was
present on the non-blocking file descriptor.

=back

=for hackers
Declared and documented at config.h, line 1172

=over 4

=item C<VAL_O_NONBLOCK>
X<VAL_O_NONBLOCK>

This symbol is to be used during C<open()> or C<fcntl(F_SETFL)> to turn on
non-blocking I/O for the file descriptor. Note that there is no way
back, i.e. you cannot turn it blocking again this way. If you wish to
alternatively switch between blocking and non-blocking, use the
C<ioctl(FIOSNBIO)> call instead, but that is not supported by all devices.

=back

=for hackers
Declared and documented at config.h, line 1171

=over 4

=item C<VOID_CLOSEDIR>
X<VOID_CLOSEDIR>

This symbol, if defined, indicates that the C<closedir()> routine
does not return a value.

=back

=for hackers
Declared and documented at config.h, line 892

=head1 Floating point

Also L</List of capability HAS_foo symbols> lists capabilities
that arent in this section.  For example C<HAS_ASINH>, for the
hyperbolic sine function.


=over 4

=item C<CASTFLAGS>
X<CASTFLAGS>

This symbol contains flags that say what difficulties the compiler
has casting odd floating values to unsigned long:

 0 = ok
 1 = couldn't cast < 0
 2 = couldn't cast >= 0x80000000
 4 = couldn't cast in argument expression list

=back

=for hackers
Declared and documented at config.h, line 886

=over 4

=item C<CASTNEGFLOAT>
X<CASTNEGFLOAT>

This symbol is defined if the C compiler can cast negative
numbers to unsigned longs, ints and shorts.

=back

=for hackers
Declared and documented at config.h, line 885

=over 4

=item C<DOUBLE_HAS_INF>
X<DOUBLE_HAS_INF>

This symbol, if defined, indicates that the double has
the infinity.

=back

=for hackers
Declared and documented at config.h, line 3992

=over 4

=item C<DOUBLE_HAS_NAN>
X<DOUBLE_HAS_NAN>

This symbol, if defined, indicates that the double has
the not-a-number.

=back

=for hackers
Declared and documented at config.h, line 3993

=over 4

=item C<DOUBLE_HAS_NEGATIVE_ZERO>
X<DOUBLE_HAS_NEGATIVE_ZERO>

This symbol, if defined, indicates that the double has
the C<negative_zero>.

=back

=for hackers
Declared and documented at config.h, line 3994

=over 4

=item C<DOUBLE_HAS_SUBNORMALS>
X<DOUBLE_HAS_SUBNORMALS>

This symbol, if defined, indicates that the double has
the subnormals (denormals).

=back

=for hackers
Declared and documented at config.h, line 3995

=over 4

=item C<DOUBLE_STYLE_CRAY>
X<DOUBLE_STYLE_CRAY>

This symbol, if defined, indicates that the double is
the 64-bit C<CRAY> mainframe format.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<DOUBLE_STYLE_IBM>
X<DOUBLE_STYLE_IBM>

This symbol, if defined, indicates that the double is
the 64-bit C<IBM> mainframe format.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<DOUBLE_STYLE_IEEE>
X<DOUBLE_STYLE_IEEE>

This symbol, if defined, indicates that the double is
the 64-bit C<IEEE> 754.

=back

=for hackers
Declared and documented at config.h, line 3998

=over 4

=item C<DOUBLE_STYLE_VAX>
X<DOUBLE_STYLE_VAX>

This symbol, if defined, indicates that the double is
the 64-bit C<VAX> format D or G.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<DOUBLEINFBYTES>
X<DOUBLEINFBYTES>

This symbol, if defined, is a comma-separated list of
hexadecimal bytes for the double precision infinity.

=back

=for hackers
Declared and documented at config.h, line 3901

=over 4

=item C<DOUBLEKIND>
X<DOUBLEKIND>

C<DOUBLEKIND> will be one of
C<DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN>
C<DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN>
C<DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN>
C<DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN>
C<DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN>
C<DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN>
C<DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE>
C<DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE>
C<DOUBLE_IS_VAX_F_FLOAT>
C<DOUBLE_IS_VAX_D_FLOAT>
C<DOUBLE_IS_VAX_G_FLOAT>
C<DOUBLE_IS_IBM_SINGLE_32_BIT>
C<DOUBLE_IS_IBM_DOUBLE_64_BIT>
C<DOUBLE_IS_CRAY_SINGLE_64_BIT>
C<DOUBLE_IS_UNKNOWN_FORMAT>

=back

=for hackers
Declared and documented at config.h, line 3972

=over 4

=item C<DOUBLEMANTBITS>
X<DOUBLEMANTBITS>

This symbol, if defined, tells how many mantissa bits
there are in double precision floating point format.
Note that this is usually C<DBL_MANT_DIG> minus one, since
with the standard C<IEEE> 754 formats C<DBL_MANT_DIG> includes
the implicit bit, which doesn't really exist.

=back

=for hackers
Declared and documented at config.h, line 4021

=over 4

=item C<DOUBLENANBYTES>
X<DOUBLENANBYTES>

This symbol, if defined, is a comma-separated list of
hexadecimal bytes (0xHH) for the double precision not-a-number.

=back

=for hackers
Declared and documented at config.h, line 3902

=over 4

=item C<DOUBLESIZE>
X<DOUBLESIZE>

This symbol contains the size of a double, so that the C preprocessor
can make decisions based on it.

=back

=for hackers
Declared and documented at config.h, line 1121

=over 4

=item C<Gconvert>
X<Gconvert>

This preprocessor macro is defined to convert a floating point
number to a string without a trailing decimal point.  This
emulates the behavior of C<sprintf("%g")>, but is sometimes much more
efficient.  If C<gconvert()> is not available, but C<gcvt()> drops the
trailing decimal point, then C<gcvt()> is used.  If all else fails,
a macro using C<sprintf("%g")> is used. Arguments for the Gconvert
macro are: value, number of digits, whether trailing zeros should
be retained, and the output buffer.
The usual values are:

 d_Gconvert='gconvert((x),(n),(t),(b))'
 d_Gconvert='gcvt((x),(n),(b))'
 d_Gconvert='sprintf((b),"%.*g",(n),(x))'

The last two assume trailing zeros should not be kept.

=over 3

 char *  Gconvert(double x, Size_t n, bool t, char * b)

=back

=back

=for hackers
Declared at handy.h, line 48; documented at config.h, line 915

=over 4

=item C<HAS_ATOLF>
X<HAS_ATOLF>

This symbol, if defined, indicates that the C<atolf> routine is
available to convert strings into long doubles.

=back

=for hackers
Declared and documented at config.h, line 2274

=over 4

=item C<HAS_CLASS>
X<HAS_CLASS>

This symbol, if defined, indicates that the C<class> routine is
available to classify doubles.  Available for example in C<AIX>.
The returned values are defined in F<float.h> and are:

 FP_PLUS_NORM    Positive normalized, nonzero
 FP_MINUS_NORM   Negative normalized, nonzero
 FP_PLUS_DENORM  Positive denormalized, nonzero
 FP_MINUS_DENORM Negative denormalized, nonzero
 FP_PLUS_ZERO    +0.0
 FP_MINUS_ZERO   -0.0
 FP_PLUS_INF     +INF
 FP_MINUS_INF    -INF
 FP_NANS         Signaling Not a Number (NaNS)
 FP_NANQ         Quiet Not a Number (NaNQ)

=back

=for hackers
Declared and documented at config.h, line 2372

=over 4

=item C<HAS_FINITE>
X<HAS_FINITE>

This symbol, if defined, indicates that the C<finite> routine is
available to check whether a double is C<finite> (non-infinity non-NaN).

=back

=for hackers
Declared and documented at config.h, line 2518

=over 4

=item C<HAS_FINITEL>
X<HAS_FINITEL>

This symbol, if defined, indicates that the C<finitel> routine is
available to check whether a long double is finite
(non-infinity non-NaN).

=back

=for hackers
Declared and documented at config.h, line 2525

=over 4

=item C<HAS_FP_CLASS>
X<HAS_FP_CLASS>

This symbol, if defined, indicates that the C<fp_class> routine is
available to classify doubles.  Available for example in Digital C<UNIX>.
The returned values are defined in F<math.h> and are:

 FP_SNAN           Signaling NaN (Not-a-Number)
 FP_QNAN           Quiet NaN (Not-a-Number)
 FP_POS_INF        +infinity
 FP_NEG_INF        -infinity
 FP_POS_NORM       Positive normalized
 FP_NEG_NORM       Negative normalized
 FP_POS_DENORM     Positive denormalized
 FP_NEG_DENORM     Negative denormalized
 FP_POS_ZERO       +0.0 (positive zero)
 FP_NEG_ZERO       -0.0 (negative zero)

=back

=for hackers
Declared and documented at config.h, line 2569

=over 4

=item C<HAS_FP_CLASSIFY>
X<HAS_FP_CLASSIFY>

This symbol, if defined, indicates that the C<fp_classify> routine is
available to classify doubles. The values are defined in F<math.h>

 FP_NORMAL     Normalized
 FP_ZERO       Zero
 FP_INFINITE   Infinity
 FP_SUBNORMAL  Denormalized
 FP_NAN        NaN



=back

=for hackers
Declared and documented at config.h, line 2620

=over 4

=item C<HAS_FP_CLASSL>
X<HAS_FP_CLASSL>

This symbol, if defined, indicates that the C<fp_classl> routine is
available to classify long doubles.  Available for example in
Digital C<UNIX>.  See for possible values C<HAS_FP_CLASS>.

=back

=for hackers
Declared and documented at config.h, line 2576

=over 4

=item C<HAS_FPCLASS>
X<HAS_FPCLASS>

This symbol, if defined, indicates that the C<fpclass> routine is
available to classify doubles.  Available for example in Solaris/C<SVR4>.
The returned values are defined in F<ieeefp.h> and are:

 FP_SNAN         signaling NaN
 FP_QNAN         quiet NaN
 FP_NINF         negative infinity
 FP_PINF         positive infinity
 FP_NDENORM      negative denormalized non-zero
 FP_PDENORM      positive denormalized non-zero
 FP_NZERO        negative zero
 FP_PZERO        positive zero
 FP_NNORM        negative normalized non-zero
 FP_PNORM        positive normalized non-zero

=back

=for hackers
Declared and documented at config.h, line 2594

=over 4

=item C<HAS_FPCLASSIFY>
X<HAS_FPCLASSIFY>

This symbol, if defined, indicates that the C<fpclassify> routine is
available to classify doubles.  Available for example in HP-UX.
The returned values are defined in F<math.h> and are

 FP_NORMAL     Normalized
 FP_ZERO       Zero
 FP_INFINITE   Infinity
 FP_SUBNORMAL  Denormalized
 FP_NAN        NaN



=back

=for hackers
Declared and documented at config.h, line 2619

=over 4

=item C<HAS_FPCLASSL>
X<HAS_FPCLASSL>

This symbol, if defined, indicates that the C<fpclassl> routine is
available to classify long doubles.  Available for example in C<IRIX>.
The returned values are defined in F<ieeefp.h> and are:

 FP_SNAN         signaling NaN
 FP_QNAN         quiet NaN
 FP_NINF         negative infinity
 FP_PINF         positive infinity
 FP_NDENORM      negative denormalized non-zero
 FP_PDENORM      positive denormalized non-zero
 FP_NZERO        negative zero
 FP_PZERO        positive zero
 FP_NNORM        negative normalized non-zero
 FP_PNORM        positive normalized non-zero

=back

=for hackers
Declared and documented at config.h, line 2638

=over 4

=item C<HAS_FPGETROUND>
X<HAS_FPGETROUND>

This symbol, if defined, indicates that the C<fpgetround> routine is
available to get the floating point rounding mode.

=back

=for hackers
Declared and documented at config.h, line 2644

=over 4

=item C<HAS_FREXPL>
X<HAS_FREXPL>

This symbol, if defined, indicates that the C<frexpl> routine is
available to break a long double floating-point number into
a normalized fraction and an integral power of 2.

=back

=for hackers
Declared and documented at config.h, line 2656

=over 4

=item C<HAS_ILOGB>
X<HAS_ILOGB>

This symbol, if defined, indicates that the C<ilogb> routine is
available to get integer exponent of a floating-point value.

=back

=for hackers
Declared and documented at config.h, line 2799

=over 4

=item C<HAS_ISFINITE>
X<HAS_ISFINITE>

This symbol, if defined, indicates that the C<isfinite> routine is
available to check whether a double is finite (non-infinity non-NaN).

=back

=for hackers
Declared and documented at config.h, line 2836

=over 4

=item C<HAS_ISFINITEL>
X<HAS_ISFINITEL>

This symbol, if defined, indicates that the C<isfinitel> routine is
available to check whether a long double is finite.
(non-infinity non-NaN).

=back

=for hackers
Declared and documented at config.h, line 2843

=over 4

=item C<HAS_ISINF>
X<HAS_ISINF>

This symbol, if defined, indicates that the C<isinf> routine is
available to check whether a double is an infinity.

=back

=for hackers
Declared and documented at config.h, line 2849

=over 4

=item C<HAS_ISINFL>
X<HAS_ISINFL>

This symbol, if defined, indicates that the C<isinfl> routine is
available to check whether a long double is an infinity.

=back

=for hackers
Declared and documented at config.h, line 2855

=over 4

=item C<HAS_ISNAN>
X<HAS_ISNAN>

This symbol, if defined, indicates that the C<isnan> routine is
available to check whether a double is a NaN.

=back

=for hackers
Declared and documented at config.h, line 2867

=over 4

=item C<HAS_ISNANL>
X<HAS_ISNANL>

This symbol, if defined, indicates that the C<isnanl> routine is
available to check whether a long double is a NaN.

=back

=for hackers
Declared and documented at config.h, line 2873

=over 4

=item C<HAS_ISNORMAL>
X<HAS_ISNORMAL>

This symbol, if defined, indicates that the C<isnormal> routine is
available to check whether a double is normal (non-zero normalized).

=back

=for hackers
Declared and documented at config.h, line 2879

=over 4

=item C<HAS_J0>
X<HAS_J0>

This symbol, if defined, indicates to the C program that the
C<j0()> function is available for Bessel functions of the first
kind of the order zero, for doubles.

=back

=for hackers
Declared and documented at config.h, line 2891

=over 4

=item C<HAS_J0L>
X<HAS_J0L>

This symbol, if defined, indicates to the C program that the
C<j0l()> function is available for Bessel functions of the first
kind of the order zero, for long doubles.

=back

=for hackers
Declared and documented at config.h, line 2892

=over 4

=item C<HAS_LDBL_DIG>
X<HAS_LDBL_DIG>

This symbol, if defined, indicates that this system's F<float.h>
or F<limits.h> defines the symbol C<LDBL_DIG>, which is the number
of significant digits in a long double precision number. Unlike
for C<DBL_DIG>, there's no good guess for C<LDBL_DIG> if it is undefined.

=back

=for hackers
Declared and documented at config.h, line 2906

=over 4

=item C<HAS_LDEXPL>
X<HAS_LDEXPL>

This symbol, if defined, indicates that the C<ldexpl> routine is
available to shift a long double floating-point number
by an integral power of 2.

=back

=for hackers
Declared and documented at config.h, line 1776

=over 4

=item C<HAS_LLRINT>
X<HAS_LLRINT>

This symbol, if defined, indicates that the C<llrint> routine is
available to return the long long value closest to a double
(according to the current rounding mode).

=back

=for hackers
Declared and documented at config.h, line 2933

=over 4

=item C<HAS_LLRINTL>
X<HAS_LLRINTL>

This symbol, if defined, indicates that the C<llrintl> routine is
available to return the long long value closest to a long double
(according to the current rounding mode).

=back

=for hackers
Declared and documented at config.h, line 2940

=over 4

=item C<HAS_LLROUNDL>
X<HAS_LLROUNDL>

This symbol, if defined, indicates that the C<llroundl> routine is
available to return the nearest long long value away from zero of
the long double argument value.

=back

=for hackers
Declared and documented at config.h, line 2953

=over 4

=item C<HAS_LONG_DOUBLE>
X<HAS_LONG_DOUBLE>

This symbol will be defined if the C compiler supports long
doubles.

=back

=for hackers
Declared and documented at config.h, line 1777

=over 4

=item C<HAS_LRINT>
X<HAS_LRINT>

This symbol, if defined, indicates that the C<lrint> routine is
available to return the integral value closest to a double
(according to the current rounding mode).

=back

=for hackers
Declared and documented at config.h, line 2978

=over 4

=item C<HAS_LRINTL>
X<HAS_LRINTL>

This symbol, if defined, indicates that the C<lrintl> routine is
available to return the integral value closest to a long double
(according to the current rounding mode).

=back

=for hackers
Declared and documented at config.h, line 2985

=over 4

=item C<HAS_LROUNDL>
X<HAS_LROUNDL>

This symbol, if defined, indicates that the C<lroundl> routine is
available to return the nearest integral value away from zero of
the long double argument value.

=back

=for hackers
Declared and documented at config.h, line 2998

=over 4

=item C<HAS_MODFL>
X<HAS_MODFL>

This symbol, if defined, indicates that the C<modfl> routine is
available to split a long double x into a fractional part f and
an integer part i such that |f| < 1.0 and (f + i) = x.

=back

=for hackers
Declared and documented at config.h, line 3065

=over 4

=item C<HAS_NAN>
X<HAS_NAN>

This symbol, if defined, indicates that the C<nan> routine is
available to generate NaN.

=back

=for hackers
Declared and documented at config.h, line 3084

=over 4

=item C<HAS_NEXTTOWARD>
X<HAS_NEXTTOWARD>

This symbol, if defined, indicates that the C<nexttoward> routine is
available to return the next machine representable long double from
x in direction y.

=back

=for hackers
Declared and documented at config.h, line 3148

=over 4

=item C<HAS_REMAINDER>
X<HAS_REMAINDER>

This symbol, if defined, indicates that the C<remainder> routine is
available to return the floating-point C<remainder>.

=back

=for hackers
Declared and documented at config.h, line 3230

=over 4

=item C<HAS_SCALBN>
X<HAS_SCALBN>

This symbol, if defined, indicates that the C<scalbn> routine is
available to multiply floating-point number by integral power
of radix.

=back

=for hackers
Declared and documented at config.h, line 3265

=over 4

=item C<HAS_SIGNBIT>
X<HAS_SIGNBIT>

This symbol, if defined, indicates that the C<signbit> routine is
available to check if the given number has the sign bit set.
This should include correct testing of -0.0.  This will only be set
if the C<signbit()> routine is safe to use with the NV type used internally
in perl.  Users should call C<Perl_signbit()>, which will be #defined to
the system's C<signbit()> function or macro if this symbol is defined.

=back

=for hackers
Declared and documented at config.h, line 3316

=over 4

=item C<HAS_SQRTL>
X<HAS_SQRTL>

This symbol, if defined, indicates that the C<sqrtl> routine is
available to do long double square roots.

=back

=for hackers
Declared and documented at config.h, line 3368

=over 4

=item C<HAS_STRTOD_L>
X<HAS_STRTOD_L>

This symbol, if defined, indicates that the C<strtod_l> routine is
available to convert strings to long doubles.

=back

=for hackers
Declared and documented at config.h, line 5204

=over 4

=item C<HAS_STRTOLD>
X<HAS_STRTOLD>

This symbol, if defined, indicates that the C<strtold> routine is
available to convert strings to long doubles.

=back

=for hackers
Declared and documented at config.h, line 3444

=over 4

=item C<HAS_STRTOLD_L>
X<HAS_STRTOLD_L>

This symbol, if defined, indicates that the C<strtold_l> routine is
available to convert strings to long doubles.

=back

=for hackers
Declared and documented at config.h, line 5210

=over 4

=item C<HAS_TRUNC>
X<HAS_TRUNC>

This symbol, if defined, indicates that the C<trunc> routine is
available to round doubles towards zero.

=back

=for hackers
Declared and documented at config.h, line 3552

=over 4

=item C<HAS_UNORDERED>
X<HAS_UNORDERED>

This symbol, if defined, indicates that the C<unordered> routine is
available to check whether two doubles are C<unordered>
(effectively: whether either of them is NaN)

=back

=for hackers
Declared and documented at config.h, line 3579

=over 4

=item C<I_FENV>
X<I_FENV>

This symbol, if defined, indicates to the C program that it should
include F<fenv.h> to get the floating point environment definitions.

=over 3

 #ifdef I_FENV
     #include <fenv.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3718

=over 4

=item C<I_QUADMATH>
X<I_QUADMATH>

This symbol, if defined, indicates that F<quadmath.h> exists and
should be included.

=over 3

 #ifdef I_QUADMATH
     #include <quadmath.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3790

=over 4

=item C<LONG_DOUBLE_STYLE_IEEE>
X<LONG_DOUBLE_STYLE_IEEE>

This symbol, if defined, indicates that the long double
is any of the C<IEEE> 754 style long doubles:
C<LONG_DOUBLE_STYLE_IEEE_STD>, C<LONG_DOUBLE_STYLE_IEEE_EXTENDED>,
C<LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE>.

=back

=for hackers
Declared and documented at config.h, line 1794

=over 4

=item C<LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE>
X<LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE>

This symbol, if defined, indicates that the long double is
the 128-bit double-double.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<LONG_DOUBLE_STYLE_IEEE_EXTENDED>
X<LONG_DOUBLE_STYLE_IEEE_EXTENDED>

This symbol, if defined, indicates that the long double is
the 80-bit C<IEEE> 754. Note that despite the 'extended' this
is less than the 'std', since this is an extension of
the double precision.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<LONG_DOUBLE_STYLE_IEEE_STD>
X<LONG_DOUBLE_STYLE_IEEE_STD>

This symbol, if defined, indicates that the long double is
the 128-bit C<IEEE> 754.

=back

=for hackers
Declared and documented at config.h, line 1797

=over 4

=item C<LONG_DOUBLE_STYLE_VAX>
X<LONG_DOUBLE_STYLE_VAX>

This symbol, if defined, indicates that the long double is
the 128-bit C<VAX> format H.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<LONG_DOUBLEKIND>
X<LONG_DOUBLEKIND>

C<LONG_DOUBLEKIND> will be one of
C<LONG_DOUBLE_IS_DOUBLE>
C<LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN>
C<LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN>
C<LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN>
C<LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN>
C<LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN>
C<LONG_DOUBLE_IS_VAX_H_FLOAT>
C<LONG_DOUBLE_IS_UNKNOWN_FORMAT>
It is only defined if the system supports long doubles.

=back

=for hackers
Declared and documented at config.h, line 1780

=over 4

=item C<LONG_DOUBLESIZE>
X<LONG_DOUBLESIZE>

This symbol contains the size of a long double, so that the
C preprocessor can make decisions based on it.  It is only
defined if the system supports long doubles.  Note that this
is C<sizeof(long double)>, which may include unused bytes.

=back

=for hackers
Declared and documented at config.h, line 1779

=over 4

=item C<LONGDBLINFBYTES>
X<LONGDBLINFBYTES>

This symbol, if defined, is a comma-separated list of
hexadecimal bytes for the long double precision infinity.

=back

=for hackers
Declared and documented at config.h, line 3903

=over 4

=item C<LONGDBLMANTBITS>
X<LONGDBLMANTBITS>

This symbol, if defined, tells how many mantissa bits
there are in long double precision floating point format.
Note that this can be C<LDBL_MANT_DIG> minus one,
since C<LDBL_MANT_DIG> can include the C<IEEE> 754 implicit bit.
The common x86-style 80-bit long double does not have
an implicit bit.

=back

=for hackers
Declared and documented at config.h, line 4022

=over 4

=item C<LONGDBLNANBYTES>
X<LONGDBLNANBYTES>

This symbol, if defined, is a comma-separated list of
hexadecimal bytes (0xHH) for the long double precision not-a-number.

=back

=for hackers
Declared and documented at config.h, line 3904

=over 4

=item C<NV>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 92

=over 4

=item C<NV_OVERFLOWS_INTEGERS_AT>
X<NV_OVERFLOWS_INTEGERS_AT>

This symbol gives the largest integer value that NVs can hold. This
value + 1.0 cannot be stored accurately. It is expressed as constant
floating point expression to reduce the chance of decimal/binary
conversion issues. If it can not be determined, the value 0 is given.

=back

=for hackers
Declared and documented at config.h, line 4179

=over 4

=item C<NV_PRESERVES_UV>
X<NV_PRESERVES_UV>

This symbol, if defined, indicates that a variable of type C<NVTYPE>
can preserve all the bits of a variable of type C<UVTYPE>.

=back

=for hackers
Declared and documented in config.h

=over 4

=item C<NV_PRESERVES_UV_BITS>
X<NV_PRESERVES_UV_BITS>

This symbol contains the number of bits a variable of type C<NVTYPE>
can preserve of a variable of type C<UVTYPE>.

=back

=for hackers
Declared and documented at config.h, line 4178

=over 4

=item C<NV_ZERO_IS_ALLBITS_ZERO>
X<NV_ZERO_IS_ALLBITS_ZERO>

This symbol, if defined, indicates that a variable of type C<NVTYPE>
stores 0.0 in memory as all bits zero.

=back

=for hackers
Declared and documented at config.h, line 4180

=over 4

=item C<NVMANTBITS>
X<NVMANTBITS>

This symbol, if defined, tells how many mantissa bits
(not including implicit bit) there are in a Perl NV.
This depends on which floating point type was chosen.

=back

=for hackers
Declared and documented at config.h, line 4023

=over 4

=item C<NVSIZE>
X<NVSIZE>

This symbol contains the C<sizeof(NV)>.
Note that some floating point formats have unused bytes.
The most notable example is the x86* 80-bit extended precision
which comes in byte sizes of 12 and 16 (for 32 and 64 bit
platforms, respectively), but which only uses 10 bytes.
Perl compiled with C<-Duselongdouble> on x86* is like this.

=back

=for hackers
Declared and documented at config.h, line 4176

=over 4

=item C<NVTYPE>
X<NVTYPE>

This symbol defines the C type used for Perl's NV.

=back

=for hackers
Declared and documented at config.h, line 4163

=head1 General Configuration
X<PERL_GCC_BRACE_GROUPS_FORBIDDEN>

This section contains configuration information not otherwise
found in the more specialized sections of this document.  At the
end is a list of C<#defines> whose name should be enough to tell
you what they do, and a list of #defines which tell you if you
need to C<#include> files to get the corresponding functionality.


=over 4

=item C<ASCIIish>
X<ASCIIish>

A preprocessor symbol that is defined iff the system is an ASCII platform; this
symbol would not be defined on C<L</EBCDIC>> platforms.

=over 3

 #ifdef  ASCIIish

=back

=back

=for hackers
Declared and documented at perl.h, line 874

=over 4

=item C<BYTEORDER>
X<BYTEORDER>

This symbol holds the hexadecimal constant defined in byteorder,
in a UV, i.e. 0x1234 or 0x4321 or 0x12345678, etc...
If the compiler supports cross-compiling or multiple-architecture
binaries, use compiler-defined macros to
determine the byte order.

=back

=for hackers
Declared and documented at config.h, line 4189

=over 4

=item C<CAT2>
X<CAT2>

This macro concatenates 2 tokens together.

=over 3

 token  CAT2(token x, token y)

=back

=back

=for hackers
Declared at handy.h, line 43; documented at config.h, line 1393

=over 4

=item C<CHARBITS>
X<CHARBITS>

This symbol contains the size of a char, so that the C preprocessor
can make decisions based on it.

=back

=for hackers
Declared and documented at config.h, line 865

=over 4

=item C<DB_VERSION_MAJOR_CFG>
X<DB_VERSION_MAJOR_CFG>

This symbol, if defined, defines the major version number of
Berkeley DB found in the F<db.h> header when Perl was configured.

=back

=for hackers
Declared and documented at config.h, line 3710

=over 4

=item C<DB_VERSION_MINOR_CFG>
X<DB_VERSION_MINOR_CFG>

This symbol, if defined, defines the minor version number of
Berkeley DB found in the F<db.h> header when Perl was configured.
For DB version 1 this is always 0.

=back

=for hackers
Declared and documented at config.h, line 3711

=over 4

=item C<DB_VERSION_PATCH_CFG>
X<DB_VERSION_PATCH_CFG>

This symbol, if defined, defines the patch version number of
Berkeley DB found in the F<db.h> header when Perl was configured.
For DB version 1 this is always 0.

=back

=for hackers
Declared and documented at config.h, line 3712

=over 4

=item C<DEFAULT_INC_EXCLUDES_DOT>
X<DEFAULT_INC_EXCLUDES_DOT>

This symbol, if defined, removes the legacy default behavior of
including '.' at the end of @C<INC>.

=back

=for hackers
Declared and documented at config.h, line 3623

=over 4

=item C<DLSYM_NEEDS_UNDERSCORE>
X<DLSYM_NEEDS_UNDERSCORE>

This symbol, if defined, indicates that we need to prepend an
underscore to the symbol name before calling C<dlsym()>.  This only
makes sense if you *have* dlsym, which we will presume is the
case if you're using F<dl_dlopen.xs>.

=back

=for hackers
Declared and documented at config.h, line 2430

=over 4

=item C<Drand01>
X<Drand01>

This macro is to be used to generate uniformly distributed
random numbers over the range [0., 1.[.  You may have to supply
an 'extern double C<drand48()>;' in your program since SunOS 4.1.3
doesn't provide you with anything relevant in its headers.
See C<L</HAS_DRAND48_PROTO>>.

=over 3

 double  Drand01()

=back

=back

=for hackers
Declared at handy.h, line 46; documented at config.h, line 1204

=over 4

=item C<EBCDIC>
X<EBCDIC>

This symbol, if defined, indicates that this system uses
C<EBCDIC> encoding.

=back

=for hackers
Declared and documented at config.h, line 1223

=over 4

=item C<HAS_CSH>
X<HAS_CSH>

This symbol, if defined, indicates that the C-shell exists.

=back

=for hackers
Declared and documented at config.h, line 1498

=over 4

=item C<HAS_GETHOSTNAME>
X<HAS_GETHOSTNAME>

This symbol, if defined, indicates that the C program may use the
C<gethostname()> routine to derive the host name.  See also C<L</HAS_UNAME>>
and C<L</PHOSTNAME>>.

=back

=for hackers
Declared and documented at config.h, line 1618

=over 4

=item C<HAS_GNULIBC>
X<HAS_GNULIBC>

This symbol, if defined, indicates to the C program that
the C<GNU> C library is being used.  A better check is to use
the C<__GLIBC__> and C<__GLIBC_MINOR__> symbols supplied with glibc.

=back

=for hackers
Declared and documented at config.h, line 929

=over 4

=item C<HAS_LGAMMA>
X<HAS_LGAMMA>

This symbol, if defined, indicates that the C<lgamma> routine is
available to do the log gamma function.  See also C<L</HAS_TGAMMA>> and
C<L</HAS_LGAMMA_R>>.

=back

=for hackers
Declared and documented at config.h, line 2913

=over 4

=item C<HAS_LGAMMA_R>
X<HAS_LGAMMA_R>

This symbol, if defined, indicates that the C<lgamma_r> routine is
available to do the log gamma function without using the global
signgam variable.

=back

=for hackers
Declared and documented at config.h, line 2920

=over 4

=item C<HAS_NON_INT_BITFIELDS>
X<HAS_NON_INT_BITFIELDS>

This symbol, if defined, indicates that the C compiler accepts, without
error or warning, C<struct bitfields> that are declared with sizes other
than plain 'int'; for example 'unsigned char' is accepted.

=back

=for hackers
Declared and documented at config.h, line 2323

=over 4

=item C<HAS_PRCTL_SET_NAME>
X<HAS_PRCTL_SET_NAME>

This symbol, if defined, indicates that the prctl routine is
available to set process title and supports C<PR_SET_NAME>.

=back

=for hackers
Declared and documented at config.h, line 3185

=over 4

=item C<HAS_PROCSELFEXE>
X<HAS_PROCSELFEXE>

This symbol is defined if C<PROCSELFEXE_PATH> is a symlink
to the absolute pathname of the executing program.

=back

=for hackers
Declared and documented at config.h, line 3196

=over 4

=item C<HAS_PSEUDOFORK>
X<HAS_PSEUDOFORK>

This symbol, if defined, indicates that an emulation of the
fork routine is available.

=back

=for hackers
Declared and documented at config.h, line 2012

=over 4

=item C<HAS_REGCOMP>
X<HAS_REGCOMP>

This symbol, if defined, indicates that the C<regcomp()> routine is
available to do some regular pattern matching (usually on C<POSIX>.2
conforming systems).

=back

=for hackers
Declared and documented at config.h, line 358

=over 4

=item C<HAS_SETPGID>
X<HAS_SETPGID>

This symbol, if defined, indicates that the C<setpgid(pid, gpid)>
routine is available to set process group ID.

=back

=for hackers
Declared and documented at config.h, line 417

=over 4

=item C<HAS_SIGSETJMP>
X<HAS_SIGSETJMP>

This variable indicates to the C program that the C<sigsetjmp()>
routine is available to save the calling process's registers
and stack environment for later use by C<siglongjmp()>, and
to optionally save the process's signal mask.  See
C<L</Sigjmp_buf>>, C<L</Sigsetjmp>>, and C<L</Siglongjmp>>.

=back

=for hackers
Declared and documented at config.h, line 1015

=over 4

=item C<HAS_STRUCT_CMSGHDR>
X<HAS_STRUCT_CMSGHDR>

This symbol, if defined, indicates that the C<struct cmsghdr>
is supported.

=back

=for hackers
Declared and documented at config.h, line 2384

=over 4

=item C<HAS_STRUCT_MSGHDR>
X<HAS_STRUCT_MSGHDR>

This symbol, if defined, indicates that the C<struct msghdr>
is supported.

=back

=for hackers
Declared and documented at config.h, line 3078

=over 4

=item C<HAS_TGAMMA>
X<HAS_TGAMMA>

This symbol, if defined, indicates that the C<tgamma> routine is
available to do the gamma function. See also C<L</HAS_LGAMMA>>.

=back

=for hackers
Declared and documented at config.h, line 3497

=over 4

=item C<HAS_UNAME>
X<HAS_UNAME>

This symbol, if defined, indicates that the C program may use the
C<uname()> routine to derive the host name.  See also C<L</HAS_GETHOSTNAME>>
and C<L</PHOSTNAME>>.

=back

=for hackers
Declared and documented at config.h, line 1619

=over 4

=item C<HAS_UNION_SEMUN>
X<HAS_UNION_SEMUN>

This symbol, if defined, indicates that the C<union semun> is
defined by including F<sys/sem.h>.  If not, the user code
probably needs to define it as:

 union semun {
 int val;
 struct semid_ds *buf;
 unsigned short *array;
 }

=back

=for hackers
Declared and documented at config.h, line 1999

=over 4

=item C<I_DIRENT>
X<I_DIRENT>

This symbol, if defined, indicates to the C program that it should
include F<dirent.h>. Using this symbol also triggers the definition
of the C<Direntry_t> define which ends up being 'C<struct dirent>' or
'C<struct direct>' depending on the availability of F<dirent.h>.

=over 3

 #ifdef I_DIRENT
     #include <dirent.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 2038

=over 4

=item C<I_POLL>
X<I_POLL>

This symbol, if defined, indicates that F<poll.h> exists and
should be included. (see also C<L</HAS_POLL>>)

=over 3

 #ifdef I_POLL
     #include <poll.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3778

=over 4

=item C<I_SYS_RESOURCE>
X<I_SYS_RESOURCE>

This symbol, if defined, indicates to the C program that it should
include F<sys/resource.h>.

=over 3

 #ifdef I_SYS_RESOURCE
     #include <sys_resource.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 693

=over 4

=item C<LIBM_LIB_VERSION>
X<LIBM_LIB_VERSION>

This symbol, if defined, indicates that libm exports C<_LIB_VERSION>
and that F<math.h> defines the enum to manipulate it.

=back

=for hackers
Declared and documented at config.h, line 2926

=over 4

=item C<NEED_VA_COPY>

This symbol, if defined, indicates that the system stores
the variable argument list datatype, C<va_list>, in a format
that cannot be copied by simple assignment, so that some
other means must be used when copying is required.
As such systems vary in their provision (or non-provision)
of copying mechanisms, F<handy.h> defines a platform-
independent macro, C<Perl_va_copy(src, dst)>, to do the job.

=back

=for hackers
Documented at pod/perlhacktips.pod, line 924

=over 4

=item C<OSNAME>
X<OSNAME>

This symbol contains the name of the operating system, as determined
by Configure.  You shouldn't rely on it too much; the specific
feature tests from Configure are generally more reliable.

=back

=for hackers
Declared and documented at config.h, line 1377

=over 4

=item C<OSVERS>
X<OSVERS>

This symbol contains the version of the operating system, as determined
by Configure.  You shouldn't rely on it too much; the specific
feature tests from Configure are generally more reliable.

=back

=for hackers
Declared and documented at config.h, line 1378

=over 4

=item C<PERL_USE_GCC_BRACE_GROUPS>
X<PERL_USE_GCC_BRACE_GROUPS>

This C pre-processor value, if defined, indicates that it is permissible to use
the GCC brace groups extension.  However, use of this extension is DISCOURAGED.
Use a C<static inline> function instead.

The extension, of the form

 ({ statement ... })

turns the block consisting of I<statement ...> into an expression with a
value, unlike plain C language blocks.  This can present optimization
possibilities, B<BUT>, unless you know for sure that this will never be
compiled without this extension being available and not forbidden, you need to
specify an alternative.  Thus two code paths have to be maintained, which can
get out-of-sync.  All these issues are solved by using a C<static inline>
function instead.

Perl can be configured to not use this feature by passing the parameter
C<-Accflags=-DPERL_GCC_BRACE_GROUPS_FORBIDDEN> to F<Configure>.

=over 3

 #ifdef  PERL_USE_GCC_BRACE_GROUPS

=back

=back

=for hackers
Declared and documented at perl.h, line 824

=over 4

=item C<PHOSTNAME>
X<PHOSTNAME>

This symbol, if defined, indicates the command to feed to the
C<popen()> routine to derive the host name.  See also C<L</HAS_GETHOSTNAME>>
and C<L</HAS_UNAME>>.  Note that the command uses a fully qualified path,
so that it is safe even if used by a process with super-user
privileges.

=back

=for hackers
Declared and documented at config.h, line 1622

=over 4

=item C<PROCSELFEXE_PATH>
X<PROCSELFEXE_PATH>

If C<HAS_PROCSELFEXE> is defined this symbol is the filename
of the symbolic link pointing to the absolute pathname of
the executing program.

=back

=for hackers
Declared and documented at config.h, line 3198

=over 4

=item C<PTRSIZE>
X<PTRSIZE>

This symbol contains the size of a pointer, so that the C preprocessor
can make decisions based on it.  It will be C<sizeof(void *)> if
the compiler supports (void *); otherwise it will be
C<sizeof(char *)>.

=back

=for hackers
Declared and documented at config.h, line 1182

=over 4

=item C<RANDBITS>
X<RANDBITS>

This symbol indicates how many bits are produced by the
function used to generate normalized random numbers.
Values include 15, 16, 31, and 48.

=back

=for hackers
Declared and documented at config.h, line 1207

=over 4

=item C<seedDrand01>
X<seedDrand01>

This symbol defines the macro to be used in seeding the
random number generator (see C<L</Drand01>>).

=over 3

 void  seedDrand01(Rand_seed_t x)

=back

=back

=for hackers
Declared at handy.h, line 47; documented at config.h, line 1206

=over 4

=item C<SELECT_MIN_BITS>
X<SELECT_MIN_BITS>

This symbol holds the minimum number of bits operated by select.
That is, if you do C<select(n, ...)>, how many bits at least will be
cleared in the masks if some activity is detected.  Usually this
is either n or 32*C<ceil(n/32)>, especially many little-endians do
the latter.  This is only useful if you have C<select()>, naturally.

=back

=for hackers
Declared and documented at config.h, line 4243

=over 4

=item C<SETUID_SCRIPTS_ARE_SECURE_NOW>
X<SETUID_SCRIPTS_ARE_SECURE_NOW>

This symbol, if defined, indicates that the bug that prevents
setuid scripts from being secure is not present in this kernel.

=back

=for hackers
Declared and documented at config.h, line 1527

=over 4

=item C<ST_DEV_SIGN>
X<ST_DEV_SIGN>

This symbol holds the signedness of C<struct stat>'s C<st_dev>.
1 for unsigned, -1 for signed.

=back

=for hackers
Declared and documented at config.h, line 4252

=over 4

=item C<ST_DEV_SIZE>
X<ST_DEV_SIZE>

This variable contains the size of C<struct stat>'s C<st_dev> in bytes.

=back

=for hackers
Declared and documented at config.h, line 4253

=over 4

=item C<STRINGIFY>
X<STRINGIFY>

This macro surrounds its token with double quotes.

=over 3

 string  STRINGIFY(token x)

=back

=back

=for hackers
Declared at handy.h, line 44; documented at config.h, line 1395


=head2 List of capability C<HAS_I<foo>> symbols

This is a list of those symbols that dont appear elsewhere in ths
document that indicate if the current platform has a certain
capability.  Their names all begin with C<HAS_>.  Only those
symbols whose capability is directly derived from the name are
listed here.  All others have their meaning expanded out elsewhere
in this document.  This (relatively) compact list is because we
think that the expansion would add little or no value and take up
a lot of space (because there are so many).  If you think certain
ones should be expanded, send email to
L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>.

Each symbol here will be C<#define>d if and only if the platform
has the capability.  If you need more detail, see the
corresponding entry in F<config.h>.  For convenience, the list is
split so that the ones that indicate there is a reentrant version
of a capability are listed separately

C<HAS__FWALK>,S< > C<HAS_ACCEPT4>,S< > C<HAS_ACCESS>,S< > C<HAS_ACCESSX>,S< > C<HAS_ACOSH>,S< > C<HAS_AINTL>,S< > C<HAS_ALARM>,S< > C<HAS_ASINH>,S< > C<HAS_ATANH>,S< > C<HAS_ATOLL>,S< > C<HAS_CBRT>,S< > C<HAS_CHOWN>,S< > C<HAS_CHROOT>,S< > C<HAS_CHSIZE>,S< > C<HAS_CLEARENV>,S< > C<HAS_COPYSIGN>,S< > C<HAS_COPYSIGNL>,S< > C<HAS_CRYPT>,S< > C<HAS_CTERMID>,S< > C<HAS_CUSERID>,S< > C<HAS_DIRFD>,S< > C<HAS_DLADDR>,S< > C<HAS_DLERROR>,S< > C<HAS_EACCESS>,S< > C<HAS_ENDHOSTENT>,S< > C<HAS_ENDNETENT>,S< > C<HAS_ENDPROTOENT>,S< > C<HAS_ENDSERVENT>,S< > C<HAS_ERF>,S< > C<HAS_ERFC>,S< > C<HAS_EXPM1>,S< > C<HAS_EXP2>,S< > C<HAS_FCHMOD>,S< > C<HAS_FCHMODAT>,S< > C<HAS_FCHOWN>,S< > C<HAS_FD_SET>,S< > C<HAS_FDIM>,S< > C<HAS_FEGETROUND>,S< > C<HAS_FFS>,S< > C<HAS_FFSL>,S< > C<HAS_FGETPOS>,S< > C<HAS_FLOCK>,S< > C<HAS_FMA>,S< > C<HAS_FMAX>,S< > C<HAS_FMIN>,S< > C<HAS_FORK>,S< > C<HAS_FSEEKO>,S< > C<HAS_FSETPOS>,S< > C<HAS_FSYNC>,S< > C<HAS_FTELLO>,S< > C<HAS_GAI_STRERROR>,S< > C<HAS_GETADDRINFO>,S< > C<HAS_GETCWD>,S< > C<HAS_GETESPWNAM>,S< > C<HAS_GETGROUPS>,S< > C<HAS_GETHOSTBYADDR>,S< > C<HAS_GETHOSTBYNAME>,S< > C<HAS_GETHOSTENT>,S< > C<HAS_GETLOGIN>,S< > C<HAS_GETNAMEINFO>,S< > C<HAS_GETNETBYADDR>,S< > C<HAS_GETNETBYNAME>,S< > C<HAS_GETNETENT>,S< > C<HAS_GETPAGESIZE>,S< > C<HAS_GETPGID>,S< > C<HAS_GETPGRP>,S< > C<HAS_GETPGRP2>,S< > C<HAS_GETPPID>,S< > C<HAS_GETPRIORITY>,S< > C<HAS_GETPROTOBYNAME>,S< > C<HAS_GETPROTOBYNUMBER>,S< > C<HAS_GETPROTOENT>,S< > C<HAS_GETPRPWNAM>,S< > C<HAS_GETSERVBYNAME>,S< > C<HAS_GETSERVBYPORT>,S< > C<HAS_GETSERVENT>,S< > C<HAS_GETSPNAM>,S< > C<HAS_HTONL>,S< > C<HAS_HTONS>,S< > C<HAS_HYPOT>,S< > C<HAS_ILOGBL>,S< > C<HAS_INET_ATON>,S< > C<HAS_INETNTOP>,S< > C<HAS_INETPTON>,S< > C<HAS_IP_MREQ>,S< > C<HAS_IP_MREQ_SOURCE>,S< > C<HAS_IPV6_MREQ>,S< > C<HAS_IPV6_MREQ_SOURCE>,S< > C<HAS_ISASCII>,S< > C<HAS_ISBLANK>,S< > C<HAS_ISLESS>,S< > C<HAS_KILLPG>,S< > C<HAS_LCHOWN>,S< > C<HAS_LINK>,S< > C<HAS_LINKAT>,S< > C<HAS_LLROUND>,S< > C<HAS_LOCKF>,S< > C<HAS_LOGB>,S< > C<HAS_LOG1P>,S< > C<HAS_LOG2>,S< > C<HAS_LROUND>,S< > C<HAS_LSTAT>,S< > C<HAS_MADVISE>,S< > C<HAS_MBLEN>,S< > C<HAS_MBRLEN>,S< > C<HAS_MBRTOWC>,S< > C<HAS_MBSTOWCS>,S< > C<HAS_MBTOWC>,S< > C<HAS_MEMMEM>,S< > C<HAS_MEMRCHR>,S< > C<HAS_MKDTEMP>,S< > C<HAS_MKFIFO>,S< > C<HAS_MKOSTEMP>,S< > C<HAS_MKSTEMP>,S< > C<HAS_MKSTEMPS>,S< > C<HAS_MMAP>,S< > C<HAS_MPROTECT>,S< > C<HAS_MSG>,S< > C<HAS_MSYNC>,S< > C<HAS_MUNMAP>,S< > C<HAS_NEARBYINT>,S< > C<HAS_NEXTAFTER>,S< > C<HAS_NICE>,S< > C<HAS_NTOHL>,S< > C<HAS_NTOHS>,S< > C<HAS_PATHCONF>,S< > C<HAS_PAUSE>,S< > C<HAS_PHOSTNAME>,S< > C<HAS_PIPE>,S< > C<HAS_PIPE2>,S< > C<HAS_PRCTL>,S< > C<HAS_PTRDIFF_T>,S< > C<HAS_READLINK>,S< > C<HAS_READV>,S< > C<HAS_RECVMSG>,S< > C<HAS_REMQUO>,S< > C<HAS_RENAME>,S< > C<HAS_RENAMEAT>,S< > C<HAS_RINT>,S< > C<HAS_ROUND>,S< > C<HAS_SCALBNL>,S< > C<HAS_SEM>,S< > C<HAS_SENDMSG>,S< > C<HAS_SETEGID>,S< > C<HAS_SETENV>,S< > C<HAS_SETEUID>,S< > C<HAS_SETGROUPS>,S< > C<HAS_SETHOSTENT>,S< > C<HAS_SETLINEBUF>,S< > C<HAS_SETNETENT>,S< > C<HAS_SETPGRP>,S< > C<HAS_SETPGRP2>,S< > C<HAS_SETPRIORITY>,S< > C<HAS_SETPROCTITLE>,S< > C<HAS_SETPROTOENT>,S< > C<HAS_SETREGID>,S< > C<HAS_SETRESGID>,S< > C<HAS_SETRESUID>,S< > C<HAS_SETREUID>,S< > C<HAS_SETRGID>,S< > C<HAS_SETRUID>,S< > C<HAS_SETSERVENT>,S< > C<HAS_SETSID>,S< > C<HAS_SHM>,S< > C<HAS_SIGACTION>,S< > C<HAS_SIGPROCMASK>,S< > C<HAS_SIN6_SCOPE_ID>,S< > C<HAS_SNPRINTF>,S< > C<HAS_STAT>,S< > C<HAS_STRCOLL>,S< > C<HAS_STRERROR_L>,S< > C<HAS_STRLCAT>,S< > C<HAS_STRLCPY>,S< > C<HAS_STRNLEN>,S< > C<HAS_STRTOD>,S< > C<HAS_STRTOL>,S< > C<HAS_STRTOLL>,S< > C<HAS_STRTOQ>,S< > C<HAS_STRTOUL>,S< > C<HAS_STRTOULL>,S< > C<HAS_STRTOUQ>,S< > C<HAS_STRXFRM>,S< > C<HAS_STRXFRM_L>,S< > C<HAS_SYMLINK>,S< > C<HAS_SYS_ERRLIST>,S< > C<HAS_SYSCALL>,S< > C<HAS_SYSCONF>,S< > C<HAS_SYSTEM>,S< > C<HAS_TCGETPGRP>,S< > C<HAS_TCSETPGRP>,S< > C<HAS_TOWLOWER>,S< > C<HAS_TOWUPPER>,S< > C<HAS_TRUNCATE>,S< > C<HAS_TRUNCL>,S< > C<HAS_UALARM>,S< > C<HAS_UMASK>,S< > C<HAS_UNLINKAT>,S< > C<HAS_UNSETENV>,S< > C<HAS_VFORK>,S< > C<HAS_VSNPRINTF>,S< > C<HAS_WAITPID>,S< > C<HAS_WAIT4>,S< > C<HAS_WCRTOMB>,S< > C<HAS_WCSCMP>,S< > C<HAS_WCSTOMBS>,S< > C<HAS_WCSXFRM>,S< > C<HAS_WCTOMB>,S< > C<HAS_WRITEV>

And, the reentrant capabilities:

C<HAS_CRYPT_R>,S< > C<HAS_CTERMID_R>,S< > C<HAS_DRAND48_R>,S< > C<HAS_ENDHOSTENT_R>,S< > C<HAS_ENDNETENT_R>,S< > C<HAS_ENDPROTOENT_R>,S< > C<HAS_ENDSERVENT_R>,S< > C<HAS_GETGRGID_R>,S< > C<HAS_GETGRNAM_R>,S< > C<HAS_GETHOSTBYADDR_R>,S< > C<HAS_GETHOSTBYNAME_R>,S< > C<HAS_GETHOSTENT_R>,S< > C<HAS_GETLOGIN_R>,S< > C<HAS_GETNETBYADDR_R>,S< > C<HAS_GETNETBYNAME_R>,S< > C<HAS_GETNETENT_R>,S< > C<HAS_GETPROTOBYNAME_R>,S< > C<HAS_GETPROTOBYNUMBER_R>,S< > C<HAS_GETPROTOENT_R>,S< > C<HAS_GETPWNAM_R>,S< > C<HAS_GETPWUID_R>,S< > C<HAS_GETSERVBYNAME_R>,S< > C<HAS_GETSERVBYPORT_R>,S< > C<HAS_GETSERVENT_R>,S< > C<HAS_GETSPNAM_R>,S< > C<HAS_RANDOM_R>,S< > C<HAS_READDIR_R>,S< > C<HAS_SETHOSTENT_R>,S< > C<HAS_SETNETENT_R>,S< > C<HAS_SETPROTOENT_R>,S< > C<HAS_SETSERVENT_R>,S< > C<HAS_SRANDOM_R>,S< > C<HAS_SRAND48_R>,S< > C<HAS_STRERROR_R>,S< > C<HAS_TMPNAM_R>,S< > C<HAS_TTYNAME_R>

Example usage:

=over 4

 #ifdef HAS_STRNLEN
   use strnlen()
 #else
   use an alternative implementation
 #endif

=back

=head2 List of C<#include> needed symbols

This list contains symbols that indicate if certain C<#include>
files are present on the platform.  If your code accesses the
functionality that one of these is for, you will need to
C<#include> it if the symbol on this list is C<#define>d.  For
more detail, see the corresponding entry in F<config.h>.

C<I_ARPA_INET>,S< > C<I_BFD>,S< > C<I_CRYPT>,S< > C<I_DBM>,S< > C<I_DLFCN>,S< > C<I_EXECINFO>,S< > C<I_FP>,S< > C<I_FP_CLASS>,S< > C<I_GDBM>,S< > C<I_GDBM_NDBM>,S< > C<I_GDBMNDBM>,S< > C<I_GRP>,S< > C<I_IEEEFP>,S< > C<I_INTTYPES>,S< > C<I_LIBUTIL>,S< > C<I_MNTENT>,S< > C<I_NDBM>,S< > C<I_NET_ERRNO>,S< > C<I_NETDB>,S< > C<I_NETINET_IN>,S< > C<I_NETINET_TCP>,S< > C<I_PROT>,S< > C<I_PWD>,S< > C<I_RPCSVC_DBM>,S< > C<I_SGTTY>,S< > C<I_SHADOW>,S< > C<I_STDBOOL>,S< > C<I_STDINT>,S< > C<I_SUNMATH>,S< > C<I_SYS_ACCESS>,S< > C<I_SYS_IOCTL>,S< > C<I_SYS_MOUNT>,S< > C<I_SYS_PARAM>,S< > C<I_SYS_POLL>,S< > C<I_SYS_SECURITY>,S< > C<I_SYS_SELECT>,S< > C<I_SYS_STAT>,S< > C<I_SYS_STATVFS>,S< > C<I_SYS_SYSCALL>,S< > C<I_SYS_TIME>,S< > C<I_SYS_TIME_KERNEL>,S< > C<I_SYS_TIMES>,S< > C<I_SYS_TYPES>,S< > C<I_SYS_UN>,S< > C<I_SYS_VFS>,S< > C<I_SYS_WAIT>,S< > C<I_SYSLOG>,S< > C<I_SYSMODE>,S< > C<I_SYSUIO>,S< > C<I_SYSUTSNAME>,S< > C<I_TERMIO>,S< > C<I_TERMIOS>,S< > C<I_UNISTD>,S< > C<I_USTAT>,S< > C<I_VFORK>,S< > C<I_WCHAR>,S< > C<I_WCTYPE>

Example usage:

=over 4

 #ifdef I_WCHAR
   #include <wchar.h>
 #endif

=back


=head1 Global Variables


These variables are global to an entire process.  They are shared between
all interpreters and all threads in a process.  Any variables not documented
here may be changed or removed without notice, so don't use them!
If you feel you really do need to use an unlisted variable, first send email to
L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>.  It may be that
someone there will point out a way to accomplish what you need without using an
internal variable.  But if not, you should get a go-ahead to document and then
use the variable.


=over 4

=item C<PL_check>
X<PL_check>

Array, indexed by opcode, of functions that will be called for the "check"
phase of optree building during compilation of Perl code.  For most (but
not all) types of op, once the op has been initially built and populated
with child ops it will be filtered through the check function referenced
by the appropriate element of this array.  The new op is passed in as the
sole argument to the check function, and the check function returns the
completed op.  The check function may (as the name suggests) check the op
for validity and signal errors.  It may also initialise or modify parts of
the ops, or perform more radical surgery such as adding or removing child
ops, or even throw the op away and return a different op in its place.

This array of function pointers is a convenient place to hook into the
compilation process.  An XS module can put its own custom check function
in place of any of the standard ones, to influence the compilation of a
particular type of op.  However, a custom check function must never fully
replace a standard check function (or even a custom check function from
another module).  A module modifying checking must instead B<wrap> the
preexisting check function.  A custom check function must be selective
about when to apply its custom behaviour.  In the usual case where
it decides not to do anything special with an op, it must chain the
preexisting op function.  Check functions are thus linked in a chain,
with the core's base checker at the end.

For thread safety, modules should not write directly to this array.
Instead, use the function L</wrap_op_checker>.

=back

=for hackers
Declared and documented at perlvars.h, line 126

=over 4

=item C<PL_infix_plugin>
X<PL_infix_plugin>

NOTE: C<PL_infix_plugin> is B<experimental> and may change or be
removed without notice.

B<NOTE:> This API exists entirely for the purpose of making the CPAN module
C<XS::Parse::Infix> work. It is not expected that additional modules will make
use of it; rather, that they should use C<XS::Parse::Infix> to provide parsing
of new infix operators.

Function pointer, pointing at a function used to handle extended infix
operators. The function should be declared as

        int infix_plugin_function(pTHX_
                char *opname, STRLEN oplen,
                struct Perl_custom_infix **infix_ptr)

The function is called from the tokenizer whenever a possible infix operator
is seen. C<opname> points to the operator name in the parser's input buffer,
and C<oplen> gives the I<maximum> number of bytes of it that should be
consumed; it is not null-terminated. The function is expected to examine the
operator name and possibly other state such as L<%^H|perlvar/%^H>, to
determine whether it wants to handle the operator name.

As compared to the single stage of C<PL_keyword_plugin>, parsing of additional
infix operators occurs in three separate stages. This is because of the more
complex interactions it has with the parser, to ensure that operator
precedence rules work correctly. These stages are co-ordinated by the use of
an additional information structure.

If the function wants to handle the infix operator, it must set the variable
pointed to by C<infix_ptr> to the address of a structure that provides this
additional information about the subsequent parsing stages. If it does not,
it should make a call to the next function in the chain.

This structure has the following definition:

	struct Perl_custom_infix {
	    enum Perl_custom_infix_precedence prec;
	    void (*parse)(pTHX_ SV **opdata,
		struct Perl_custom_infix *);
	    OP *(*build_op)(pTHX_ SV **opdata, OP *lhs, OP *rhs,
		struct Perl_custom_infix *);
	};

The function must then return an integer giving the number of bytes consumed
by the name of this operator. In the case of an operator whose name is
composed of identifier characters, this must be equal to C<oplen>. In the case
of an operator named by non-identifier characters, this is permitted to be
shorter than C<oplen>, and any additional characters after it will not be
claimed by the infix operator but instead will be consumed by the tokenizer
and parser as normal.

If the optional C<parse> function is provided, it is called immediately by the
parser to let the operator's definition consume any additional syntax from the
source code. This should I<not> be used for normal operand parsing, but it may
be useful when implementing things like parametric operators or meta-operators
that consume more syntax themselves. This function may use the variable
pointed to by C<opdata> to provide an SV containing additional data to be
passed into the C<build_op> function later on.

The information structure gives the operator precedence level in the C<prec>
field. This is used to tell the parser how much of the surrounding syntax
before and after should be considered as operands to the operator.

The tokenizer and parser will then continue to operate as normal until enough
additional input has been parsed to form both the left- and right-hand side
operands to the operator, according to the precedence level. At this point the
C<build_op> function is called, being passed the left- and right-hand operands
as optree fragments. It is expected to combine them into the resulting optree
fragment, which it should return.

After the C<build_op> function has returned, if the variable pointed to by
C<opdata> was set to a non-C<NULL> value, it will then be destroyed by calling
C<SvREFCNT_dec()>.

For thread safety, modules should not set this variable directly.
Instead, use the function L</wrap_infix_plugin>.

However, that all said, the introductory note above still applies. This
variable is provided in core perl only for the benefit of the
C<XS::Parse::Infix> module. That module acts as a central registry for infix
operators, automatically handling things like deparse support and
discovery/reflection, and these abilities only work because it knows all the
registered operators. Other modules should not use this interpreter variable
directly to implement them because then those central features would no longer
work properly.

Furthermore, it is likely that this (experimental) API will be replaced in a
future Perl version by a more complete API that fully implements the central
registry and other semantics currently provided by C<XS::Parse::Infix>, once
the module has had sufficient experimental testing time. This current
mechanism exists only as an interim measure to get to that stage.

=back

=for hackers
Declared and documented at perlvars.h, line 255

=over 4

=item C<PL_keyword_plugin>
X<PL_keyword_plugin>

NOTE: C<PL_keyword_plugin> is B<experimental> and may change or be
removed without notice.

Function pointer, pointing at a function used to handle extended keywords.
The function should be declared as

        int keyword_plugin_function(pTHX_
                char *keyword_ptr, STRLEN keyword_len,
                OP **op_ptr)

The function is called from the tokeniser, whenever a possible keyword
is seen.  C<keyword_ptr> points at the word in the parser's input
buffer, and C<keyword_len> gives its length; it is not null-terminated.
The function is expected to examine the word, and possibly other state
such as L<%^H|perlvar/%^H>, to decide whether it wants to handle it
as an extended keyword.  If it does not, the function should return
C<KEYWORD_PLUGIN_DECLINE>, and the normal parser process will continue.

If the function wants to handle the keyword, it first must
parse anything following the keyword that is part of the syntax
introduced by the keyword.  See L</Lexer interface> for details.

When a keyword is being handled, the plugin function must build
a tree of C<OP> structures, representing the code that was parsed.
The root of the tree must be stored in C<*op_ptr>.  The function then
returns a constant indicating the syntactic role of the construct that
it has parsed: C<KEYWORD_PLUGIN_STMT> if it is a complete statement, or
C<KEYWORD_PLUGIN_EXPR> if it is an expression.  Note that a statement
construct cannot be used inside an expression (except via C<do BLOCK>
and similar), and an expression is not a complete statement (it requires
at least a terminating semicolon).

When a keyword is handled, the plugin function may also have
(compile-time) side effects.  It may modify C<%^H>, define functions, and
so on.  Typically, if side effects are the main purpose of a handler,
it does not wish to generate any ops to be included in the normal
compilation.  In this case it is still required to supply an op tree,
but it suffices to generate a single null op.

That's how the C<*PL_keyword_plugin> function needs to behave overall.
Conventionally, however, one does not completely replace the existing
handler function.  Instead, take a copy of C<PL_keyword_plugin> before
assigning your own function pointer to it.  Your handler function should
look for keywords that it is interested in and handle those.  Where it
is not interested, it should call the saved plugin function, passing on
the arguments it received.  Thus C<PL_keyword_plugin> actually points
at a chain of handler functions, all of which have an opportunity to
handle keywords, and only the last function in the chain (built into
the Perl core) will normally return C<KEYWORD_PLUGIN_DECLINE>.

For thread safety, modules should not set this variable directly.
Instead, use the function L</wrap_keyword_plugin>.

=back

=for hackers
Declared and documented at perlvars.h, line 194

=over 4

=item C<PL_phase>
X<PL_phase>

A value that indicates the current Perl interpreter's phase. Possible values
include C<PERL_PHASE_CONSTRUCT>, C<PERL_PHASE_START>, C<PERL_PHASE_CHECK>,
C<PERL_PHASE_INIT>, C<PERL_PHASE_RUN>, C<PERL_PHASE_END>, and
C<PERL_PHASE_DESTRUCT>.

For example, the following determines whether the interpreter is in
global destruction:

    if (PL_phase == PERL_PHASE_DESTRUCT) {
        // we are in global destruction
    }

C<PL_phase> was introduced in Perl 5.14; in prior perls you can use
C<PL_dirty> (boolean) to determine whether the interpreter is in global
destruction. (Use of C<PL_dirty> is discouraged since 5.14.)

=over 3

 enum perl_phase  PL_phase

=back

=back

=for hackers
Declared and documented at perlvars.h, line 154

=head1 GV Handling and Stashes
X<GV>X<GV_ADD>X<GV_ADDMG>X<GV_ADDMULTI>X<GV_ADDWARN>
X<GV_AUTOLOAD_ISMETHOD>X<GV_NO_SVGMAGIC>X<GV_NOADD_NOINIT>X<GV_NOEXPAND>
X<GV_NOINIT>X<GV_NOTQUAL>X<GV_NOUNIVERSAL>X<GV_SUPER>X<SVf_UTF8>


A GV is a structure which corresponds to a Perl typeglob, I<i.e.>, *foo.
It is a structure that holds a pointer to a scalar, an array, a hash etc,
corresponding to $foo, @foo, %foo.

GVs are usually found as values in stashes (symbol table hashes) where
Perl stores its global variables.

A B<stash> is a hash that contains all variables that are defined
within a package.  See L<perlguts/Stashes and Globs>


=over 4

=item C<amagic_call>
X<amagic_call>

Perform the overloaded (active magic) operation given by C<method>.
C<method> is one of the values found in F<overload.h>.

C<flags> affects how the operation is performed, as follows:

=over

=item C<AMGf_noleft>

C<left> is not to be used in this operation.

=item C<AMGf_noright>

C<right> is not to be used in this operation.

=item C<AMGf_unary>

The operation is done only on just one operand.

=item C<AMGf_assign>

The operation changes one of the operands, e.g., $x += 1

=back

=over 3

 SV *       amagic_call(      SV *left, SV *right, int method,
                              int dir)
 SV *  Perl_amagic_call(pTHX_ SV *left, SV *right, int method,
                              int dir)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 3754

=over 4

=item C<amagic_deref_call>
X<amagic_deref_call>

Perform C<method> overloading dereferencing on C<ref>, returning the
dereferenced result.  C<method> must be one of the dereference operations given
in F<overload.h>.

If overloading is inactive on C<ref>, returns C<ref> itself.

=over 3

 SV *       amagic_deref_call(      SV *ref, int method)
 SV *  Perl_amagic_deref_call(pTHX_ SV *ref, int method)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 3687

=over 4

=item C<gv_add_by_type>
X<gv_add_by_type>

Make sure there is a slot of type C<type> in the GV C<gv>.

=over 3

 GV *       gv_add_by_type(      GV *gv, svtype type)
 GV *  Perl_gv_add_by_type(pTHX_ GV *gv, svtype type)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 50

=over 4

=item C<Gv_AMupdate>
X<Gv_AMupdate>

Recalculates overload magic in the package given by C<stash>.

Returns:

=over

=item 1 on success and there is some overload

=item 0 if there is no overload

=item -1 if some error occurred and it couldn't croak (because C<destructing>
is true).

=back

=over 3

 int       Gv_AMupdate(      HV *stash, bool destructing)
 int  Perl_Gv_AMupdate(pTHX_ HV *stash, bool destructing)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 3145

=over 4

=item C<gv_autoload_pv>

=item C<gv_autoload_pvn>

=item C<gv_autoload_sv>

=item C<gv_autoload4>
X<gv_autoload_pv>X<gv_autoload_pvn>X<gv_autoload_sv>X<gv_autoload4>

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 the name (fully qualified).  Also,
if found and the GV's CV is an XSUB, the CV's PV will be set to the 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.

C<gv_autoload4>) has a C<method> parameter; the others a C<flags> one  (both
types explained below).  Otherwise, the forms differ only in how the name is
specified.

In C<gv_autoload_pv>, C<namepv> is a C language NUL-terminated string.

In C<gv_autoload_pvn> and C<gv_autoload4>), 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.

The other way to indicate that the name is encoded as UTF-8 is to set the 
C<SVf_UTF8> bit in C<flags> for the forms that have that parameter.  
The name is never considered to be UTF-8 in C<gv_autoload4>.

The C<method> parameter in C<gv_autoload4> is used only to indicate that the
name is for a method (non-zero), or not (zero).  The other forms use the
C<GV_AUTOLOAD_ISMETHOD> bit in C<flags> to indicate this.

The only other significant value in C<flags> currently is C<GV_SUPER>
to indicate, if set, to skip searching for the name in C<stash>.

=over 3

 GV *       gv_autoload_pv (      NOCHECK HV *stash,
                                  const char *namepv, U32 flags)
 GV *  Perl_gv_autoload_pv (pTHX_ NOCHECK HV *stash,
                                  const char *namepv, U32 flags)
 GV *       gv_autoload_pvn(      NOCHECK HV *stash,
                                  const char *name, STRLEN len,
                                  U32 flags)
 GV *  Perl_gv_autoload_pvn(pTHX_ NOCHECK HV *stash,
                                  const char *name, STRLEN len,
                                  U32 flags)
 GV *       gv_autoload_sv (      NOCHECK HV *stash, SV *namesv,
                                  U32 flags)
 GV *  Perl_gv_autoload_sv (pTHX_ NOCHECK HV *stash, SV *namesv,
                                  U32 flags)
 GV *       gv_autoload4   (      HV *stash, const char *name,
                                  STRLEN len, I32 method
)

=back

=back

=for hackers
gv_autoload_pv declared in embed.fnc; all in group documented at gv.c, line 1300
gv_autoload_pvn declared in embed.fnc
gv_autoload_sv declared in embed.fnc
gv_autoload4 declared at gv.h, line 320

=over 4

=item C<gv_AVadd>

=item C<gv_HVadd>

=item C<gv_IOadd>

=item C<gv_SVadd>
X<gv_AVadd>X<gv_HVadd>X<gv_IOadd>X<gv_SVadd>

Make sure there is a slot of the given type (AV, HV, IO, SV) in the GV C<gv>.

=over 3

 GV *       gv_AVadd(      GV *gv)
 GV *  Perl_gv_AVadd(pTHX_ GV *gv)
 GV *       gv_HVadd(      GV *gv)
 GV *  Perl_gv_HVadd(pTHX_ GV *gv)
 GV *       gv_IOadd(      GV *gv)
 GV *  Perl_gv_IOadd(pTHX_ GV *gv)
 GV *       gv_SVadd(      GV *gv)
 GV *  Perl_gv_SVadd(pTHX_ GV *gv)

=back

=back

=for hackers
gv_AVadd declared in embed.fnc; all in group documented at gv.h, line 336
gv_HVadd declared in embed.fnc
gv_IOadd declared in embed.fnc
gv_SVadd declared in embed.fnc

=over 4

=item C<gv_const_sv>
X<gv_const_sv>

If C<gv> is a typeglob whose subroutine entry is a constant sub eligible for
inlining, or C<gv> is a placeholder reference that would be promoted to such
a typeglob, then returns the value returned by the sub.  Otherwise, returns
C<NULL>.

=over 3

 SV *       gv_const_sv(      GV *gv)
 SV *  Perl_gv_const_sv(pTHX_ GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 181

=over 4

=item C<gv_efullname3>

=item C<gv_efullname4>

=item C<gv_fullname3>

=item C<gv_fullname4>
X<gv_efullname3>X<gv_efullname4>X<gv_fullname3>X<gv_fullname4>

Place the full package name of C<gv> into C<sv>.  The C<gv_e*> forms return
instead the effective package name (see L</HvENAME>).

If C<prefix> is non-NULL, it is considered to be a C language NUL-terminated
string, and the stored name will be prefaced with it.

The other difference between the functions is that the C<*4> forms have an
extra parameter, C<keepmain>.  If C<true> an initial C<main::> in the name is
kept; if C<false> it is stripped.  With the C<*3> forms, it is always kept.

=over 3

 void       gv_efullname3(      SV *sv, const GV *gv,
                                const char *prefix)
 void  Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv,
                                const char *prefix)
 void       gv_efullname4(      SV *sv, const GV *gv,
                                const char *prefix, bool keepmain)
 void  Perl_gv_efullname4(pTHX_ SV *sv, const GV *gv,
                                const char *prefix, bool keepmain)
 void       gv_fullname3 (      SV *sv, const GV *gv,
                                const char *prefix)
 void  Perl_gv_fullname3 (pTHX_ SV *sv, const GV *gv,
                                const char *prefix)
 void       gv_fullname4 (      SV *sv, const GV *gv,
                                const char *prefix, bool keepmain)
 void  Perl_gv_fullname4 (pTHX_ SV *sv, const GV *gv,
                                const char *prefix, bool keepmain)

=back

=back

=for hackers
gv_efullname3 declared in embed.fnc; all in group documented at gv.c, line 2740
gv_efullname4 declared in embed.fnc
gv_fullname3 declared in embed.fnc
gv_fullname4 declared in embed.fnc

=over 4

=item C<gv_fetchfile>

=item C<gv_fetchfile_flags>
X<gv_fetchfile>X<gv_fetchfile_flags>

These return the debugger glob for the file (compiled by Perl) whose name is
given by the C<name> parameter.

There are currently exactly two differences between these functions.

The C<name> parameter to C<gv_fetchfile> is a C string, meaning it is
C<NUL>-terminated; whereas the C<name> parameter to C<gv_fetchfile_flags> is a
Perl string, whose length (in bytes) is passed in via the C<namelen> parameter
This means the name may contain embedded C<NUL> characters.
C<namelen> doesn't exist in plain C<gv_fetchfile>).

The other difference is that C<gv_fetchfile_flags> has an extra C<flags>
parameter, which is currently completely ignored, but allows for possible
future extensions.

=over 3

 GV *       gv_fetchfile      (      const char *name)
 GV *  Perl_gv_fetchfile      (pTHX_ const char *name)
 GV *       gv_fetchfile_flags(      const char * const name,
                                     const STRLEN len,
                                     const U32 flags)
 GV *  Perl_gv_fetchfile_flags(pTHX_ const char * const name,
                                     const STRLEN len,
                                     const U32 flags)

=back

=back

=for hackers
gv_fetchfile declared in embed.fnc; all in group documented at gv.c, line 108
gv_fetchfile_flags declared in embed.fnc

=over 4

=item C<gv_fetchmeth>

=item C<gv_fetchmeth_autoload>

=item C<gv_fetchmeth_pv>

=item C<gv_fetchmeth_pv_autoload>

=item C<gv_fetchmeth_pvn>

=item C<gv_fetchmeth_pvn_autoload>

=item C<gv_fetchmeth_sv>

=item C<gv_fetchmeth_sv_autoload>
X<gv_fetchmeth>X<gv_fetchmeth_autoload>X<gv_fetchmeth_pv>
X<gv_fetchmeth_pv_autoload>X<gv_fetchmeth_pvn>X<gv_fetchmeth_pvn_autoload>
X<gv_fetchmeth_sv>X<gv_fetchmeth_sv_autoload>

These each look for a glob with name C<name>, containing a defined subroutine,
returning the GV of that glob if found, or C<NULL> if not.

You probably want to use the C<L</gv_fetchmethod>> family of functions
instead.

Searching is always done in the following order, with some steps skipped
depending on various criteria.  The first match found is used, ending the
search.  C<gv_fetchmeth_pv> and C<gv_fetchmeth_pv_autoload> lack a flags
parameter, so in the following, consider C<flags> to be zero for those two
functions.

=over

=item 1

C<stash> is searched first, unless C<stash> either is NULL or C<GV_SUPER> is
set in C<flags>.

=item 2

Stashes accessible via C<@ISA> are searched next.

Searching is conducted according to L<C<MRO> order|perlmroapi>.

=item 3

C<UNIVERSAL::> is searched unless C<GV_NOUNIVERSAL> is set.

=item 4

Autoloaded subroutines are then looked for, but only for the forms whose names
end in C<_autoload>, and when C<stash> is not NULL and C<GV_SUPER> is not set.

=back

The argument C<level> should be either 0 or -1.

=over

=item If -1

No method caching is done.

=item If 0

If C<GV_SUPER> is not set in C<flags>, the method found is cached in C<stash>.

If C<GV_SUPER> is set in C<flags>, the method is cached in the super
cache for C<stash>.

If the method is not found a negative cache entry is added.

Note that subroutines found in C<UNIVERSAL::> are not cached,
though this may change.

=back

The GV returned from these may be a method cache entry, which is not visible to
Perl code.  So when calling C<L</call_sv>>, you should not use the GV directly;
instead, you should use the method's CV, which can be obtained from the GV with
the C<GvCV> macro.  For an autoloaded subroutine without a stub, C<GvCV()> of
the result may be zero.

The only other significant value for C<flags> is C<SVf_UTF8>, indicating that
C<name> is to be treated as being encoded in UTF-8.  Since plain
C<gv_fetchmeth> and C<gv_fetchmeth_autoload> lack a C<flags> parameter, C<name>
is never UTF-8.

Otherwise, the functions behave identically, except as noted below.

In C<gv_fetchmeth_pv> and C<gv_fetchmeth_pv_autoload>, C<name> is a C language
NUL-terminated string.

In C<gv_fetchmeth>, C<gv_fetchmeth_pvn>, C<gv_fetchmeth_autoload>, and
C<gv_fetchmeth_pvn_autoload>, C<name> points to the first byte of the name, and
an additional parameter, C<len>, specifies its length in bytes.  Hence, the
name may contain embedded-NUL characters.

In C<gv_fetchmeth_sv> and C<gv_fetchmeth_sv_autoload>, C<*name> is an SV, and
the name is the PV extracted from that, using C<L</SvPV>>.  If the SV is marked
as being in UTF-8, the extracted PV will also be.  Including C<SVf_UTF8> in
C<flags> will force the name to be considered to be UTF-8 even if the SV is
not so marked.

=over 3

 GV *       gv_fetchmeth             (      NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level)
 GV *       gv_fetchmeth_autoload    (      NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level)
 GV *       gv_fetchmeth_pv          (      NOCHECK HV *stash,
                                            const char *name,
                                            I32 level, U32 flags)
 GV *  Perl_gv_fetchmeth_pv          (pTHX_ NOCHECK HV *stash,
                                            const char *name,
                                            I32 level, U32 flags)
 GV *       gv_fetchmeth_pv_autoload (      NOCHECK HV *stash,
                                            const char *name,
                                            I32 level, U32 flags)
 GV *  Perl_gv_fetchmeth_pv_autoload (pTHX_ NOCHECK HV *stash,
                                            const char *name,
                                            I32 level, U32 flags)
 GV *       gv_fetchmeth_pvn         (      NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level,
                                            U32 flags)
 GV *  Perl_gv_fetchmeth_pvn         (pTHX_ NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level,
                                            U32 flags)
 GV *       gv_fetchmeth_pvn_autoload(      NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level,
                                            U32 flags)
 GV *  Perl_gv_fetchmeth_pvn_autoload(pTHX_ NOCHECK HV *stash,
                                            const char *name,
                                            STRLEN len, I32 level,
                                            U32 flags)
 GV *       gv_fetchmeth_sv          (      NOCHECK HV *stash,
                                            SV *namesv, I32 level,
                                            U32 flags)
 GV *  Perl_gv_fetchmeth_sv          (pTHX_ NOCHECK HV *stash,
                                            SV *namesv, I32 level,
                                            U32 flags)
 GV *       gv_fetchmeth_sv_autoload (      NOCHECK HV *stash,
                                            SV *namesv, I32 level,
                                            U32 flags)
 GV *  Perl_gv_fetchmeth_sv_autoload (pTHX_ NOCHECK HV *stash,
                                            SV *namesv, I32 level,
                                            U32 flags)

=back

=back

=for hackers
gv_fetchmeth declared in embed.fnc; all in group documented at gv.c, line 725
gv_fetchmeth_autoload declared in embed.fnc
gv_fetchmeth_pv declared in embed.fnc
gv_fetchmeth_pv_autoload declared in embed.fnc
gv_fetchmeth_pvn declared in embed.fnc
gv_fetchmeth_pvn_autoload declared in embed.fnc
gv_fetchmeth_sv declared in embed.fnc
gv_fetchmeth_sv_autoload declared in embed.fnc

=over 4

=item C<gv_fetchmethod>

=item C<gv_fetchmethod_autoload>
X<gv_fetchmethod>X<gv_fetchmethod_autoload>

These each return the glob which contains the subroutine to call to invoke the
method on the C<stash>.  In fact in the presence of autoloading this may be the
glob for "AUTOLOAD".  In this case the corresponding variable C<$AUTOLOAD> is
already setup.

The third parameter of C<gv_fetchmethod_autoload> determines whether
AUTOLOAD lookup is performed if the given method is not present: non-zero
means yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD.
Calling C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload>
with a non-zero C<autoload> parameter.

These functions grant C<"SUPER"> token
as a prefix of the method name.  Note
that if you want to keep the returned glob for a long time, you need to
check for it being "AUTOLOAD", since at the later time the call may load a
different subroutine due to C<$AUTOLOAD> changing its value.  Use the glob
created as a side effect to do this.

These functions have the same side-effects as C<gv_fetchmeth> with
C<level==0>.  The warning against passing the GV returned by
C<gv_fetchmeth> to C<call_sv> applies equally to these functions.

=over 3

 GV *       gv_fetchmethod         (      NOCHECK HV *stash,
                                          const char *name)
 GV *  Perl_gv_fetchmethod         (pTHX_ NOCHECK HV *stash,
                                          const char *name)
 GV *       gv_fetchmethod_autoload(      NOCHECK HV *stash,
                                          const char *name,
                                          I32 autoload)
 GV *  Perl_gv_fetchmethod_autoload(pTHX_ NOCHECK HV *stash,
                                          const char *name,
                                          I32 autoload)

=back

=back

=for hackers
gv_fetchmethod declared in embed.fnc; all in group documented at gv.c, line 1098
gv_fetchmethod_autoload declared in embed.fnc

=over 4

=item C<gv_fetchpv>

=item C<gv_fetchpvn>

=item C<gv_fetchpvn_flags>

=item C<gv_fetchpvs>

=item C<gv_fetchsv>

=item C<gv_fetchsv_nomg>
X<gv_fetchpv>X<gv_fetchpvn>X<gv_fetchpvn_flags>X<gv_fetchpvs>X<gv_fetchsv>
X<gv_fetchsv_nomg>

These all return the GV of type C<sv_type> whose name is given by the inputs,
or NULL if no GV of that name and type could be found.  See L<perlguts/Stashes
and Globs>.

The only differences are how the input name is specified, and if 'get' magic is
normally used in getting that name.

Don't be fooled by the fact that only one form has C<flags> in its name.  They
all have a C<flags> parameter in fact, and all the flag bits have the same
meanings for all

If any of the flags C<GV_ADD>, C<GV_ADDMG>, C<GV_ADDWARN>, C<GV_ADDMULTI>, or
C<GV_NOINIT> is set, a GV is created if none already exists for the input name
and type.  However, C<GV_ADDMG> will only do the creation for magical GV's.
For all of these flags except C<GV_NOINIT>, C<L</gv_init_pvn>> is called after
the addition.  C<GV_ADDWARN> is used when the caller expects that adding won't
be necessary because the symbol should already exist; but if not, add it
anyway, with a warning that it was unexpectedly absent.  The C<GV_ADDMULTI>
flag means to pretend that the GV has been seen before (I<i.e.>, suppress "Used
once" warnings).

The flag C<GV_NOADD_NOINIT> causes C<L</gv_init_pvn>> not be to called if the
GV existed but isn't PVGV.

If the C<SVf_UTF8> bit is set, the name is treated as being encoded in UTF-8;
otherwise the name won't be considered to be UTF-8 in the C<pv>-named forms,
and the UTF-8ness of the underlying SVs will be used in the C<sv> forms.

If the flag C<GV_NOTQUAL> is set, the caller warrants that the input name is a
plain symbol name, not qualified with a package, otherwise the name is checked
for being a qualified one.

In C<gv_fetchpv>, C<nambeg> is a C string, NUL-terminated with no intermediate
NULs.

In C<gv_fetchpvs>, C<name> is a literal C string, hence is enclosed in
double quotes.

C<gv_fetchpvn> and C<gv_fetchpvn_flags> are identical.  In these, <nambeg> is
a Perl string whose byte length is given by C<full_len>, and may contain
embedded NULs.

In C<gv_fetchsv> and C<gv_fetchsv_nomg>, the name is extracted from the PV of
the input C<name> SV.  The only difference between these two forms is that
'get' magic is normally done on C<name> in C<gv_fetchsv>, and always skipped
with C<gv_fetchsv_nomg>.  Including C<GV_NO_SVGMAGIC> in the C<flags> parameter
to C<gv_fetchsv> makes it behave identically to C<gv_fetchsv_nomg>.

=over 3

 GV *       gv_fetchpv       (      const char *nambeg, I32 flags,
                                    const svtype sv_type)
 GV *  Perl_gv_fetchpv       (pTHX_ const char *nambeg, I32 flags,
                                    const svtype sv_type)
 GV *       gv_fetchpvn      (      const char * nambeg,
                                    STRLEN full_len, I32 flags,
                                    const svtype sv_type)
 GV *       gv_fetchpvn_flags(      const char *name, STRLEN len,
                                    I32 flags,
                                    const svtype sv_type)
 GV *  Perl_gv_fetchpvn_flags(pTHX_ const char *name, STRLEN len,
                                    I32 flags,
                                    const svtype sv_type)
 GV *       gv_fetchpvs      (      "name", I32 flags,
                                    const svtype sv_type)
 GV *       gv_fetchsv       (      SV *name, I32 flags,
                                    const svtype sv_type)
 GV *  Perl_gv_fetchsv       (pTHX_ SV *name, I32 flags,
                                    const svtype sv_type)
 GV *       gv_fetchsv_nomg  (      SV *name, I32 flags,
                                    const svtype sv_type)

=back

=back

=for hackers
gv_fetchpv declared in embed.fnc; all in group documented at gv.c, line 2532
gv_fetchpvn declared at handy.h, line 464
gv_fetchpvn_flags declared in embed.fnc
gv_fetchpvs declared at handy.h, line 463
gv_fetchsv declared in embed.fnc
gv_fetchsv_nomg declared at gv.h, line 305

=over 4

=item C<gv_fullname3*>

=item C<gv_fullname4*>

Described under C<L</gv_efullname3>>

=back

=over 4

=item C<gv_HVadd*>

Described under C<L</gv_AVadd>>

=back

=over 4

=item C<gv_init>

=item C<gv_init_pv>

=item C<gv_init_pvn>

=item C<gv_init_sv>
X<gv_init>X<gv_init_pv>X<gv_init_pvn>X<gv_init_sv>

These each convert a scalar into a typeglob.  This is an incoercible typeglob;
assigning a reference to it will assign to one of its slots, instead of
overwriting it as happens with typeglobs created by C<SvSetSV>.  Converting
any scalar that is C<SvOK()> may produce unpredictable results and is reserved
for perl's internal use.

C<gv> is the scalar to be converted.

C<stash> is the parent stash/package, if any.

In C<gv_init> and C<gv_init_pvn>, C<name> and C<len> give the name.  The name
must be unqualified; that is, it must not include the package name.  If C<gv>
is a stash element, it is the caller's responsibility to ensure that the name
passed to this function matches the name of the element.  If it does not match,
perl's internal bookkeeping will get out of sync. C<name> may contain embedded
NUL characters.

C<gv_init_pv> is identical to C<gv_init_pvn>, but takes a NUL-terminated string
for the name instead of separate char * and length parameters.

In C<gv_init_sv>, the name is given by C<sv>.

All but C<gv_init> take a C<flags> parameter.  Set C<flags> to include
C<SVf_UTF8> if C<name> is a UTF-8 string.  In C<gv_init_sv>, if C<SvUTF8(sv)>
is non-zero, name will be also be considered to be a UTF-8 string.  It's
unlikely to be a good idea to pass this particular flag to C<gv_init_sv>, as
that would potentially override the (presumaby known) state of C<sv>.

C<flags> can also take the C<GV_ADDMULTI> flag, which means to pretend that the
GV has been seen before (i.e., suppress "Used once" warnings).

C<gv_init> is the old form of C<gv_init_pvn>.  It does not work with UTF-8
strings, as it has no flags parameter.  Setting the C<multi> parameter to
non-zero has the same effect as setting the C<GV_ADDMULTI> flag in the other
forms.

=over 3

 void       gv_init    (      GV *gv, HV *stash, const char *name,
                              STRLEN len, int multi)
 void       gv_init_pv (      GV *gv, HV *stash, const char *name,
                              U32 flags)
 void  Perl_gv_init_pv (pTHX_ GV *gv, HV *stash, const char *name,
                              U32 flags)
 void       gv_init_pvn(      GV *gv, HV *stash, const char *name,
                              STRLEN len, U32 flags)
 void  Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name,
                              STRLEN len, U32 flags)
 void       gv_init_sv (      GV *gv, HV *stash, SV *namesv,
                              U32 flags)
 void  Perl_gv_init_sv (pTHX_ GV *gv, HV *stash, SV *namesv,
                              U32 flags)

=back

=back

=for hackers
gv_init declared in embed.fnc; all in group documented at gv.c, line 335
gv_init_pv declared in embed.fnc
gv_init_pvn declared in embed.fnc
gv_init_sv declared in embed.fnc

=over 4

=item C<gv_IOadd*>

Described under C<L</gv_AVadd>>

=back

=over 4

=item C<gv_name_set>
X<gv_name_set>

Set the name for GV C<gv> to C<name> which is C<len> bytes long.  Thus it may
contain embedded NUL characters.

If C<flags> contains C<SVf_UTF8>, the name is treated as being encoded in
UTF-8; otherwise not.

=over 3

 void       gv_name_set(      GV *gv, const char *name, U32 len,
                              U32 flags)
 void  Perl_gv_name_set(pTHX_ GV *gv, const char *name, U32 len,
                              U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at gv.c, line 4301

=over 4

=item C<gv_stashpv>

=item C<gv_stashpvn>

=item C<gv_stashpvs>

=item C<gv_stashsv>
X<gv_stashpv>X<gv_stashpvn>X<gv_stashpvs>X<gv_stashsv>

Note C<gv_stashsv> is strongly preferred for performance reasons.

These each return a pointer to the stash for a specified package.

In C<gv_stashsv>, the package is specified by C<sv>.

In C<gv_stashpvs>, the package is specified by the literal C string enclosed in
double quotes.

In the other forms, C<name> specifies the package.  In C<gv_stashpvn>,
C<namelen> gives the length of the name in bytes, so it may include embedded
NUL characters.  In C<gv_stashpv>, C<name> ends at the first NUL character.

C<flags> is passed to C<gv_fetchpvn_flags()>, so if set to C<GV_ADD> then the
package will be created if it does not already exist.  If the package does not
exist and C<flags> is 0 (or any other setting that does not create packages)
then C<NULL> is returned.

Flags may be one of:

 GV_ADD           Create and initialize the package if doesn't
                  already exist
 GV_NOADD_NOINIT  Don't create the package,
 GV_ADDMG         GV_ADD iff the GV is magical
 GV_NOINIT        GV_ADD, but don't initialize
 GV_NOEXPAND      Don't expand SvOK() entries to PVGV
 SVf_UTF8         The name is in UTF-8

The most important of which are probably C<GV_ADD> and C<SVf_UTF8>.

=over 3

 HV *       gv_stashpv (      const char *name, I32 flags)
 HV *  Perl_gv_stashpv (pTHX_ const char *name, I32 flags)
 HV *       gv_stashpvn(      const char *name, U32 namelen,
                              I32 flags)
 HV *  Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen,
                              I32 flags)
 HV*        gv_stashpvs(      "name", I32 create)
 HV *       gv_stashsv (      SV *sv, I32 flags)
 HV *  Perl_gv_stashsv (pTHX_ SV *sv, I32 flags)

=back

=back

=for hackers
gv_stashpv declared in embed.fnc; all in group documented at gv.c, line 1575
gv_stashpvn declared in embed.fnc
gv_stashpvs declared at handy.h, line 455
gv_stashsv declared in embed.fnc

=over 4

=item C<gv_SVadd*>

Described under C<L</gv_AVadd>>

=back

=over 4

=item C<GvAV>
X<GvAV>

Return the AV from the GV.

=over 3

 AV*  GvAV(GV* gv)

=back

=back

=for hackers
Declared and documented at gv.h, line 104

=over 4

=item C<GvCV>
X<GvCV>

Return the CV from the GV.

=over 3

 CV*  GvCV(GV* gv)

=back

=back

=for hackers
Declared and documented at gv.h, line 112

=over 4

=item C<GvHV>
X<GvHV>

Return the HV from the GV.

=over 3

 HV*  GvHV(GV* gv)

=back

=back

=for hackers
Declared and documented at gv.h, line 108

=over 4

=item C<GvREFCNT_inc>

=item C<GvREFCNT_inc_simple>

=item C<GvREFCNT_inc_simple_NN>
X<GvREFCNT_inc>X<GvREFCNT_inc_simple>X<GvREFCNT_inc_simple_NN>

These all increment the reference count of the given SV, which must be a GV.
They are useful when assigning the result into a typed pointer as they avoid
the need to cast the result to the appropriate type.

=over 3

 GV *  GvREFCNT_inc          (GV *gv)
 GV *  GvREFCNT_inc_simple   (GV *gv)
 GV *  GvREFCNT_inc_simple_NN(GV *gv)

=back

=back

=for hackers
GvREFCNT_inc declared at gv.h, line 29; all in group documented at gv.h, line 29
GvREFCNT_inc_simple declared at gv.h, line 30
GvREFCNT_inc_simple_NN declared at gv.h, line 31

=over 4

=item C<GvSV>
X<GvSV>

Return the SV from the GV.

Prior to Perl v5.9.3, this would add a scalar if none existed.  Nowadays, use
C<L</GvSVn>> for that, or compile perl with S<C<-DPERL_CREATE_GVSV>>.  See
L<perl5100delta>.

=over 3

 SV*  GvSV(GV* gv)

=back

=back

=for hackers
Declared and documented at gv.h, line 93

=over 4

=item C<GvSVn>
X<GvSVn>

Like C<L</GvSV>>, but creates an empty scalar if none already exists.

=over 3

 SV*  GvSVn(GV* gv)

=back

=back

=for hackers
Declared and documented at gv.h, line 101

=over 4

=item C<newGVgen>

=item C<newGVgen_flags>
X<newGVgen>X<newGVgen_flags>

Create a new, guaranteed to be unique, GV in the package given by the
NUL-terminated C language string C<pack>, and return a pointer to it.

For C<newGVgen> or if C<flags> in C<newGVgen_flags> is 0, C<pack> is to be
considered to be encoded in Latin-1.  The only other legal C<flags> value is
C<SVf_UTF8>, which indicates C<pack> is to be considered to be encoded in
UTF-8.

=over 3

 GV *       newGVgen      (      const char *pack)
 GV *       newGVgen_flags(      const char *pack, U32 flags)
 GV *  Perl_newGVgen_flags(pTHX_ const char *pack, U32 flags)

=back

=back

=for hackers
newGVgen declared in embed.fnc; all in group documented at gv.c, line 2866
newGVgen_flags declared in embed.fnc

=over 4

=item C<PL_curstash>
X<PL_curstash>

The stash for the package code will be compiled into.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 HV*  PL_curstash

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 140

=over 4

=item C<PL_defgv>
X<PL_defgv>

The GV representing C<*_>.  Useful for access to C<$_>.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 GV *  PL_defgv

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 122

=over 4

=item C<PL_defoutgv>
X<PL_defoutgv>

See C<L</setdefout>>.

=back

=for hackers
Declared and documented at pp_sys.c, line 1537

=over 4

=item C<PL_defstash>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 1281

=over 4

=item C<save_gp>
X<save_gp>

Saves the current GP of gv on the save stack to be restored on scope exit.

If C<empty> is true, replace the GP with a new GP.

If C<empty> is false, mark C<gv> with C<GVf_INTRO> so the next reference
assigned is localized, which is how S<C< local *foo = $someref; >> works.

=over 3

 void       save_gp(      GV *gv, I32 empty)
 void  Perl_save_gp(pTHX_ GV *gv, I32 empty)

=back

=back

=for hackers
Declared in embed.fnc; documented at scope.c, line 474

=over 4

=item C<setdefout>
X<setdefout>

Sets C<PL_defoutgv>, the default file handle for output, to the passed in
typeglob.  As C<PL_defoutgv> "owns" a reference on its typeglob, the reference
count of the passed in typeglob is increased by one, and the reference count
of the typeglob that C<PL_defoutgv> points to is decreased by one.

=over 3

 void       setdefout(      GV *gv)
 void  Perl_setdefout(pTHX_ GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_sys.c, line 1530

=head1 Hook manipulation


These functions provide convenient and thread-safe means of manipulating
hook variables.


=over 4

=item C<rcpv_copy>
X<rcpv_copy>

refcount increment a shared memory refcounted string, and when
the refcount goes to 0 free it using PerlMemShared_free().

It is the callers responsibility to ensure that the pv is the
result of a rcpv_new() call.

Returns the same pointer that was passed in.

    new = rcpv_copy(pv);

=over 3

 char *       rcpv_copy(      char * const pv)
 char *  Perl_rcpv_copy(pTHX_ char * const pv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 16407

=over 4

=item C<rcpv_free>
X<rcpv_free>

refcount decrement a shared memory refcounted string, and when
the refcount goes to 0 free it using perlmemshared_free().

it is the callers responsibility to ensure that the pv is the
result of a rcpv_new() call.

Always returns NULL so it can be used like this:

    thing = rcpv_free(thing);

=over 3

 char *       rcpv_free(      char * const pv)
 char *  Perl_rcpv_free(pTHX_ char * const pv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 16368

=over 4

=item C<rcpv_new>
X<rcpv_new>

Create a new shared memory refcounted string with the requested size, and
with the requested initialization and a refcount of 1. The actual space
allocated will be 1 byte more than requested and rcpv_new() will ensure that
the extra byte is a null regardless of any flags settings.

If the RCPVf_NO_COPY flag is set then the pv argument will be
ignored, otherwise the contents of the pv pointer will be copied into
the new buffer or if it is NULL the function will do nothing and return NULL.

If the RCPVf_USE_STRLEN flag is set then the len argument is ignored and
recomputed using C<strlen(pv)>. It is an error to combine RCPVf_USE_STRLEN
and RCPVf_NO_COPY at the same time.

Under DEBUGGING rcpv_new() will assert() if it is asked to create a 0 length
shared string unless the RCPVf_ALLOW_EMPTY flag is set.

The return value from the function is suitable for passing into rcpv_copy() and
rcpv_free(). To access the RCPV * from the returned value use the RCPVx() macro.
The 'len' member of the RCPV struct stores the allocated length (including the
extra byte), but the RCPV_LEN() macro returns the requested length (not
including the extra byte).

Note that rcpv_new() does NOT use a hash table or anything like that to
dedupe inputs given the same text content. Each call with a non-null pv
parameter will produce a distinct pointer with its own refcount regardless of
the input content.

=over 3

 char *       rcpv_new(      const char * const pv, STRLEN len,
                             U32 flags)
 char *  Perl_rcpv_new(pTHX_ const char * const pv, STRLEN len,
                             U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 16296

=over 4

=item C<wrap_op_checker>
X<wrap_op_checker>

Puts a C function into the chain of check functions for a specified op
type.  This is the preferred way to manipulate the L</PL_check> array.
C<opcode> specifies which type of op is to be affected.  C<new_checker>
is a pointer to the C function that is to be added to that opcode's
check chain, and C<old_checker_p> points to the storage location where a
pointer to the next function in the chain will be stored.  The value of
C<new_checker> is written into the L</PL_check> array, while the value
previously stored there is written to C<*old_checker_p>.

L</PL_check> is global to an entire process, and a module wishing to
hook op checking may find itself invoked more than once per process,
typically in different threads.  To handle that situation, this function
is idempotent.  The location C<*old_checker_p> must initially (once
per process) contain a null pointer.  A C variable of static duration
(declared at file scope, typically also marked C<static> to give
it internal linkage) will be implicitly initialised appropriately,
if it does not have an explicit initialiser.  This function will only
actually modify the check chain if it finds C<*old_checker_p> to be null.
This function is also thread safe on the small scale.  It uses appropriate
locking to avoid race conditions in accessing L</PL_check>.

When this function is called, the function referenced by C<new_checker>
must be ready to be called, except for C<*old_checker_p> being unfilled.
In a threading situation, C<new_checker> may be called immediately,
even before this function has returned.  C<*old_checker_p> will always
be appropriately set before C<new_checker> is called.  If C<new_checker>
decides not to do anything special with an op that it is given (which
is the usual case for most uses of op check hooking), it must chain the
check function referenced by C<*old_checker_p>.

Taken all together, XS code to hook an op checker should typically look
something like this:

    static Perl_check_t nxck_frob;
    static OP *myck_frob(pTHX_ OP *op) {
        ...
        op = nxck_frob(aTHX_ op);
        ...
        return op;
    }
    BOOT:
        wrap_op_checker(OP_FROB, myck_frob, &nxck_frob);

If you want to influence compilation of calls to a specific subroutine,
then use L</cv_set_call_checker_flags> rather than hooking checking of
all C<entersub> ops.

=over 3

 void       wrap_op_checker(      Optype opcode,
                                  Perl_check_t new_checker,
                                  Perl_check_t *old_checker_p)
 void  Perl_wrap_op_checker(pTHX_ Optype opcode,
                                  Perl_check_t new_checker,
                                  Perl_check_t *old_checker_p)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 16172

=head1 HV Handling
X<HV_ITERNEXT_WANTPLACEHOLDERS>X<HV_NAME_SETALL>X<HvNAMELEN_get>


A HV structure represents a Perl hash.  It consists mainly of an array
of pointers, each of which points to a linked list of HE structures.  The
array is indexed by the hash function of the key, so each linked list
represents all the hash entries with the same hash value.  Each HE contains
a pointer to the actual value, plus a pointer to a HEK structure which
holds the key and hash value.


=over 4

=item C<get_hv>
X<get_hv>

Returns the HV of the specified Perl hash.  C<flags> are passed to
C<gv_fetchpv>.  If C<GV_ADD> is set and the
Perl variable does not exist then it will be created.  If C<flags> is zero
(ignoring C<SVf_UTF8>) and the variable does not exist then C<NULL> is
returned.

NOTE: the C<perl_get_hv()> form is B<deprecated>.

=over 3

 HV *       get_hv(      const char *name, I32 flags)
 HV *  Perl_get_hv(pTHX_ const char *name, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 2950

=over 4

=item C<HE>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 844

=over 4

=item C<HEf_SVKEY>
X<HEf_SVKEY>

This flag, used in the length slot of hash entries and magic structures,
specifies the structure contains an C<SV*> pointer where a C<char*> pointer
is to be expected.  (For information only--not to be used).

=back

=for hackers
Declared and documented at hv.h, line 194

=over 4

=item C<HeHASH>
X<HeHASH>

Returns the computed hash stored in the hash entry.

=over 3

 U32  HeHASH(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 253

=over 4

=item C<HeKEY>
X<HeKEY>

Returns the actual pointer stored in the key slot of the hash entry.  The
pointer may be either C<char*> or C<SV*>, depending on the value of
C<HeKLEN()>.  Can be assigned to.  The C<HePV()> or C<HeSVKEY()> macros are
usually preferable for finding the value of a key.

=over 3

 void*  HeKEY(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 232

=over 4

=item C<HeKLEN>
X<HeKLEN>

If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry
holds an C<SV*> key.  Otherwise, holds the actual length of the key.  Can
be assigned to.  The C<HePV()> macro is usually preferable for finding key
lengths.

=over 3

 STRLEN  HeKLEN(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 238

=over 4

=item C<HePV>
X<HePV>

Returns the key slot of the hash entry as a C<char*> value, doing any
necessary dereferencing of possibly C<SV*> keys.  The length of the string
is placed in C<len> (this is a macro, so do I<not> use C<&len>).  If you do
not care about what the length of the key is, you may use the global
variable C<PL_na>, though this is rather less efficient than using a local
variable.  Remember though, that hash keys in perl are free to contain
embedded nulls, so using C<strlen()> or similar is not a good way to find
the length of hash keys.  This is very similar to the C<SvPV()> macro
described elsewhere in this document.  See also C<L</HeUTF8>>.

If you are using C<HePV> to get values to pass to C<newSVpvn()> to create a
new SV, you should consider using C<newSVhek(HeKEY_hek(he))> as it is more
efficient.

=over 3

 char*  HePV(HE* he, STRLEN len)

=back

=back

=for hackers
Declared and documented at hv.h, line 256

=over 4

=item C<HeSVKEY>
X<HeSVKEY>

Returns the key as an C<SV*>, or C<NULL> if the hash entry does not
contain an C<SV*> key.

=over 3

 SV*  HeSVKEY(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 278

=over 4

=item C<HeSVKEY_force>
X<HeSVKEY_force>

Returns the key as an C<SV*>.  Will create and return a temporary mortal
C<SV*> if the hash entry contains only a C<char*> key.

=over 3

 SV*  HeSVKEY_force(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 282

=over 4

=item C<HeSVKEY_set>
X<HeSVKEY_set>

Sets the key to a given C<SV*>, taking care to set the appropriate flags to
indicate the presence of an C<SV*> key, and returns the same
C<SV*>.

=over 3

 SV*  HeSVKEY_set(HE* he, SV* sv)

=back

=back

=for hackers
Declared and documented at hv.h, line 286

=over 4

=item C<HeUTF8>
X<HeUTF8>

Returns whether the C<char *> value returned by C<HePV> is encoded in UTF-8,
doing any necessary dereferencing of possibly C<SV*> keys.  The value returned
will be 0 or non-0, not necessarily 1 (or even a value with any low bits set),
so B<do not> blindly assign this to a C<bool> variable, as C<bool> may be a
typedef for C<char>.

=over 3

 U32  HeUTF8(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 271

=over 4

=item C<HeVAL>
X<HeVAL>

Returns the value slot (type C<SV*>)
stored in the hash entry.  Can be assigned
to.

  SV *foo= HeVAL(hv);
  HeVAL(hv)= sv;

=over 3

 SV*  HeVAL(HE* he)

=back

=back

=for hackers
Declared and documented at hv.h, line 244

=over 4

=item C<HV>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 32

=over 4

=item C<hv_assert>
X<hv_assert>

Check that a hash is in an internally consistent state.

=over 3

 void  Perl_hv_assert(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 4115

=over 4

=item C<hv_bucket_ratio>
X<hv_bucket_ratio>

NOTE: C<hv_bucket_ratio> is B<experimental> and may change or be
removed without notice.

If the hash is tied dispatches through to the SCALAR tied method,
otherwise if the hash contains no keys returns 0, otherwise returns
a mortal sv containing a string specifying the number of used buckets,
followed by a slash, followed by the number of available buckets.

This function is expensive, it must scan all of the buckets
to determine which are used, and the count is NOT cached.
In a large hash this could be a lot of buckets.

=over 3

 SV *       hv_bucket_ratio(      HV *hv)
 SV *  Perl_hv_bucket_ratio(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 1246

=over 4

=item C<hv_clear>
X<hv_clear>

Frees all the elements of a hash, leaving it empty.
The XS equivalent of C<%hash = ()>.  See also L</hv_undef>.

See L</av_clear> for a note about the hash possibly being invalid on
return.

=over 3

 void       hv_clear(      HV *hv)
 void  Perl_hv_clear(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2038

=over 4

=item C<hv_clear_placeholders>
X<hv_clear_placeholders>

Clears any placeholders from a hash.  If a restricted hash has any of its keys
marked as readonly and the key is subsequently deleted, the key is not actually
deleted but is marked by assigning it a value of C<&PL_sv_placeholder>.  This tags
it so it will be ignored by future operations such as iterating over the hash,
but will still allow the hash to have a value reassigned to the key at some
future point.  This function clears any such placeholder keys from the hash.
See C<L<Hash::Util::lock_keys()|Hash::Util/lock_keys>> for an example of its
use.

=over 3

 void       hv_clear_placeholders(      HV *hv)
 void  Perl_hv_clear_placeholders(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2110

=over 4

=item C<hv_copy_hints_hv>
X<hv_copy_hints_hv>

A specialised version of L</newHVhv> for copying C<%^H>.  C<ohv> must be
a pointer to a hash (which may have C<%^H> magic, but should be generally
non-magical), or C<NULL> (interpreted as an empty hash).  The content
of C<ohv> is copied to a new hash, which has the C<%^H>-specific magic
added to it.  A pointer to the new hash is returned.

=over 3

 HV *       hv_copy_hints_hv(      HV * const ohv)
 HV *  Perl_hv_copy_hints_hv(pTHX_ HV * const ohv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 1933

=over 4

=item C<hv_delete>

=item C<hv_deletes>

=item C<hv_delete_ent>
X<hv_delete>X<hv_delete_ent>X<hv_deletes>

These each delete a key/value pair in the hash.  The value's SV is removed from
the hash, made mortal, and returned to the caller.

In C<hv_deletes>, the key must be a C language string literal, enclosed in
double quotes.  It is never treated as being in UTF-8.  There is no
length_parameter.

In C<hv_delete>, the absolute value of C<klen> is the length of the key; hence
the key may contain embedded NUL characters.  If C<klen> is negative the key
is assumed to be in UTF-8-encoded Unicode.

In C<hv_delete_ent>, the key is the PV in C<keysv>, including its length and
UTF8ness.  C<hash> can be a valid precomputed hash value, or 0 to ask for it to
be computed.

In all three, the C<flags> value will normally be zero; if set to C<G_DISCARD>
then C<NULL> will be returned.  C<NULL> will also be returned if the key is not
found.

=over 3

 SV *       hv_delete    (      HV *hv, const char *key, I32 klen,
                                I32 flags)
 SV *  Perl_hv_delete    (pTHX_ HV *hv, const char *key, I32 klen,
                                I32 flags)
 SV *       hv_deletes   (      HV *hv, "key", U32 flags)
 SV *       hv_delete_ent(      HV *hv, SV *keysv, I32 flags,
                                U32 hash)
 SV *  Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags,
                                U32 hash)

=back

=back

=for hackers
hv_delete declared in embed.fnc; all in group documented at hv.c, line 1285
hv_deletes declared at hv.h, line 580
hv_delete_ent declared in embed.fnc

=over 4

=item C<hv_exists>

=item C<hv_existss>

=item C<hv_exists_ent>
X<hv_exists>X<hv_exists_ent>X<hv_existss>

These each return a boolean indicating whether the specified hash key exists.
They differ only in how the key is specified.

In C<hv_existss>, the key must be a C language string literal, enclosed in
double quotes.  It is never treated as being in UTF-8.  There is no
length_parameter.

In C<hv_exists>, the absolute value of C<klen> is the length of the key.  If
C<klen> is negative the key is assumed to be in UTF-8-encoded Unicode.
C<key> may contain embedded NUL characters.

In C<hv_exists_ent>, the key is specified by the SV C<keysv>; its UTF8ness is
the same as that SV.  There is an additional parameter, C<hash>, which can be a
valid precomputed hash value, or 0 to ask for it to be computed.

=over 3

 bool       hv_exists    (      HV *hv, const char *key, I32 klen)
 bool  Perl_hv_exists    (pTHX_ HV *hv, const char *key, I32 klen)
 bool       hv_existss   (      HV *hv, "key")
 bool       hv_exists_ent(      HV *hv, SV *keysv, U32 hash)
 bool  Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)

=back

=back

=for hackers
hv_exists declared in embed.fnc; all in group documented at hv.c, line 400
hv_existss declared at hv.h, line 572
hv_exists_ent declared in embed.fnc

=over 4

=item C<hv_fetch>

=item C<hv_fetchs>
X<hv_fetch>X<hv_fetchs>

These each return the SV which corresponds to the specified key in the hash.
They differ only in how the key is specified.

In C<hv_fetchs>, the key must be a C language string literal, enclosed in
double quotes.  It is never treated as being in UTF-8.  There is no
length_parameter.

In C<hv_fetch>, the absolute value of C<klen> is the length of the key.  If
C<klen> is negative the key is assumed to be in UTF-8-encoded Unicode.
C<key> may contain embedded NUL characters.

In both, if C<lval> is set, then the fetch will be part of a store.  This means
that if there is no value in the hash associated with the given key, then one
is created and a pointer to it is returned.  The C<SV*> it points to can be
assigned to.  But always check that the return value is non-null before
dereferencing it to an C<SV*>.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
information on how to use this function on tied hashes.

=over 3

 SV **       hv_fetch (      HV *hv, const char *key, I32 klen,
                             I32 lval)
 SV **  Perl_hv_fetch (pTHX_ HV *hv, const char *key, I32 klen,
                             I32 lval)
 SV**        hv_fetchs(      HV* hv, "key", I32 lval)

=back

=back

=for hackers
hv_fetch declared in embed.fnc; all in group documented at hv.c, line 419
hv_fetchs declared at hv.h, line 579

=over 4

=item C<hv_fetch_ent>
X<hv_fetch_ent>

Returns the hash entry which corresponds to the specified key in the hash.
C<hash> must be a valid precomputed hash number for the given C<key>, or 0
if you want the function to compute it.  IF C<lval> is set then the fetch
will be part of a store.  Make sure the return value is non-null before
accessing it.  The return value when C<hv> is a tied hash is a pointer to a
static location, so be sure to make a copy of the structure if you need to
store it somewhere.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
information on how to use this function on tied hashes.

=over 3

 HE *       hv_fetch_ent(      HV *hv, SV *keysv, I32 lval,
                               U32 hash)
 HE *  Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval,
                               U32 hash)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 448

=over 4

=item C<hv_fetchs*>

Described under C<L</hv_fetch>>

=back

=over 4

=item C<hv_iterinit>
X<hv_iterinit>

Prepares a starting point to traverse a hash table.  Returns the number of
keys in the hash, including placeholders (i.e. the same as C<HvTOTALKEYS(hv)>).
The return value is currently only meaningful for hashes without tie magic.

NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number of
hash buckets that happen to be in use.  If you still need that esoteric
value, you can get it through the macro C<HvFILL(hv)>.

=over 3

 I32       hv_iterinit(      HV *hv)
 I32  Perl_hv_iterinit(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2500

=over 4

=item C<hv_iterkey>
X<hv_iterkey>

Returns the key from the current position of the hash iterator.  See
C<L</hv_iterinit>>.

=over 3

 char *       hv_iterkey(      HE *entry, I32 *retlen)
 char *  Perl_hv_iterkey(pTHX_ HE *entry, I32 *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 3148

=over 4

=item C<hv_iterkeysv>
X<hv_iterkeysv>

Returns the key as an C<SV*> from the current position of the hash
iterator.  The return value will always be a mortal copy of the key.  Also
see C<L</hv_iterinit>>.

=over 3

 SV *       hv_iterkeysv(      HE *entry)
 SV *  Perl_hv_iterkeysv(pTHX_ HE *entry)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 3175

=over 4

=item C<hv_iternext>
X<hv_iternext>

Returns entries from a hash iterator.  See C<L</hv_iterinit>>.

You may call C<hv_delete> or C<hv_delete_ent> on the hash entry that the
iterator currently points to, without losing your place or invalidating your
iterator.  Note that in this case the current entry is deleted from the hash
with your iterator holding the last reference to it.  Your iterator is flagged
to free the entry on the next call to C<hv_iternext>, so you must not discard
your iterator immediately else the entry will leak - call C<hv_iternext> to
trigger the resource deallocation.

=over 3

 HE *       hv_iternext(      HV *hv)
 HE *  Perl_hv_iternext(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2935

=over 4

=item C<hv_iternext_flags>
X<hv_iternext_flags>

NOTE: C<hv_iternext_flags> is B<experimental> and may change or be
removed without notice.

Returns entries from a hash iterator.  See C<L</hv_iterinit>> and
C<L</hv_iternext>>.
The C<flags> value will normally be zero; if C<HV_ITERNEXT_WANTPLACEHOLDERS> is
set the placeholders keys (for restricted hashes) will be returned in addition
to normal keys.  By default placeholders are automatically skipped over.
Currently a placeholder is implemented with a value that is
C<&PL_sv_placeholder>.  Note that the implementation of placeholders and
restricted hashes may change, and the implementation currently is
insufficiently abstracted for any change to be tidy.

=over 3

 HE *       hv_iternext_flags(      HV *hv, I32 flags)
 HE *  Perl_hv_iternext_flags(pTHX_ HV *hv, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2947

=over 4

=item C<hv_iternextsv>
X<hv_iternextsv>

Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one
operation.

=over 3

 SV *       hv_iternextsv(      HV *hv, char **key, I32 *retlen)
 SV *  Perl_hv_iternextsv(pTHX_ HV *hv, char **key, I32 *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 3220

=over 4

=item C<hv_iterval>
X<hv_iterval>

Returns the value from the current position of the hash iterator.  See
C<L</hv_iterkey>>.

=over 3

 SV *       hv_iterval(      HV *hv, HE *entry)
 SV *  Perl_hv_iterval(pTHX_ HV *hv, HE *entry)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 3193

=over 4

=item C<hv_ksplit>
X<hv_ksplit>

Attempt to grow the hash C<hv> so it has at least C<newmax> buckets available.
Perl chooses the actual number for its convenience.

This is the same as doing the following in Perl code:

 keys %hv = newmax;

=over 3

 void       hv_ksplit(      HV *hv, IV newmax)
 void  Perl_hv_ksplit(pTHX_ HV *hv, IV newmax)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 1745

=over 4

=item C<hv_magic>
X<hv_magic>

Adds magic to a hash.  See C<L</sv_magic>>.

=over 3

 void       hv_magic(      HV *hv, GV *gv, int how)
 void  Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 3245

=over 4

=item C<hv_name_set>

=item C<hv_name_sets>
X<hv_name_set>X<hv_name_sets>

These each set the name of stash C<hv> to the specified name.

They differ only in how the name is specified.

In C<hv_name_sets>, the name is a literal C string, enclosed in double quotes.

In C<hv_name_set>, C<name> points to the first byte of the name, and an
additional parameter, C<len>, specifies its length in bytes.  Hence, the name
may contain embedded-NUL characters.

If C<SVf_UTF8> is set in C<flags>, the name is treated as being in UTF-8;
otherwise not.

If C<HV_NAME_SETALL> is set in C<flags>, both the name and the effective name
are set.

=over 3

 void       hv_name_set (      HV *hv, const char *name, U32 len,
                               U32 flags)
 void  Perl_hv_name_set (pTHX_ HV *hv, const char *name, U32 len,
                               U32 flags)
 void       hv_name_sets(      HV *hv, "name", U32 flags)

=back

=back

=for hackers
hv_name_set declared in embed.fnc; all in group documented at hv.c, line 2646
hv_name_sets declared at hv.h, line 581

=over 4

=item C<hv_scalar>
X<hv_scalar>

Evaluates the hash in scalar context and returns the result.

When the hash is tied dispatches through to the SCALAR method,
otherwise returns a mortal SV containing the number of keys
in the hash.

Note, prior to 5.25 this function returned what is now
returned by the hv_bucket_ratio() function.

=over 3

 SV *       hv_scalar(      HV *hv)
 SV *  Perl_hv_scalar(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 1129

=over 4

=item C<hv_store>

=item C<hv_stores>
X<hv_store>X<hv_stores>

These each store SV C<val> with the specified key in hash C<hv>, returning NULL
if the operation failed or if the value did not need to be actually stored
within the hash (as in the case of tied hashes).  Otherwise it can be
dereferenced to get the original C<SV*>.

They differ only in how the hash key is specified.

In C<hv_stores>, the key must be a C language string literal, enclosed in
double quotes.  It is never treated as being in UTF-8.  There is no
length_parameter.

In C<hv_store>, C<key> is either NULL or points to the first byte of the string
specifying the key, and its length in bytes is given by the absolute value of
an additional parameter, C<klen>.  A NULL key indicates the key is to be
treated as C<undef>, and C<klen> is ignored; otherwise the key string may
contain embedded-NUL bytes.  If C<klen> is negative, the string is treated as
being encoded in UTF-8; otherwise not.

C<hv_store> has another extra parameter, C<hash>, a precomputed hash of the key
string, or zero if it has not been precomputed.  This parameter is omitted from
C<hv_stores>, as it is computed automatically at compile time.

If C<hv> is NULL, NULL is returned and no action is taken.

If C<val> is NULL, it is treated as being C<undef>; otherwise the caller is
responsible for suitably incrementing the reference count of C<val> before
the call, and decrementing it if the function returned C<NULL>.  Effectively
a successful C<hv_store> takes ownership of one reference to C<val>.  This is
usually what you want; a newly created SV has a reference count of one, so
if all your code does is create SVs and store them in a hash, C<hv_store>
will own the only reference to the new SV, and your code doesn't need to do
anything further to tidy up.

C<hv_store> is not implemented as a call to L</C<hv_store_ent>>, and does not
create a temporary SV for the key, so if your key data is not already in SV
form, then use C<hv_store> in preference to C<hv_store_ent>.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
information on how to use this function on tied hashes.

=over 3

 SV **       hv_store (      HV *hv, const char *key, I32 klen,
                             SV *val, U32 hash)
 SV **  Perl_hv_store (pTHX_ HV *hv, const char *key, I32 klen,
                             SV *val, U32 hash)
 SV **       hv_stores(      HV *hv, "key", SV *val)

=back

=back

=for hackers
hv_store declared in embed.fnc; all in group documented at hv.c, line 330
hv_stores declared in embed.fnc

=over 4

=item C<hv_store_ent>
X<hv_store_ent>

Stores C<val> in a hash.  The hash key is specified as C<key>.  The C<hash>
parameter is the precomputed hash value; if it is zero, then Perl will
compute it.  The return value is the new hash entry so created.  It will be
C<NULL> if the operation failed or if the value did not need to be actually
stored within the hash (as in the case of tied hashes).  Otherwise the
contents of the return value can be accessed using the C<He?> macros
described here.  Note that the caller is responsible for suitably
incrementing the reference count of C<val> before the call, and
decrementing it if the function returned NULL.  Effectively a successful
C<hv_store_ent> takes ownership of one reference to C<val>.  This is
usually what you want; a newly created SV has a reference count of one, so
if all your code does is create SVs and store them in a hash, C<hv_store>
will own the only reference to the new SV, and your code doesn't need to do
anything further to tidy up.  Note that C<hv_store_ent> only reads the C<key>;
unlike C<val> it does not take ownership of it, so maintaining the correct
reference count on C<key> is entirely the caller's responsibility.  The reason
it does not take ownership is that C<key> is not used after this function
returns, and so can be freed immediately.  C<hv_store>
is not implemented as a call to C<hv_store_ent>, and does not create a temporary
SV for the key, so if your key data is not already in SV form, then use
C<hv_store> in preference to C<hv_store_ent>.

See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
information on how to use this function on tied hashes.

=over 3

 HE *       hv_store_ent(      HV *hv, SV *key, SV *val, U32 hash)
 HE *  Perl_hv_store_ent(pTHX_ HV *hv, SV *key, SV *val, U32 hash)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 373

=over 4

=item C<hv_stores*>

Described under C<L</hv_store>>

=back

=over 4

=item C<hv_undef>
X<hv_undef>

Undefines the hash.  The XS equivalent of C<undef(%hash)>.

As well as freeing all the elements of the hash (like C<hv_clear()>), this
also frees any auxiliary data and storage associated with the hash.

See L</av_clear> for a note about the hash possibly being invalid on
return.

=over 3

 void  hv_undef(HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 2266

=over 4

=item C<HvENAME>
X<HvENAME>

Returns the effective name of a stash, or NULL if there is none.  The
effective name represents a location in the symbol table where this stash
resides.  It is updated automatically when packages are aliased or deleted.
A stash that is no longer in the symbol table has no effective name.  This
name is preferable to C<HvNAME> for use in MRO linearisations and isa
caches.

=over 3

 char*  HvENAME(HV* stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 218

=over 4

=item C<HvENAMELEN>
X<HvENAMELEN>

Returns the length of the stash's effective name.

=over 3

 STRLEN  HvENAMELEN(HV *stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 226

=over 4

=item C<HvENAMEUTF8>
X<HvENAMEUTF8>

Returns true if the effective name is in UTF-8 encoding.

=over 3

 unsigned char  HvENAMEUTF8(HV *stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 229

=over 4

=item C<HvFILL>
X<HvFILL>

Returns the number of hash buckets that happen to be in use.

As of perl 5.25 this function is used only for debugging
purposes, and the number of used hash buckets is not
in any way cached, thus this function can be costly
to execute as it must iterate over all the buckets in the
hash.

=over 3

 STRLEN  HvFILL(HV *const hv)

=back

=back

=for hackers
Declared and documented at hv.h, line 306

=over 4

=item C<HvHasAUX>
X<HvHasAUX>

Returns true if the HV has a C<struct xpvhv_aux> extension. Use this to check
whether it is valid to call C<HvAUX()>.

=over 3

 bool  HvHasAUX(HV *const hv)

=back

=back

=for hackers
Declared and documented at hv.h, line 325

=over 4

=item C<HvNAME>
X<HvNAME>

Returns the package name of a stash, or C<NULL> if C<stash> isn't a stash.
See C<L</SvSTASH>>, C<L</CvSTASH>>.

=over 3

 char*  HvNAME(HV* stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 204

=over 4

=item C<HvNAMELEN>
X<HvNAMELEN>

Returns the length of the stash's name.

Disfavored forms of HvNAME and HvNAMELEN; suppress mention of them

=over 3

 STRLEN  HvNAMELEN(HV *stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 208

=over 4

=item C<HvNAMEUTF8>
X<HvNAMEUTF8>

Returns true if the name is in UTF-8 encoding.

=over 3

 unsigned char  HvNAMEUTF8(HV *stash)

=back

=back

=for hackers
Declared and documented at hv.h, line 215

=over 4

=item C<HvREFCNT_inc>

=item C<HvREFCNT_inc_simple>

=item C<HvREFCNT_inc_simple_NN>
X<HvREFCNT_inc>X<HvREFCNT_inc_simple>X<HvREFCNT_inc_simple_NN>

These all increment the reference count of the given SV, which must be a HV.
They are useful when assigning the result into a typed pointer as they avoid
the need to cast the result to the appropriate type.

=over 3

 HV *  HvREFCNT_inc          (HV *hv)
 HV *  HvREFCNT_inc_simple   (HV *hv)
 HV *  HvREFCNT_inc_simple_NN(HV *hv)

=back

=back

=for hackers
HvREFCNT_inc declared at hv.h, line 178; all in group documented at hv.h, line 178
HvREFCNT_inc_simple declared at hv.h, line 179
HvREFCNT_inc_simple_NN declared at hv.h, line 180

=over 4

=item C<newHV>
X<newHV>

Creates a new HV.  The reference count is set to 1.

=over 3

 HV *       newHV()
 HV *  Perl_newHV(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.h, line 727

=over 4

=item C<newHVhv>
X<newHVhv>

The content of C<ohv> is copied to a new hash.  A pointer to the new hash is
returned.

=over 3

 HV *       newHVhv(      HV *hv)
 HV *  Perl_newHVhv(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at hv.c, line 1828

=over 4

=item C<Nullhv>
X<Nullhv>

C<B<DEPRECATED!>>  It is planned to remove C<Nullhv>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Null HV pointer.

(deprecated - use C<(HV *)NULL> instead)

=back

=for hackers
Declared and documented at hv.h, line 199

=over 4

=item C<PERL_HASH>

Described in L<perlguts>.

=over 3

 void  PERL_HASH(U32 hash, char *key, STRLEN klen)

=back

=back

=for hackers
Documented at pod/perlguts.pod, line 882

=over 4

=item C<PL_modglobal>
X<PL_modglobal>

C<PL_modglobal> is a general purpose, interpreter global HV for use by
extensions that need to keep information on a per-interpreter basis.
In a pinch, it can also be used as a symbol table for extensions
to share data among each other.  It is a good idea to use keys
prefixed by the package name of the extension that owns the data.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 HV*  PL_modglobal

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 654

=head1 Input/Output

=over 4

=item C<do_close>
X<do_close>

Close an I/O stream.  This implements Perl L<perlfunc/C<close>>.

C<gv> is the glob associated with the stream.

C<is_explict> is C<true> if this is an explicit close of the stream; C<false>
if it is part of another operation, such as closing a pipe (which involves
implicitly closing both ends).

Returns C<true> if successful; otherwise returns C<false> and sets C<errno> to
indicate the cause.

=over 3

 bool       do_close(      GV *gv, bool is_explicit)
 bool  Perl_do_close(pTHX_ GV *gv, bool is_explicit)

=back

=back

=for hackers
Declared in embed.fnc; documented at doio.c, line 1847

=over 4

=item C<IoDIRP>

=item C<IOf_FLUSH>

=item C<IOf_UNTAINT>

=item C<IoFLAGS>

=item C<IoIFP>

=item C<IoOFP>

=item C<IoTYPE>

Described in L<perlguts>.

=over 3

 DIR *     IoDIRP (IO *io)
 U8        IoFLAGS(IO *io)
 PerlIO *  IoIFP  (IO *io)
 PerlIO *  IoOFP  (IO *io)
 char      IoTYPE (IO *io)

=back

=back

=for hackers
IoDIRP all in group documented at pod/perlguts.pod, line 1391
IOf_FLUSH 
IOf_UNTAINT 
IoFLAGS 
IoIFP 
IoOFP 
IoTYPE 

=over 4

=item C<my_chsize>
X<my_chsize>

The C library L<chsize(3)> if available, or a Perl implementation of it.

=over 3

 I32       my_chsize(      int fd, Off_t length)
 I32  Perl_my_chsize(pTHX_ int fd, Off_t length)

=back

=back

=for hackers
Declared in embed.fnc; documented at doio.c, line 2126

=over 4

=item C<my_dirfd>
X<my_dirfd>

The C library C<L<dirfd(3)>> if available, or a Perl implementation of it, or die
if not easily emulatable.

=over 3

 int       my_dirfd(DIR *dir)
 int  Perl_my_dirfd(DIR *dir)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 5814

=over 4

=item C<my_pclose>
X<my_pclose>

A wrapper for the C library L<pclose(3)>.  Don't use the latter, as the Perl
version knows things that interact with the rest of the perl interpreter.

=over 3

 I32       my_pclose(      PerlIO *ptr)
 I32  Perl_my_pclose(pTHX_ PerlIO *ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 3117

=over 4

=item C<my_popen>
X<my_popen>

A wrapper for the C library L<popen(3)>.  Don't use the latter, as the Perl
version knows things that interact with the rest of the perl interpreter.

=over 3

 PerlIO *       my_popen(      const char *cmd, const char *mode)
 PerlIO *  Perl_my_popen(pTHX_ const char *cmd, const char *mode)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2650

=over 4

=item C<newIO>
X<newIO>

Create a new IO, setting the reference count to 1.

=over 3

 IO *       newIO()
 IO *  Perl_newIO(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.h, line 2643

=over 4

=item C<PERL_FLUSHALL_FOR_CHILD>
X<PERL_FLUSHALL_FOR_CHILD>

This defines a way to flush all output buffers.  This may be a
performance issue, so we allow people to disable it.  Also, if
we are using stdio, there are broken implementations of fflush(NULL)
out there, Solaris being the most prominent.

=over 3

 void  PERL_FLUSHALL_FOR_CHILD

=back

=back

=for hackers
Declared and documented at perl.h, line 4046

=over 4

=item C<PerlIO_apply_layers>

=item C<PerlIO_binmode>

=item C<PerlIO_canset_cnt>

=item C<PerlIO_clearerr>

=item C<PerlIO_close>

=item C<PerlIO_debug>

=item C<PerlIO_eof>

=item C<PerlIO_error>

=item C<PerlIO_exportFILE>

=item C<PerlIO_fast_gets>

=item C<PerlIO_fdopen>

=item C<PerlIO_fileno>

=item C<PerlIO_fill>

=item C<PerlIO_findFILE>

=item C<PerlIO_flush>

=item C<PerlIO_get_base>

=item C<PerlIO_get_bufsiz>

=item C<PerlIO_get_cnt>

=item C<PerlIO_get_ptr>

=item C<PerlIO_getc>

=item C<PerlIO_getpos>

=item C<PerlIO_has_base>

=item C<PerlIO_has_cntptr>

=item C<PerlIO_importFILE>

=item C<PerlIO_open>

=item C<PerlIO_printf>

=item C<PerlIO_putc>

=item C<PerlIO_puts>

=item C<PerlIO_read>

=item C<PerlIO_releaseFILE>

=item C<PerlIO_reopen>

=item C<PerlIO_rewind>

=item C<PerlIO_seek>

=item C<PerlIO_set_cnt>

=item C<PerlIO_set_ptrcnt>

=item C<PerlIO_setlinebuf>

=item C<PerlIO_setpos>

=item C<PerlIO_stderr>

=item C<PerlIO_stdin>

=item C<PerlIO_stdout>

=item C<PerlIO_stdoutf>

=item C<PerlIO_tell>

=item C<PerlIO_ungetc>

=item C<PerlIO_unread>

=item C<PerlIO_vprintf>

=item C<PerlIO_write>
X<PerlIO_fill>X<PerlIO_unread>

Described in L<perlapio>.

=over 3

 int             PerlIO_apply_layers(pTHX_ PerlIO *f,
                                           const char *mode,
                                           const char *layers)
 int             PerlIO_binmode     (pTHX_ PerlIO *f, int ptype,
                                           int imode,
                                           const char *layers)
 int             PerlIO_canset_cnt  (      PerlIO *f)
 void            PerlIO_clearerr    (      PerlIO *f)
 void       Perl_PerlIO_clearerr    (pTHX_ PerlIO *f)
 int             PerlIO_close       (      PerlIO *f)
 int        Perl_PerlIO_close       (pTHX_ PerlIO *f)
 void            PerlIO_debug       (      const char *fmt, ...)
 int             PerlIO_eof         (      PerlIO *f)
 int        Perl_PerlIO_eof         (pTHX_ PerlIO *f)
 int             PerlIO_error       (      PerlIO *f)
 int        Perl_PerlIO_error       (pTHX_ PerlIO *f)
 FILE *          PerlIO_exportFILE  (      PerlIO *f,
                                           const char *mode)
 int             PerlIO_fast_gets   (      PerlIO *f)
 PerlIO *        PerlIO_fdopen      (      int fd,
                                           const char *mode)
 int             PerlIO_fileno      (      PerlIO *f)
 int        Perl_PerlIO_fileno      (pTHX_ PerlIO *f)
 int             PerlIO_fill        (      PerlIO *f)
 int        Perl_PerlIO_fill        (pTHX_ PerlIO *f)
 FILE *          PerlIO_findFILE    (      PerlIO *f)
 int             PerlIO_flush       (      PerlIO *f)
 int        Perl_PerlIO_flush       (pTHX_ PerlIO *f)
 STDCHAR *       PerlIO_get_base    (      PerlIO *f)
 STDCHAR *  Perl_PerlIO_get_base    (pTHX_ PerlIO *f)
 SSize_t         PerlIO_get_bufsiz  (      PerlIO *f)
 SSize_t    Perl_PerlIO_get_bufsiz  (pTHX_ PerlIO *f)
 SSize_t         PerlIO_get_cnt     (      PerlIO *f)
 SSize_t    Perl_PerlIO_get_cnt     (pTHX_ PerlIO *f)
 STDCHAR *       PerlIO_get_ptr     (      PerlIO *f)
 STDCHAR *  Perl_PerlIO_get_ptr     (pTHX_ PerlIO *f)
 int             PerlIO_getc        (      PerlIO *d)
 int             PerlIO_getpos      (      PerlIO *f, SV *save)
 int             PerlIO_has_base    (      PerlIO *f)
 int             PerlIO_has_cntptr  (      PerlIO *f)
 PerlIO *        PerlIO_importFILE  (      FILE *stdio,
                                           const char *mode)
 PerlIO *        PerlIO_open        (      const char *path,
                                           const char *mode)
 int             PerlIO_printf      (      PerlIO *f,
                                           const char *fmt, ...)
 int             PerlIO_putc        (      PerlIO *f, int ch)
 int             PerlIO_puts        (      PerlIO *f,
                                           const char *string)
 SSize_t         PerlIO_read        (      PerlIO *f, void *vbuf,
                                           Size_t count)
 SSize_t    Perl_PerlIO_read        (pTHX_ PerlIO *f, void *vbuf,
                                           Size_t count)
 void            PerlIO_releaseFILE (      PerlIO *f, FILE *stdio)
 PerlIO *        PerlIO_reopen      (      const char *path,
                                           const char *mode,
                                           PerlIO *old)
 void            PerlIO_rewind      (      PerlIO *f)
 int             PerlIO_seek        (      PerlIO *f,
                                           Off_t offset,
                                           int whence)
 int        Perl_PerlIO_seek        (pTHX_ PerlIO *f,
                                           Off_t offset,
                                           int whence)
 void            PerlIO_set_cnt     (      PerlIO *f, SSize_t cnt)
 void       Perl_PerlIO_set_cnt     (pTHX_ PerlIO *f, SSize_t cnt)
 void            PerlIO_set_ptrcnt  (      PerlIO *f,
                                           STDCHAR *ptr,
                                           SSize_t cnt)
 void       Perl_PerlIO_set_ptrcnt  (pTHX_ PerlIO *f,
                                           STDCHAR *ptr,
                                           SSize_t cnt)
 void            PerlIO_setlinebuf  (      PerlIO *f)
 void       Perl_PerlIO_setlinebuf  (pTHX_ PerlIO *f)
 int             PerlIO_setpos      (      PerlIO *f, SV *saved)
 PerlIO *        PerlIO_stderr      ()
 PerlIO *   Perl_PerlIO_stderr      (pTHX)
 PerlIO *        PerlIO_stdin       ()
 PerlIO *   Perl_PerlIO_stdin       (pTHX)
 PerlIO *        PerlIO_stdout      ()
 PerlIO *   Perl_PerlIO_stdout      (pTHX)
 int             PerlIO_stdoutf     (      const char *fmt, ...)
 Off_t           PerlIO_tell        (      PerlIO *f)
 Off_t      Perl_PerlIO_tell        (pTHX_ PerlIO *f)
 int             PerlIO_ungetc      (      PerlIO *f, int ch)
 SSize_t         PerlIO_unread      (      PerlIO *f,
                                           const void *vbuf,
                                           Size_t count)
 SSize_t    Perl_PerlIO_unread      (pTHX_ PerlIO *f,
                                           const void *vbuf,
                                           Size_t count)
 int             PerlIO_vprintf     (      PerlIO *f,
                                           const char *fmt,
                                           va_list args)
 SSize_t         PerlIO_write       (      PerlIO *f,
                                           const void *vbuf,
                                           Size_t count)
 SSize_t    Perl_PerlIO_write       (pTHX_ PerlIO *f,
                                           const void *vbuf,
                                           Size_t count)

=back

=back

=for hackers
PerlIO_apply_layers all in group documented at pod/perlapio.pod, line 75
PerlIO_binmode declared at pod/perlapio.pod, line 76
PerlIO_canset_cnt declared at pod/perlapio.pod, line 77
PerlIO_clearerr declared in embed.fnc
PerlIO_close declared in embed.fnc
PerlIO_debug declared at pod/perlapio.pod, line 80
PerlIO_eof declared in embed.fnc
PerlIO_error declared in embed.fnc
PerlIO_exportFILE declared at pod/perlapio.pod, line 83
PerlIO_fast_gets declared at pod/perlapio.pod, line 84
PerlIO_fdopen declared at pod/perlapio.pod, line 85
PerlIO_fileno declared in embed.fnc
PerlIO_fill declared in embed.fnc
PerlIO_findFILE declared at pod/perlapio.pod, line 88
PerlIO_flush declared in embed.fnc
PerlIO_get_base declared in embed.fnc
PerlIO_get_bufsiz declared in embed.fnc
PerlIO_get_cnt declared in embed.fnc
PerlIO_get_ptr declared in embed.fnc
PerlIO_getc declared at pod/perlapio.pod, line 94
PerlIO_getpos declared at pod/perlapio.pod, line 95
PerlIO_has_base declared at pod/perlapio.pod, line 96
PerlIO_has_cntptr declared at pod/perlapio.pod, line 97
PerlIO_importFILE declared at pod/perlapio.pod, line 98
PerlIO_open declared at pod/perlapio.pod, line 99
PerlIO_printf declared at pod/perlapio.pod, line 100
PerlIO_putc declared at pod/perlapio.pod, line 101
PerlIO_puts declared at pod/perlapio.pod, line 102
PerlIO_read declared in embed.fnc
PerlIO_releaseFILE declared at pod/perlapio.pod, line 104
PerlIO_reopen declared at pod/perlapio.pod, line 105
PerlIO_rewind declared at pod/perlapio.pod, line 106
PerlIO_seek declared in embed.fnc
PerlIO_set_cnt declared in embed.fnc
PerlIO_set_ptrcnt declared in embed.fnc
PerlIO_setlinebuf declared in embed.fnc
PerlIO_setpos declared at pod/perlapio.pod, line 111
PerlIO_stderr declared in embed.fnc
PerlIO_stdin declared in embed.fnc
PerlIO_stdout declared in embed.fnc
PerlIO_stdoutf declared at pod/perlapio.pod, line 115
PerlIO_tell declared in embed.fnc
PerlIO_ungetc declared at pod/perlapio.pod, line 117
PerlIO_unread declared in embed.fnc
PerlIO_vprintf declared at pod/perlapio.pod, line 119
PerlIO_write declared in embed.fnc

=over 4

=item C<PERLIO_F_APPEND>

=item C<PERLIO_F_CANREAD>

=item C<PERLIO_F_CANWRITE>

=item C<PERLIO_F_CRLF>

=item C<PERLIO_F_EOF>

=item C<PERLIO_F_ERROR>

=item C<PERLIO_F_FASTGETS>

=item C<PERLIO_F_LINEBUF>

=item C<PERLIO_F_OPEN>

=item C<PERLIO_F_RDBUF>

=item C<PERLIO_F_TEMP>

=item C<PERLIO_F_TRUNCATE>

=item C<PERLIO_F_UNBUF>

=item C<PERLIO_F_UTF8>

=item C<PERLIO_F_WRBUF>

Described in L<perliol>.

=back

=for hackers
PERLIO_F_APPEND all in group documented at pod/perliol.pod, line 377
PERLIO_F_CANREAD 
PERLIO_F_CANWRITE 
PERLIO_F_CRLF 
PERLIO_F_EOF 
PERLIO_F_ERROR 
PERLIO_F_FASTGETS 
PERLIO_F_LINEBUF 
PERLIO_F_OPEN 
PERLIO_F_RDBUF 
PERLIO_F_TEMP 
PERLIO_F_TRUNCATE 
PERLIO_F_UNBUF 
PERLIO_F_UTF8 
PERLIO_F_WRBUF 

=over 4

=item C<PerlIO_fast_gets*>

=item C<PerlIO_fdopen*>

=item C<PerlIO_fileno*>

=item C<PerlIO_fill*>

=item C<PerlIO_findFILE*>

=item C<PerlIO_flush*>

Described in L<perlapio>.

=back

=over 4

=item C<PERLIO_FUNCS_CAST>
X<PERLIO_FUNCS_CAST>

Cast the pointer C<func> to be of type S<C<PerlIO_funcs *>>.

=over 3

 PerlIO_funcs *  PERLIO_FUNCS_CAST(PerlIO * func)

=back

=back

=for hackers
Declared and documented at perlio.h, line 72

=over 4

=item C<PERLIO_FUNCS_DECL>
X<PERLIO_FUNCS_DECL>

Declare C<ftab> to be a PerlIO function table, that is, of type
C<PerlIO_funcs>.

=over 3

   PERLIO_FUNCS_DECL(PerlIO * ftab)

=back

=back

=for hackers
Declared and documented at perlio.h, line 68

=over 4

=item C<PerlIO_get_base*>

=item C<PerlIO_get_bufsiz*>

=item C<PerlIO_get_cnt*>

=item C<PerlIO_get_ptr*>

=item C<PerlIO_getc*>

=item C<PerlIO_getpos*>

=item C<PerlIO_has_base*>

=item C<PerlIO_has_cntptr*>

=item C<PerlIO_importFILE*>

Described in L<perlapio>.

=back

=over 4

=item C<PERLIO_K_BUFFERED>

=item C<PERLIO_K_CANCRLF>

=item C<PERLIO_K_FASTGETS>

=item C<PERLIO_K_MULTIARG>

=item C<PERLIO_K_RAW>

Described in L<perliol>.

=back

=for hackers
PERLIO_K_BUFFERED all in group documented at pod/perliol.pod, line 464
PERLIO_K_CANCRLF 
PERLIO_K_FASTGETS 
PERLIO_K_MULTIARG 
PERLIO_K_RAW 

=over 4

=item C<PERLIO_NOT_STDIO>

=item C<PerlIO_open*>

=item C<PerlIO_printf*>

=item C<PerlIO_putc*>

=item C<PerlIO_puts*>

=item C<PerlIO_read*>

=item C<PerlIO_releaseFILE*>

=item C<PerlIO_reopen*>

=item C<PerlIO_rewind*>

=item C<PerlIO_seek*>

=item C<PerlIO_set_cnt*>

=item C<PerlIO_set_ptrcnt*>

=item C<PerlIO_setlinebuf*>

=item C<PerlIO_setpos*>

=item C<PerlIO_stderr*>

=item C<PerlIO_stdin*>

=item C<PerlIO_stdout*>

=item C<PerlIO_stdoutf*>

=item C<PerlIO_tell*>

=item C<PerlIO_ungetc*>

=item C<PerlIO_unread*>

=item C<PerlIO_vprintf*>

=item C<PerlIO_write*>

Described in L<perlapio>.

=back

=for hackers
PERLIO_NOT_STDIO all in group documented at pod/perlapio.pod, line 369

=over 4

=item C<PL_maxsysfd>

Described in L<perliol>.

=back

=for hackers
Documented at pod/perliol.pod, line 538

=over 4

=item C<repeatcpy>
X<repeatcpy>

Make C<count> copies of the C<len> bytes beginning at C<from>, placing them
into memory beginning at C<to>, which must be big enough to accommodate them
all.

=over 3

 void       repeatcpy(char *to, const char *from, SSize_t len,
                      IV count)
 void  Perl_repeatcpy(char *to, const char *from, SSize_t len,
                      IV count)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 3307

=over 4

=item C<SvVSTRING>
X<SvVSTRING>

If the given SV has vstring magic, stores the length of it into the variable
C<len>, and returns the string pointer.  If not, returns C<NULL>.

This is a wrapper around the C<sv_vstring_get> function that conveniently
takes the address of the C<len> variable, in a form similar to the C<SvPV>
macro family.

=over 3

 const char *  SvVSTRING(SV* sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 2759

=over 4

=item C<USE_STDIO>

Described in L<perlapio>.

=over 3

 #ifdef  USE_STDIO

=back

=back

=for hackers
Documented at pod/perlapio.pod, line 147

=head1 Integer

=over 4

=item C<CASTI32>
X<CASTI32>

This symbol is defined if the C compiler can cast negative
or large floating point numbers to 32-bit ints.

=back

=for hackers
Declared and documented at config.h, line 871

=over 4

=item C<HAS_INT64_T>
X<HAS_INT64_T>

This symbol will defined if the C compiler supports C<int64_t>.
Usually the F<inttypes.h> needs to be included, but sometimes
F<sys/types.h> is enough.

=back

=for hackers
Declared and documented at config.h, line 2824

=over 4

=item C<HAS_LONG_LONG>
X<HAS_LONG_LONG>

This symbol will be defined if the C compiler supports long long.

=back

=for hackers
Declared and documented at config.h, line 1809

=over 4

=item C<HAS_QUAD>
X<HAS_QUAD>

This symbol, if defined, tells that there's a 64-bit integer type,
C<Quad_t>, and its unsigned counterpart, C<Uquad_t>. C<QUADKIND> will be one
of C<QUAD_IS_INT>, C<QUAD_IS_LONG>, C<QUAD_IS_LONG_LONG>, C<QUAD_IS_INT64_T>,
or C<QUAD_IS___INT64>.

=back

=for hackers
Declared and documented at config.h, line 786

=over 4

=item C<INTMAX_C>
X<INTMAX_C>

Returns a token the C compiler recognizes for the constant C<number> of the
widest integer type on the machine.  For example, if the machine has C<long
long>s, C<INTMAX_C(-1)> would yield

 -1LL

See also, for example, C<L</INT32_C>>.

Use L</IV> to declare variables of the maximum usable size on this platform.

=over 3

   INTMAX_C(number)

=back

=back

=for hackers
Declared and documented at perl.h, line 1521

=over 4

=item C<INTSIZE>
X<INTSIZE>

This symbol contains the value of C<sizeof(int)> so that the C
preprocessor can make decisions based on it.

=back

=for hackers
Declared and documented at config.h, line 767

=over 4

=item C<INT16_C>

=item C<INT32_C>

=item C<INT64_C>
X<INT16_C>X<INT32_C>X<INT64_C>

Returns a token the C compiler recognizes for the constant C<number> of the
corresponding integer type on the machine.

If the machine does not have a 64-bit type, C<INT64_C> is undefined.
Use C<L</INTMAX_C>> to get the largest type available on the platform.

=over 3

 I16  INT16_C(number)
 I32  INT32_C(number)
 I64  INT64_C(number)

=back

=back

=for hackers
INT16_C declared at perl.h, line 1431; all in group documented at perl.h, line 1431
INT32_C declared at perl.h, line 1432
INT64_C declared at perl.h, line 1433

=over 4

=item C<IV>

=item C<I8>

=item C<I16>

=item C<I32>

=item C<I64>

Described in L<perlguts>.

=back

=for hackers
IV all in group documented at pod/perlguts.pod, line 65
I8 
I16 
I32 
I64 

=over 4

=item C<IV_MAX>
X<IV_MAX>

The largest signed integer that fits in an IV on this platform.

=over 3

 IV  IV_MAX

=back

=back

=for hackers
Declared and documented at perl.h, line 4729

=over 4

=item C<IV_MIN>
X<IV_MIN>

The negative signed integer furthest away from 0 that fits in an IV on this
platform.

It is easy to get undefined C behavior with this value.  The macros (currently
only available for internal use) L<perlintern/C<NEGATE_2UV>>,
L<perlintern/C<ABS_IV_MIN>>, and L<perlintern/C<NEGATE_2IV>> avoid
undefined behavior when finding the opposite signed equivalent value.

=over 3

 IV  IV_MIN

=back

=back

=for hackers
Declared and documented at perl.h, line 4732

=over 4

=item C<IVSIZE>
X<IVSIZE>

This symbol contains the C<sizeof(IV)>.

=back

=for hackers
Declared and documented at config.h, line 4164

=over 4

=item C<IVTYPE>
X<IVTYPE>

This symbol defines the C type used for Perl's IV.

=back

=for hackers
Declared and documented at config.h, line 4151

=over 4

=item C<I8*>

Described in L<perlguts>.

=back

=over 4

=item C<I8SIZE>
X<I8SIZE>

This symbol contains the C<sizeof(I8)>.

=back

=for hackers
Declared and documented at config.h, line 4166

=over 4

=item C<I8TYPE>
X<I8TYPE>

This symbol defines the C type used for Perl's I8.

=back

=for hackers
Declared and documented at config.h, line 4153

=over 4

=item C<I16*>

Described in L<perlguts>.

=back

=over 4

=item C<I16SIZE>
X<I16SIZE>

This symbol contains the C<sizeof(I16)>.

=back

=for hackers
Declared and documented at config.h, line 4168

=over 4

=item C<I16TYPE>
X<I16TYPE>

This symbol defines the C type used for Perl's I16.

=back

=for hackers
Declared and documented at config.h, line 4155

=over 4

=item C<I32*>

Described in L<perlguts>.

=back

=over 4

=item C<I32df>
X<I32df>

This symbol defines the format string used for printing a Perl I32
as a signed decimal integer.

=back

=for hackers
Declared and documented at config.h, line 4056

=over 4

=item C<I32SIZE>
X<I32SIZE>

This symbol contains the C<sizeof(I32)>.

=back

=for hackers
Declared and documented at config.h, line 4170

=over 4

=item C<I32TYPE>
X<I32TYPE>

This symbol defines the C type used for Perl's I32.

=back

=for hackers
Declared and documented at config.h, line 4157

=over 4

=item C<I64*>

Described in L<perlguts>.

=back

=over 4

=item C<I64SIZE>
X<I64SIZE>

This symbol contains the C<sizeof(I64)>.

=back

=for hackers
Declared and documented at config.h, line 4173

=over 4

=item C<I64TYPE>
X<I64TYPE>

This symbol defines the C type used for Perl's I64.

=back

=for hackers
Declared and documented at config.h, line 4160

=over 4

=item C<line_t>
X<line_t>

The typedef to use to declare variables that are to hold line numbers.

=back

=for hackers
Declared and documented at handy.h, line 2536

=over 4

=item C<LONGLONGSIZE>
X<LONGLONGSIZE>

This symbol contains the size of a long long, so that the
C preprocessor can make decisions based on it.  It is only
defined if the system supports long long.

=back

=for hackers
Declared and documented at config.h, line 1811

=over 4

=item C<LONGSIZE>
X<LONGSIZE>

This symbol contains the value of C<sizeof(long)> so that the C
preprocessor can make decisions based on it.

=back

=for hackers
Declared and documented at config.h, line 768

=over 4

=item C<memzero>
X<memzero>

Set the C<l> bytes starting at C<*d> to all zeroes.

=over 3

 void  memzero(void * d, Size_t l)

=back

=back

=for hackers
Declared and documented at perl.h, line 1753

=over 4

=item C<PERL_INT_FAST8_T>

=item C<PERL_INT_FAST16_T>

=item C<PERL_UINT_FAST8_T>

=item C<PERL_UINT_FAST16_T>
X<PERL_INT_FAST8_T>X<PERL_INT_FAST16_T>X<PERL_UINT_FAST8_T>
X<PERL_UINT_FAST16_T>

These are equivalent to the correspondingly-named C99 typedefs on platforms
that have those; they evaluate to C<int> and C<unsigned int> on platforms that
don't, so that you can portably take advantage of this C99 feature.

=back

=for hackers
PERL_INT_FAST8_T declared at handy.h, line 293; all in group documented at handy.h, line 293
PERL_INT_FAST16_T 
PERL_UINT_FAST8_T 
PERL_UINT_FAST16_T 

=over 4

=item C<PERL_INT_MAX>

=item C<PERL_INT_MIN>

=item C<PERL_LONG_MAX>

=item C<PERL_LONG_MIN>

=item C<PERL_QUAD_MAX>

=item C<PERL_QUAD_MIN>

=item C<PERL_SHORT_MAX>

=item C<PERL_SHORT_MIN>

=item C<PERL_UCHAR_MAX>

=item C<PERL_UCHAR_MIN>

=item C<PERL_UINT_MAX>

=item C<PERL_UINT_MIN>

=item C<PERL_ULONG_MAX>

=item C<PERL_ULONG_MIN>

=item C<PERL_UQUAD_MAX>

=item C<PERL_UQUAD_MIN>

=item C<PERL_USHORT_MAX>

=item C<PERL_USHORT_MIN>
X<PERL_INT_MAX>X<PERL_INT_MIN>X<PERL_LONG_MAX>X<PERL_LONG_MIN>
X<PERL_QUAD_MAX>X<PERL_QUAD_MIN>X<PERL_SHORT_MAX>X<PERL_SHORT_MIN>
X<PERL_UCHAR_MAX>X<PERL_UCHAR_MIN>X<PERL_UINT_MAX>X<PERL_UINT_MIN>
X<PERL_ULONG_MAX>X<PERL_ULONG_MIN>X<PERL_UQUAD_MAX>X<PERL_UQUAD_MIN>
X<PERL_USHORT_MAX>X<PERL_USHORT_MIN>

These give the largest and smallest number representable in the current
platform in variables of the corresponding types.

For signed types, the smallest representable number is the most negative
number, the one furthest away from zero.

For C99 and later compilers, these correspond to things like C<INT_MAX>, which
are available to the C code.  But these constants, furnished by Perl,
allow code compiled on earlier compilers to portably have access to the same
constants.

=over 3

 int             PERL_INT_MAX
 int             PERL_INT_MIN
 long            PERL_LONG_MAX
 long            PERL_LONG_MIN
 IV              PERL_QUAD_MAX
 IV              PERL_QUAD_MIN
 short           PERL_SHORT_MAX
 short           PERL_SHORT_MIN
 U8              PERL_UCHAR_MAX
 U8              PERL_UCHAR_MIN
 unsigned int    PERL_UINT_MAX
 unsigned int    PERL_UINT_MIN
 unsigned long   PERL_ULONG_MAX
 unsigned long   PERL_ULONG_MIN
 UV              PERL_UQUAD_MAX
 UV              PERL_UQUAD_MIN
 unsigned short  PERL_USHORT_MAX
 unsigned short  PERL_USHORT_MIN

=back

=back

=for hackers
PERL_INT_MAX declared at perl.h, line 3168; all in group documented at perl.h, line 3168
PERL_INT_MIN declared at perl.h, line 3169
PERL_LONG_MAX declared at perl.h, line 3170
PERL_LONG_MIN declared at perl.h, line 3171
PERL_QUAD_MAX declared at perl.h, line 3172
PERL_QUAD_MIN declared at perl.h, line 3173
PERL_SHORT_MAX declared at perl.h, line 3174
PERL_SHORT_MIN declared at perl.h, line 3175
PERL_UCHAR_MAX declared at perl.h, line 3176
PERL_UCHAR_MIN declared at perl.h, line 3177
PERL_UINT_MAX declared at perl.h, line 3178
PERL_UINT_MIN declared at perl.h, line 3179
PERL_ULONG_MAX declared at perl.h, line 3180
PERL_ULONG_MIN declared at perl.h, line 3181
PERL_UQUAD_MAX declared at perl.h, line 3182
PERL_UQUAD_MIN declared at perl.h, line 3183
PERL_USHORT_MAX declared at perl.h, line 3184
PERL_USHORT_MIN declared at perl.h, line 3185

=over 4

=item C<PERL_UINT_FAST8_T*>

=item C<PERL_UINT_FAST16_T*>

Described under C<L</PERL_INT_FAST8_T>>

=back

=over 4

=item C<SHORTSIZE>
X<SHORTSIZE>

This symbol contains the value of C<sizeof(short)> so that the C
preprocessor can make decisions based on it.

=back

=for hackers
Declared and documented at config.h, line 769

=over 4

=item C<UINTMAX_C>
X<UINTMAX_C>

Returns a token the C compiler recognizes for the constant C<number> of the
widest unsigned integer type on the machine.  For example, if the machine has
C<long>s, C<UINTMAX_C(1)> would yield

 1UL

See also, for example, C<L</UINT32_C>>.

Use L</UV> to declare variables of the maximum usable size on this platform.

=over 3

   UINTMAX_C(number)

=back

=back

=for hackers
Declared and documented at perl.h, line 1532

=over 4

=item C<UINT16_C>

=item C<UINT32_C>

=item C<UINT64_C>
X<UINT16_C>X<UINT32_C>X<UINT64_C>

Returns a token the C compiler recognizes for the constant C<number> of the
corresponding unsigned integer type on the machine.

If the machine does not have a 64-bit type, C<UINT64_C> is undefined.
Use C<L</UINTMAX_C>> to get the largest type available on the platform.

=over 3

 U16  UINT16_C(number)
 U32  UINT32_C(number)
 U64  UINT64_C(number)

=back

=back

=for hackers
UINT16_C declared at perl.h, line 1441; all in group documented at perl.h, line 1441
UINT32_C declared at perl.h, line 1442
UINT64_C declared at perl.h, line 1443

=over 4

=item C<UV>

=item C<U8>

=item C<U16>

=item C<U32>

=item C<U64>

Described in L<perlguts>.

=back

=for hackers
UV all in group documented at pod/perlguts.pod, line 71
U8 
U16 
U32 
U64 

=over 4

=item C<UV_MAX>
X<UV_MAX>

The largest unsigned integer that fits in a UV on this platform.

=over 3

 UV  UV_MAX

=back

=back

=for hackers
Declared and documented at perl.h, line 4741

=over 4

=item C<UV_MIN>
X<UV_MIN>

The smallest unsigned integer that fits in a UV on this platform.  It should
equal zero.

=over 3

 UV  UV_MIN

=back

=back

=for hackers
Declared and documented at perl.h, line 4744

=over 4

=item C<UVSIZE>
X<UVSIZE>

This symbol contains the C<sizeof(UV)>.

=back

=for hackers
Declared and documented at config.h, line 4165

=over 4

=item C<UVTYPE>
X<UVTYPE>

This symbol defines the C type used for Perl's UV.

=back

=for hackers
Declared and documented at config.h, line 4152

=over 4

=item C<U8*>

Described in L<perlguts>.

=back

=over 4

=item C<U8SIZE>
X<U8SIZE>

This symbol contains the C<sizeof(U8)>.

=back

=for hackers
Declared and documented at config.h, line 4167

=over 4

=item C<U8TYPE>
X<U8TYPE>

This symbol defines the C type used for Perl's U8.

=back

=for hackers
Declared and documented at config.h, line 4154

=over 4

=item C<U16*>

Described in L<perlguts>.

=back

=over 4

=item C<U16SIZE>
X<U16SIZE>

This symbol contains the C<sizeof(U16)>.

=back

=for hackers
Declared and documented at config.h, line 4169

=over 4

=item C<U16TYPE>
X<U16TYPE>

This symbol defines the C type used for Perl's U16.

=back

=for hackers
Declared and documented at config.h, line 4156

=over 4

=item C<U32*>

Described in L<perlguts>.

=back

=over 4

=item C<U32of>
X<U32of>

This symbol defines the format string used for printing a Perl U32
as an unsigned octal integer.

=back

=for hackers
Declared and documented at config.h, line 4057

=over 4

=item C<U32SIZE>
X<U32SIZE>

This symbol contains the C<sizeof(U32)>.

=back

=for hackers
Declared and documented at config.h, line 4171

=over 4

=item C<U32TYPE>
X<U32TYPE>

This symbol defines the C type used for Perl's U32.

=back

=for hackers
Declared and documented at config.h, line 4158

=over 4

=item C<U32uf>
X<U32uf>

This symbol defines the format string used for printing a Perl U32
as an unsigned decimal integer.

=back

=for hackers
Declared and documented at config.h, line 4058

=over 4

=item C<U32Xf>
X<U32Xf>

This symbol defines the format string used for printing a Perl U32
as an unsigned hexadecimal integer in uppercase C<ABCDEF>.

=back

=for hackers
Declared and documented at config.h, line 4060

=over 4

=item C<U32xf>
X<U32xf>

This symbol defines the format string used for printing a Perl U32
as an unsigned hexadecimal integer in lowercase abcdef.

=back

=for hackers
Declared and documented at config.h, line 4059

=over 4

=item C<U64*>

Described in L<perlguts>.

=back

=over 4

=item C<U64SIZE>
X<U64SIZE>

This symbol contains the C<sizeof(U64)>.

=back

=for hackers
Declared and documented at config.h, line 4174

=over 4

=item C<U64TYPE>
X<U64TYPE>

This symbol defines the C type used for Perl's U64.

=back

=for hackers
Declared and documented at config.h, line 4161

=over 4

=item C<WIDEST_UTYPE>
X<WIDEST_UTYPE>

Yields the widest unsigned integer type on the platform, currently either
C<U32> or C<U64>.  This can be used in declarations such as

 WIDEST_UTYPE my_uv;

or casts

 my_uv = (WIDEST_UTYPE) val;

=back

=for hackers
Declared and documented at handy.h, line 1403

=head1 I/O Formats

These are used for formatting the corresponding type For example,
instead of saying

 Perl_newSVpvf(pTHX_ "Create an SV with a %d in it\n", iv);

use

 Perl_newSVpvf(pTHX_ "Create an SV with a " IVdf " in it\n", iv);

This keeps you from having to know if, say an IV, needs to be
printed as C<%d>, C<%ld>, or something else.


=over 4

=item C<HvNAMEf>

=item C<HvNAMEf_QUOTEDPREFIX>

Described in L<perlguts>.

=back

=for hackers
HvNAMEf all in group documented at pod/perlguts.pod, line 3291
HvNAMEf_QUOTEDPREFIX 

=over 4

=item C<IVdf>
X<IVdf>

This symbol defines the format string used for printing a Perl IV
as a signed decimal integer.

=back

=for hackers
Declared and documented at config.h, line 4227

=over 4

=item C<NVef>
X<NVef>

This symbol defines the format string used for printing a Perl NV
using %e-ish floating point format.

=back

=for hackers
Declared and documented at config.h, line 4232

=over 4

=item C<NVff>
X<NVff>

This symbol defines the format string used for printing a Perl NV
using %f-ish floating point format.

=back

=for hackers
Declared and documented at config.h, line 4233

=over 4

=item C<NVgf>
X<NVgf>

This symbol defines the format string used for printing a Perl NV
using %g-ish floating point format.

=back

=for hackers
Declared and documented at config.h, line 4234

=over 4

=item C<PERL_PRIeldbl>
X<PERL_PRIeldbl>

This symbol, if defined, contains the string used by stdio to
format long doubles (format 'e') for output.

=back

=for hackers
Declared and documented at config.h, line 3990

=over 4

=item C<PERL_PRIfldbl>
X<PERL_PRIfldbl>

This symbol, if defined, contains the string used by stdio to
format long doubles (format 'f') for output.

=back

=for hackers
Declared and documented at config.h, line 3988

=over 4

=item C<PERL_PRIgldbl>
X<PERL_PRIgldbl>

This symbol, if defined, contains the string used by stdio to
format long doubles (format 'g') for output.

=back

=for hackers
Declared and documented at config.h, line 3989

=over 4

=item C<PERL_SCNfldbl>
X<PERL_SCNfldbl>

This symbol, if defined, contains the string used by stdio to
format long doubles (format 'f') for input.

=back

=for hackers
Declared and documented at config.h, line 3991

=over 4

=item C<PRINTF_FORMAT_NULL_OK>
X<PRINTF_FORMAT_NULL_OK>

Allows C<__printf__> format to be null when checking printf-style

=back

=for hackers
Declared and documented at config.h, line 1475

=over 4

=item C<SVf>

=item C<SVf_QUOTEDPREFIX>

=item C<SVfARG>

=item C<UTF8f>

=item C<UTF8f_QUOTEDPREFIX>

=item C<UTF8fARG>

Described in L<perlguts>.

=over 3

   SVfARG  (SV *sv)
   UTF8fARG(bool is_utf8, Size_t byte_len, char *str)

=back

=back

=for hackers
SVf all in group documented at pod/perlguts.pod, line 3256
SVf_QUOTEDPREFIX 
SVfARG 
UTF8f 
UTF8f_QUOTEDPREFIX 
UTF8fARG 

=over 4

=item C<UVf>
X<UVf>

C<B<DEPRECATED!>>  It is planned to remove C<UVf>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Obsolete form of C<UVuf>, which you should convert to instead use

=over 3

 const char *  UVf

=back

=back

=for hackers
Declared and documented at perl.h, line 4177

=over 4

=item C<UVof>
X<UVof>

This symbol defines the format string used for printing a Perl UV
as an unsigned octal integer.

=back

=for hackers
Declared and documented at config.h, line 4229

=over 4

=item C<UVuf>
X<UVuf>

This symbol defines the format string used for printing a Perl UV
as an unsigned decimal integer.

=back

=for hackers
Declared and documented at config.h, line 4228

=over 4

=item C<UVXf>
X<UVXf>

This symbol defines the format string used for printing a Perl UV
as an unsigned hexadecimal integer in uppercase C<ABCDEF>.

=back

=for hackers
Declared and documented at config.h, line 4231

=over 4

=item C<UVxf>
X<UVxf>

This symbol defines the format string used for printing a Perl UV
as an unsigned hexadecimal integer in lowercase abcdef.

=back

=for hackers
Declared and documented at config.h, line 4230

=head1 Lexer interface
X<LEX_KEEP_PREVIOUS>X<LEX_STUFF_UTF8>X<PARSE_OPTIONAL>


This is the lower layer of the Perl parser, managing characters and tokens.


=over 4

=item C<BHK>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 2781

=over 4

=item C<lex_bufutf8>
X<lex_bufutf8>

NOTE: C<lex_bufutf8> is B<experimental> and may change or be
removed without notice.

Indicates whether the octets in the lexer buffer
(L</PL_parser-E<gt>linestr>) should be interpreted as the UTF-8 encoding
of Unicode characters.  If not, they should be interpreted as Latin-1
characters.  This is analogous to the C<SvUTF8> flag for scalars.

In UTF-8 mode, it is not guaranteed that the lexer buffer actually
contains valid UTF-8.  Lexing code must be robust in the face of invalid
encoding.

The actual C<SvUTF8> flag of the L</PL_parser-E<gt>linestr> scalar
is significant, but not the whole story regarding the input character
encoding.  Normally, when a file is being read, the scalar contains octets
and its C<SvUTF8> flag is off, but the octets should be interpreted as
UTF-8 if the C<use utf8> pragma is in effect.  During a string eval,
however, the scalar may have the C<SvUTF8> flag on, and in this case its
octets should be interpreted as UTF-8 unless the C<use bytes> pragma
is in effect.  This logic may change in the future; use this function
instead of implementing the logic yourself.

=over 3

 bool       lex_bufutf8()
 bool  Perl_lex_bufutf8(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1082

=over 4

=item C<lex_discard_to>
X<lex_discard_to>

NOTE: C<lex_discard_to> is B<experimental> and may change or be
removed without notice.

Discards the first part of the L</PL_parser-E<gt>linestr> buffer,
up to C<ptr>.  The remaining content of the buffer will be moved, and
all pointers into the buffer updated appropriately.  C<ptr> must not
be later in the buffer than the position of L</PL_parser-E<gt>bufptr>:
it is not permitted to discard text that has yet to be lexed.

Normally it is not necessarily to do this directly, because it suffices to
use the implicit discarding behaviour of L</lex_next_chunk> and things
based on it.  However, if a token stretches across multiple lines,
and the lexing code has kept multiple lines of text in the buffer for
that purpose, then after completion of the token it would be wise to
explicitly discard the now-unneeded earlier lines, to avoid future
multi-line tokens growing the buffer without bound.

=over 3

 void       lex_discard_to(      char *ptr)
 void  Perl_lex_discard_to(pTHX_ char *ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1370

=over 4

=item C<lex_grow_linestr>
X<lex_grow_linestr>

NOTE: C<lex_grow_linestr> is B<experimental> and may change or be
removed without notice.

Reallocates the lexer buffer (L</PL_parser-E<gt>linestr>) to accommodate
at least C<len> octets (including terminating C<NUL>).  Returns a
pointer to the reallocated buffer.  This is necessary before making
any direct modification of the buffer that would increase its length.
L</lex_stuff_pvn> provides a more convenient way to insert text into
the buffer.

Do not use C<SvGROW> or C<sv_grow> directly on C<PL_parser-E<gt>linestr>;
this function updates all of the lexer's variables that point directly
into the buffer.

=over 3

 char *       lex_grow_linestr(      STRLEN len)
 char *  Perl_lex_grow_linestr(pTHX_ STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1113

=over 4

=item C<lex_next_chunk>
X<lex_next_chunk>

NOTE: C<lex_next_chunk> is B<experimental> and may change or be
removed without notice.

Reads in the next chunk of text to be lexed, appending it to
L</PL_parser-E<gt>linestr>.  This should be called when lexing code has
looked to the end of the current chunk and wants to know more.  It is
usual, but not necessary, for lexing to have consumed the entirety of
the current chunk at this time.

If L</PL_parser-E<gt>bufptr> is pointing to the very end of the current
chunk (i.e., the current chunk has been entirely consumed), normally the
current chunk will be discarded at the same time that the new chunk is
read in.  If C<flags> has the C<LEX_KEEP_PREVIOUS> bit set, the current chunk
will not be discarded.  If the current chunk has not been entirely
consumed, then it will not be discarded regardless of the flag.

Returns true if some new text was added to the buffer, or false if the
buffer has reached the end of the input text.

=over 3

 bool       lex_next_chunk(      U32 flags)
 bool  Perl_lex_next_chunk(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1443

=over 4

=item C<lex_peek_unichar>
X<lex_peek_unichar>

NOTE: C<lex_peek_unichar> is B<experimental> and may change or be
removed without notice.

Looks ahead one (Unicode) character in the text currently being lexed.
Returns the codepoint (unsigned integer value) of the next character,
or -1 if lexing has reached the end of the input text.  To consume the
peeked character, use L</lex_read_unichar>.

If the next character is in (or extends into) the next chunk of input
text, the next chunk will be read in.  Normally the current chunk will be
discarded at the same time, but if C<flags> has the C<LEX_KEEP_PREVIOUS>
bit set, then the current chunk will not be discarded.

If the input is being interpreted as UTF-8 and a UTF-8 encoding error
is encountered, an exception is generated.

=over 3

 I32       lex_peek_unichar(      U32 flags)
 I32  Perl_lex_peek_unichar(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1592

=over 4

=item C<lex_read_space>
X<lex_read_space>

NOTE: C<lex_read_space> is B<experimental> and may change or be
removed without notice.

Reads optional spaces, in Perl style, in the text currently being
lexed.  The spaces may include ordinary whitespace characters and
Perl-style comments.  C<#line> directives are processed if encountered.
L</PL_parser-E<gt>bufptr> is moved past the spaces, so that it points
at a non-space character (or the end of the input text).

If spaces extend into the next chunk of input text, the next chunk will
be read in.  Normally the current chunk will be discarded at the same
time, but if C<flags> has the C<LEX_KEEP_PREVIOUS> bit set, then the current
chunk will not be discarded.

=over 3

 void       lex_read_space(      U32 flags)
 void  Perl_lex_read_space(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1692

=over 4

=item C<lex_read_to>
X<lex_read_to>

NOTE: C<lex_read_to> is B<experimental> and may change or be
removed without notice.

Consume text in the lexer buffer, from L</PL_parser-E<gt>bufptr> up
to C<ptr>.  This advances L</PL_parser-E<gt>bufptr> to match C<ptr>,
performing the correct bookkeeping whenever a newline character is passed.
This is the normal way to consume lexed text.

Interpretation of the buffer's octets can be abstracted out by
using the slightly higher-level functions L</lex_peek_unichar> and
L</lex_read_unichar>.

=over 3

 void       lex_read_to(      char *ptr)
 void  Perl_lex_read_to(pTHX_ char *ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1339

=over 4

=item C<lex_read_unichar>
X<lex_read_unichar>

NOTE: C<lex_read_unichar> is B<experimental> and may change or be
removed without notice.

Reads the next (Unicode) character in the text currently being lexed.
Returns the codepoint (unsigned integer value) of the character read,
and moves L</PL_parser-E<gt>bufptr> past the character, or returns -1
if lexing has reached the end of the input text.  To non-destructively
examine the next character, use L</lex_peek_unichar> instead.

If the next character is in (or extends into) the next chunk of input
text, the next chunk will be read in.  Normally the current chunk will be
discarded at the same time, but if C<flags> has the C<LEX_KEEP_PREVIOUS>
bit set, then the current chunk will not be discarded.

If the input is being interpreted as UTF-8 and a UTF-8 encoding error
is encountered, an exception is generated.

=over 3

 I32       lex_read_unichar(      U32 flags)
 I32  Perl_lex_read_unichar(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1654

=over 4

=item C<lex_start>
X<lex_start>

NOTE: C<lex_start> is B<experimental> and may change or be
removed without notice.

Creates and initialises a new lexer/parser state object, supplying
a context in which to lex and parse from a new source of Perl code.
A pointer to the new state object is placed in L</PL_parser>.  An entry
is made on the save stack so that upon unwinding, the new state object
will be destroyed and the former value of L</PL_parser> will be restored.
Nothing else need be done to clean up the parsing context.

The code to be parsed comes from C<line> and C<rsfp>.  C<line>, if
non-null, provides a string (in SV form) containing code to be parsed.
A copy of the string is made, so subsequent modification of C<line>
does not affect parsing.  C<rsfp>, if non-null, provides an input stream
from which code will be read to be parsed.  If both are non-null, the
code in C<line> comes first and must consist of complete lines of input,
and C<rsfp> supplies the remainder of the source.

The C<flags> parameter is reserved for future use.  Currently it is only
used by perl internally, so extensions should always pass zero.

=over 3

 void       lex_start(      SV *line, PerlIO *rsfp, U32 flags)
 void  Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 846

=over 4

=item C<lex_stuff_pv>

=item C<lex_stuff_pvn>

=item C<lex_stuff_pvs>

=item C<lex_stuff_sv>
X<lex_stuff_pv>X<lex_stuff_pvn>X<lex_stuff_pvs>X<lex_stuff_sv>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

These each insert characters into the lexer buffer
(L</PL_parser-E<gt>linestr>),
immediately after the current lexing point (L</PL_parser-E<gt>bufptr>),
reallocating the buffer if necessary.  This means that lexing code that
runs later will see the characters as if they had appeared in the input.
It is not recommended to do this as part of normal parsing, and most
uses of this facility run the risk of the inserted characters being
interpreted in an unintended manner.

In C<lex_stuff_pvs>, the string to be inserted is a literal C string, enclosed
in double quotes.

In C<lex_stuff_pv> and C<lex_stuff_pvn>, the string to be inserted is
represented by the octets starting at C<pv>.  In C<lex_stuff_pv>, the first NUL
octet terminates the string.  In C<lex_stuff_pvn>, C<len> octets will be used,
hence the string may contain embedded NUL characters.

In all three cases, these octets are interpreted as either UTF-8 or Latin-1,
according to whether or not the C<LEX_STUFF_UTF8> flag is set in C<flags>.

In C<lex_stuff_sv>, the string to be inserted is the string value of C<sv>.
C<flags> must be 0.  The string is interpreted as either UTF-8 or Latin-1,
according to whether or not C<sv> has its UTF-8 flag set.

In all three forms, the characters are recoded for the lexer buffer, according
to how the buffer is currently being interpreted (L</lex_bufutf8>).

=over 3

 void       lex_stuff_pv (      const char *pv, U32 flags)
 void  Perl_lex_stuff_pv (pTHX_ const char *pv, U32 flags)
 void       lex_stuff_pvn(      const char *pv, STRLEN len,
                                U32 flags)
 void  Perl_lex_stuff_pvn(pTHX_ const char *pv, STRLEN len,
                                U32 flags)
 void       lex_stuff_pvs(      "pv", U32 flags)
 void       lex_stuff_sv (      SV *sv, U32 flags)
 void  Perl_lex_stuff_sv (pTHX_ SV *sv, U32 flags)

=back

=back

=for hackers
lex_stuff_pv declared in embed.fnc; all in group documented at toke.c, line 1176
lex_stuff_pvn declared in embed.fnc
lex_stuff_pvs declared at handy.h, line 473
lex_stuff_sv declared in embed.fnc

=over 4

=item C<lex_unstuff>
X<lex_unstuff>

NOTE: C<lex_unstuff> is B<experimental> and may change or be
removed without notice.

Discards text about to be lexed, from L</PL_parser-E<gt>bufptr> up to
C<ptr>.  Text following C<ptr> will be moved, and the buffer shortened.
This hides the discarded text from any lexing code that runs later,
as if the text had never appeared.

This is not the normal way to consume lexed text.  For that, use
L</lex_read_to>.

=over 3

 void       lex_unstuff(      char *ptr)
 void  Perl_lex_unstuff(pTHX_ char *ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 1305

=over 4

=item C<parse_arithexpr>
X<parse_arithexpr>

NOTE: C<parse_arithexpr> is B<experimental> and may change or be
removed without notice.

Parse a Perl arithmetic expression.  This may contain operators of precedence
down to the bit shift operators.  The expression must be followed (and thus
terminated) either by a comparison or lower-precedence operator or by
something that would normally terminate an expression such as semicolon.
If C<flags> has the C<PARSE_OPTIONAL> bit set, then the expression is optional,
otherwise it is mandatory.  It is up to the caller to ensure that the
dynamic parser state (L</PL_parser> et al) is correctly set to reflect
the source of the code to be parsed and the lexical context for the
expression.

The op tree representing the expression is returned.  If an optional
expression is absent, a null pointer is returned, otherwise the pointer
will be non-null.

If an error occurs in parsing or compilation, in most cases a valid op
tree is returned anyway.  The error is reflected in the parser state,
normally resulting in a single exception at the top level of parsing
which covers all the compilation errors that occurred.  Some compilation
errors, however, will throw an exception immediately.

=over 3

 OP *       parse_arithexpr(      U32 flags)
 OP *  Perl_parse_arithexpr(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13536

=over 4

=item C<parse_barestmt>
X<parse_barestmt>

NOTE: C<parse_barestmt> is B<experimental> and may change or be
removed without notice.

Parse a single unadorned Perl statement.  This may be a normal imperative
statement or a declaration that has compile-time effect.  It does not
include any label or other affixture.  It is up to the caller to ensure
that the dynamic parser state (L</PL_parser> et al) is correctly set to
reflect the source of the code to be parsed and the lexical context for
the statement.

The op tree representing the statement is returned.  This may be a
null pointer if the statement is null, for example if it was actually
a subroutine definition (which has compile-time side effects).  If not
null, it will be ops directly implementing the statement, suitable to
pass to L</newSTATEOP>.  It will not normally include a C<nextstate> or
equivalent op (except for those embedded in a scope contained entirely
within the statement).

If an error occurs in parsing or compilation, in most cases a valid op
tree (most likely null) is returned anyway.  The error is reflected in
the parser state, normally resulting in a single exception at the top
level of parsing which covers all the compilation errors that occurred.
Some compilation errors, however, will throw an exception immediately.

The C<flags> parameter is reserved for future use, and must always
be zero.

=over 3

 OP *       parse_barestmt(      U32 flags)
 OP *  Perl_parse_barestmt(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13704

=over 4

=item C<parse_block>
X<parse_block>

NOTE: C<parse_block> is B<experimental> and may change or be
removed without notice.

Parse a single complete Perl code block.  This consists of an opening
brace, a sequence of statements, and a closing brace.  The block
constitutes a lexical scope, so C<my> variables and various compile-time
effects can be contained within it.  It is up to the caller to ensure
that the dynamic parser state (L</PL_parser> et al) is correctly set to
reflect the source of the code to be parsed and the lexical context for
the statement.

The op tree representing the code block is returned.  This is always a
real op, never a null pointer.  It will normally be a C<lineseq> list,
including C<nextstate> or equivalent ops.  No ops to construct any kind
of runtime scope are included by virtue of it being a block.

If an error occurs in parsing or compilation, in most cases a valid op
tree (most likely null) is returned anyway.  The error is reflected in
the parser state, normally resulting in a single exception at the top
level of parsing which covers all the compilation errors that occurred.
Some compilation errors, however, will throw an exception immediately.

The C<flags> parameter is reserved for future use, and must always
be zero.

=over 3

 OP *       parse_block(      U32 flags)
 OP *  Perl_parse_block(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13668

=over 4

=item C<parse_fullexpr>
X<parse_fullexpr>

NOTE: C<parse_fullexpr> is B<experimental> and may change or be
removed without notice.

Parse a single complete Perl expression.  This allows the full
expression grammar, including the lowest-precedence operators such
as C<or>.  The expression must be followed (and thus terminated) by a
token that an expression would normally be terminated by: end-of-file,
closing bracketing punctuation, semicolon, or one of the keywords that
signals a postfix expression-statement modifier.  If C<flags> has the
C<PARSE_OPTIONAL> bit set, then the expression is optional, otherwise it is
mandatory.  It is up to the caller to ensure that the dynamic parser
state (L</PL_parser> et al) is correctly set to reflect the source of
the code to be parsed and the lexical context for the expression.

The op tree representing the expression is returned.  If an optional
expression is absent, a null pointer is returned, otherwise the pointer
will be non-null.

If an error occurs in parsing or compilation, in most cases a valid op
tree is returned anyway.  The error is reflected in the parser state,
normally resulting in a single exception at the top level of parsing
which covers all the compilation errors that occurred.  Some compilation
errors, however, will throw an exception immediately.

=over 3

 OP *       parse_fullexpr(      U32 flags)
 OP *  Perl_parse_fullexpr(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13635

=over 4

=item C<parse_fullstmt>
X<parse_fullstmt>

NOTE: C<parse_fullstmt> is B<experimental> and may change or be
removed without notice.

Parse a single complete Perl statement.  This may be a normal imperative
statement or a declaration that has compile-time effect, and may include
optional labels.  It is up to the caller to ensure that the dynamic
parser state (L</PL_parser> et al) is correctly set to reflect the source
of the code to be parsed and the lexical context for the statement.

The op tree representing the statement is returned.  This may be a
null pointer if the statement is null, for example if it was actually
a subroutine definition (which has compile-time side effects).  If not
null, it will be the result of a L</newSTATEOP> call, normally including
a C<nextstate> or equivalent op.

If an error occurs in parsing or compilation, in most cases a valid op
tree (most likely null) is returned anyway.  The error is reflected in
the parser state, normally resulting in a single exception at the top
level of parsing which covers all the compilation errors that occurred.
Some compilation errors, however, will throw an exception immediately.

The C<flags> parameter is reserved for future use, and must always
be zero.

=over 3

 OP *       parse_fullstmt(      U32 flags)
 OP *  Perl_parse_fullstmt(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13812

=over 4

=item C<parse_label>
X<parse_label>

NOTE: C<parse_label> is B<experimental> and may change or be
removed without notice.

Parse a single label, possibly optional, of the type that may prefix a
Perl statement.  It is up to the caller to ensure that the dynamic parser
state (L</PL_parser> et al) is correctly set to reflect the source of
the code to be parsed.  If C<flags> has the C<PARSE_OPTIONAL> bit set, then the
label is optional, otherwise it is mandatory.

The name of the label is returned in the form of a fresh scalar.  If an
optional label is absent, a null pointer is returned.

If an error occurs in parsing, which can only occur if the label is
mandatory, a valid label is returned anyway.  The error is reflected in
the parser state, normally resulting in a single exception at the top
level of parsing which covers all the compilation errors that occurred.

=over 3

 SV *       parse_label(      U32 flags)
 SV *  Perl_parse_label(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13742

=over 4

=item C<parse_listexpr>
X<parse_listexpr>

NOTE: C<parse_listexpr> is B<experimental> and may change or be
removed without notice.

Parse a Perl list expression.  This may contain operators of precedence
down to the comma operator.  The expression must be followed (and thus
terminated) either by a low-precedence logic operator such as C<or> or by
something that would normally terminate an expression such as semicolon.
If C<flags> has the C<PARSE_OPTIONAL> bit set, then the expression is optional,
otherwise it is mandatory.  It is up to the caller to ensure that the
dynamic parser state (L</PL_parser> et al) is correctly set to reflect
the source of the code to be parsed and the lexical context for the
expression.

The op tree representing the expression is returned.  If an optional
expression is absent, a null pointer is returned, otherwise the pointer
will be non-null.

If an error occurs in parsing or compilation, in most cases a valid op
tree is returned anyway.  The error is reflected in the parser state,
normally resulting in a single exception at the top level of parsing
which covers all the compilation errors that occurred.  Some compilation
errors, however, will throw an exception immediately.

=over 3

 OP *       parse_listexpr(      U32 flags)
 OP *  Perl_parse_listexpr(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13603

=over 4

=item C<parse_stmtseq>
X<parse_stmtseq>

NOTE: C<parse_stmtseq> is B<experimental> and may change or be
removed without notice.

Parse a sequence of zero or more Perl statements.  These may be normal
imperative statements, including optional labels, or declarations
that have compile-time effect, or any mixture thereof.  The statement
sequence ends when a closing brace or end-of-file is encountered in a
place where a new statement could have validly started.  It is up to
the caller to ensure that the dynamic parser state (L</PL_parser> et al)
is correctly set to reflect the source of the code to be parsed and the
lexical context for the statements.

The op tree representing the statement sequence is returned.  This may
be a null pointer if the statements were all null, for example if there
were no statements or if there were only subroutine definitions (which
have compile-time side effects).  If not null, it will be a C<lineseq>
list, normally including C<nextstate> or equivalent ops.

If an error occurs in parsing or compilation, in most cases a valid op
tree is returned anyway.  The error is reflected in the parser state,
normally resulting in a single exception at the top level of parsing
which covers all the compilation errors that occurred.  Some compilation
errors, however, will throw an exception immediately.

The C<flags> parameter is reserved for future use, and must always
be zero.

=over 3

 OP *       parse_stmtseq(      U32 flags)
 OP *  Perl_parse_stmtseq(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13847

=over 4

=item C<parse_subsignature>
X<parse_subsignature>

NOTE: C<parse_subsignature> is B<experimental> and may change or be
removed without notice.

Parse a subroutine signature declaration. This is the contents of the
parentheses following a named or anonymous subroutine declaration when the
C<signatures> feature is enabled. Note that this function neither expects
nor consumes the opening and closing parentheses around the signature; it
is the caller's job to handle these.

This function must only be called during parsing of a subroutine; after
L</start_subparse> has been called. It might allocate lexical variables on
the pad for the current subroutine.

The op tree to unpack the arguments from the stack at runtime is returned.
This op tree should appear at the beginning of the compiled function. The
caller may wish to use L</op_append_list> to build their function body
after it, or splice it together with the body before calling L</newATTRSUB>.

The C<flags> parameter is reserved for future use, and must always
be zero.

=over 3

 OP *       parse_subsignature(      U32 flags)
 OP *  Perl_parse_subsignature(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13891

=over 4

=item C<parse_termexpr>
X<parse_termexpr>

NOTE: C<parse_termexpr> is B<experimental> and may change or be
removed without notice.

Parse a Perl term expression.  This may contain operators of precedence
down to the assignment operators.  The expression must be followed (and thus
terminated) either by a comma or lower-precedence operator or by
something that would normally terminate an expression such as semicolon.
If C<flags> has the C<PARSE_OPTIONAL> bit set, then the expression is optional,
otherwise it is mandatory.  It is up to the caller to ensure that the
dynamic parser state (L</PL_parser> et al) is correctly set to reflect
the source of the code to be parsed and the lexical context for the
expression.

The op tree representing the expression is returned.  If an optional
expression is absent, a null pointer is returned, otherwise the pointer
will be non-null.

If an error occurs in parsing or compilation, in most cases a valid op
tree is returned anyway.  The error is reflected in the parser state,
normally resulting in a single exception at the top level of parsing
which covers all the compilation errors that occurred.  Some compilation
errors, however, will throw an exception immediately.

=over 3

 OP *       parse_termexpr(      U32 flags)
 OP *  Perl_parse_termexpr(pTHX_ U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13571

=over 4

=item C<PL_parser>
X<PL_parser>

Pointer to a structure encapsulating the state of the parsing operation
currently in progress.  The pointer can be locally changed to perform
a nested parse without interfering with the state of an outer parse.
Individual members of C<PL_parser> have their own documentation.

=back

=for hackers
Declared and documented at toke.c, line 28

=over 4

=item C<PL_parser-E<gt>bufend>
X<PL_parser-E<gt>bufend>

NOTE: C<PL_parser-E<gt>bufend> is B<experimental> and may change or be
removed without notice.

Direct pointer to the end of the chunk of text currently being lexed, the
end of the lexer buffer.  This is equal to C<SvPVX(PL_parser-E<gt>linestr)
+ SvCUR(PL_parser-E<gt>linestr)>.  A C<NUL> character (zero octet) is
always located at the end of the buffer, and does not count as part of
the buffer's contents.

=back

=for hackers
Declared and documented at toke.c, line 1045

=over 4

=item C<PL_parser-E<gt>bufptr>
X<PL_parser-E<gt>bufptr>

NOTE: C<PL_parser-E<gt>bufptr> is B<experimental> and may change or be
removed without notice.

Points to the current position of lexing inside the lexer buffer.
Characters around this point may be freely examined, within
the range delimited by C<SvPVX(L</PL_parser-E<gt>linestr>)> and
L</PL_parser-E<gt>bufend>.  The octets of the buffer may be intended to be
interpreted as either UTF-8 or Latin-1, as indicated by L</lex_bufutf8>.

Lexing code (whether in the Perl core or not) moves this pointer past
the characters that it consumes.  It is also expected to perform some
bookkeeping whenever a newline character is consumed.  This movement
can be more conveniently performed by the function L</lex_read_to>,
which handles newlines appropriately.

Interpretation of the buffer's octets can be abstracted out by
using the slightly higher-level functions L</lex_peek_unichar> and
L</lex_read_unichar>.

=back

=for hackers
Declared and documented at toke.c, line 1053

=over 4

=item C<PL_parser-E<gt>linestart>
X<PL_parser-E<gt>linestart>

NOTE: C<PL_parser-E<gt>linestart> is B<experimental> and may change or be
removed without notice.

Points to the start of the current line inside the lexer buffer.
This is useful for indicating at which column an error occurred, and
not much else.  This must be updated by any lexing code that consumes
a newline; the function L</lex_read_to> handles this detail.

=back

=for hackers
Declared and documented at toke.c, line 1071

=over 4

=item C<PL_parser-E<gt>linestr>
X<PL_parser-E<gt>linestr>

NOTE: C<PL_parser-E<gt>linestr> is B<experimental> and may change or be
removed without notice.

Buffer scalar containing the chunk currently under consideration of the
text currently being lexed.  This is always a plain string scalar (for
which C<SvPOK> is true).  It is not intended to be used as a scalar by
normal scalar means; instead refer to the buffer directly by the pointer
variables described below.

The lexer maintains various C<char*> pointers to things in the
C<PL_parser-E<gt>linestr> buffer.  If C<PL_parser-E<gt>linestr> is ever
reallocated, all of these pointers must be updated.  Don't attempt to
do this manually, but rather use L</lex_grow_linestr> if you need to
reallocate the buffer.

The content of the text chunk in the buffer is commonly exactly one
complete line of input, up to and including a newline terminator,
but there are situations where it is otherwise.  The octets of the
buffer may be intended to be interpreted as either UTF-8 or Latin-1.
The function L</lex_bufutf8> tells you which.  Do not use the C<SvUTF8>
flag on this scalar, which may disagree with it.

For direct examination of the buffer, the variable
L</PL_parser-E<gt>bufend> points to the end of the buffer.  The current
lexing position is pointed to by L</PL_parser-E<gt>bufptr>.  Direct use
of these pointers is usually preferable to examination of the scalar
through normal scalar means.

=back

=for hackers
Declared and documented at toke.c, line 1018

=over 4

=item C<resume_compcv_and_save>
X<resume_compcv_and_save>

Resumes a buffer previously suspended by the C<suspend_compcv> function, in a
way that will be re-suspended at the end of the scope so it can be used again
later.  This should be used within an C<ENTER>/C<LEAVE> scoped pair.

=over 3

 void  resume_compcv_and_save(struct suspended_compcv *buffer)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2971

=over 4

=item C<resume_compcv_final>
X<resume_compcv_final>

Resumes the parser state previously saved using the C<suspend_compcv> function
for a final time before being compiled into a full CV.  This should be used
within an C<ENTER>/C<LEAVE> scoped pair.

=over 3

 void  resume_compcv_final(struct suspended_compcv *buffer)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2965

=over 4

=item C<suspend_compcv>
X<suspend_compcv>

Implements part of the concept of a "suspended compilation CV", which can be
used to pause the parser and compiler during parsing a CV in order to come
back to it later on.

This function saves the current state of the subroutine under compilation
(C<PL_compcv>) into the supplied buffer.  This should be used initially to
create the state in the buffer, as the final thing before a C<LEAVE> within a
block.

    ENTER;
    start_subparse(0);
    ...

    suspend_compcv(&buffer);
    LEAVE;

Once suspended, the C<resume_compcv_final> or C<resume_compcv_and_save>
function can later be used to continue the parsing from the point this stopped.

=over 3

 void       suspend_compcv(      struct suspended_compcv *buffer)
 void  Perl_suspend_compcv(pTHX_ struct suspended_compcv *buffer)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 2922

=over 4

=item C<valid_identifier_pve>
X<valid_identifier_pve>

Returns true if the string given by C<s> until C<end> would be considered
valid as a Perl identifier.  That is, it must begin with a character matching
C<isIDFIRST>, followed by characters all matching C<isIDCONT>.  An empty
string (i.e. when C<end> is C<s>) will return false.

If C<flags> contains the C<SVf_UTF8> bit, then the string is presumed to be
encoded in UTF-8, and suitable Unicode character test functions will be used.

=over 3

 bool       valid_identifier_pve(      const char *s,
                                       const char *end, U32 flags)
 bool  Perl_valid_identifier_pve(pTHX_ const char *s,
                                       const char *end, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13923

=over 4

=item C<valid_identifier_pvn>
X<valid_identifier_pvn>

Returns true if the string given by C<s> whose length is C<len> would be
considered valid as a Perl identifier.  That is, it must begin with a
character matching C<isIDFIRST>, followed by characters all matching
C<isIDCONT>.  An empty string (i.e. when C<len> is zero) will return false.

If C<flags> contains the C<SVf_UTF8> bit, then the string is presumed to be
encoded in UTF-8, and suitable Unicode character test functions will be used.

=over 3

 bool       valid_identifier_pvn(      const char *s, STRLEN len,
                                       U32 flags)
 bool  Perl_valid_identifier_pvn(pTHX_ const char *s, STRLEN len,
                                       U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13975

=over 4

=item C<valid_identifier_sv>
X<valid_identifier_sv>

Returns true if the given SV contains a non-empty string whose characters
match accoding to C<valid_identifier_pvn>.  Returns false if given NULL, an
undefined SV, or a SV that does not contain a non-empty string.

Does not invoke C<get> magic on the SV beforehand.

=over 3

 bool       valid_identifier_sv(      SV *sv)
 bool  Perl_valid_identifier_sv(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13997

=over 4

=item C<wrap_infix_plugin>
X<wrap_infix_plugin>

NOTE: C<wrap_infix_plugin> is B<experimental> and may change or be
removed without notice.

B<NOTE:> This API exists entirely for the purpose of making the CPAN module
C<XS::Parse::Infix> work. It is not expected that additional modules will make
use of it; rather, that they should use C<XS::Parse::Infix> to provide parsing
of new infix operators.

Puts a C function into the chain of infix plugins.  This is the preferred
way to manipulate the L</PL_infix_plugin> variable.  C<new_plugin> is a
pointer to the C function that is to be added to the infix plugin chain, and
C<old_plugin_p> points to a storage location where a pointer to the next
function in the chain will be stored.  The value of C<new_plugin> is written
into the L</PL_infix_plugin> variable, while the value previously stored there
is written to C<*old_plugin_p>.

Direct access to L</PL_infix_plugin> should be avoided.

=over 3

 void       wrap_infix_plugin(  Perl_infix_plugin_t new_plugin,
                                Perl_infix_plugin_t *old_plugin_p)
 void  Perl_wrap_infix_plugin(pTHX_
                                Perl_infix_plugin_t new_plugin,
                                Perl_infix_plugin_t *old_plugin_p)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13451

=over 4

=item C<wrap_keyword_plugin>
X<wrap_keyword_plugin>

NOTE: C<wrap_keyword_plugin> is B<experimental> and may change or be
removed without notice.

Puts a C function into the chain of keyword plugins.  This is the
preferred way to manipulate the L</PL_keyword_plugin> variable.
C<new_plugin> is a pointer to the C function that is to be added to the
keyword plugin chain, and C<old_plugin_p> points to the storage location
where a pointer to the next function in the chain will be stored.  The
value of C<new_plugin> is written into the L</PL_keyword_plugin> variable,
while the value previously stored there is written to C<*old_plugin_p>.

L</PL_keyword_plugin> is global to an entire process, and a module wishing
to hook keyword parsing may find itself invoked more than once per
process, typically in different threads.  To handle that situation, this
function is idempotent.  The location C<*old_plugin_p> must initially
(once per process) contain a null pointer.  A C variable of static
duration (declared at file scope, typically also marked C<static> to give
it internal linkage) will be implicitly initialised appropriately, if it
does not have an explicit initialiser.  This function will only actually
modify the plugin chain if it finds C<*old_plugin_p> to be null.  This
function is also thread safe on the small scale.  It uses appropriate
locking to avoid race conditions in accessing L</PL_keyword_plugin>.

When this function is called, the function referenced by C<new_plugin>
must be ready to be called, except for C<*old_plugin_p> being unfilled.
In a threading situation, C<new_plugin> may be called immediately, even
before this function has returned.  C<*old_plugin_p> will always be
appropriately set before C<new_plugin> is called.  If C<new_plugin>
decides not to do anything special with the identifier that it is given
(which is the usual case for most calls to a keyword plugin), it must
chain the plugin function referenced by C<*old_plugin_p>.

Taken all together, XS code to install a keyword plugin should typically
look something like this:

    static Perl_keyword_plugin_t next_keyword_plugin;
    static OP *my_keyword_plugin(pTHX_
        char *keyword_ptr, STRLEN keyword_len, OP **op_ptr)
    {
        if (memEQs(keyword_ptr, keyword_len,
                   "my_new_keyword")) {
            ...
        } else {
            return next_keyword_plugin(aTHX_
                keyword_ptr, keyword_len, op_ptr);
        }
    }
    BOOT:
        wrap_keyword_plugin(my_keyword_plugin,
                            &next_keyword_plugin);

Direct access to L</PL_keyword_plugin> should be avoided.

=over 3

 void       wrap_keyword_plugin(Perl_keyword_plugin_t new_plugin,
                              Perl_keyword_plugin_t *old_plugin_p)
 void  Perl_wrap_keyword_plugin(pTHX_
                              Perl_keyword_plugin_t new_plugin,
                              Perl_keyword_plugin_t *old_plugin_p)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13379

=head1 Locales

=over 4

=item C<DECLARATION_FOR_LC_NUMERIC_MANIPULATION>
X<DECLARATION_FOR_LC_NUMERIC_MANIPULATION>

This macro should be used as a statement.  It declares a private variable
(whose name begins with an underscore) that is needed by the other macros in
this section.  Failing to include this correctly should lead to a syntax error.
For compatibility with C89 C compilers it should be placed in a block before
any executable statements.

=over 3

 void  DECLARATION_FOR_LC_NUMERIC_MANIPULATION

=back

=back

=for hackers
Declared and documented at perl.h, line 7602

=over 4

=item C<HAS_DUPLOCALE>
X<HAS_DUPLOCALE>

This symbol, if defined, indicates that the C<duplocale> routine is
available to duplicate a locale object.

=back

=for hackers
Declared and documented at config.h, line 3131

=over 4

=item C<HAS_FREELOCALE>
X<HAS_FREELOCALE>

This symbol, if defined, indicates that the C<freelocale> routine is
available to deallocates the resources associated with a locale object.

=back

=for hackers
Declared and documented at config.h, line 3129

=over 4

=item C<HAS_LC_MONETARY_2008>
X<HAS_LC_MONETARY_2008>

This symbol, if defined, indicates that the localeconv routine is
available and has the additional members added in C<POSIX> 1003.1-2008.

=back

=for hackers
Declared and documented at config.h, line 2898

=over 4

=item C<HAS_LOCALECONV>
X<HAS_LOCALECONV>

This symbol, if defined, indicates that the C<localeconv> routine is
available for numeric and monetary formatting conventions.

=back

=for hackers
Declared and documented at config.h, line 213

=over 4

=item C<HAS_LOCALECONV_L>
X<HAS_LOCALECONV_L>

This symbol, if defined, indicates that the C<localeconv_l> routine is
available to query certain information about a locale.

=back

=for hackers
Declared and documented at config.h, line 4953

=over 4

=item C<HAS_NEWLOCALE>
X<HAS_NEWLOCALE>

This symbol, if defined, indicates that the C<newlocale> routine is
available to return a new locale object or modify an existing
locale object.

=back

=for hackers
Declared and documented at config.h, line 3128

=over 4

=item C<HAS_NL_LANGINFO>
X<HAS_NL_LANGINFO>

This symbol, if defined, indicates that the C<nl_langinfo> routine is
available to return locale data.  You will also need F<langinfo.h>
and therefore C<I_LANGINFO>.

=back

=for hackers
Declared and documented at config.h, line 3160

=over 4

=item C<HAS_NL_LANGINFO_L>
X<HAS_NL_LANGINFO_L>

This symbol, if defined, indicates that the C<nl_langinfo_l> routine is
available to return locale data.  You will also need F<langinfo.h>
and therefore C<I_LANGINFO>.

=back

=for hackers
Declared and documented at config.h, line 3161

=over 4

=item C<HAS_QUERYLOCALE>
X<HAS_QUERYLOCALE>

This symbol, if defined, indicates that the C<querylocale> routine is
available to return the name of the locale for a category mask.

=back

=for hackers
Declared and documented at config.h, line 3132

=over 4

=item C<HAS_SETLOCALE>
X<HAS_SETLOCALE>

This symbol, if defined, indicates that the C<setlocale> routine is
available to handle locale-specific ctype implementations.

=back

=for hackers
Declared and documented at config.h, line 3299

=over 4

=item C<HAS_SETLOCALE_R>
X<HAS_SETLOCALE_R>

This symbol, if defined, indicates that the C<setlocale_r> routine
is available to setlocale re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 5106

=over 4

=item C<HAS_USELOCALE>
X<HAS_USELOCALE>

This symbol, if defined, indicates that the C<uselocale> routine is
available to set the current locale for the calling thread.

=back

=for hackers
Declared and documented at config.h, line 3130

=over 4

=item C<I_LANGINFO>
X<I_LANGINFO>

This symbol, if defined, indicates that F<langinfo.h> exists and
should be included.

=over 3

 #ifdef I_LANGINFO
     #include <langinfo.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3748

=over 4

=item C<I_LOCALE>
X<I_LOCALE>

This symbol, if defined, indicates to the C program that it should
include F<locale.h>.

=over 3

 #ifdef I_LOCALE
     #include <locale.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 639

=over 4

=item C<I_XLOCALE>
X<I_XLOCALE>

This symbol, if defined, indicates to the C program that the
header F<xlocale.h> is available.  See also C<L</NEED_XLOCALE_H>>

=over 3

 #ifdef I_XLOCALE
     #include <xlocale.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3134

=over 4

=item C<IN_LOCALE>
X<IN_LOCALE>

Evaluates to TRUE if the plain locale pragma without a parameter (S<C<use
locale>>) is in effect.

=over 3

 bool  IN_LOCALE

=back

=back

=for hackers
Declared and documented at perl.h, line 7482

=over 4

=item C<IN_LOCALE_COMPILETIME>
X<IN_LOCALE_COMPILETIME>

Evaluates to TRUE if, when compiling a perl program (including an C<eval>) if
the plain locale pragma without a parameter (S<C<use locale>>) is in effect.

=over 3

 bool  IN_LOCALE_COMPILETIME

=back

=back

=for hackers
Declared and documented at perl.h, line 7487

=over 4

=item C<IN_LOCALE_RUNTIME>
X<IN_LOCALE_RUNTIME>

Evaluates to TRUE if, when executing a perl program (including an C<eval>) if
the plain locale pragma without a parameter (S<C<use locale>>) is in effect.

=over 3

 bool  IN_LOCALE_RUNTIME

=back

=back

=for hackers
Declared and documented at perl.h, line 7492

=over 4

=item C<NEED_XLOCALE_H>
X<NEED_XLOCALE_H>

This symbol, if defined, indicates that the C program should
include F<xlocale.h> to get C<newlocale()> and its friends.

=back

=for hackers
Declared and documented at config.h, line 3133

=over 4

=item C<Perl_langinfo*>

=item C<Perl_langinfo8*>

Described under C<L</sv_langinfo>>

=back

=over 4

=item C<PERL_LC_ALL_CATEGORY_POSITIONS_INIT>
X<PERL_LC_ALL_CATEGORY_POSITIONS_INIT>

This symbol, when defined, gives the C initializer for an array whose
element [0] is the first category in the string returned by
C<setlocale(LC_ALL, NULL)> when not all categories are the same, on
systems that use a positional notation.  After element [0] is
C<LC_ALL_SEPARATOR>, then the category given by element [1] and so on.

=back

=for hackers
Declared and documented at config.h, line 3648

=over 4

=item C<PERL_LC_ALL_SEPARATOR>
X<PERL_LC_ALL_SEPARATOR>

This symbol, if defined, gives the string returned by
C<setlocale(LC_ALL, NULL)> to separate categories that are in different
locales on systems that use a positional notation as opposed to
'name=value' pairs.  An example on some platforms could be the '/' in
"C/C<de_DE>/C/C<en_UK>/C/C"

=back

=for hackers
Declared and documented at config.h, line 3647

=over 4

=item C<PERL_LC_ALL_USES_NAME_VALUE_PAIRS>
X<PERL_LC_ALL_USES_NAME_VALUE_PAIRS>

This symbol, if defined, indicates to the C program that the string
returned by C<setlocale(LC_ALL, NULL)> uses 'name=value;' pairs to
indicate what each category's locale is when they aren't all set to the
same locale.  For example, "C<LC_NUMERIC>=C;C<LC_CTYPE>=C<de_DE>;..."
When not defined, the system uses positional notation.

=back

=for hackers
Declared and documented at config.h, line 3646

=over 4

=item C<Perl_localeconv>
X<Perl_localeconv>

This is a thread-safe version of the libc L<localeconv(3)>.  It is the same as
L<POSIX::localeconv|POSIX/localeconv> (returning a hash of the C<localeconv()>
fields), but directly callable from XS code.  The hash is mortalized, so must
be dealt with immediately.

=over 3

 HV *  Perl_localeconv(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at locale.c, line 5179

=over 4

=item C<Perl_setlocale>
X<Perl_setlocale>

This is an (almost) drop-in replacement for the system C<L<setlocale(3)>>,
taking the same parameters, and returning the same information, except that it
returns the correct underlying C<LC_NUMERIC> locale.  Regular C<setlocale> will
instead return C<C> if the underlying locale has a non-dot decimal point
character, or a non-empty thousands separator for displaying floating point
numbers.  This is because perl keeps that locale category such that it has a
dot and empty separator, changing the locale briefly during the operations
where the underlying one is required. C<Perl_setlocale> knows about this, and
compensates; regular C<setlocale> doesn't.

Another reason it isn't completely a drop-in replacement is that it is
declared to return S<C<const char *>>, whereas the system setlocale omits the
C<const> (presumably because its API was specified long ago, and can't be
updated; it is illegal to change the information C<setlocale> returns; doing
so leads to segfaults.)

Finally, C<Perl_setlocale> works under all circumstances, whereas plain
C<setlocale> can be completely ineffective on some platforms under some
configurations.

Changing the locale is not a good idea when more than one thread is running,
except on systems where the predefined variable C<${^SAFE_LOCALES}> is
non-zero.  This is because on such systems the locale is global to the whole
process and not local to just the thread calling the function.  So changing it
in one thread instantaneously changes it in all.  On some such systems, the
system C<setlocale()> is ineffective, returning the wrong information, and
failing to actually change the locale.  z/OS refuses to try to change the
locale once a second thread is created.  C<Perl_setlocale>, should give you
accurate results of what actually happened on these problematic platforms,
returning NULL if the system forbade the locale change.

The return points to a per-thread static buffer, which is overwritten the next
time C<Perl_setlocale> is called from the same thread.

=over 3

 const char *  Perl_setlocale(const int category,
                              const char *locale)

=back

=back

=for hackers
Declared in embed.fnc; documented at locale.c, line 4437

=over 4

=item C<RESTORE_LC_NUMERIC>
X<RESTORE_LC_NUMERIC>

This is used in conjunction with one of the macros
L</STORE_LC_NUMERIC_SET_TO_NEEDED>
and L</STORE_LC_NUMERIC_FORCE_TO_UNDERLYING> to properly restore the
C<LC_NUMERIC> state.

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro and the two
C<STORE> ones.  This macro should be called as a single statement, not an
expression, but with an empty argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

=over 3

 void  RESTORE_LC_NUMERIC()

=back

=back

=for hackers
Declared and documented at perl.h, line 7683

=over 4

=item C<SETLOCALE_ACCEPTS_ANY_LOCALE_NAME>
X<SETLOCALE_ACCEPTS_ANY_LOCALE_NAME>

This symbol, if defined, indicates that the setlocale routine is
available and it accepts any input locale name as valid.

=back

=for hackers
Declared and documented at config.h, line 3300

=over 4

=item C<STORE_LC_NUMERIC_FORCE_TO_UNDERLYING>
X<STORE_LC_NUMERIC_FORCE_TO_UNDERLYING>

This is used by XS code that is C<LC_NUMERIC> locale-aware to force the
locale for category C<LC_NUMERIC> to be what perl thinks is the current
underlying locale.  (The perl interpreter could be wrong about what the
underlying locale actually is if some C or XS code has called the C library
function L<setlocale(3)> behind its back; calling L</sync_locale> before calling
this macro will update perl's records.)

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro.  This macro
should be called as a single statement, not an expression, but with an empty
argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    STORE_LC_NUMERIC_FORCE_TO_UNDERLYING();
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

The private variable is used to save the current locale state, so
that the requisite matching call to L</RESTORE_LC_NUMERIC> can restore it.

On threaded perls not operating with thread-safe functionality, this macro uses
a mutex to force a critical section.  Therefore the matching RESTORE should be
close by, and guaranteed to be called.

=over 3

 void  STORE_LC_NUMERIC_FORCE_TO_UNDERLYING()

=back

=back

=for hackers
Declared and documented at perl.h, line 7610

=over 4

=item C<STORE_LC_NUMERIC_SET_TO_NEEDED>
X<STORE_LC_NUMERIC_SET_TO_NEEDED>

This is used to help wrap XS or C code that is C<LC_NUMERIC> locale-aware.
This locale category is generally kept set to a locale where the decimal radix
character is a dot, and the separator between groups of digits is empty.  This
is because most XS code that reads floating point numbers is expecting them to
have this syntax.

This macro makes sure the current C<LC_NUMERIC> state is set properly, to be
aware of locale if the call to the XS or C code from the Perl program is
from within the scope of a S<C<use locale>>; or to ignore locale if the call is
instead from outside such scope.

This macro is the start of wrapping the C or XS code; the wrap ending is done
by calling the L</RESTORE_LC_NUMERIC> macro after the operation.  Otherwise
the state can be changed that will adversely affect other XS code.

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro.  This macro
should be called as a single statement, not an expression, but with an empty
argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    STORE_LC_NUMERIC_SET_TO_NEEDED();
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

On threaded perls not operating with thread-safe functionality, this macro uses
a mutex to force a critical section.  Therefore the matching RESTORE should be
close by, and guaranteed to be called; see L</WITH_LC_NUMERIC_SET_TO_NEEDED>
for a more contained way to ensure that.

=over 3

 void  STORE_LC_NUMERIC_SET_TO_NEEDED()

=back

=back

=for hackers
Declared and documented at perl.h, line 7640

=over 4

=item C<STORE_LC_NUMERIC_SET_TO_NEEDED_IN>
X<STORE_LC_NUMERIC_SET_TO_NEEDED_IN>

Same as L</STORE_LC_NUMERIC_SET_TO_NEEDED> with in_lc_numeric provided
as the precalculated value of C<IN_LC(LC_NUMERIC)>. It is the caller's
responsibility to ensure that the status of C<PL_compiling> and C<PL_hints>
cannot have changed since the precalculation.

=over 3

 void  STORE_LC_NUMERIC_SET_TO_NEEDED_IN(bool in_lc_numeric)

=back

=back

=for hackers
Declared and documented at perl.h, line 7676

=over 4

=item C<sv_langinfo>

=item C<Perl_langinfo>

=item C<Perl_langinfo8>
X<Perl_langinfo>X<Perl_langinfo8>X<sv_langinfo>

These perform the equivalent functionality as the system C<L<nl_langinfo(3)>>,
taking the same C<item> parameter values, but are preferred over calling that
directly because they are portable to platforms lacking that function, are
thread-safe, and can automatically handle UTF-8 strings.

The simplest to use is C<sv_langinfo>.  It returns an SV containing the correct
PV and UTF8ness, requiring no extra muss or fuss from you.  New code should use
this form.

C<Perl_langinfo> and C<Perl_langinfo8> are retained for backwards
compatibility.  C<Perl_langinfo> is an (almost) drop-in replacement for the
system C<L<nl_langinfo(3)>>, but exists on systems that lack a native
C<nl_langinfo>.

C<Perl_langinfo8> is identical to C<Perl_langinfo> except for an additional
parameter, a pointer to a variable declared as C<L</utf8ness_t>>, into which it
returns to you how you should treat the returned string with regards to it
being encoded in UTF-8 or not.

C<Perl_langinfo> and C<Perl_langinfo8> share private per-thread memory that
will be changed the next time either one of them is called with any input, but
not before.

Concerning the differences between these functions and plain C<nl_langinfo()>:

=over

=item a.

C<Perl_langinfo8> has an extra parameter, described above.  Besides this, the
other reason they aren't quite a drop-in replacement is actually an advantage.
The C<const>ness of the return allows the compiler to catch attempts to write
into the returned buffer, which is illegal and could cause run-time crashes.

=item b.

They deliver the correct results for the C<RADIXCHAR> and C<THOUSEP> items,
without you having to write extra code.  The reason for the extra code would be
because these are from the C<LC_NUMERIC> locale category, which is normally
kept set by Perl so that the radix is a dot, and the separator is the empty
string, no matter what the underlying locale is supposed to be, and so to get
the expected results, you have to temporarily toggle into the underlying
locale, and later toggle back.  (You could use plain C<nl_langinfo> and
C<L</STORE_LC_NUMERIC_FORCE_TO_UNDERLYING>> for this but then you wouldn't get
the other advantages of C<Perl_langinfo()>; not keeping C<LC_NUMERIC> in the C
(or equivalent) locale would break a lot of CPAN, which is expecting the radix
(decimal point) character to be a dot.)

=item c.

The system function they replace can have its static return buffer trashed,
not only by a subsequent call to that function, but by a C<freelocale>,
C<setlocale>, or other locale change.  C<sv_langinfo> sidesteps this problem
entirely; the returned buffer of the other two is not changed until the next
call to one or the other, so the buffer is never in a trashed state.

=item d.

The return buffer of C<Perl_langinfo> and C<Perl_langinfo8> is per-thread  so
it also is never overwritten by a call to these functions from another thread;
unlike the function they replace.

=item e.

But most importantly, they work on systems that don't have C<nl_langinfo>, such
as Windows, hence making your code more portable.  Of the fifty-some possible
items specified by the POSIX 2008 standard,
L<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>,
only one is completely unimplemented, though on non-Windows platforms, another
significant one is not fully implemented).  They use various techniques to
recover the other items, including calling C<L<localeconv(3)>>, and
C<L<strftime(3)>>, both of which are specified in C89, so should be always be
available.  Later C<strftime()> versions have additional capabilities.
If an item is not available on your system, this returns either the value
associated with the C locale, or simply C<"">, whichever is more appropriate.

It is important to note that, when called with an item that is recovered by
using C<localeconv>, the buffer from any previous explicit call to
C<L<localeconv(3)>> will be overwritten.  But you shouldn't be using
C<localeconv> anyway because it is is very much not thread-safe, and suffers
from the same problems outlined in item 'b.' above for the fields it returns
that are controlled by the LC_NUMERIC locale category.  Instead, avoid all of
those problems by calling L</Perl_localeconv>, which is thread-safe; or by
using the methods given in L<perlcall>  to call
L<C<POSIX::localeconv()>|POSIX/localeconv>, which is also thread-safe.

=back

The details for those items which may deviate from what this emulation returns
and what a native C<nl_langinfo()> would return are specified in
L<I18N::Langinfo>.

=over 3

 SV *               sv_langinfo   (      const nl_item item)
 SV *          Perl_sv_langinfo   (pTHX_ const nl_item item)
 const char *       Perl_langinfo (      const nl_item item)
 const char *       Perl_langinfo8(      const nl_item item,
                                         utf8ness_t *utf8ness)

=back

=back

=for hackers
sv_langinfo declared in embed.fnc; all in group documented at locale.c, line 6069
Perl_langinfo declared in embed.fnc
Perl_langinfo8 declared in embed.fnc

=over 4

=item C<switch_to_global_locale>
X<switch_to_global_locale>

This function copies the locale state of the calling thread into the program's
global locale, and converts the thread to use that global locale.

It is intended so that Perl can safely be used with C libraries that access the
global locale and which can't be converted to not access it.  Effectively, this
means libraries that call C<L<setlocale(3)>> on non-Windows systems.  (For
portability, it is a good idea to use it on Windows as well.)

A downside of using it is that it disables the services that Perl provides to
hide locale gotchas from your code.  The service you most likely will miss
regards the radix character (decimal point) in floating point numbers.  Code
executed after this function is called can no longer just assume that this
character is correct for the current circumstances.

To return to Perl control, and restart the gotcha prevention services, call
C<L</sync_locale>>.  Behavior is undefined for any pure Perl code that executes
while the switch is in effect.

The global locale and the per-thread locales are independent.  As long as just
one thread converts to the global locale, everything works smoothly.  But if
more than one does, they can easily interfere with each other, and races are
likely.  On Windows systems prior to Visual Studio 15 (at which point Microsoft
fixed a bug), races can occur (even if only one thread has been converted to
the global locale), but only if you use the following operations:

=over

=item L<POSIX::localeconv|POSIX/localeconv>

=item L<I18N::Langinfo>, items C<CRNCYSTR> and C<THOUSEP>

=item L<perlapi/sv_langinfo>, items C<CRNCYSTR> and C<THOUSEP>

=back

The first item is not fixable (except by upgrading to a later Visual Studio
release), but it would be possible to work around the latter two items by
having Perl change its algorithm for calculating these to use Windows API
functions (likely C<GetNumberFormat> and C<GetCurrencyFormat>); patches
welcome.

XS code should never call plain C<setlocale>, but should instead be converted
to either call L<C<Perl_setlocale>|perlapi/Perl_setlocale> (which is a drop-in
for the system C<setlocale>) or use the methods given in L<perlcall> to call
L<C<POSIX::setlocale>|POSIX/setlocale>.  Either one will transparently properly
handle all cases of single- vs multi-thread, POSIX 2008-supported or not.

=over 3

 void       switch_to_global_locale()
 void  Perl_switch_to_global_locale(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at locale.c, line 10684

=over 4

=item C<sync_locale>
X<sync_locale>

This function copies the state of the program global locale into the calling
thread, and converts that thread to using per-thread locales, if it wasn't
already, and the platform supports them.  The LC_NUMERIC locale is toggled into
the standard state (using the C locale's conventions), if not within the
lexical scope of S<C<use locale>>.

Perl will now consider itself to have control of the locale.

Since unthreaded perls have only a global locale, this function is a no-op
without threads.

This function is intended for use with C libraries that do locale manipulation.
It allows Perl to accommodate the use of them.  Call this function before
transferring back to Perl space so that it knows what state the C code has left
things in.

XS code should not manipulate the locale on its own.  Instead,
L<C<Perl_setlocale>|perlapi/Perl_setlocale> can be used at any time to query or
change the locale (though changing the locale is antisocial and dangerous on
multi-threaded systems that don't have multi-thread safe locale operations.
(See L<perllocale/Multi-threaded operation>).

Using the libc C<L<setlocale(3)>> function should be avoided.  Nevertheless,
certain non-Perl libraries called from XS, do call it, and their behavior may
not be able to be changed.  This function, along with
C<L</switch_to_global_locale>>, can be used to get seamless behavior in these
circumstances, as long as only one thread is involved.

If the library has an option to turn off its locale manipulation, doing that is
preferable to using this mechanism.  C<Gtk> is such a library.

The return value is a boolean: TRUE if the global locale at the time of call
was in effect for the caller; and FALSE if a per-thread locale was in effect.

=over 3

 bool       sync_locale()
 bool  Perl_sync_locale(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at locale.c, line 10839

=over 4

=item C<WITH_LC_NUMERIC_SET_TO_NEEDED>
X<WITH_LC_NUMERIC_SET_TO_NEEDED>

This macro invokes the supplied statement or block within the context
of a L</STORE_LC_NUMERIC_SET_TO_NEEDED> .. L</RESTORE_LC_NUMERIC> pair
if required, so eg:

  WITH_LC_NUMERIC_SET_TO_NEEDED(
    SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  );

is equivalent to:

  {
#ifdef USE_LOCALE_NUMERIC
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
    STORE_LC_NUMERIC_SET_TO_NEEDED();
#endif
    SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis);
#ifdef USE_LOCALE_NUMERIC
    RESTORE_LC_NUMERIC();
#endif
  }

=over 3

 void  WITH_LC_NUMERIC_SET_TO_NEEDED(block)

=back

=back

=for hackers
Declared and documented at perl.h, line 7702

=over 4

=item C<WITH_LC_NUMERIC_SET_TO_NEEDED_IN>
X<WITH_LC_NUMERIC_SET_TO_NEEDED_IN>

Same as L</WITH_LC_NUMERIC_SET_TO_NEEDED> with in_lc_numeric provided
as the precalculated value of C<IN_LC(LC_NUMERIC)>. It is the caller's
responsibility to ensure that the status of C<PL_compiling> and C<PL_hints>
cannot have changed since the precalculation.

=over 3

 void  WITH_LC_NUMERIC_SET_TO_NEEDED_IN(bool in_lc_numeric, block)

=back

=back

=for hackers
Declared and documented at perl.h, line 7725

=head1 Magic
X<MAGIC>


"Magic" is special data attached to SV structures in order to give them
"magical" properties.  When any Perl code tries to read from, or assign to,
an SV marked as magical, it calls the 'get' or 'set' function associated
with that SV's magic.  A get is called prior to reading an SV, in order to
give it a chance to update its internal value (get on $. writes the line
number of the last read filehandle into the SV's IV slot), while
set is called after an SV has been written to, in order to allow it to make
use of its changed value (set on $/ copies the SV's new value to the
PL_rs global variable).

Magic is implemented as a linked list of MAGIC structures attached to the
SV.  Each MAGIC struct holds the type of the magic, a pointer to an array
of functions that implement the get(), set(), length() etc functions,
plus space for some flags and pointers.  For example, a tied variable has
a MAGIC structure that contains a pointer to the object associated with the
tie.


=over 4

=item C<mg_clear>
X<mg_clear>

Clear something magical that the SV represents.  See C<L</sv_magic>>.

=over 3

 int       mg_clear(      SV *sv)
 int  Perl_mg_clear(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 333

=over 4

=item C<mg_copy>
X<mg_copy>

Copies the magic from one SV to another.  See C<L</sv_magic>>.

=over 3

 int       mg_copy(      SV *sv, SV *nsv, const char *key,
                         I32 klen)
 int  Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key,
                         I32 klen)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 428

=over 4

=item C<mg_find>
X<mg_find>

Finds the magic pointer for C<type> matching the SV.  See C<L</sv_magic>>.

=over 3

 MAGIC *       mg_find(const SV *sv, int type)
 MAGIC *  Perl_mg_find(const SV *sv, int type)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 384

=over 4

=item C<mg_findext>
X<mg_findext>

Finds the magic pointer of C<type> with the given C<vtbl> for the C<SV>.  See
C<L</sv_magicext>>.

=over 3

 MAGIC *       mg_findext(const SV *sv, int type,
                          const MGVTBL *vtbl)
 MAGIC *  Perl_mg_findext(const SV *sv, int type,
                          const MGVTBL *vtbl)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 398

=over 4

=item C<mg_free>
X<mg_free>

Free any magic storage used by the SV.  See C<L</sv_magic>>.

=over 3

 int       mg_free(      SV *sv)
 int  Perl_mg_free(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 532

=over 4

=item C<mg_free_type>
X<mg_free_type>

Remove any magic of type C<how> from the SV C<sv>.  See L</sv_magic>.

=over 3

 void       mg_free_type(      SV *sv, int how)
 void  Perl_mg_free_type(pTHX_ SV *sv, int how)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 558

=over 4

=item C<mg_freeext>
X<mg_freeext>

Remove any magic of type C<how> using virtual table C<vtbl> from the
SV C<sv>.  See L</sv_magic>.

C<mg_freeext(sv, how, NULL)> is equivalent to C<mg_free_type(sv, how)>.

=over 3

 void       mg_freeext(      SV *sv, int how, const MGVTBL *vtbl)
 void  Perl_mg_freeext(pTHX_ SV *sv, int how, const MGVTBL *vtbl)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 591

=over 4

=item C<mg_get>
X<mg_get>

Do magic before a value is retrieved from the SV.  The type of SV must
be >= C<SVt_PVMG>.  See C<L</sv_magic>>.

=over 3

 int       mg_get(      SV *sv)
 int  Perl_mg_get(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 157

=over 4

=item C<mg_magical>
X<mg_magical>

Turns on the magical status of an SV.  See C<L</sv_magic>>.

=over 3

 void       mg_magical(SV *sv)
 void  Perl_mg_magical(SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 125

=over 4

=item C<mg_set>
X<mg_set>

Do magic after a value is assigned to the SV.  See C<L</sv_magic>>.

=over 3

 int       mg_set(      SV *sv)
 int  Perl_mg_set(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mg.c, line 262

=over 4

=item C<MGf_COPY>

=item C<MGf_DUP>

=item C<MGf_LOCAL>

=item C<MGVTBL>

=item C<PERL_MAGIC_arylen>

=item C<PERL_MAGIC_arylen_p>

=item C<PERL_MAGIC_backref>

=item C<PERL_MAGIC_bm>

=item C<PERL_MAGIC_checkcall>

=item C<PERL_MAGIC_collxfrm>

=item C<PERL_MAGIC_dbfile>

=item C<PERL_MAGIC_dbline>

=item C<PERL_MAGIC_debugvar>

=item C<PERL_MAGIC_defelem>

=item C<PERL_MAGIC_destruct>

=item C<PERL_MAGIC_env>

=item C<PERL_MAGIC_envelem>

=item C<PERL_MAGIC_ext>

=item C<PERL_MAGIC_extvalue>

=item C<PERL_MAGIC_fm>

=item C<PERL_MAGIC_hints>

=item C<PERL_MAGIC_hintselem>

=item C<PERL_MAGIC_hook>

=item C<PERL_MAGIC_hookelem>

=item C<PERL_MAGIC_isa>

=item C<PERL_MAGIC_isaelem>

=item C<PERL_MAGIC_lvref>

=item C<PERL_MAGIC_nkeys>

=item C<PERL_MAGIC_nonelem>

=item C<PERL_MAGIC_overload_table>

=item C<PERL_MAGIC_pos>

=item C<PERL_MAGIC_qr>

=item C<PERL_MAGIC_regdata>

=item C<PERL_MAGIC_regdatum>

=item C<PERL_MAGIC_regex_global>

=item C<PERL_MAGIC_rhash>

=item C<PERL_MAGIC_shared>

=item C<PERL_MAGIC_shared_scalar>

=item C<PERL_MAGIC_sig>

=item C<PERL_MAGIC_sigelem>

=item C<PERL_MAGIC_substr>

=item C<PERL_MAGIC_sv>

=item C<PERL_MAGIC_symtab>

=item C<PERL_MAGIC_taint>

=item C<PERL_MAGIC_tied>

=item C<PERL_MAGIC_tiedelem>

=item C<PERL_MAGIC_tiedscalar>

=item C<PERL_MAGIC_utf8>

=item C<PERL_MAGIC_uvar>

=item C<PERL_MAGIC_uvar_elem>

=item C<PERL_MAGIC_vec>

=item C<PERL_MAGIC_vstring>

Described in L<perlguts>.

=back

=for hackers
MGf_COPY all in group documented at pod/perlguts.pod, line 1588
MGf_DUP 
MGf_LOCAL 
MGVTBL 
PERL_MAGIC_arylen 
PERL_MAGIC_arylen_p 
PERL_MAGIC_backref 
PERL_MAGIC_bm 
PERL_MAGIC_checkcall 
PERL_MAGIC_collxfrm 
PERL_MAGIC_dbfile 
PERL_MAGIC_dbline 
PERL_MAGIC_debugvar 
PERL_MAGIC_defelem 
PERL_MAGIC_destruct 
PERL_MAGIC_env 
PERL_MAGIC_envelem 
PERL_MAGIC_ext 
PERL_MAGIC_extvalue 
PERL_MAGIC_fm 
PERL_MAGIC_hints 
PERL_MAGIC_hintselem 
PERL_MAGIC_hook 
PERL_MAGIC_hookelem 
PERL_MAGIC_isa 
PERL_MAGIC_isaelem 
PERL_MAGIC_lvref 
PERL_MAGIC_nkeys 
PERL_MAGIC_nonelem 
PERL_MAGIC_overload_table 
PERL_MAGIC_pos 
PERL_MAGIC_qr 
PERL_MAGIC_regdata 
PERL_MAGIC_regdatum 
PERL_MAGIC_regex_global 
PERL_MAGIC_rhash 
PERL_MAGIC_shared 
PERL_MAGIC_shared_scalar 
PERL_MAGIC_sig 
PERL_MAGIC_sigelem 
PERL_MAGIC_substr 
PERL_MAGIC_sv 
PERL_MAGIC_symtab 
PERL_MAGIC_taint 
PERL_MAGIC_tied 
PERL_MAGIC_tiedelem 
PERL_MAGIC_tiedscalar 
PERL_MAGIC_utf8 
PERL_MAGIC_uvar 
PERL_MAGIC_uvar_elem 
PERL_MAGIC_vec 
PERL_MAGIC_vstring 

=over 4

=item C<SvTIED_obj>

Described in L<perlinterp>.

=over 3

   SvTIED_obj(SV *sv, MAGIC *mg)

=back

=back

=for hackers
Documented at pod/perlinterp.pod, line 841

=head1 Memory Management

=over 4

=item C<dump_mstats>
X<dump_mstats>

When enabled by compiling with C<-DDEBUGGING_MSTATS>, print out statistics
about malloc as two lines of numbers, one showing the length of the free list
for each size category, the second showing the number of S<mallocs - frees> for
each size category.

C<s>, if not NULL, is used as a phrase to include in the output, such as
S<"after compilation">.

=over 3

 void       dump_mstats(      const char *s)
 void  Perl_dump_mstats(pTHX_ const char *s)

=back

=back

=for hackers
Declared in embed.fnc; documented at malloc.c, line 2230

=over 4

=item C<HAS_MALLOC_GOOD_SIZE>
X<HAS_MALLOC_GOOD_SIZE>

This symbol, if defined, indicates that the C<malloc_good_size>
routine is available for use.

=back

=for hackers
Declared and documented at config.h, line 3016

=over 4

=item C<HAS_MALLOC_SIZE>
X<HAS_MALLOC_SIZE>

This symbol, if defined, indicates that the C<malloc_size>
routine is available for use.

=back

=for hackers
Declared and documented at config.h, line 3010

=over 4

=item C<HASATTRIBUTE_MALLOC>
X<HASATTRIBUTE_MALLOC>

Can we handle C<GCC> attribute for malloc-style functions.

=back

=for hackers
Declared and documented at config.h, line 1477

=over 4

=item C<I_MALLOCMALLOC>
X<I_MALLOCMALLOC>

This symbol, if defined, indicates to the C program that it should
include F<malloc/malloc.h>.

=over 3

 #ifdef I_MALLOCMALLOC
     #include <mallocmalloc.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3760

=over 4

=item C<MYMALLOC>
X<MYMALLOC>

This symbol, if defined, indicates that we're using our own malloc.

=back

=for hackers
Declared and documented at config.h, line 2200

=over 4

=item C<Newx>

=item C<safemalloc>
X<Newx>X<safemalloc>

The XSUB-writer's interface to the C C<malloc> function.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

In 5.9.3, Newx() and friends replace the older New() API, and drops
the first parameter, I<x>, a debug aid which allowed callers to identify
themselves.  This aid has been superseded by a new build option,
PERL_MEM_LOG (see L<perlhacktips/PERL_MEM_LOG>).  The older API is still
there for use in XS modules supporting older perls.

=over 3

 void   Newx      (void* ptr, int nitems, type)
 void*  safemalloc(size_t size)

=back

=back

=for hackers
Newx declared at handy.h, line 2604; all in group documented at handy.h, line 2604
safemalloc declared at handy.h, line 2605

=over 4

=item C<Newxc>
X<Newxc>

The XSUB-writer's interface to the C C<malloc> function, with
cast.  See also C<L</Newx>>.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=over 3

 void  Newxc(void* ptr, int nitems, type, cast)

=back

=back

=for hackers
Declared and documented at handy.h, line 2617

=over 4

=item C<Newxz>

=item C<safecalloc>
X<Newxz>X<safecalloc>

The XSUB-writer's interface to the C C<calloc> function.  The allocated
memory is zeroed with C<memzero>.  See also C<L</Newx>>.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=over 3

 void   Newxz     (void* ptr, int nitems, type)
 void*  safecalloc(size_t nitems, size_t item_size)

=back

=back

=for hackers
Newxz declared at handy.h, line 2623; all in group documented at handy.h, line 2623
safecalloc declared at handy.h, line 2624

=over 4

=item C<PERL_MALLOC_WRAP>
X<PERL_MALLOC_WRAP>

This symbol, if defined, indicates that we'd like malloc wrap checks.

=back

=for hackers
Declared and documented at config.h, line 2195

=over 4

=item C<Renew>

=item C<saferealloc>
X<Renew>X<saferealloc>

The XSUB-writer's interface to the C C<realloc> function.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=over 3

 void   Renew      (void* ptr, int nitems, type)
 void*  saferealloc(void *ptr, size_t size)

=back

=back

=for hackers
Renew declared at handy.h, line 2631; all in group documented at handy.h, line 2631
saferealloc declared at handy.h, line 2632

=over 4

=item C<Renewc>
X<Renewc>

The XSUB-writer's interface to the C C<realloc> function, with
cast.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=over 3

 void  Renewc(void* ptr, int nitems, type, cast)

=back

=back

=for hackers
Declared and documented at handy.h, line 2638

=over 4

=item C<safecalloc*>

Described under C<L</Newxz>>

=back

=over 4

=item C<Safefree>
X<Safefree>

The XSUB-writer's interface to the C C<free> function.

This should B<ONLY> be used on memory obtained using L</"Newx"> and friends.

=over 3

 void  Safefree(void* ptr)

=back

=back

=for hackers
Declared and documented at handy.h, line 2644

=over 4

=item C<safemalloc*>

Described under C<L</Newx>>

=back

=over 4

=item C<saferealloc*>

Described under C<L</Renew>>

=back

=over 4

=item C<safesyscalloc>
X<safesyscalloc>

Safe version of system's calloc()

=over 3

 Malloc_t       safesyscalloc(MEM_SIZE elements, MEM_SIZE size)
 Malloc_t  Perl_safesyscalloc(MEM_SIZE elements, MEM_SIZE size)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 439

=over 4

=item C<safesysfree>
X<safesysfree>

Safe version of system's free()

=over 3

 Free_t       safesysfree(Malloc_t where)
 Free_t  Perl_safesysfree(Malloc_t where)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 368

=over 4

=item C<safesysmalloc>
X<safesysmalloc>

Paranoid version of system's malloc()

=over 3

 Malloc_t       safesysmalloc(MEM_SIZE nbytes)
 Malloc_t  Perl_safesysmalloc(MEM_SIZE nbytes)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 143

=over 4

=item C<safesysrealloc>
X<safesysrealloc>

Paranoid version of system's realloc()

=over 3

 Malloc_t       safesysrealloc(Malloc_t where, MEM_SIZE nbytes)
 Malloc_t  Perl_safesysrealloc(Malloc_t where, MEM_SIZE nbytes)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 232

=head1 MRO


These functions are related to the method resolution order of perl classes
Also see L<perlmroapi>.


=over 4

=item C<HvMROMETA>

Described in L<perlmroapi>.

=over 3

 struct mro_meta *  HvMROMETA(HV *hv)

=back

=back

=for hackers
Documented at pod/perlmroapi.pod, line 82

=over 4

=item C<mro_get_from_name>
X<mro_get_from_name>

Returns the previously registered mro with the given C<name>, or NULL if not
registered.  See L</C<mro_register>>.

=over 3

 const struct mro_alg *  Perl_mro_get_from_name(pTHX_ SV *name)

=back

=back

=for hackers
Declared in embed.fnc; documented at mro_core.c, line 107

=over 4

=item C<mro_get_linear_isa>
X<mro_get_linear_isa>

Returns the mro linearisation for the given stash.  By default, this
will be whatever C<mro_get_linear_isa_dfs> returns unless some
other MRO is in effect for the stash.  The return value is a
read-only AV* whose values are string SVs giving class names.

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 3

 AV *       mro_get_linear_isa(      HV *stash)
 AV *  Perl_mro_get_linear_isa(pTHX_ HV *stash)

=back

=back

=for hackers
Declared in embed.fnc; documented at mro_core.c, line 398

=over 4

=item C<MRO_GET_PRIVATE_DATA>

Described in L<perlmroapi>.

=over 3

 SV*  MRO_GET_PRIVATE_DATA(struct mro_meta *const smeta,
                           const struct mro_alg *const which)

=back

=back

=for hackers
Documented at pod/perlmroapi.pod, line 83

=over 4

=item C<mro_method_changed_in>
X<mro_method_changed_in>

Invalidates method caching on any child classes
of the given stash, so that they might notice
the changes in this one.

Ideally, all instances of C<PL_sub_generation++> in
perl source outside of F<mro.c> should be
replaced by calls to this.

Perl automatically handles most of the common
ways a method might be redefined.  However, there
are a few ways you could change a method in a stash
without the cache code noticing, in which case you
need to call this method afterwards:

1) Directly manipulating the stash HV entries from
XS code.

2) Assigning a reference to a readonly scalar
constant into a stash entry in order to create
a constant subroutine (like F<constant.pm>
does).

This same method is available from pure perl
via, C<mro::method_changed_in(classname)>.

=over 3

 void       mro_method_changed_in(      HV *stash)
 void  Perl_mro_method_changed_in(pTHX_ HV *stash)

=back

=back

=for hackers
Declared in embed.fnc; documented at mro_core.c, line 1300

=over 4

=item C<mro_register>
X<mro_register>

Registers a custom mro plugin.  See L<perlmroapi> for details on this and other
mro functions.

=over 3

 void  Perl_mro_register(pTHX_ const struct mro_alg *mro)

=back

=back

=for hackers
Declared in embed.fnc; documented at mro_core.c, line 131

=over 4

=item C<mro_set_mro>
X<mro_set_mro>

Set C<meta> to the value contained in the registered mro plugin whose name is
C<name>.

Croaks if C<name> hasn't been registered

=over 3

 void  Perl_mro_set_mro(pTHX_ struct mro_meta * const meta,
                              SV * const name)

=back

=back

=for hackers
Declared in embed.fnc; documented at mro_core.c, line 1385

=over 4

=item C<mro_set_private_data>

Described in L<perlmroapi>.

=over 3

 SV *  Perl_mro_set_private_data(pTHX_
                               struct mro_meta * const smeta,
                               const struct mro_alg * const which,
                               SV * const data)

=back

=back

=for hackers
Declared in embed.fnc; documented at pod/perlmroapi.pod, line 89

=head1 Multicall Functions

=over 4

=item C<dMULTICALL>
X<dMULTICALL>

Declare local variables for a multicall.  See L<perlcall/LIGHTWEIGHT CALLBACKS>.

=over 3

   dMULTICALL;

=back

=back

=for hackers
Declared and documented at cop.h, line 1371

=over 4

=item C<MULTICALL>
X<MULTICALL>

Make a lightweight callback.  See L<perlcall/LIGHTWEIGHT CALLBACKS>.

=over 3

   MULTICALL;

=back

=back

=for hackers
Declared and documented at cop.h, line 1378

=over 4

=item C<POP_MULTICALL>
X<POP_MULTICALL>

Closing bracket for a lightweight callback.
See L<perlcall/LIGHTWEIGHT CALLBACKS>.

=over 3

   POP_MULTICALL;

=back

=back

=for hackers
Declared and documented at cop.h, line 1381

=over 4

=item C<PUSH_MULTICALL>
X<PUSH_MULTICALL>

Opening bracket for a lightweight callback.
See L<perlcall/LIGHTWEIGHT CALLBACKS>.

=over 3

   PUSH_MULTICALL(CV* the_cv);

=back

=back

=for hackers
Declared and documented at cop.h, line 1374

=head1 Numeric Functions
X<IS_NUMBER_GREATER_THAN_UV_MAX>X<IS_NUMBER_IN_UV>X<IS_NUMBER_INFINITY>
X<IS_NUMBER_NAN>X<IS_NUMBER_NEG>X<IS_NUMBER_NOT_INT>X<IS_NUMBER_TRAILING>
X<PERL_SCAN_ALLOW_UNDERSCORES>X<PERL_SCAN_DISALLOW_PREFIX>
X<PERL_SCAN_GREATER_THAN_UV_MAX>X<PERL_SCAN_SILENT_ILLDIGIT>
X<PERL_SCAN_TRAILING>

=over 4

=item C<Atof*>

Described under C<L</my_atof>>

=back

=over 4

=item C<grok_atoUV>
X<grok_atoUV>

parse a string, looking for a decimal unsigned integer.

On entry, C<pv> points to the beginning of the string;
C<valptr> points to a UV that will receive the converted value, if found;
C<endptr> is either NULL or points to a variable that points to one byte
beyond the point in C<pv> that this routine should examine.
If C<endptr> is NULL, C<pv> is assumed to be NUL-terminated.

Returns FALSE if C<pv> doesn't represent a valid unsigned integer value (with
no leading zeros).  Otherwise it returns TRUE, and sets C<*valptr> to that
value.

If you constrain the portion of C<pv> that is looked at by this function (by
passing a non-NULL C<endptr>), and if the initial bytes of that portion form a
valid value, it will return TRUE, setting C<*endptr> to the byte following the
final digit of the value.  But if there is no constraint at what's looked at,
all of C<pv> must be valid in order for TRUE to be returned.  C<*endptr> is
unchanged from its value on input if FALSE is returned;

The only characters this accepts are the decimal digits '0'..'9'.

As opposed to L<atoi(3)> or L<strtol(3)>, C<grok_atoUV> does NOT allow optional
leading whitespace, nor negative inputs.  If such features are required, the
calling code needs to explicitly implement those.

Note that this function returns FALSE for inputs that would overflow a UV,
or have leading zeros.  Thus a single C<0> is accepted, but not C<00> nor
C<01>, C<002>, I<etc>.

Background: C<atoi> has severe problems with illegal inputs, it cannot be
used for incremental parsing, and therefore should be avoided
C<atoi> and C<strtol> are also affected by locale settings, which can also be
seen as a bug (global state controlled by user environment).

=over 3

 bool       grok_atoUV(const char *pv, UV *valptr,
                       const char **endptr)
 bool  Perl_grok_atoUV(const char *pv, UV *valptr,
                       const char **endptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 1310

=over 4

=item C<grok_bin>
X<grok_bin>

converts a string representing a binary number to numeric form.

On entry C<start> and C<*len_p> give the string to scan, C<*flags> gives
conversion flags, and C<result> should be C<NULL> or a pointer to an NV.  The
scan stops at the end of the string, or at just before the first invalid
character.  Unless C<PERL_SCAN_SILENT_ILLDIGIT> is set in C<*flags>,
encountering an invalid character (except NUL) will also trigger a warning.  On
return C<*len_p> is set to the length of the scanned string, and C<*flags>
gives output flags.

If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,
and nothing is written to C<*result>.  If the value is > C<UV_MAX>, C<grok_bin>
returns C<UV_MAX>, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
and writes an approximation of the correct value into C<*result> (which is an
NV; or the approximation is discarded if C<result> is NULL).

The binary number may optionally be prefixed with C<"0b"> or C<"b"> unless
C<PERL_SCAN_DISALLOW_PREFIX> is set in C<*flags> on entry.

If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in C<*flags> then any or all pairs of
digits may be separated from each other by a single underscore; also a single
leading underscore is accepted.

=over 3

 UV       grok_bin(      const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)
 UV  Perl_grok_bin(pTHX_ const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 220

=over 4

=item C<grok_hex>
X<grok_hex>

converts a string representing a hex number to numeric form.

On entry C<start> and C<*len_p> give the string to scan, C<*flags> gives
conversion flags, and C<result> should be C<NULL> or a pointer to an NV.  The
scan stops at the end of the string, or at just before the first invalid
character.  Unless C<PERL_SCAN_SILENT_ILLDIGIT> is set in C<*flags>,
encountering an invalid character (except NUL) will also trigger a warning.  On
return C<*len_p> is set to the length of the scanned string, and C<*flags>
gives output flags.

If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,
and nothing is written to C<*result>.  If the value is > C<UV_MAX>, C<grok_hex>
returns C<UV_MAX>, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
and writes an approximation of the correct value into C<*result> (which is an
NV; or the approximation is discarded if C<result> is NULL).

The hex number may optionally be prefixed with C<"0x"> or C<"x"> unless
C<PERL_SCAN_DISALLOW_PREFIX> is set in C<*flags> on entry.

If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in C<*flags> then any or all pairs of
digits may be separated from each other by a single underscore; also a single
leading underscore is accepted.

=over 3

 UV       grok_hex(      const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)
 UV  Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 266

=over 4

=item C<grok_infnan>
X<grok_infnan>

Helper for C<grok_number()>, accepts various ways of spelling "infinity"
or "not a number", and returns one of the following flag combinations:

  IS_NUMBER_INFINITY
  IS_NUMBER_NAN
  IS_NUMBER_INFINITY | IS_NUMBER_NEG
  IS_NUMBER_NAN | IS_NUMBER_NEG
  0

possibly |-ed with C<IS_NUMBER_TRAILING>.

If an infinity or a not-a-number is recognized, C<*sp> will point to
one byte past the end of the recognized string.  If the recognition fails,
zero is returned, and C<*sp> will not move.

=over 3

 int       grok_infnan(      const char **sp, const char *send)
 int  Perl_grok_infnan(pTHX_ const char **sp, const char *send)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 728

=over 4

=item C<grok_number>

=item C<grok_number_flags>
X<grok_number>X<grok_number_flags>

Look for a number in the C<len> bytes starting at C<pv>.  If one isn't found,
return 0; otherwise return its type (and optionally its value).  In
C<grok_number> all C<len> bytes must be either leading C<L</isSPACE>>
characters or part of the number.  The same is true in C<grok_number_flags>
unless C<flags> contains the C<PERL_SCAN_TRAILING> bit, which allows for
trailing non-numeric text.  (This is the only difference between the two
functions.)

The returned type is the ORing of various bits (#defined in F<perl.h>) as
described below:

If the number is negative, the returned type will include the C<IS_NUMBER_NEG>
bit.

If the absolute value of the integral portion of the found number fits in a UV,
the returned type will include the C<IS_NUMBER_IN_UV> bit.  If it won't fit,
instead the C<IS_NUMBER_GREATER_THAN_UV_MAX> bit will be included.

If the found number is not an integer, the returned type will include
the C<IS_NUMBER_NOT_INT> bit. This happens either if the number
is expressed in exponential C<e> notation, or if it includes a decimal
point (radix) character.  If exponential notation is used, then neither
IS_NUMBER_IN_UV nor IS_NUMBER_GREATER_THAN_UV_MAX bits are set.
Otherwise, the integer part of the number is used to determine the
C<IS_NUMBER_IN_UV> and C<IS_NUMBER_GREATER_THAN_UV_MAX> bits.

If the found number is a string indicating it is infinity, the
C<IS_NUMBER_INFINITY> and C<IS_NUMBER_NOT_INT> bits are included in the
returned type.

If the found number is a string indicating it is not a number, the
C<IS_NUMBER_NAN> and C<IS_NUMBER_NOT_INT> bits are included in the
returned type.

You can get the number's absolute integral value returned to you by calling
these functions with a non-NULL C<valuep> argument.  If the returned type
includes the C<IS_NUMBER_IN_UV> bit, C<*valuep> will be set to the correct
value.  Otherwise, it could well have been zapped with garbage.

In C<grok_number_flags> when C<flags> contains the C<PERL_SCAN_TRAILING>
bit, and trailing non-numeric text was found, the returned type will include
the C<IS_NUMBER_TRAILING> bit.

=over 3

 int       grok_number      (      const char *pv, STRLEN len,
                                   UV *valuep)
 int  Perl_grok_number      (pTHX_ const char *pv, STRLEN len,
                                   UV *valuep)
 int       grok_number_flags(      const char *pv, STRLEN len,
                                   UV *valuep, U32 flags)
 int  Perl_grok_number_flags(pTHX_ const char *pv, STRLEN len,
                                   UV *valuep, U32 flags)

=back

=back

=for hackers
grok_number declared in embed.fnc; all in group documented at numeric.c, line 998
grok_number_flags declared in embed.fnc

=over 4

=item C<grok_numeric_radix>

=item C<GROK_NUMERIC_RADIX>
X<GROK_NUMERIC_RADIX>X<grok_numeric_radix>

These are identical.

Scan and skip for a numeric decimal separator (radix).

=over 3

 bool       grok_numeric_radix(      const char **sp,
                                     const char *send)
 bool  Perl_grok_numeric_radix(pTHX_ const char **sp,
                                     const char *send)
 bool       GROK_NUMERIC_RADIX(      const char **sp,
                                     const char *send)

=back

=back

=for hackers
grok_numeric_radix declared in embed.fnc; all in group documented at numeric.c, line 674
GROK_NUMERIC_RADIX declared at perl.h, line 8262

=over 4

=item C<grok_oct>
X<grok_oct>

converts a string representing an octal number to numeric form.

On entry C<start> and C<*len_p> give the string to scan, C<*flags> gives
conversion flags, and C<result> should be C<NULL> or a pointer to an NV.  The
scan stops at the end of the string, or at just before the first invalid
character.  Unless C<PERL_SCAN_SILENT_ILLDIGIT> is set in C<*flags>,
encountering an invalid character (except NUL) will also trigger a warning.  On
return C<*len_p> is set to the length of the scanned string, and C<*flags>
gives output flags.

If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,
and nothing is written to C<*result>.  If the value is > C<UV_MAX>, C<grok_oct>
returns C<UV_MAX>, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
and writes an approximation of the correct value into C<*result> (which is an
NV; or the approximation is discarded if C<result> is NULL).

If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in C<*flags> then any or all pairs of
digits may be separated from each other by a single underscore; also a single
leading underscore is accepted.

The C<PERL_SCAN_DISALLOW_PREFIX> flag is always treated as being set for
this function.

=over 3

 UV       grok_oct(      const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)
 UV  Perl_grok_oct(pTHX_ const char *start, STRLEN *len_p,
                         I32 *flags, NV *result)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 307

=over 4

=item C<isinfnan>
X<isinfnan>

C<Perl_isinfnan()> is a utility function that returns true if the NV
argument is either an infinity or a C<NaN>, false otherwise.  To test
in more detail, use C<Perl_isinf()> and C<Perl_isnan()>.

This is also the logical inverse of Perl_isfinite().

=over 3

 bool       isinfnan(NV nv)
 bool  Perl_isinfnan(NV nv)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 1912

=over 4

=item C<my_atof>

=item C<Atof>
X<Atof>X<my_atof>

These each are C<L<atof(3)>>, but properly work with Perl locale handling,
accepting a dot radix character always, but also the current locale's radix
character if and only if called from within the lexical scope of a Perl C<use
locale> statement.

N.B. C<s> must be NUL terminated.

=over 3

 NV       my_atof(      const char *s)
 NV  Perl_my_atof(pTHX_ const char *s)
 NV       Atof   (      const char * const s)

=back

=back

=for hackers
my_atof declared in embed.fnc; all in group documented at numeric.c, line 1516
Atof declared at perl.h, line 3085

=over 4

=item C<my_strtod>

=item C<Strtod>
X<my_strtod>X<Strtod>

These are identical.

They act like the libc C<L<strtod(3)>> function, with three exceptions:

=over

=item 1.

Their return value is an NV.  Plain C<strod> returns a double precision value.

=item 2.

Plain C<strtod> always is expecting the radix character (or string) to be the
one specified by the underlying locale the program is executing in.  This is
almost universally a dot (U+002E) or a comma (U+002C).

In contrast, these expect the radix to be a dot, except when called from within
the scope of S<C<use locale>>, in which case they act like plain C<strtod>,
expecting the radix to be that specified by the current locale.

=item 3.

These are are available even on platforms that lack plain strtod().

=back

=over 3

 NV       my_strtod(const char * const s, char **e)
 NV  Perl_my_strtod(const char * const s, char **e)
 NV       Strtod   (const char * const s, char **e)

=back

=back

=for hackers
my_strtod declared in embed.fnc; all in group documented at numeric.c, line 79
Strtod declared at perl.h, line 7944

=over 4

=item C<PERL_ABS>
X<PERL_ABS>

Typeless C<abs> or C<fabs>, I<etc>.  (The usage below indicates it is for
integers, but it works for any type.)  Use instead of these, since the C
library ones force their argument to be what it is expecting, potentially
leading to disaster.  But also beware that this evaluates its argument twice,
so no C<x++>.

=over 3

 int  PERL_ABS(int x)

=back

=back

=for hackers
Declared and documented at perl.h, line 8383

=over 4

=item C<Perl_acos>

=item C<Perl_asin>

=item C<Perl_atan>

=item C<Perl_atan2>

=item C<Perl_ceil>

=item C<Perl_cos>

=item C<Perl_cosh>

=item C<Perl_exp>

=item C<Perl_floor>

=item C<Perl_fmod>

=item C<Perl_frexp>

=item C<Perl_isfinite>

=item C<Perl_isinf>

=item C<Perl_isnan>

=item C<Perl_ldexp>

=item C<Perl_log>

=item C<Perl_log10>

=item C<Perl_modf>

=item C<Perl_pow>

=item C<Perl_sin>

=item C<Perl_sinh>

=item C<Perl_sqrt>

=item C<Perl_tan>

=item C<Perl_tanh>
X<Perl_acos>X<Perl_asin>X<Perl_atan>X<Perl_atan2>X<Perl_ceil>X<Perl_cos>
X<Perl_cosh>X<Perl_exp>X<Perl_floor>X<Perl_fmod>X<Perl_frexp>
X<Perl_isfinite>X<Perl_isinf>X<Perl_isnan>X<Perl_ldexp>X<Perl_log>
X<Perl_log10>X<Perl_modf>X<Perl_pow>X<Perl_sin>X<Perl_sinh>X<Perl_sqrt>
X<Perl_tan>X<Perl_tanh>

These perform the corresponding mathematical operation on the operand(s), using
the libc function designed for the task that has just enough precision for an
NV on this platform.  If no such function with sufficient precision exists,
the highest precision one available is used.

=over 3

 NV  Perl_acos    (NV x)
 NV  Perl_asin    (NV x)
 NV  Perl_atan    (NV x)
 NV  Perl_atan2   (NV x, NV y)
 NV  Perl_ceil    (NV x)
 NV  Perl_cos     (NV x)
 NV  Perl_cosh    (NV x)
 NV  Perl_exp     (NV x)
 NV  Perl_floor   (NV x)
 NV  Perl_fmod    (NV x, NV y)
 NV  Perl_frexp   (NV x, int *exp)
 IV  Perl_isfinite(NV x)
 IV  Perl_isinf   (NV x)
 IV  Perl_isnan   (NV x)
 NV  Perl_ldexp   (NV x, int exp)
 NV  Perl_log     (NV x)
 NV  Perl_log10   (NV x)
 NV  Perl_modf    (NV x, NV *iptr)
 NV  Perl_pow     (NV x, NV y)
 NV  Perl_sin     (NV x)
 NV  Perl_sinh    (NV x)
 NV  Perl_sqrt    (NV x)
 NV  Perl_tan     (NV x)
 NV  Perl_tanh    (NV x)

=back

=back

=for hackers
Perl_acos declared at perl.h, line 3094; all in group documented at perl.h, line 3094
Perl_asin declared at perl.h, line 3095
Perl_atan declared at perl.h, line 3096
Perl_atan2 declared at perl.h, line 3097
Perl_ceil declared at perl.h, line 3098
Perl_cos declared at perl.h, line 3099
Perl_cosh declared at perl.h, line 3100
Perl_exp declared at perl.h, line 3101
Perl_floor declared at perl.h, line 3102
Perl_fmod declared at perl.h, line 3103
Perl_frexp declared at perl.h, line 3104
Perl_isfinite declared at perl.h, line 3105
Perl_isinf declared at perl.h, line 3106
Perl_isnan declared at perl.h, line 3107
Perl_ldexp declared at perl.h, line 3108
Perl_log declared at perl.h, line 3109
Perl_log10 declared at perl.h, line 3110
Perl_modf declared at perl.h, line 3111
Perl_pow declared at perl.h, line 3112
Perl_sin declared at perl.h, line 3113
Perl_sinh declared at perl.h, line 3114
Perl_sqrt declared at perl.h, line 3115
Perl_tan declared at perl.h, line 3116
Perl_tanh declared at perl.h, line 3117

=over 4

=item C<Perl_signbit>
X<Perl_signbit>

NOTE: C<Perl_signbit> is B<experimental> and may change or be
removed without notice.

Return a non-zero integer if the sign bit on an NV is set, and 0 if
it is not.

If F<Configure> detects this system has a C<signbit()> that will work with
our NVs, then we just use it via the C<#define> in F<perl.h>.  Otherwise,
fall back on this implementation.  The main use of this function
is catching C<-0.0>.

C<Configure> notes:  This function is called C<'Perl_signbit'> instead of a
plain C<'signbit'> because it is easy to imagine a system having a C<signbit()>
function or macro that doesn't happen to work with our particular choice
of NVs.  We shouldn't just re-C<#define> C<signbit> as C<Perl_signbit> and expect
the standard system headers to be happy.  Also, this is a no-context
function (no C<pTHX_>) because C<Perl_signbit()> is usually re-C<#defined> in
F<perl.h> as a simple macro call to the system's C<signbit()>.
Users should just always call C<Perl_signbit()>.

=over 3

 int  Perl_signbit(NV f)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 1999

=over 4

=item C<Perl_sin*>

=item C<Perl_sinh*>

=item C<Perl_sqrt*>

=item C<Perl_tan*>

=item C<Perl_tanh*>

Described under C<L</Perl_acos>>

=back

=over 4

=item C<PL_hexdigit>
X<PL_hexdigit>

This array, indexed by an integer, converts that value into the character that
represents it.  For example, if the input is 8, the return will be a string
whose first character is '8'.  What is actually returned is a pointer into a
string.  All you are interested in is the first character of that string.  To
get uppercase letters (for the values 10..15), add 16 to the index.  Hence,
C<PL_hexdigit[11]> is C<'b'>, and C<PL_hexdigit[11+16]> is C<'B'>.  Adding 16
to an index whose representation is '0'..'9' yields the same as not adding 16.
Indices outside the range 0..31 result in (bad) undefined behavior.

=back

=for hackers
Declared and documented at perl.h, line 5416

=over 4

=item C<READ_XDIGIT>
X<READ_XDIGIT>

Returns the value of an ASCII-range hex digit and advances the string pointer.
Behaviour is only well defined when isXDIGIT(*str) is true.

=over 3

 U8  READ_XDIGIT(char str*)

=back

=back

=for hackers
Declared and documented at handy.h, line 1162

=over 4

=item C<scan_bin>
X<scan_bin>

For backwards compatibility.  Use C<grok_bin> instead.

=over 3

 NV       scan_bin(      const char *start, STRLEN len,
                         STRLEN *retlen)
 NV  Perl_scan_bin(pTHX_ const char *start, STRLEN len,
                         STRLEN *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 619

=over 4

=item C<scan_hex>
X<scan_hex>

For backwards compatibility.  Use C<grok_hex> instead.

=over 3

 NV       scan_hex(      const char *start, STRLEN len,
                         STRLEN *retlen)
 NV  Perl_scan_hex(pTHX_ const char *start, STRLEN len,
                         STRLEN *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 623

=over 4

=item C<scan_oct>
X<scan_oct>

For backwards compatibility.  Use C<grok_oct> instead.

=over 3

 NV       scan_oct(      const char *start, STRLEN len,
                         STRLEN *retlen)
 NV  Perl_scan_oct(pTHX_ const char *start, STRLEN len,
                         STRLEN *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at numeric.c, line 627

=over 4

=item C<Strtod*>

Described under C<L</my_strtod>>

=back

=over 4

=item C<Strtol>
X<Strtol>

Platform and configuration independent C<strtol>.  This expands to the
appropriate C<strotol>-like function based on the platform and F<Configure>
options>.  For example it could expand to C<strtoll> or C<strtoq> instead of
C<strtol>.

=over 3

 NV  Strtol(const char * const s, char ** e, int base)

=back

=back

=for hackers
Declared and documented at perl.h, line 7946

=over 4

=item C<Strtoul>
X<Strtoul>

Platform and configuration independent C<strtoul>.  This expands to the
appropriate C<strotoul>-like function based on the platform and F<Configure>
options>.  For example it could expand to C<strtoull> or C<strtouq> instead of
C<strtoul>.

=over 3

 NV  Strtoul(const char * const s, char ** e, int base)

=back

=back

=for hackers
Declared and documented at perl.h, line 7953

=head1 Optrees
X<CALL_CHECKER_REQUIRE_GV>X<OPf_KIDS>X<OPpEARLY_CV>X<OPpENTERSUB_AMPER>
X<RV2CVOPCV_MARK_EARLY>X<RV2CVOPCV_RETURN_NAME_GV>

=over 4

=item C<alloccopstash>
X<alloccopstash>

NOTE: C<alloccopstash> is B<experimental> and may change or be
removed without notice.

Available only under threaded builds, this function allocates an entry in
C<PL_stashpad> for the stash passed to it.

=over 3

 PADOFFSET       alloccopstash(      HV *hv)
 PADOFFSET  Perl_alloccopstash(pTHX_ HV *hv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 834

=over 4

=item C<BINOP>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 2604

=over 4

=item C<block_end>
X<block_end>

Handles compile-time scope exit.  C<floor>
is the savestack index returned by
C<block_start>, and C<seq> is the body of the block.  Returns the block,
possibly modified.

=over 3

 OP *       block_end(      I32 floor, OP *seq)
 OP *  Perl_block_end(pTHX_ I32 floor, OP *seq)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 4594

=over 4

=item C<block_start>
X<block_start>

Handles compile-time scope entry.
Arranges for hints to be restored on block
exit and also handles pad sequence numbers to make lexical variables scope
right.  Returns a savestack index for use with C<block_end>.

=over 3

 int       block_start(      int full)
 int  Perl_block_start(pTHX_ int full)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 4563

=over 4

=item C<ck_entersub_args_list>
X<ck_entersub_args_list>

Performs the default fixup of the arguments part of an C<entersub>
op tree.  This consists of applying list context to each of the
argument ops.  This is the standard treatment used on a call marked
with C<&>, or a method call, or a call through a subroutine reference,
or any other call where the callee can't be identified at compile time,
or a call where the callee has no prototype.

=over 3

 OP *       ck_entersub_args_list(      OP *entersubop)
 OP *  Perl_ck_entersub_args_list(pTHX_ OP *entersubop)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 14687

=over 4

=item C<ck_entersub_args_proto>
X<ck_entersub_args_proto>

Performs the fixup of the arguments part of an C<entersub> op tree
based on a subroutine prototype.  This makes various modifications to
the argument ops, from applying context up to inserting C<refgen> ops,
and checking the number and syntactic types of arguments, as directed by
the prototype.  This is the standard treatment used on a subroutine call,
not marked with C<&>, where the callee can be identified at compile time
and has a prototype.

C<protosv> supplies the subroutine prototype to be applied to the call.
It may be a normal defined scalar, of which the string value will be used.
Alternatively, for convenience, it may be a subroutine object (a C<CV*>
that has been cast to C<SV*>) which has a prototype.  The prototype
supplied, in whichever form, does not need to match the actual callee
referenced by the op tree.

If the argument ops disagree with the prototype, for example by having
an unacceptable number of arguments, a valid op tree is returned anyway.
The error is reflected in the parser state, normally resulting in a single
exception at the top level of parsing which covers all the compilation
errors that occurred.  In the error message, the callee is referred to
by the name defined by the C<namegv> parameter.

=over 3

 OP *       ck_entersub_args_proto(      OP *entersubop,
                                         GV *namegv, SV *protosv)
 OP *  Perl_ck_entersub_args_proto(pTHX_ OP *entersubop,
                                         GV *namegv, SV *protosv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 14724

=over 4

=item C<ck_entersub_args_proto_or_list>
X<ck_entersub_args_proto_or_list>

Performs the fixup of the arguments part of an C<entersub> op tree either
based on a subroutine prototype or using default list-context processing.
This is the standard treatment used on a subroutine call, not marked
with C<&>, where the callee can be identified at compile time.

C<protosv> supplies the subroutine prototype to be applied to the call,
or indicates that there is no prototype.  It may be a normal scalar,
in which case if it is defined then the string value will be used
as a prototype, and if it is undefined then there is no prototype.
Alternatively, for convenience, it may be a subroutine object (a C<CV*>
that has been cast to C<SV*>), of which the prototype will be used if it
has one.  The prototype (or lack thereof) supplied, in whichever form,
does not need to match the actual callee referenced by the op tree.

If the argument ops disagree with the prototype, for example by having
an unacceptable number of arguments, a valid op tree is returned anyway.
The error is reflected in the parser state, normally resulting in a single
exception at the top level of parsing which covers all the compilation
errors that occurred.  In the error message, the callee is referred to
by the name defined by the C<namegv> parameter.

=over 3

 OP *       ck_entersub_args_proto_or_list(      OP *entersubop,
                                                 GV *namegv,
                                                 SV *protosv)
 OP *  Perl_ck_entersub_args_proto_or_list(pTHX_ OP *entersubop,
                                                 GV *namegv,
                                                 SV *protosv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 14973

=over 4

=item C<cv_const_sv>
X<cv_const_sv>

If C<cv> is a constant sub eligible for inlining, returns the constant
value returned by the sub.  Otherwise, returns C<NULL>.

Constant subs can be created with C<newCONSTSUB> or as described in
L<perlsub/"Constant Functions">.

=over 3

 SV *       cv_const_sv(const CV * const cv)
 SV *  Perl_cv_const_sv(const CV * const cv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10406

=over 4

=item C<cv_get_call_checker>
X<cv_get_call_checker>

The original form of L</cv_get_call_checker_flags>, which does not return
checker flags.  When using a checker function returned by this function,
it is only safe to call it with a genuine GV as its C<namegv> argument.

=over 3

 void       cv_get_call_checker(      CV *cv,
                                      Perl_call_checker *ckfun_p,
                                      SV **ckobj_p)
 void  Perl_cv_get_call_checker(pTHX_ CV *cv,
                                      Perl_call_checker *ckfun_p,
                                      SV **ckobj_p)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15172

=over 4

=item C<cv_get_call_checker_flags>
X<cv_get_call_checker_flags>

Retrieves the function that will be used to fix up a call to C<cv>.
Specifically, the function is applied to an C<entersub> op tree for a
subroutine call, not marked with C<&>, where the callee can be identified
at compile time as C<cv>.

The C-level function pointer is returned in C<*ckfun_p>, an SV argument
for it is returned in C<*ckobj_p>, and control flags are returned in
C<*ckflags_p>.  The function is intended to be called in this manner:

 entersubop = (*ckfun_p)(aTHX_ entersubop, namegv, (*ckobj_p));

In this call, C<entersubop> is a pointer to the C<entersub> op,
which may be replaced by the check function, and C<namegv> supplies
the name that should be used by the check function to refer
to the callee of the C<entersub> op if it needs to emit any diagnostics.
It is permitted to apply the check function in non-standard situations,
such as to a call to a different subroutine or to a method call.

C<namegv> may not actually be a GV.  If the C<CALL_CHECKER_REQUIRE_GV>
bit is clear in C<*ckflags_p>, it is permitted to pass a CV or other SV
instead, anything that can be used as the first argument to L</cv_name>.
If the C<CALL_CHECKER_REQUIRE_GV> bit is set in C<*ckflags_p> then the
check function requires C<namegv> to be a genuine GV.

By default, the check function is
L<Perl_ck_entersub_args_proto_or_list|/ck_entersub_args_proto_or_list>,
the SV parameter is C<cv> itself, and the C<CALL_CHECKER_REQUIRE_GV>
flag is clear.  This implements standard prototype processing.  It can
be changed, for a particular subroutine, by L</cv_set_call_checker_flags>.

If the C<CALL_CHECKER_REQUIRE_GV> bit is set in C<gflags> then it
indicates that the caller only knows about the genuine GV version of
C<namegv>, and accordingly the corresponding bit will always be set in
C<*ckflags_p>, regardless of the check function's recorded requirements.
If the C<CALL_CHECKER_REQUIRE_GV> bit is clear in C<gflags> then it
indicates the caller knows about the possibility of passing something
other than a GV as C<namegv>, and accordingly the corresponding bit may
be either set or clear in C<*ckflags_p>, indicating the check function's
recorded requirements.

C<gflags> is a bitset passed into C<cv_get_call_checker_flags>, in which
only the C<CALL_CHECKER_REQUIRE_GV> bit currently has a defined meaning
(for which see above).  All other bits should be clear.

=over 3

 void       cv_get_call_checker_flags(CV *cv, U32 gflags,
                                       Perl_call_checker *ckfun_p,
                                       SV **ckobj_p,
                                       U32 *ckflags_p)
 void  Perl_cv_get_call_checker_flags(pTHX_ CV *cv, U32 gflags,
                                       Perl_call_checker *ckfun_p,
                                       SV **ckobj_p,
                                       U32 *ckflags_p)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15124

=over 4

=item C<cv_set_call_checker>
X<cv_set_call_checker>

The original form of L</cv_set_call_checker_flags>, which passes it the
C<CALL_CHECKER_REQUIRE_GV> flag for backward-compatibility.  The effect
of that flag setting is that the check function is guaranteed to get a
genuine GV as its C<namegv> argument.

=over 3

 void       cv_set_call_checker(      CV *cv,
                                      Perl_call_checker ckfun,
                                      SV *ckobj)
 void  Perl_cv_set_call_checker(pTHX_ CV *cv,
                                      Perl_call_checker ckfun,
                                      SV *ckobj)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15247

=over 4

=item C<cv_set_call_checker_flags>
X<cv_set_call_checker_flags>

Sets the function that will be used to fix up a call to C<cv>.
Specifically, the function is applied to an C<entersub> op tree for a
subroutine call, not marked with C<&>, where the callee can be identified
at compile time as C<cv>.

The C-level function pointer is supplied in C<ckfun>, an SV argument for
it is supplied in C<ckobj>, and control flags are supplied in C<ckflags>.
The function should be defined like this:

    STATIC OP * ckfun(pTHX_ OP *op, GV *namegv, SV *ckobj)

It is intended to be called in this manner:

    entersubop = ckfun(aTHX_ entersubop, namegv, ckobj);

In this call, C<entersubop> is a pointer to the C<entersub> op,
which may be replaced by the check function, and C<namegv> supplies
the name that should be used by the check function to refer
to the callee of the C<entersub> op if it needs to emit any diagnostics.
It is permitted to apply the check function in non-standard situations,
such as to a call to a different subroutine or to a method call.

C<namegv> may not actually be a GV.  For efficiency, perl may pass a
CV or other SV instead.  Whatever is passed can be used as the first
argument to L</cv_name>.  You can force perl to pass a GV by including
C<CALL_CHECKER_REQUIRE_GV> in the C<ckflags>.

C<ckflags> is a bitset, in which only the C<CALL_CHECKER_REQUIRE_GV>
bit currently has a defined meaning (for which see above).  All other
bits should be clear.

The current setting for a particular CV can be retrieved by
L</cv_get_call_checker_flags>.

=over 3

 void       cv_set_call_checker_flags(    CV *cv,
                                          Perl_call_checker ckfun,
                                          SV *ckobj, U32 ckflags)
 void  Perl_cv_set_call_checker_flags(pTHX_ CV *cv,
                                          Perl_call_checker ckfun,
                                          SV *ckobj, U32 ckflags)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 15211

=over 4

=item C<finalize_optree>
X<finalize_optree>

This function finalizes the optree.  Should be called directly after
the complete optree is built.  It does some additional
checking which can't be done in the normal C<ck_>xxx functions and makes
the tree thread-safe.

=over 3

 void       finalize_optree(      OP *o)
 void  Perl_finalize_optree(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at peep.c, line 1176

=over 4

=item C<forbid_outofblock_ops>
X<forbid_outofblock_ops>

NOTE: C<forbid_outofblock_ops> is B<experimental> and may change or be
removed without notice.

Checks an optree that implements a block, to ensure there are no control-flow
ops that attempt to leave the block.  Any C<OP_RETURN> is forbidden, as is any
C<OP_GOTO>. Loops are analysed, so any LOOPEX op (C<OP_NEXT>, C<OP_LAST> or
C<OP_REDO>) that affects a loop that contains it within the block are
permitted, but those that do not are forbidden.

If any of these forbidden constructions are detected, an exception is thrown
by using the op name and the blockname argument to construct a suitable
message.

This function alone is not sufficient to ensure the optree does not perform
any of these forbidden activities during runtime, as it might call a different
function that performs a non-local LOOPEX, or a string-eval() that performs a
C<goto>, or various other things. It is intended purely as a compile-time
check for those that could be detected statically. Additional runtime checks
may be required depending on the circumstance it is used for.

Note currently that I<all> C<OP_GOTO> ops are forbidden, even in cases where
they might otherwise be safe to execute.  This may be permitted in a later
version.

=over 3

 void       forbid_outofblock_ops(      OP *o,
                                        const char *blockname)
 void  Perl_forbid_outofblock_ops(pTHX_ OP *o,
                                        const char *blockname)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5393

=over 4

=item C<LINKLIST>
X<LINKLIST>

Given the root of an optree, link the tree in execution order using the
C<op_next> pointers and return the first op executed.  If this has
already been done, it will not be redone, and C<< o->op_next >> will be
returned.  If C<< o->op_next >> is not already set, C<o> should be at
least an C<UNOP>.

=over 3

 OP*  LINKLIST(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 686

=over 4

=item C<LISTOP>

=item C<LOGOP>

=item C<LOOP>

Described in L<perlguts>.

=back

=for hackers
LISTOP all in group documented at pod/perlguts.pod, line 2605
LOGOP 
LOOP 

=over 4

=item C<newANONATTRSUB>
X<newANONATTRSUB>

Construct a nameless (anonymous) Perl subroutine, also performing some
surrounding jobs.

This is the same as L<perlintern/C<newATTRSUB_x>> with its C<o_is_gv> parameter
set to FALSE, and its C<o> parameter to NULL.
For more details, see L<perlintern/C<newATTRSUB_x>>.

=over 3

 OP *       newANONATTRSUB(      I32 floor, OP *proto, OP *attrs,
                                 OP *block)
 OP *  Perl_newANONATTRSUB(pTHX_ I32 floor, OP *proto, OP *attrs,
                                 OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12214

=over 4

=item C<newANONHASH>
X<newANONHASH>

Constructs, checks, and returns an anonymous hash op.

=over 3

 OP *       newANONHASH(      OP *o)
 OP *  Perl_newANONHASH(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12177

=over 4

=item C<newANONLIST>
X<newANONLIST>

Constructs, checks, and returns an anonymous list op.

=over 3

 OP *       newANONLIST(      OP *o)
 OP *  Perl_newANONLIST(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12162

=over 4

=item C<newANONSUB>
X<newANONSUB>

Construct a nameless (anonymous) Perl subroutine without attributes, also
performing some surrounding jobs.

This is the same as L<perlintern/C<newATTRSUB_x>> with its C<o_is_gv> parameter
set to FALSE, and its C<o> and C<attrs> parameters to NULL.
For more details, see L<perlintern/C<newATTRSUB_x>>.

=over 3

 OP *       newANONSUB(      I32 floor, OP *proto, OP *block)
 OP *  Perl_newANONSUB(pTHX_ I32 floor, OP *proto, OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12195

=over 4

=item C<newARGDEFELEMOP>
X<newARGDEFELEMOP>

Constructs and returns a new C<OP_ARGDEFELEM> op which provides a defaulting
expression given by C<expr> for the signature parameter at the index given
by C<argindex>. The expression optree is consumed by this function and
becomes part of the returned optree.

=over 3

 OP *       newARGDEFELEMOP(      I32 flags, OP *expr,
                                  I32 argindex)
 OP *  Perl_newARGDEFELEMOP(pTHX_ I32 flags, OP *expr,
                                  I32 argindex)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8640

=over 4

=item C<newASSIGNOP>
X<newASSIGNOP>

Constructs, checks, and returns an assignment op.  C<left> and C<right>
supply the parameters of the assignment; they are consumed by this
function and become part of the constructed op tree.

If C<optype> is C<OP_ANDASSIGN>, C<OP_ORASSIGN>, or C<OP_DORASSIGN>, then
a suitable conditional optree is constructed.  If C<optype> is the opcode
of a binary operator, such as C<OP_BIT_OR>, then an op is constructed that
performs the binary operation and assigns the result to the left argument.
Either way, if C<optype> is non-zero then C<flags> has no effect.

If C<optype> is zero, then a plain scalar or list assignment is
constructed.  Which type of assignment it is is automatically determined.
C<flags> gives the eight bits of C<op_flags>, except that C<OPf_KIDS>
will be set automatically, and, shifted up eight bits, the eight bits
of C<op_private>, except that the bit with value 1 or 2 is automatically
set as required.

=over 3

 OP *       newASSIGNOP(      I32 flags, OP *left, I32 optype,
                              OP *right)
 OP *  Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype,
                              OP *right)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8666

=over 4

=item C<newATTRSUB>
X<newATTRSUB>

Construct a Perl subroutine, also performing some surrounding jobs,
returning a pointer to the constructed subroutine.

This is the same as L<perlintern/C<newATTRSUB_x>> with its C<o_is_gv> parameter
set to FALSE.  This means that if C<o> is null, the new sub will be anonymous;
otherwise the name will be derived from C<o> in the way described (as with all
other details) in L<perlintern/C<newATTRSUB_x>>.

=over 3

 CV *  newATTRSUB(I32 floor, OP *o, OP *proto, OP *attrs,
                  OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10997

=over 4

=item C<newAVREF>
X<newAVREF>

Constructs, checks, and returns an arrary reference op.

=over 3

 OP *       newAVREF(      OP *o)
 OP *  Perl_newAVREF(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12300

=over 4

=item C<newBINOP>
X<newBINOP>

Constructs, checks, and returns an op of any binary type.  C<type>
is the opcode.  C<flags> gives the eight bits of C<op_flags>, except
that C<OPf_KIDS> will be set automatically, and, shifted up eight bits,
the eight bits of C<op_private>, except that the bit with value 1 or
2 is automatically set as required.  C<first> and C<last> supply up to
two ops to be the direct children of the binary op; they are consumed
by this function and become part of the constructed op tree.

=over 3

 OP *       newBINOP(      I32 type, I32 flags, OP *first,
                           OP *last)
 OP *  Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first,
                           OP *last)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5998

=over 4

=item C<newCONDOP>
X<newCONDOP>

Constructs, checks, and returns a conditional-expression (C<cond_expr>)
op.  C<flags> gives the eight bits of C<op_flags>, except that C<OPf_KIDS>
will be set automatically, and, shifted up eight bits, the eight bits of
C<op_private>, except that the bit with value 1 is automatically set.
C<first> supplies the expression selecting between the two branches,
and C<trueop> and C<falseop> supply the branches; they are consumed by
this function and become part of the constructed op tree.

=over 3

 OP *       newCONDOP(      I32 flags, OP *first, OP *trueop,
                            OP *falseop)
 OP *  Perl_newCONDOP(pTHX_ I32 flags, OP *first, OP *trueop,
                            OP *falseop)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9219

=over 4

=item C<newCONSTSUB>

=item C<newCONSTSUB_flags>
X<newCONSTSUB>X<newCONSTSUB_flags>

Construct a constant subroutine, also performing some surrounding
jobs.  A scalar constant-valued subroutine is eligible for inlining
at compile-time, and in Perl code can be created by S<C<sub FOO () {
123 }>>.  Other kinds of constant subroutine have other treatment.

The subroutine will have an empty prototype and will ignore any arguments
when called.  Its constant behaviour is determined by C<sv>.  If C<sv>
is null, the subroutine will yield an empty list.  If C<sv> points to a
scalar, the subroutine will always yield that scalar.  If C<sv> points
to an array, the subroutine will always yield a list of the elements of
that array in list context, or the number of elements in the array in
scalar context.  This function takes ownership of one counted reference
to the scalar or array, and will arrange for the object to live as long
as the subroutine does.  If C<sv> points to a scalar then the inlining
assumes that the value of the scalar will never change, so the caller
must ensure that the scalar is not subsequently written to.  If C<sv>
points to an array then no such assumption is made, so it is ostensibly
safe to mutate the array or its elements, but whether this is really
supported has not been determined.

The subroutine will have C<CvFILE> set according to C<PL_curcop>.
Other aspects of the subroutine will be left in their default state.
The caller is free to mutate the subroutine beyond its initial state
after this function has returned.

If C<name> is null then the subroutine will be anonymous, with its
C<CvGV> referring to an C<__ANON__> glob.  If C<name> is non-null then the
subroutine will be named accordingly, referenced by the appropriate glob.


C<name> is a string, giving a sigilless symbol name.
For C</newCONSTSUB>, C<name> is NUL-terminated, interpreted as Latin-1.

For C</newCONSTSUB_flags>, C<name> has length C<len> bytes, hence may contain
embedded NULs.  It is interpreted as UTF-8 if C<flags> has the C<SVf_UTF8> bit
set, and Latin-1 otherwise.  C<flags> should not have bits set other than
C<SVf_UTF8>.

The name may be either qualified or unqualified.  If the
name is unqualified then it defaults to being in the stash specified by
C<stash> if that is non-null, or to C<PL_curstash> if C<stash> is null.
The symbol is always added to the stash if necessary, with C<GV_ADDMULTI>
semantics.

If there is already a subroutine of the specified name, then the new sub
will replace the existing one in the glob.  A warning may be generated
about the redefinition.

If the subroutine has one of a few special names, such as C<BEGIN> or
C<END>, then it will be claimed by the appropriate queue for automatic
running of phase-related subroutines.  In this case the relevant glob will
be left not containing any subroutine, even if it did contain one before.
Execution of the subroutine will likely be a no-op, unless C<sv> was
a tied array or the caller modified the subroutine in some interesting
way before it was executed.  In the case of C<BEGIN>, the treatment is
buggy: the sub will be executed when only half built, and may be deleted
prematurely, possibly causing a crash.

The function returns a pointer to the constructed subroutine.  If the sub
is anonymous then ownership of one counted reference to the subroutine
is transferred to the caller.  If the sub is named then the caller does
not get ownership of a reference.  In most such cases, where the sub
has a non-phase name, the sub will be alive at the point it is returned
by virtue of being contained in the glob that names it.  A phase-named
subroutine will usually be alive by virtue of the reference owned by
the phase's automatic run queue.  A C<BEGIN> subroutine may have been
destroyed already by the time this function returns, but currently bugs
occur in that case before the caller gets control.  It is the caller's
responsibility to ensure that it knows which of these situations applies.

=over 3

 CV *       newCONSTSUB      (      HV *stash, const char *name,
                                    SV *sv)
 CV *  Perl_newCONSTSUB      (pTHX_ HV *stash, const char *name,
                                    SV *sv)
 CV *       newCONSTSUB_flags(      HV *stash, const char *name,
                                    STRLEN len, U32 flags, SV *sv)
 CV *  Perl_newCONSTSUB_flags(pTHX_ HV *stash, const char *name,
                                    STRLEN len, U32 flags, SV *sv)

=back

=back

=for hackers
newCONSTSUB declared in embed.fnc; all in group documented at op.c, line 11744
newCONSTSUB_flags declared in embed.fnc

=over 4

=item C<newCVREF>
X<newCVREF>

Constructs, checks, and returns a code reference op.

=over 3

 OP *       newCVREF(      I32 flags, OP *o)
 OP *  Perl_newCVREF(pTHX_ I32 flags, OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12379

=over 4

=item C<newDEFEROP>
X<newDEFEROP>

NOTE: C<newDEFEROP> is B<experimental> and may change or be
removed without notice.

Constructs and returns a deferred-block statement that implements the
C<defer> semantics.  The C<block> optree is consumed by this function and
becomes part of the returned optree.

The C<flags> argument carries additional flags to set on the returned op,
including the C<op_private> field.

=over 3

 OP *       newDEFEROP(      I32 flags, OP *block)
 OP *  Perl_newDEFEROP(pTHX_ I32 flags, OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10254

=over 4

=item C<newDEFSVOP>
X<newDEFSVOP>

Constructs and returns an op to access C<$_>.

=over 3

 OP *       newDEFSVOP()
 OP *  Perl_newDEFSVOP(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8005

=over 4

=item C<newFOROP>
X<newFOROP>

Constructs, checks, and returns an op tree expressing a C<foreach>
loop (iteration through a list of values).  This is a heavyweight loop,
with structure that allows exiting the loop by C<last> and suchlike.

C<sv> optionally supplies the variable(s) that will be aliased to each
item in turn; if null, it defaults to C<$_>.
C<expr> supplies the list of values to iterate over.  C<block> supplies
the main body of the loop, and C<cont> optionally supplies a C<continue>
block that operates as a second half of the body.  All of these optree
inputs are consumed by this function and become part of the constructed
op tree.

C<flags> gives the eight bits of C<op_flags> for the C<leaveloop>
op and, shifted up eight bits, the eight bits of C<op_private> for
the C<leaveloop> op, except that (in both cases) some bits will be set
automatically.

=over 3

 OP *       newFOROP(      I32 flags, OP *sv, OP *expr, OP *block,
                           OP *cont)
 OP *  Perl_newFOROP(pTHX_ I32 flags, OP *sv, OP *expr, OP *block,
                           OP *cont)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9694

=over 4

=item C<newGIVENOP>
X<newGIVENOP>

Constructs, checks, and returns an op tree expressing a C<given> block.
C<cond> supplies the expression to whose value C<$_> will be locally
aliased, and C<block> supplies the body of the C<given> construct; they
are consumed by this function and become part of the constructed op tree.
C<defsv_off> must be zero (it used to identity the pad slot of lexical $_).

=over 3

 OP *       newGIVENOP(      OP *cond, OP *block,
                             PADOFFSET defsv_off)
 OP *  Perl_newGIVENOP(pTHX_ OP *cond, OP *block,
                             PADOFFSET defsv_off)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10196

=over 4

=item C<newGVOP>
X<newGVOP>

Constructs, checks, and returns an op of any type that involves an
embedded reference to a GV.  C<type> is the opcode.  C<flags> gives the
eight bits of C<op_flags>.  C<gv> identifies the GV that the op should
reference; calling this function does not transfer ownership of any
reference to it.

=over 3

 OP *       newGVOP(      I32 type, I32 flags, GV *gv)
 OP *  Perl_newGVOP(pTHX_ I32 type, I32 flags, GV *gv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8065

=over 4

=item C<newGVREF>
X<newGVREF>

Constructs, checks, and returns a glob reference op.

=over 3

 OP *       newGVREF(      I32 type, OP *o)
 OP *  Perl_newGVREF(pTHX_ I32 type, OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12324

=over 4

=item C<newHVREF>
X<newHVREF>

Constructs, checks, and returns a hash reference op.

=over 3

 OP *       newHVREF(      OP *o)
 OP *  Perl_newHVREF(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12355

=over 4

=item C<newLISTOP>
X<newLISTOP>

Constructs, checks, and returns an op of any list type.  C<type> is
the opcode.  C<flags> gives the eight bits of C<op_flags>, except that
C<OPf_KIDS> will be set automatically if required.  C<first> and C<last>
supply up to two ops to be direct children of the list op; they are
consumed by this function and become part of the constructed op tree.

For most list operators, the check function expects all the kid ops to be
present already, so calling C<newLISTOP(OP_JOIN, ...)> (e.g.) is not
appropriate.  What you want to do in that case is create an op of type
C<OP_LIST>, append more children to it, and then call L</op_convert_list>.
See L</op_convert_list> for more information.

If a compiletime-known fixed list of child ops is required, the
L</newLISTOPn> function can be used as a convenient shortcut, avoiding the
need to create a temporary plain C<OP_LIST> in a new variable.

=over 3

 OP *       newLISTOP(      I32 type, I32 flags, OP *first,
                            OP *last)
 OP *  Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP *first,
                            OP *last)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5693

=over 4

=item C<newLISTOPn>
X<newLISTOPn>

Constructs, checks, and returns an op of any list type.  C<type> is
the opcode.  C<flags> gives the eight bits of C<op_flags>, except that
C<OPf_KIDS> will be set automatically if required.  The variable number of
arguments after C<flags> must all be OP pointers, terminated by a final
C<NULL> pointer.  These will all be consumed as direct children of the list
op and become part of the constructed op tree.

Do not forget to end the arguments list with a C<NULL> pointer.

This function is useful as a shortcut to performing the sequence of
C<newLISTOP()>, C<op_append_elem()> on each element and final
C<op_convert_list()> in the case where a compiletime-known fixed sequence of
child ops is required.  If a variable number of elements are required, or for
splicing in an entire sub-list of child ops, see instead L</newLISTOP> and
L</op_convert_list>.

=over 3

 OP *       newLISTOPn(      I32 type, I32 flags, ...)
 OP *  Perl_newLISTOPn(pTHX_ I32 type, I32 flags, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5755

=over 4

=item C<newLOGOP>
X<newLOGOP>

Constructs, checks, and returns a logical (flow control) op.  C<type>
is the opcode.  C<flags> gives the eight bits of C<op_flags>, except
that C<OPf_KIDS> will be set automatically, and, shifted up eight bits,
the eight bits of C<op_private>, except that the bit with value 1 is
automatically set.  C<first> supplies the expression controlling the
flow, and C<other> supplies the side (alternate) chain of ops; they are
consumed by this function and become part of the constructed op tree.

=over 3

 OP *       newLOGOP(      I32 optype, I32 flags, OP *first,
                           OP *other)
 OP *  Perl_newLOGOP(pTHX_ I32 optype, I32 flags, OP *first,
                           OP *other)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8976

=over 4

=item C<newLOOPEX>
X<newLOOPEX>

Constructs, checks, and returns a loop-exiting op (such as C<goto>
or C<last>).  C<type> is the opcode.  C<label> supplies the parameter
determining the target of the op; it is consumed by this function and
becomes part of the constructed op tree.

=over 3

 OP *       newLOOPEX(      I32 type, OP *label)
 OP *  Perl_newLOOPEX(pTHX_ I32 type, OP *label)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9964

=over 4

=item C<newLOOPOP>
X<newLOOPOP>

Constructs, checks, and returns an op tree expressing a loop.  This is
only a loop in the control flow through the op tree; it does not have
the heavyweight loop structure that allows exiting the loop by C<last>
and suchlike.  C<flags> gives the eight bits of C<op_flags> for the
top-level op, except that some bits will be set automatically as required.
C<expr> supplies the expression controlling loop iteration, and C<block>
supplies the body of the loop; they are consumed by this function and
become part of the constructed op tree.  C<debuggable> is currently
unused and should always be 1.

=over 3

 OP *       newLOOPOP(      I32 flags, I32 debuggable, OP *expr,
                            OP *block)
 OP *  Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr,
                            OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9424

=over 4

=item C<newMETHOP>
X<newMETHOP>

Constructs, checks, and returns an op of method type with a method name
evaluated at runtime.  C<type> is the opcode.  C<flags> gives the eight
bits of C<op_flags>, except that C<OPf_KIDS> will be set automatically,
and, shifted up eight bits, the eight bits of C<op_private>, except that
the bit with value 1 is automatically set.  C<dynamic_meth> supplies an
op which evaluates method name; it is consumed by this function and
become part of the constructed op tree.
Supported optypes: C<OP_METHOD>.

=over 3

 OP *       newMETHOP(      I32 type, I32 flags, OP *dynamic_meth)
 OP *  Perl_newMETHOP(pTHX_ I32 type, I32 flags, OP *dynamic_meth)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5923

=over 4

=item C<newMETHOP_named>
X<newMETHOP_named>

Constructs, checks, and returns an op of method type with a constant
method name.  C<type> is the opcode.  C<flags> gives the eight bits of
C<op_flags>, and, shifted up eight bits, the eight bits of
C<op_private>.  C<const_meth> supplies a constant method name;
it must be a shared COW string.
Supported optypes: C<OP_METHOD_NAMED>.

=over 3

 OP *       newMETHOP_named(      I32 type, I32 flags,
                                  SV * const_meth)
 OP *  Perl_newMETHOP_named(pTHX_ I32 type, I32 flags,
                                  SV * const_meth)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5979

=over 4

=item C<newNULLLIST>
X<newNULLLIST>

Constructs, checks, and returns a new C<stub> op, which represents an
empty list expression.

=over 3

 OP *       newNULLLIST()
 OP *  Perl_newNULLLIST(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5625

=over 4

=item C<newOP>
X<newOP>

Constructs, checks, and returns an op of any base type (any type that
has no extra fields).  C<type> is the opcode.  C<flags> gives the
eight bits of C<op_flags>, and, shifted up eight bits, the eight bits
of C<op_private>.

=over 3

 OP *       newOP(      I32 optype, I32 flags)
 OP *  Perl_newOP(pTHX_ I32 optype, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5794

=over 4

=item C<newPADOP>
X<newPADOP>

Constructs, checks, and returns an op of any type that involves a
reference to a pad element.  C<type> is the opcode.  C<flags> gives the
eight bits of C<op_flags>.  A pad slot is automatically allocated, and
is populated with C<sv>; this function takes ownership of one reference
to it.

This function only exists if Perl has been compiled to use ithreads.

=over 3

 OP *       newPADOP(      I32 type, I32 flags, SV *sv)
 OP *  Perl_newPADOP(pTHX_ I32 type, I32 flags, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8021

=over 4

=item C<newPMOP>
X<newPMOP>

Constructs, checks, and returns an op of any pattern matching type.
C<type> is the opcode.  C<flags> gives the eight bits of C<op_flags>
and, shifted up eight bits, the eight bits of C<op_private>.

=over 3

 OP *       newPMOP(      I32 type, I32 flags)
 OP *  Perl_newPMOP(pTHX_ I32 type, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 7483

=over 4

=item C<newPVOP>
X<newPVOP>

Constructs, checks, and returns an op of any type that involves an
embedded C-level pointer (PV).  C<type> is the opcode.  C<flags> gives
the eight bits of C<op_flags>.  C<pv> supplies the C-level pointer.
Depending on the op type, the memory referenced by C<pv> may be freed
when the op is destroyed.  If the op is of a freeing type, C<pv> must
have been allocated using C<PerlMemShared_malloc>.

=over 3

 OP *       newPVOP(      I32 type, I32 flags, char *pv)
 OP *  Perl_newPVOP(pTHX_ I32 type, I32 flags, char *pv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8089

=over 4

=item C<newRANGE>
X<newRANGE>

Constructs and returns a C<range> op, with subordinate C<flip> and
C<flop> ops.  C<flags> gives the eight bits of C<op_flags> for the
C<flip> op and, shifted up eight bits, the eight bits of C<op_private>
for both the C<flip> and C<range> ops, except that the bit with value
1 is automatically set.  C<left> and C<right> supply the expressions
controlling the endpoints of the range; they are consumed by this function
and become part of the constructed op tree.

=over 3

 OP *       newRANGE(      I32 flags, OP *left, OP *right)
 OP *  Perl_newRANGE(pTHX_ I32 flags, OP *left, OP *right)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9357

=over 4

=item C<newSLICEOP>
X<newSLICEOP>

Constructs, checks, and returns an C<lslice> (list slice) op.  C<flags>
gives the eight bits of C<op_flags>, except that C<OPf_KIDS> will
be set automatically, and, shifted up eight bits, the eight bits of
C<op_private>, except that the bit with value 1 or 2 is automatically
set as required.  C<listval> and C<subscript> supply the parameters of
the slice; they are consumed by this function and become part of the
constructed op tree.

=over 3

 OP *       newSLICEOP(      I32 flags, OP *subscript, OP *listop)
 OP *  Perl_newSLICEOP(pTHX_ I32 flags, OP *subscript, OP *listop)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8521

=over 4

=item C<newSTATEOP>
X<newSTATEOP>

Constructs a state op (COP).  The state op is normally a C<nextstate> op,
but will be a C<dbstate> op if debugging is enabled for currently-compiled
code.  The state op is populated from C<PL_curcop> (or C<PL_compiling>).
If C<label> is non-null, it supplies the name of a label to attach to
the state op; this function takes ownership of the memory pointed at by
C<label>, and will free it.  C<flags> gives the eight bits of C<op_flags>
for the state op.

If C<o> is null, the state op is returned.  Otherwise the state op is
combined with C<o> into a C<lineseq> list op, which is returned.  C<o>
is consumed by this function and becomes part of the returned op tree.

=over 3

 OP *       newSTATEOP(      I32 flags, char *label, OP *o)
 OP *  Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 8884

=over 4

=item C<newSUB>
X<newSUB>

Construct a Perl subroutine without attributes, and also performing some
surrounding jobs, returning a pointer to the constructed subroutine.

This is the same as L<perlintern/C<newATTRSUB_x>> with its C<o_is_gv> parameter
set to FALSE, and its C<attrs> parameter to NULL.  This means that if C<o> is
null, the new sub will be anonymous; otherwise the name will be derived from
C<o> in the way described (as with all other details) in
L<perlintern/C<newATTRSUB_x>>.

=over 3

 CV *       newSUB(      I32 floor, OP *o, OP *proto, OP *block)
 CV *  Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 11006

=over 4

=item C<newSVOP>
X<newSVOP>

Constructs, checks, and returns an op of any type that involves an
embedded SV.  C<type> is the opcode.  C<flags> gives the eight bits
of C<op_flags>.  C<sv> gives the SV to embed in the op; this function
takes ownership of one reference to it.

=over 3

 OP *       newSVOP(      I32 type, I32 flags, SV *sv)
 OP *  Perl_newSVOP(pTHX_ I32 type, I32 flags, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 7966

=over 4

=item C<newSVREF>
X<newSVREF>

Constructs, checks, and returns a scalar reference op.

=over 3

 OP *       newSVREF(      OP *o)
 OP *  Perl_newSVREF(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 12396

=over 4

=item C<newTRYCATCHOP>
X<newTRYCATCHOP>

NOTE: C<newTRYCATCHOP> is B<experimental> and may change or be
removed without notice.

Constructs and returns a conditional execution statement that implements
the C<try>/C<catch> semantics.  First the op tree in C<tryblock> is executed,
inside a context that traps exceptions.  If an exception occurs then the
optree in C<catchblock> is executed, with the trapped exception set into the
lexical variable given by C<catchvar> (which must be an op of type
C<OP_PADSV>).  All the optrees are consumed by this function and become part
of the returned op tree.

The C<flags> argument is currently ignored.

=over 3

 OP *       newTRYCATCHOP(      I32 flags, OP *tryblock,
                                OP *catchvar, OP *catchblock)
 OP *  Perl_newTRYCATCHOP(pTHX_ I32 flags, OP *tryblock,
                                OP *catchvar, OP *catchblock)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9300

=over 4

=item C<newUNOP>
X<newUNOP>

Constructs, checks, and returns an op of any unary type.  C<type> is
the opcode.  C<flags> gives the eight bits of C<op_flags>, except that
C<OPf_KIDS> will be set automatically if required, and, shifted up eight
bits, the eight bits of C<op_private>, except that the bit with value 1
is automatically set.  C<first> supplies an optional op to be the direct
child of the unary op; it is consumed by this function and become part
of the constructed op tree.

=over 3

 OP *       newUNOP(      I32 type, I32 flags, OP *first)
 OP *  Perl_newUNOP(pTHX_ I32 type, I32 flags, OP *first)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5833

=over 4

=item C<newUNOP_AUX>
X<newUNOP_AUX>

Similar to C<newUNOP>, but creates an C<UNOP_AUX> struct instead, with C<op_aux>
initialised to C<aux>

=over 3

 OP *       newUNOP_AUX(      I32 type, I32 flags, OP *first,
                              UNOP_AUX_item *aux)
 OP *  Perl_newUNOP_AUX(pTHX_ I32 type, I32 flags, OP *first,
                              UNOP_AUX_item *aux)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5890

=over 4

=item C<newWHENOP>
X<newWHENOP>

Constructs, checks, and returns an op tree expressing a C<when> block.
C<cond> supplies the test expression, and C<block> supplies the block
that will be executed if the test evaluates to true; they are consumed
by this function and become part of the constructed op tree.  C<cond>
will be interpreted DWIMically, often as a comparison against C<$_>,
and may be null to generate a C<default> block.

=over 3

 OP *       newWHENOP(      OP *cond, OP *block)
 OP *  Perl_newWHENOP(pTHX_ OP *cond, OP *block)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10222

=over 4

=item C<newWHILEOP>
X<newWHILEOP>

Constructs, checks, and returns an op tree expressing a C<while> loop.
This is a heavyweight loop, with structure that allows exiting the loop
by C<last> and suchlike.

C<loop> is an optional preconstructed C<enterloop> op to use in the
loop; if it is null then a suitable op will be constructed automatically.
C<expr> supplies the loop's controlling expression.  C<block> supplies the
main body of the loop, and C<cont> optionally supplies a C<continue> block
that operates as a second half of the body.  All of these optree inputs
are consumed by this function and become part of the constructed op tree.

C<flags> gives the eight bits of C<op_flags> for the C<leaveloop>
op and, shifted up eight bits, the eight bits of C<op_private> for
the C<leaveloop> op, except that (in both cases) some bits will be set
automatically.  C<debuggable> is currently unused and should always be 1.
C<has_my> can be supplied as true to force the
loop body to be enclosed in its own scope.

=over 3

 OP *       newWHILEOP(      I32 flags, I32 debuggable,
                             LOOP *loop, OP *expr, OP *block,
                             OP *cont, I32 has_my)
 OP *  Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable,
                             LOOP *loop, OP *expr, OP *block,
                             OP *cont, I32 has_my)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 9525

=over 4

=item C<newXS>
X<newXS>

Used by C<xsubpp> to hook up XSUBs as Perl subs.  C<filename> needs to be
static storage, as it is used directly as CvFILE(), without a copy being made.

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 11873

=over 4

=item C<OA_BASEOP>

=item C<OA_BINOP>

=item C<OA_COP>

=item C<OA_LISTOP>

=item C<OA_LOGOP>

=item C<OA_LOOP>

=item C<OA_PADOP>

=item C<OA_PMOP>

=item C<OA_PVOP_OR_SVOP>

=item C<OA_SVOP>

=item C<OA_UNOP>

=item C<OP>

Described in L<perlguts>.

=back

=for hackers
OA_BASEOP all in group documented at pod/perlguts.pod, line 3910
OA_BINOP 
OA_COP 
OA_LISTOP 
OA_LOGOP 
OA_LOOP 
OA_PADOP 
OA_PMOP 
OA_PVOP_OR_SVOP 
OA_SVOP 
OA_UNOP 
OP 

=over 4

=item C<op_append_elem>
X<op_append_elem>

Append an item to the list of ops contained directly within a list-type
op, returning the lengthened list.  C<first> is the list-type op,
and C<last> is the op to append to the list.  C<optype> specifies the
intended opcode for the list.  If C<first> is not already a list of the
right type, it will be upgraded into one.  If either C<first> or C<last>
is null, the other is returned unchanged.

=over 3

 OP *       op_append_elem(      I32 optype, OP *first, OP *last)
 OP *  Perl_op_append_elem(pTHX_ I32 optype, OP *first, OP *last)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5443

=over 4

=item C<op_append_list>
X<op_append_list>

Concatenate the lists of ops contained directly within two list-type ops,
returning the combined list.  C<first> and C<last> are the list-type ops
to concatenate.  C<optype> specifies the intended opcode for the list.
If either C<first> or C<last> is not already a list of the right type,
it will be upgraded into one.  If either C<first> or C<last> is null,
the other is returned unchanged.

=over 3

 OP *       op_append_list(      I32 optype, OP *first, OP *last)
 OP *  Perl_op_append_list(pTHX_ I32 optype, OP *first, OP *last)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5476

=over 4

=item C<OP_CLASS>
X<OP_CLASS>

Return the class of the provided OP: that is, which of the *OP
structures it uses.  For core ops this currently gets the information out
of C<PL_opargs>, which does not always accurately reflect the type used;
in v5.26 onwards, see also the function C<L</op_class>> which can do a better
job of determining the used type.

For custom ops the type is returned from the registration, and it is up
to the registree to ensure it is accurate.  The value returned will be
one of the C<OA_>* constants from F<op.h>.

=over 3

 U32  OP_CLASS(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 1004

=over 4

=item C<op_contextualize>
X<op_contextualize>

Applies a syntactic context to an op tree representing an expression.
C<o> is the op tree, and C<context> must be C<G_SCALAR>, C<G_LIST>,
or C<G_VOID> to specify the context to apply.  The modified op tree
is returned.

=over 3

 OP *       op_contextualize(      OP *o, I32 context)
 OP *  Perl_op_contextualize(pTHX_ OP *o, I32 context)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 1755

=over 4

=item C<op_convert_list>
X<op_convert_list>

Converts C<o> into a list op if it is not one already, and then converts it
into the specified C<type>, calling its check function, allocating a target if
it needs one, and folding constants.

A list-type op is usually constructed one kid at a time via C<newLISTOP>,
C<op_prepend_elem> and C<op_append_elem>.  Then finally it is passed to
C<op_convert_list> to make it the right type.

=over 3

 OP *       op_convert_list(      I32 optype, I32 flags, OP *o)
 OP *  Perl_op_convert_list(pTHX_ I32 optype, I32 flags, OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5552

=over 4

=item C<OP_DESC>
X<OP_DESC>

Return a short description of the provided OP.

=over 3

 const char *  OP_DESC(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 1001

=over 4

=item C<op_force_list>
X<op_force_list>

Promotes o and any siblings to be an C<OP_LIST> if it is not already. If
a new C<OP_LIST> op was created, its first child will be C<OP_PUSHMARK>.
The returned node itself will be nulled, leaving only its children.

This is often what you want to do before putting the optree into list
context; as

    o = op_contextualize(op_force_list(o), G_LIST);

=over 3

 OP *       op_force_list(      OP *o)
 OP *  Perl_op_force_list(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5672

=over 4

=item C<op_free>
X<op_free>

Free an op and its children. Only use this when an op is no longer linked
to from any optree.

Remember that any op with C<OPf_KIDS> set is expected to have a valid
C<op_first> pointer.  If you are attempting to free an op but preserve its
child op, make sure to clear that flag before calling C<op_free()>.  For
example:

    OP *kid = o->op_first; o->op_first = NULL;
    o->op_flags &= ~OPf_KIDS;
    op_free(o);

=over 3

 void       op_free(      OP *arg)
 void  Perl_op_free(pTHX_ OP *arg)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 882

=over 4

=item C<op_linklist>
X<op_linklist>

This function is the implementation of the L</LINKLIST> macro.  It should
not be called directly.

=over 3

 OP *       op_linklist(      OP *o)
 OP *  Perl_op_linklist(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 1781

=over 4

=item C<op_lvalue>
X<op_lvalue>

NOTE: C<op_lvalue> is B<experimental> and may change or be
removed without notice.

Propagate lvalue ("modifiable") context to an op and its children.
C<type> represents the context type, roughly based on the type of op that
would do the modifying, although C<local()> is represented by C<OP_NULL>,
because it has no op type of its own (it is signalled by a flag on
the lvalue op).

This function detects things that can't be modified, such as C<$x+1>, and
generates errors for them.  For example, C<$x+1 = 2> would cause it to be
called with an op of type C<OP_ADD> and a C<type> argument of C<OP_SASSIGN>.

It also flags things that need to behave specially in an lvalue context,
such as C<$$x = 5> which might have to vivify a reference in C<$x>.

=over 3

 OP *  op_lvalue(OP *o, I32 type)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 3064

=over 4

=item C<OP_NAME>
X<OP_NAME>

Return the name of the provided OP.  For core ops this looks up the name
from the op_type; for custom ops from the op_ppaddr.

=over 3

 const char *  OP_NAME(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 997

=over 4

=item C<op_null>
X<op_null>

Neutralizes an op when it is no longer needed, but is still linked to from
other ops.

=over 3

 void       op_null(      OP *o)
 void  Perl_op_null(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 1477

=over 4

=item C<op_parent>
X<op_parent>

Returns the parent OP of C<o>, if it has a parent. Returns C<NULL> otherwise.

=over 3

 OP *       op_parent(OP *o)
 OP *  Perl_op_parent(OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 1680

=over 4

=item C<op_prepend_elem>
X<op_prepend_elem>

Prepend an item to the list of ops contained directly within a list-type
op, returning the lengthened list.  C<first> is the op to prepend to the
list, and C<last> is the list-type op.  C<optype> specifies the intended
opcode for the list.  If C<last> is not already a list of the right type,
it will be upgraded into one.  If either C<first> or C<last> is null,
the other is returned unchanged.

=over 3

 OP *       op_prepend_elem(      I32 optype, OP *first, OP *last)
 OP *  Perl_op_prepend_elem(pTHX_ I32 optype, OP *first, OP *last)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 5514

=over 4

=item C<op_scope>
X<op_scope>

NOTE: C<op_scope> is B<experimental> and may change or be
removed without notice.

Wraps up an op tree with some additional ops so that at runtime a dynamic
scope will be created.  The original ops run in the new dynamic scope,
and then, provided that they exit normally, the scope will be unwound.
The additional ops used to create and unwind the dynamic scope will
normally be an C<enter>/C<leave> pair, but a C<scope> op may be used
instead if the ops are simple enough to not need the full dynamic scope
structure.

=over 3

 OP *       op_scope(      OP *o)
 OP *  Perl_op_scope(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 4509

=over 4

=item C<op_sibling_splice>
X<op_sibling_splice>

A general function for editing the structure of an existing chain of
op_sibling nodes.  By analogy with the perl-level C<splice()> function, allows
you to delete zero or more sequential nodes, replacing them with zero or
more different nodes.  Performs the necessary op_first/op_last
housekeeping on the parent node and op_sibling manipulation on the
children.  The last deleted node will be marked as the last node by
updating the op_sibling/op_sibparent or op_moresib field as appropriate.

Note that op_next is not manipulated, and nodes are not freed; that is the
responsibility of the caller.  It also won't create a new list op for an
empty list etc; use higher-level functions like op_append_elem() for that.

C<parent> is the parent node of the sibling chain. It may passed as C<NULL> if
the splicing doesn't affect the first or last op in the chain.

C<start> is the node preceding the first node to be spliced.  Node(s)
following it will be deleted, and ops will be inserted after it.  If it is
C<NULL>, the first node onwards is deleted, and nodes are inserted at the
beginning.

C<del_count> is the number of nodes to delete.  If zero, no nodes are deleted.
If -1 or greater than or equal to the number of remaining kids, all
remaining kids are deleted.

C<insert> is the first of a chain of nodes to be inserted in place of the nodes.
If C<NULL>, no nodes are inserted.

The head of the chain of deleted ops is returned, or C<NULL> if no ops were
deleted.

For example:

    action                    before      after         returns
    ------                    -----       -----         -------

                              P           P
    splice(P, A, 2, X-Y-Z)    |           |             B-C
                              A-B-C-D     A-X-Y-Z-D

                              P           P
    splice(P, NULL, 1, X-Y)   |           |             A
                              A-B-C-D     X-Y-B-C-D

                              P           P
    splice(P, NULL, 3, NULL)  |           |             A-B-C
                              A-B-C-D     D

                              P           P
    splice(P, B, 0, X-Y)      |           |             NULL
                              A-B-C-D     A-B-X-Y-C-D


For lower-level direct manipulation of C<op_sibparent> and C<op_moresib>,
see C<L</OpMORESIB_set>>, C<L</OpLASTSIB_set>>, C<L</OpMAYBESIB_set>>.

=over 3

 OP *       op_sibling_splice(      OP *parent, OP *start,
                                    int del_count, OP *insert)
 OP *  Perl_op_sibling_splice(pTHX_ OP *parent, OP *start,
                                    int del_count, OP *insert)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 1532

=over 4

=item C<OP_TYPE_IS>
X<OP_TYPE_IS>

Returns true if the given OP is not a C<NULL> pointer
and if it is of the given type.

The negation of this macro, C<OP_TYPE_ISNT> is also available
as well as C<OP_TYPE_IS_NN> and C<OP_TYPE_ISNT_NN> which elide
the NULL pointer check.

=over 3

 bool  OP_TYPE_IS(OP *o, Optype type)

=back

=back

=for hackers
Declared and documented at op.h, line 1015

=over 4

=item C<OP_TYPE_IS_OR_WAS>
X<OP_TYPE_IS_OR_WAS>

Returns true if the given OP is not a NULL pointer and
if it is of the given type or used to be before being
replaced by an OP of type OP_NULL.

The negation of this macro, C<OP_TYPE_ISNT_AND_WASNT>
is also available as well as C<OP_TYPE_IS_OR_WAS_NN>
and C<OP_TYPE_ISNT_AND_WASNT_NN> which elide
the C<NULL> pointer check.

=over 3

 bool  OP_TYPE_IS_OR_WAS(OP *o, Optype type)

=back

=back

=for hackers
Declared and documented at op.h, line 1023

=over 4

=item C<op_wrap_finally>
X<op_wrap_finally>

NOTE: C<op_wrap_finally> is B<experimental> and may change or be
removed without notice.

Wraps the given C<block> optree fragment in its own scoped block, arranging
for the C<finally> optree fragment to be invoked when leaving that block for
any reason. Both optree fragments are consumed and the combined result is
returned.

=over 3

 OP *       op_wrap_finally(      OP *block, OP *finally)
 OP *  Perl_op_wrap_finally(pTHX_ OP *block, OP *finally)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 10295

=over 4

=item C<opcode>
X<opcode>

An enum of all the legal Perl opcodes, defined in F<opnames.h>

=back

=for hackers
Declared and documented at opnames.h, line 447

=over 4

=item C<OpHAS_SIBLING>
X<OpHAS_SIBLING>

Returns true if C<o> has a sibling

=over 3

 bool  OpHAS_SIBLING(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 1033

=over 4

=item C<OpLASTSIB_set>
X<OpLASTSIB_set>

Marks C<o> as having no further siblings and marks
o as having the specified parent. See also C<L</OpMORESIB_set>> and
C<OpMAYBESIB_set>. For a higher-level interface, see
C<L</op_sibling_splice>>.

=over 3

 void  OpLASTSIB_set(OP *o, OP *parent)

=back

=back

=for hackers
Declared and documented at op.h, line 1044

=over 4

=item C<OpMAYBESIB_set>
X<OpMAYBESIB_set>

Conditionally does C<OpMORESIB_set> or C<OpLASTSIB_set> depending on whether
C<sib> is non-null. For a higher-level interface, see C<L</op_sibling_splice>>.

=over 3

 void  OpMAYBESIB_set(OP *o, OP *sib, OP *parent)

=back

=back

=for hackers
Declared and documented at op.h, line 1050

=over 4

=item C<OpMORESIB_set>
X<OpMORESIB_set>

Sets the sibling of C<o> to the non-zero value C<sib>. See also C<L</OpLASTSIB_set>>
and C<L</OpMAYBESIB_set>>. For a higher-level interface, see
C<L</op_sibling_splice>>.

=over 3

 void  OpMORESIB_set(OP *o, OP *sib)

=back

=back

=for hackers
Declared and documented at op.h, line 1039

=over 4

=item C<OpSIBLING>
X<OpSIBLING>

Returns the sibling of C<o>, or C<NULL> if there is no sibling

=over 3

 OP*  OpSIBLING(OP *o)

=back

=back

=for hackers
Declared and documented at op.h, line 1036

=over 4

=item C<optimize_optree>
X<optimize_optree>

This function applies some optimisations to the optree in top-down order.
It is called before the peephole optimizer, which processes ops in
execution order. Note that finalize_optree() also does a top-down scan,
but is called *after* the peephole optimizer.

=over 3

 void       optimize_optree(      OP *o)
 void  Perl_optimize_optree(pTHX_ OP *o)

=back

=back

=for hackers
Declared in embed.fnc; documented at peep.c, line 1023

=over 4

=item C<peep_t>

=item C<Perl_cpeep_t>

Described in L<perlguts>.

=back

=for hackers
peep_t all in group documented at pod/perlguts.pod, line 2740
Perl_cpeep_t 

=over 4

=item C<PL_opfreehook>
X<PL_opfreehook>

When non-C<NULL>, the function pointed by this variable will be called each time an OP is freed with the corresponding OP as the argument.
This allows extensions to free any extra attribute they have locally attached to an OP.
It is also assured to first fire for the parent OP and then for its kids.

When you replace this variable, it is considered a good practice to store the possibly previously installed hook and that you recall it inside your own.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 Perl_ophook_t  PL_opfreehook

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 465

=over 4

=item C<PL_peepp>
X<PL_peepp>

Pointer to the per-subroutine peephole optimiser.  This is a function
that gets called at the end of compilation of a Perl subroutine (or
equivalently independent piece of Perl code) to perform fixups of
some ops and to perform small-scale optimisations.  The function is
called once for each subroutine that is compiled, and is passed, as sole
parameter, a pointer to the op that is the entry point to the subroutine.
It modifies the op tree in place.

The peephole optimiser should never be completely replaced.  Rather,
add code to it by wrapping the existing optimiser.  The basic way to do
this can be seen in L<perlguts/Compile pass 3: peephole optimization>.
If the new code wishes to operate on ops throughout the subroutine's
structure, rather than just at the top level, it is likely to be more
convenient to wrap the L</PL_rpeepp> hook.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 peep_t  PL_peepp

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 408

=over 4

=item C<PL_rpeepp>
X<PL_rpeepp>

Pointer to the recursive peephole optimiser.  This is a function
that gets called at the end of compilation of a Perl subroutine (or
equivalently independent piece of Perl code) to perform fixups of some
ops and to perform small-scale optimisations.  The function is called
once for each chain of ops linked through their C<op_next> fields;
it is recursively called to handle each side chain.  It is passed, as
sole parameter, a pointer to the op that is at the head of the chain.
It modifies the op tree in place.

The peephole optimiser should never be completely replaced.  Rather,
add code to it by wrapping the existing optimiser.  The basic way to do
this can be seen in L<perlguts/Compile pass 3: peephole optimization>.
If the new code wishes to operate only on ops at a subroutine's top level,
rather than throughout the structure, it is likely to be more convenient
to wrap the L</PL_peepp> hook.

On threaded perls, each thread has an independent copy of this variable;
each initialized at creation time with the current value of the creating
thread's copy.

=over 3

 peep_t  PL_rpeepp

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 436

=over 4

=item C<PMOP>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 2616

=over 4

=item C<rv2cv_op_cv>
X<rv2cv_op_cv>

Examines an op, which is expected to identify a subroutine at runtime,
and attempts to determine at compile time which subroutine it identifies.
This is normally used during Perl compilation to determine whether
a prototype can be applied to a function call.  C<cvop> is the op
being considered, normally an C<rv2cv> op.  A pointer to the identified
subroutine is returned, if it could be determined statically, and a null
pointer is returned if it was not possible to determine statically.

Currently, the subroutine can be identified statically if the RV that the
C<rv2cv> is to operate on is provided by a suitable C<gv> or C<const> op.
A C<gv> op is suitable if the GV's CV slot is populated.  A C<const> op is
suitable if the constant value must be an RV pointing to a CV.  Details of
this process may change in future versions of Perl.  If the C<rv2cv> op
has the C<OPpENTERSUB_AMPER> flag set then no attempt is made to identify
the subroutine statically: this flag is used to suppress compile-time
magic on a subroutine call, forcing it to use default runtime behaviour.

If C<flags> has the bit C<RV2CVOPCV_MARK_EARLY> set, then the handling
of a GV reference is modified.  If a GV was examined and its CV slot was
found to be empty, then the C<gv> op has the C<OPpEARLY_CV> flag set.
If the op is not optimised away, and the CV slot is later populated with
a subroutine having a prototype, that flag eventually triggers the warning
"called too early to check prototype".

If C<flags> has the bit C<RV2CVOPCV_RETURN_NAME_GV> set, then instead
of returning a pointer to the subroutine it returns a pointer to the
GV giving the most appropriate name for the subroutine in this context.
Normally this is just the C<CvGV> of the subroutine, but for an anonymous
(C<CvANON>) subroutine that is referenced through a GV it will be the
referencing GV.  The resulting C<GV*> is cast to C<CV*> to be returned.
A null pointer is returned as usual if there is no statically-determinable
subroutine.

=over 3

 CV *       rv2cv_op_cv(      OP *cvop, U32 flags)
 CV *  Perl_rv2cv_op_cv(pTHX_ OP *cvop, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at op.c, line 14527

=over 4

=item C<UNOP>

=item C<XOP>

Described in L<perlguts>.

=back

=for hackers
UNOP all in group documented at pod/perlguts.pod, line 2606
XOP 

=head1 Pack and Unpack

=over 4

=item C<packlist>
X<packlist>

The engine implementing C<pack()> Perl function.

=over 3

 void       packlist(      SV *cat, const char *pat,
                           const char *patend, SV **beglist,
                           SV **endlist)
 void  Perl_packlist(pTHX_ SV *cat, const char *pat,
                           const char *patend, SV **beglist,
                           SV **endlist)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_pack.c, line 1964

=over 4

=item C<unpackstring>
X<unpackstring>

The engine implementing the C<unpack()> Perl function.

Using the template C<pat..patend>, this function unpacks the string
C<s..strend> into a number of mortal SVs, which it pushes onto the perl
argument (C<@_>) stack (so you will need to issue a C<PUTBACK> before and
C<SPAGAIN> after the call to this function).  It returns the number of
pushed elements.

The C<strend> and C<patend> pointers should point to the byte following the
last character of each string.

Although this function returns its values on the perl argument stack, it
doesn't take any parameters from that stack (and thus in particular
there's no need to do a C<PUSHMARK> before calling it, unlike L</call_pv> for
example).

=over 3

 SSize_t       unpackstring(      const char *pat,
                                  const char *patend,
                                  const char *s,
                                  const char *strend, U32 flags)
 SSize_t  Perl_unpackstring(pTHX_ const char *pat,
                                  const char *patend,
                                  const char *s,
                                  const char *strend, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_pack.c, line 813

=head1 Pad Data Structures
X<SVs_PADSTALE>

=over 4

=item C<CvPADLIST>
X<CvPADLIST>

NOTE: C<CvPADLIST> is B<experimental> and may change or be
removed without notice.

CV's can have CvPADLIST(cv) set to point to a PADLIST.  This is the CV's
scratchpad, which stores lexical variables and opcode temporary and
per-thread values.

For these purposes "formats" are a kind-of CV; eval""s are too (except they're
not callable at will and are always thrown away after the eval"" is done
executing).  Require'd files are simply evals without any outer lexical
scope.

XSUBs do not have a C<CvPADLIST>.  C<dXSTARG> fetches values from C<PL_curpad>,
but that is really the callers pad (a slot of which is allocated by
every entersub). Do not get or set C<CvPADLIST> if a CV is an XSUB (as
determined by C<CvISXSUB()>), C<CvPADLIST> slot is reused for a different
internal purpose in XSUBs.

The PADLIST has a C array where pads are stored.

The 0th entry of the PADLIST is a PADNAMELIST
which represents the "names" or rather
the "static type information" for lexicals.  The individual elements of a
PADNAMELIST are PADNAMEs.  Future
refactorings might stop the PADNAMELIST from being stored in the PADLIST's
array, so don't rely on it.  See L</PadlistNAMES>.

The CvDEPTH'th entry of a PADLIST is a PAD (an AV) which is the stack frame
at that depth of recursion into the CV.  The 0th slot of a frame AV is an
AV which is C<@_>.  Other entries are storage for variables and op targets.

Iterating over the PADNAMELIST iterates over all possible pad
items.  Pad slots for targets (C<SVs_PADTMP>)
and GVs end up having &PL_padname_undef "names", while slots for constants
have C<&PL_padname_const> "names" (see C<L</pad_alloc>>).  That
C<&PL_padname_undef>
and C<&PL_padname_const> are used is an implementation detail subject to
change.  To test for them, use C<!PadnamePV(name)> and
S<C<PadnamePV(name) && !PadnameLEN(name)>>, respectively.

Only C<my>/C<our> variable slots get valid names.
The rest are op targets/GVs/constants which are statically allocated
or resolved at compile time.  These don't have names by which they
can be looked up from Perl code at run time through eval"" the way
C<my>/C<our> variables can be.  Since they can't be looked up by "name"
but only by their index allocated at compile time (which is usually
in C<< PL_op->op_targ >>), wasting a name SV for them doesn't make sense.

The pad names in the PADNAMELIST have their PV holding the name of
the variable.  The C<COP_SEQ_RANGE_LOW> and C<_HIGH> fields form a range
(low+1..high inclusive) of cop_seq numbers for which the name is
valid.  During compilation, these fields may hold the special value
PERL_PADSEQ_INTRO to indicate various stages:

 COP_SEQ_RANGE_LOW        _HIGH
 -----------------        -----
 PERL_PADSEQ_INTRO            0   variable not yet introduced:
                                  { my ($x
 valid-seq#   PERL_PADSEQ_INTRO   variable in scope:
                                  { my ($x);
 valid-seq#          valid-seq#   compilation of scope complete:
                                  { my ($x); .... }

When a lexical var hasn't yet been introduced, it already exists from the
perspective of duplicate declarations, but not for variable lookups, e.g.

    my ($x, $x); # '"my" variable $x masks earlier declaration'
    my $x = $x;  # equal to my $x = $::x;

For typed lexicals C<PadnameTYPE> points at the type stash.  For C<our>
lexicals, C<PadnameOURSTASH> points at the stash of the associated global (so
that duplicate C<our> declarations in the same package can be detected).
C<PadnameGEN> is sometimes used to store the generation number during
compilation.

If C<PadnameOUTER> is set on the pad name, then that slot in the frame AV
is a REFCNT'ed reference to a lexical from "outside".  Such entries
are sometimes referred to as 'fake'.  In this case, the name does not
use 'low' and 'high' to store a cop_seq range, since it is in scope
throughout.  Instead 'high' 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, 'low' contains the index
within the parent's pad where the lexical's value is stored, to make
cloning quicker.

If the 'name' is C<&> the corresponding entry in the PAD
is a CV representing a possible closure.

Note that formats are treated as anon subs, and are cloned each time
write is called (if necessary).

The flag C<SVs_PADSTALE> is cleared on lexicals each time the C<my()> is executed,
and set on scope exit.  This allows the
C<"Variable $x is not available"> warning
to be generated in evals, such as 

    { my $x = 1; sub f { eval '$x'} } f();

For state vars, C<SVs_PADSTALE> is overloaded to mean 'not yet initialised',
but this internal state is stored in a separate pad entry.

=over 3

 PADLIST *  CvPADLIST(CV *cv)

=back

=back

=for hackers
Declared and documented at pad.c, line 24

=over 4

=item C<pad_add_name_pvs>
X<pad_add_name_pvs>

Exactly like L</pad_add_name_pvn>, but takes a literal string
instead of a string/length pair.

=over 3

 PADOFFSET  pad_add_name_pvs("name", U32 flags, HV *typestash,
                             HV *ourstash)

=back

=back

=for hackers
Declared and documented at pad.h, line 533

=over 4

=item C<pad_new>
X<pad_new>

Create a new padlist, updating the global variables for the
currently-compiling padlist to point to the new padlist.  The following
flags can be OR'ed together:

    padnew_CLONE	this pad is for a cloned CV
    padnew_SAVE		save old globals on the save stack
    padnew_SAVESUB	also save extra stuff for start of sub

=over 3

 PADLIST *       pad_new(      int flags)
 PADLIST *  Perl_pad_new(pTHX_ int flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at pad.c, line 178

=over 4

=item C<PadARRAY>
X<PadARRAY>

NOTE: C<PadARRAY> is B<experimental> and may change or be
removed without notice.

The C array of pad entries.

=over 3

 SV **  PadARRAY(PAD * pad)

=back

=back

=for hackers
Declared and documented at pad.h, line 229

=over 4

=item C<PadlistARRAY>
X<PadlistARRAY>

NOTE: C<PadlistARRAY> is B<experimental> and may change or be
removed without notice.

The C array of a padlist, containing the pads.  Only subscript it with
numbers >= 1, as the 0th entry is not guaranteed to remain usable.

=over 3

 PAD **  PadlistARRAY(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 196

=over 4

=item C<PadlistMAX>
X<PadlistMAX>

NOTE: C<PadlistMAX> is B<experimental> and may change or be
removed without notice.

The index of the last allocated space in the padlist.  Note that the last
pad may be in an earlier slot.  Any entries following it will be C<NULL> in
that case.

=over 3

 SSize_t  PadlistMAX(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 200

=over 4

=item C<PadlistNAMES>
X<PadlistNAMES>

NOTE: C<PadlistNAMES> is B<experimental> and may change or be
removed without notice.

The names associated with pad entries.

=over 3

 PADNAMELIST *  PadlistNAMES(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 205

=over 4

=item C<PadlistNAMESARRAY>
X<PadlistNAMESARRAY>

NOTE: C<PadlistNAMESARRAY> is B<experimental> and may change or be
removed without notice.

The C array of pad names.

=over 3

 PADNAME **  PadlistNAMESARRAY(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 208

=over 4

=item C<PadlistNAMESMAX>
X<PadlistNAMESMAX>

NOTE: C<PadlistNAMESMAX> is B<experimental> and may change or be
removed without notice.

The index of the last pad name.

=over 3

 SSize_t  PadlistNAMESMAX(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 211

=over 4

=item C<PadlistREFCNT>
X<PadlistREFCNT>

NOTE: C<PadlistREFCNT> is B<experimental> and may change or be
removed without notice.

The reference count of the padlist.  Currently this is always 1.

=over 3

 U32  PadlistREFCNT(PADLIST * padlist)

=back

=back

=for hackers
Declared and documented at pad.h, line 214

=over 4

=item C<PadMAX>
X<PadMAX>

NOTE: C<PadMAX> is B<experimental> and may change or be
removed without notice.

The index of the last pad entry.

=over 3

 SSize_t  PadMAX(PAD * pad)

=back

=back

=for hackers
Declared and documented at pad.h, line 232

=over 4

=item C<PadnameLEN>
X<PadnameLEN>

NOTE: C<PadnameLEN> is B<experimental> and may change or be
removed without notice.

The length of the name.

=over 3

 STRLEN  PadnameLEN(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 239

=over 4

=item C<PadnamelistARRAY>
X<PadnamelistARRAY>

NOTE: C<PadnamelistARRAY> is B<experimental> and may change or be
removed without notice.

The C array of pad names.

=over 3

 PADNAME **  PadnamelistARRAY(PADNAMELIST * pnl)

=back

=back

=for hackers
Declared and documented at pad.h, line 217

=over 4

=item C<PadnamelistMAX>
X<PadnamelistMAX>

NOTE: C<PadnamelistMAX> is B<experimental> and may change or be
removed without notice.

The index of the last pad name.

=over 3

 SSize_t  PadnamelistMAX(PADNAMELIST * pnl)

=back

=back

=for hackers
Declared and documented at pad.h, line 220

=over 4

=item C<PadnamelistREFCNT>
X<PadnamelistREFCNT>

NOTE: C<PadnamelistREFCNT> is B<experimental> and may change or be
removed without notice.

The reference count of the pad name list.

=over 3

 SSize_t  PadnamelistREFCNT(PADNAMELIST * pnl)

=back

=back

=for hackers
Declared and documented at pad.h, line 223

=over 4

=item C<PadnamelistREFCNT_dec>
X<PadnamelistREFCNT_dec>

NOTE: C<PadnamelistREFCNT_dec> is B<experimental> and may change or be
removed without notice.

Lowers the reference count of the pad name list.

=over 3

 void  PadnamelistREFCNT_dec(PADNAMELIST * pnl)

=back

=back

=for hackers
Declared and documented at pad.h, line 226

=over 4

=item C<PadnamePV>
X<PadnamePV>

NOTE: C<PadnamePV> is B<experimental> and may change or be
removed without notice.

The name stored in the pad name struct.  This returns C<NULL> for a target
slot.

=over 3

 char *  PadnamePV(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 235

=over 4

=item C<PadnameREFCNT>
X<PadnameREFCNT>

NOTE: C<PadnameREFCNT> is B<experimental> and may change or be
removed without notice.

The reference count of the pad name.

=over 3

 SSize_t  PadnameREFCNT(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 269

=over 4

=item C<PadnameREFCNT_dec>
X<PadnameREFCNT_dec>

NOTE: C<PadnameREFCNT_dec> is B<experimental> and may change or be
removed without notice.

Lowers the reference count of the pad name.

=over 3

 void  PadnameREFCNT_dec(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 275

=over 4

=item C<PadnameREFCNT_inc>
X<PadnameREFCNT_inc>

NOTE: C<PadnameREFCNT_inc> is B<experimental> and may change or be
removed without notice.

Increases the reference count of the pad name.  Returns the pad name itself.

=over 3

 PADNAME *  PadnameREFCNT_inc(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 272

=over 4

=item C<PadnameSV>
X<PadnameSV>

NOTE: C<PadnameSV> is B<experimental> and may change or be
removed without notice.

Returns the pad name as a mortal SV.

=over 3

 SV *  PadnameSV(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 245

=over 4

=item C<PadnameUTF8>
X<PadnameUTF8>

NOTE: C<PadnameUTF8> is B<experimental> and may change or be
removed without notice.

Whether PadnamePV is in UTF-8.  Currently, this is always true.

=over 3

 bool  PadnameUTF8(PADNAME * pn)

=back

=back

=for hackers
Declared and documented at pad.h, line 242

=over 4

=item C<PL_comppad>
X<PL_comppad>

NOTE: C<PL_comppad> is B<experimental> and may change or be
removed without notice.

During compilation, this points to the array containing the values
part of the pad for the currently-compiling code.  (At runtime a CV may
have many such value arrays; at compile time just one is constructed.)
At runtime, this points to the array containing the currently-relevant
values for the pad for the currently-executing code.

=back

=for hackers
Declared and documented at pad.c, line 131

=over 4

=item C<PL_comppad_name>
X<PL_comppad_name>

NOTE: C<PL_comppad_name> is B<experimental> and may change or be
removed without notice.

During compilation, this points to the array containing the names part
of the pad for the currently-compiling code.

=back

=for hackers
Declared and documented at pad.c, line 126

=over 4

=item C<PL_curpad>
X<PL_curpad>

NOTE: C<PL_curpad> is B<experimental> and may change or be
removed without notice.

Points directly to the body of the L</PL_comppad> array.
(I.e., this is C<PadARRAY(PL_comppad)>.)

=back

=for hackers
Declared and documented at pad.c, line 139

=over 4

=item C<SVs_PADMY>

=item C<SVs_PADTMP>

C<B<DEPRECATED!>>  It is planned to remove C<SVs_PADMY>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Described in L<perlguts>.

=back

=for hackers
SVs_PADMY all in group documented at pod/perlguts.pod, line 2413
SVs_PADTMP 

=head1 Password and Group access

=over 4

=item C<GRPASSWD>
X<GRPASSWD>

This symbol, if defined, indicates to the C program that C<struct group>
in F<grp.h> contains C<gr_passwd>.

=back

=for hackers
Declared and documented at config.h, line 2057

=over 4

=item C<HAS_ENDGRENT>
X<HAS_ENDGRENT>

This symbol, if defined, indicates that the getgrent routine is
available for finalizing sequential access of the group database.

=back

=for hackers
Declared and documented at config.h, line 1534

=over 4

=item C<HAS_ENDGRENT_R>
X<HAS_ENDGRENT_R>

This symbol, if defined, indicates that the C<endgrent_r> routine
is available to endgrent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4595

=over 4

=item C<HAS_ENDPWENT>
X<HAS_ENDPWENT>

This symbol, if defined, indicates that the C<endpwent> routine is
available for finalizing sequential access of the passwd database.

=back

=for hackers
Declared and documented at config.h, line 1558

=over 4

=item C<HAS_ENDPWENT_R>
X<HAS_ENDPWENT_R>

This symbol, if defined, indicates that the C<endpwent_r> routine
is available to endpwent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4647

=over 4

=item C<HAS_GETGRENT>
X<HAS_GETGRENT>

This symbol, if defined, indicates that the C<getgrent> routine is
available for sequential access of the group database.

=back

=for hackers
Declared and documented at config.h, line 1576

=over 4

=item C<HAS_GETGRENT_R>
X<HAS_GETGRENT_R>

This symbol, if defined, indicates that the C<getgrent_r> routine
is available to getgrent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4686

=over 4

=item C<HAS_GETPWENT>
X<HAS_GETPWENT>

This symbol, if defined, indicates that the C<getpwent> routine is
available for sequential access of the passwd database.
If this is not available, the older C<getpw()> function may be available.

=back

=for hackers
Declared and documented at config.h, line 1676

=over 4

=item C<HAS_GETPWENT_R>
X<HAS_GETPWENT_R>

This symbol, if defined, indicates that the C<getpwent_r> routine
is available to getpwent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4855

=over 4

=item C<HAS_SETGRENT>
X<HAS_SETGRENT>

This symbol, if defined, indicates that the C<setgrent> routine is
available for initializing sequential access of the group database.

=back

=for hackers
Declared and documented at config.h, line 1837

=over 4

=item C<HAS_SETGRENT_R>
X<HAS_SETGRENT_R>

This symbol, if defined, indicates that the C<setgrent_r> routine
is available to setgrent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 5080

=over 4

=item C<HAS_SETPWENT>
X<HAS_SETPWENT>

This symbol, if defined, indicates that the C<setpwent> routine is
available for initializing sequential access of the passwd database.

=back

=for hackers
Declared and documented at config.h, line 1873

=over 4

=item C<HAS_SETPWENT_R>
X<HAS_SETPWENT_R>

This symbol, if defined, indicates that the C<setpwent_r> routine
is available to setpwent re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 5145

=over 4

=item C<PWAGE>
X<PWAGE>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_age>.

=back

=for hackers
Declared and documented at config.h, line 2148

=over 4

=item C<PWCHANGE>
X<PWCHANGE>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_change>.

=back

=for hackers
Declared and documented at config.h, line 2149

=over 4

=item C<PWCLASS>
X<PWCLASS>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_class>.

=back

=for hackers
Declared and documented at config.h, line 2150

=over 4

=item C<PWCOMMENT>
X<PWCOMMENT>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_comment>.

=back

=for hackers
Declared and documented at config.h, line 2152

=over 4

=item C<PWEXPIRE>
X<PWEXPIRE>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_expire>.

=back

=for hackers
Declared and documented at config.h, line 2151

=over 4

=item C<PWGECOS>
X<PWGECOS>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_gecos>.

=back

=for hackers
Declared and documented at config.h, line 2153

=over 4

=item C<PWPASSWD>
X<PWPASSWD>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_passwd>.

=back

=for hackers
Declared and documented at config.h, line 2154

=over 4

=item C<PWQUOTA>
X<PWQUOTA>

This symbol, if defined, indicates to the C program that C<struct passwd>
contains C<pw_quota>.

=back

=for hackers
Declared and documented at config.h, line 2147

=head1 Paths to system commands

=over 4

=item C<CSH>
X<CSH>

This symbol, if defined, contains the full pathname of csh.

=back

=for hackers
Declared and documented at config.h, line 1500

=over 4

=item C<LOC_SED>
X<LOC_SED>

This symbol holds the complete pathname to the sed program.

=back

=for hackers
Declared and documented at config.h, line 23

=over 4

=item C<SH_PATH>
X<SH_PATH>

This symbol contains the full pathname to the shell used on this
on this system to execute Bourne shell scripts.  Usually, this will be
F</bin/sh>, though it's possible that some systems will have F</bin/ksh>,
F</bin/pdksh>, F</bin/ash>, F</bin/bash>, or even something such as
D:F</bin/sh.exe>.

=back

=for hackers
Declared and documented at config.h, line 2209

=head1 Prototype information

=over 4

=item C<CRYPT_R_PROTO>
X<CRYPT_R_PROTO>

This symbol encodes the prototype of C<crypt_r>.
It is zero if C<d_crypt_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_crypt_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4544

=over 4

=item C<CTERMID_R_PROTO>
X<CTERMID_R_PROTO>

This symbol encodes the prototype of C<ctermid_r>.
It is zero if C<d_ctermid_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_ctermid_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4557

=over 4

=item C<DRAND48_R_PROTO>
X<DRAND48_R_PROTO>

This symbol encodes the prototype of C<drand48_r>.
It is zero if C<d_drand48_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_drand48_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4583

=over 4

=item C<ENDGRENT_R_PROTO>
X<ENDGRENT_R_PROTO>

This symbol encodes the prototype of C<endgrent_r>.
It is zero if C<d_endgrent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endgrent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4596

=over 4

=item C<ENDHOSTENT_R_PROTO>
X<ENDHOSTENT_R_PROTO>

This symbol encodes the prototype of C<endhostent_r>.
It is zero if C<d_endhostent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endhostent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4609

=over 4

=item C<ENDNETENT_R_PROTO>
X<ENDNETENT_R_PROTO>

This symbol encodes the prototype of C<endnetent_r>.
It is zero if C<d_endnetent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endnetent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4622

=over 4

=item C<ENDPROTOENT_R_PROTO>
X<ENDPROTOENT_R_PROTO>

This symbol encodes the prototype of C<endprotoent_r>.
It is zero if C<d_endprotoent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endprotoent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4635

=over 4

=item C<ENDPWENT_R_PROTO>
X<ENDPWENT_R_PROTO>

This symbol encodes the prototype of C<endpwent_r>.
It is zero if C<d_endpwent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endpwent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4648

=over 4

=item C<ENDSERVENT_R_PROTO>
X<ENDSERVENT_R_PROTO>

This symbol encodes the prototype of C<endservent_r>.
It is zero if C<d_endservent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_endservent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4661

=over 4

=item C<GDBM_NDBM_H_USES_PROTOTYPES>
X<GDBM_NDBM_H_USES_PROTOTYPES>

This symbol, if defined, indicates that <gdbm-F<ndbm.h>> uses real C<ANSI> C
prototypes instead of K&R style function declarations without any
parameter information. While C<ANSI> C prototypes are supported in C++,
K&R style function declarations will yield errors.

=back

=for hackers
Declared and documented at config.h, line 2096

=over 4

=item C<GDBMNDBM_H_USES_PROTOTYPES>
X<GDBMNDBM_H_USES_PROTOTYPES>

This symbol, if defined, indicates that F<gdbm/ndbm.h> uses real C<ANSI> C
prototypes instead of K&R style function declarations without any
parameter information. While C<ANSI> C prototypes are supported in C++,
K&R style function declarations will yield errors.

=back

=for hackers
Declared and documented at config.h, line 2095

=over 4

=item C<GETGRENT_R_PROTO>
X<GETGRENT_R_PROTO>

This symbol encodes the prototype of C<getgrent_r>.
It is zero if C<d_getgrent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getgrent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4687

=over 4

=item C<GETGRGID_R_PROTO>
X<GETGRGID_R_PROTO>

This symbol encodes the prototype of C<getgrgid_r>.
It is zero if C<d_getgrgid_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getgrgid_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4700

=over 4

=item C<GETGRNAM_R_PROTO>
X<GETGRNAM_R_PROTO>

This symbol encodes the prototype of C<getgrnam_r>.
It is zero if C<d_getgrnam_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getgrnam_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4713

=over 4

=item C<GETHOSTBYADDR_R_PROTO>
X<GETHOSTBYADDR_R_PROTO>

This symbol encodes the prototype of C<gethostbyaddr_r>.
It is zero if C<d_gethostbyaddr_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_gethostbyaddr_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4726

=over 4

=item C<GETHOSTBYNAME_R_PROTO>
X<GETHOSTBYNAME_R_PROTO>

This symbol encodes the prototype of C<gethostbyname_r>.
It is zero if C<d_gethostbyname_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_gethostbyname_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4739

=over 4

=item C<GETHOSTENT_R_PROTO>
X<GETHOSTENT_R_PROTO>

This symbol encodes the prototype of C<gethostent_r>.
It is zero if C<d_gethostent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_gethostent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4752

=over 4

=item C<GETLOGIN_R_PROTO>
X<GETLOGIN_R_PROTO>

This symbol encodes the prototype of C<getlogin_r>.
It is zero if C<d_getlogin_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getlogin_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4765

=over 4

=item C<GETNETBYADDR_R_PROTO>
X<GETNETBYADDR_R_PROTO>

This symbol encodes the prototype of C<getnetbyaddr_r>.
It is zero if C<d_getnetbyaddr_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getnetbyaddr_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4778

=over 4

=item C<GETNETBYNAME_R_PROTO>
X<GETNETBYNAME_R_PROTO>

This symbol encodes the prototype of C<getnetbyname_r>.
It is zero if C<d_getnetbyname_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getnetbyname_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4791

=over 4

=item C<GETNETENT_R_PROTO>
X<GETNETENT_R_PROTO>

This symbol encodes the prototype of C<getnetent_r>.
It is zero if C<d_getnetent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getnetent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4804

=over 4

=item C<GETPROTOBYNAME_R_PROTO>
X<GETPROTOBYNAME_R_PROTO>

This symbol encodes the prototype of C<getprotobyname_r>.
It is zero if C<d_getprotobyname_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getprotobyname_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4817

=over 4

=item C<GETPROTOBYNUMBER_R_PROTO>
X<GETPROTOBYNUMBER_R_PROTO>

This symbol encodes the prototype of C<getprotobynumber_r>.
It is zero if C<d_getprotobynumber_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getprotobynumber_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4830

=over 4

=item C<GETPROTOENT_R_PROTO>
X<GETPROTOENT_R_PROTO>

This symbol encodes the prototype of C<getprotoent_r>.
It is zero if C<d_getprotoent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getprotoent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4843

=over 4

=item C<GETPWENT_R_PROTO>
X<GETPWENT_R_PROTO>

This symbol encodes the prototype of C<getpwent_r>.
It is zero if C<d_getpwent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getpwent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4856

=over 4

=item C<GETPWNAM_R_PROTO>
X<GETPWNAM_R_PROTO>

This symbol encodes the prototype of C<getpwnam_r>.
It is zero if C<d_getpwnam_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getpwnam_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4869

=over 4

=item C<GETPWUID_R_PROTO>
X<GETPWUID_R_PROTO>

This symbol encodes the prototype of C<getpwuid_r>.
It is zero if C<d_getpwuid_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getpwuid_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4882

=over 4

=item C<GETSERVBYNAME_R_PROTO>
X<GETSERVBYNAME_R_PROTO>

This symbol encodes the prototype of C<getservbyname_r>.
It is zero if C<d_getservbyname_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getservbyname_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4895

=over 4

=item C<GETSERVBYPORT_R_PROTO>
X<GETSERVBYPORT_R_PROTO>

This symbol encodes the prototype of C<getservbyport_r>.
It is zero if C<d_getservbyport_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getservbyport_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4908

=over 4

=item C<GETSERVENT_R_PROTO>
X<GETSERVENT_R_PROTO>

This symbol encodes the prototype of C<getservent_r>.
It is zero if C<d_getservent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getservent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4921

=over 4

=item C<GETSPNAM_R_PROTO>
X<GETSPNAM_R_PROTO>

This symbol encodes the prototype of C<getspnam_r>.
It is zero if C<d_getspnam_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_getspnam_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4934

=over 4

=item C<HAS_DBMINIT_PROTO>
X<HAS_DBMINIT_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<dbminit()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern int dbminit(char *);

=back

=for hackers
Declared and documented at config.h, line 2410

=over 4

=item C<HAS_DRAND48_PROTO>
X<HAS_DRAND48_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<drand48()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern double drand48(void);

=back

=for hackers
Declared and documented at config.h, line 4435

=over 4

=item C<HAS_FLOCK_PROTO>
X<HAS_FLOCK_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<flock()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern int flock(int, int);

=back

=for hackers
Declared and documented at config.h, line 2533

=over 4

=item C<HAS_GETHOST_PROTOS>
X<HAS_GETHOST_PROTOS>

This symbol, if defined, indicates that F<netdb.h> includes
prototypes for C<gethostent()>, C<gethostbyname()>, and
C<gethostbyaddr()>.  Otherwise, it is up to the program to guess
them.  See netdbtype.U (part of metaconfig) for probing for various C<Netdb_xxx_t> types.

=back

=for hackers
Declared and documented at config.h, line 4443

=over 4

=item C<HAS_GETNET_PROTOS>
X<HAS_GETNET_PROTOS>

This symbol, if defined, indicates that F<netdb.h> includes
prototypes for C<getnetent()>, C<getnetbyname()>, and
C<getnetbyaddr()>.  Otherwise, it is up to the program to guess
them.  See netdbtype.U (part of metaconfig) for probing for various C<Netdb_xxx_t> types.

=back

=for hackers
Declared and documented at config.h, line 4451

=over 4

=item C<HAS_GETPROTO_PROTOS>
X<HAS_GETPROTO_PROTOS>

This symbol, if defined, indicates that F<netdb.h> includes
prototypes for C<getprotoent()>, C<getprotobyname()>, and
C<getprotobyaddr()>.  Otherwise, it is up to the program to guess
them.  See netdbtype.U (part of metaconfig) for probing for various C<Netdb_xxx_t> types.

=back

=for hackers
Declared and documented at config.h, line 4459

=over 4

=item C<HAS_GETSERV_PROTOS>
X<HAS_GETSERV_PROTOS>

This symbol, if defined, indicates that F<netdb.h> includes
prototypes for C<getservent()>, C<getservbyname()>, and
C<getservbyaddr()>.  Otherwise, it is up to the program to guess
them.  See netdbtype.U (part of metaconfig) for probing for various C<Netdb_xxx_t> types.

=back

=for hackers
Declared and documented at config.h, line 4467

=over 4

=item C<HAS_MODFL_PROTO>
X<HAS_MODFL_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<modfl()> function.  Otherwise, it is up
to the program to supply one.

=back

=for hackers
Declared and documented at config.h, line 3066

=over 4

=item C<HAS_SBRK_PROTO>
X<HAS_SBRK_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<sbrk()> function.  Otherwise, it is up
to the program to supply one.  Good guesses are

 extern void* sbrk(int);
 extern void* sbrk(size_t);

=back

=for hackers
Declared and documented at config.h, line 3258

=over 4

=item C<HAS_SETRESGID_PROTO>
X<HAS_SETRESGID_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<setresgid()> function.  Otherwise, it is up
to the program to supply one.  Good guesses are

 extern int setresgid(uid_t ruid, uid_t euid, uid_t suid);

=back

=for hackers
Declared and documented at config.h, line 3376

=over 4

=item C<HAS_SETRESUID_PROTO>
X<HAS_SETRESUID_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<setresuid()> function.  Otherwise, it is up
to the program to supply one.  Good guesses are

 extern int setresuid(uid_t ruid, uid_t euid, uid_t suid);

=back

=for hackers
Declared and documented at config.h, line 3384

=over 4

=item C<HAS_SHMAT_PROTOTYPE>
X<HAS_SHMAT_PROTOTYPE>

This symbol, if defined, indicates that the F<sys/shm.h> includes
a prototype for C<shmat()>.  Otherwise, it is up to the program to
guess one.  C<Shmat_t> C<shmat(int, Shmat_t, int)> is a good guess,
but not always right so it should be emitted by the program only
when C<HAS_SHMAT_PROTOTYPE> is not defined to avoid conflicting defs.

=back

=for hackers
Declared and documented at config.h, line 1906

=over 4

=item C<HAS_SOCKATMARK_PROTO>
X<HAS_SOCKATMARK_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<sockatmark()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern int sockatmark(int);

=back

=for hackers
Declared and documented at config.h, line 3356

=over 4

=item C<HAS_SYSCALL_PROTO>
X<HAS_SYSCALL_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<syscall()> function.  Otherwise, it is up
to the program to supply one.  Good guesses are

 extern int syscall(int,  ...);
 extern int syscall(long, ...);

=back

=for hackers
Declared and documented at config.h, line 3483

=over 4

=item C<HAS_TELLDIR_PROTO>
X<HAS_TELLDIR_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<telldir()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern long telldir(DIR*);

=back

=for hackers
Declared and documented at config.h, line 3491

=over 4

=item C<NDBM_H_USES_PROTOTYPES>
X<NDBM_H_USES_PROTOTYPES>

This symbol, if defined, indicates that F<ndbm.h> uses real C<ANSI> C
prototypes instead of K&R style function declarations without any
parameter information. While C<ANSI> C prototypes are supported in C++,
K&R style function declarations will yield errors.

=back

=for hackers
Declared and documented at config.h, line 2094

=over 4

=item C<RANDOM_R_PROTO>
X<RANDOM_R_PROTO>

This symbol encodes the prototype of C<random_r>.
It is zero if C<d_random_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_random_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5042

=over 4

=item C<READDIR_R_PROTO>
X<READDIR_R_PROTO>

This symbol encodes the prototype of C<readdir_r>.
It is zero if C<d_readdir_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_readdir_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5068

=over 4

=item C<SETGRENT_R_PROTO>
X<SETGRENT_R_PROTO>

This symbol encodes the prototype of C<setgrent_r>.
It is zero if C<d_setgrent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setgrent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5081

=over 4

=item C<SETHOSTENT_R_PROTO>
X<SETHOSTENT_R_PROTO>

This symbol encodes the prototype of C<sethostent_r>.
It is zero if C<d_sethostent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_sethostent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5094

=over 4

=item C<SETLOCALE_R_PROTO>
X<SETLOCALE_R_PROTO>

This symbol encodes the prototype of C<setlocale_r>.
It is zero if C<d_setlocale_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setlocale_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5107

=over 4

=item C<SETNETENT_R_PROTO>
X<SETNETENT_R_PROTO>

This symbol encodes the prototype of C<setnetent_r>.
It is zero if C<d_setnetent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setnetent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5120

=over 4

=item C<SETPROTOENT_R_PROTO>
X<SETPROTOENT_R_PROTO>

This symbol encodes the prototype of C<setprotoent_r>.
It is zero if C<d_setprotoent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setprotoent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5133

=over 4

=item C<SETPWENT_R_PROTO>
X<SETPWENT_R_PROTO>

This symbol encodes the prototype of C<setpwent_r>.
It is zero if C<d_setpwent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setpwent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5146

=over 4

=item C<SETSERVENT_R_PROTO>
X<SETSERVENT_R_PROTO>

This symbol encodes the prototype of C<setservent_r>.
It is zero if C<d_setservent_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_setservent_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5159

=over 4

=item C<SRANDOM_R_PROTO>
X<SRANDOM_R_PROTO>

This symbol encodes the prototype of C<srandom_r>.
It is zero if C<d_srandom_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_srandom_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5185

=over 4

=item C<SRAND48_R_PROTO>
X<SRAND48_R_PROTO>

This symbol encodes the prototype of C<srand48_r>.
It is zero if C<d_srand48_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_srand48_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5172

=over 4

=item C<STRERROR_R_PROTO>
X<STRERROR_R_PROTO>

This symbol encodes the prototype of C<strerror_r>.
It is zero if C<d_strerror_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_strerror_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5198

=over 4

=item C<TMPNAM_R_PROTO>
X<TMPNAM_R_PROTO>

This symbol encodes the prototype of C<tmpnam_r>.
It is zero if C<d_tmpnam_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_tmpnam_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5235

=over 4

=item C<TTYNAME_R_PROTO>
X<TTYNAME_R_PROTO>

This symbol encodes the prototype of C<ttyname_r>.
It is zero if C<d_ttyname_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_ttyname_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 5248

=head1 Reference-counted stack manipulation

Functions for pushing and pulling items on the stack when the
stack is reference counted. They are intended as replacements
for the old PUSHs, POPi, EXTEND etc pp macros within pp
functions.


=over 4

=item C<rpp_context>
X<rpp_context>

NOTE: C<rpp_context> is B<experimental> and may change or be
removed without notice.

Impose void, scalar or list context on the stack.
First, pop C<extra> items off the stack, then when C<gimme> is:
C<G_LIST>:   return as-is.
C<G_VOID>:   pop everything back to C<mark>
C<G_SCALAR>: move the top stack item (or C<&PL_sv_undef> if none) to
C<mark+1> and free everything above it.

=over 3

 void       rpp_context(      SV **mark, U8 gimme, SSize_t extra)
 void  Perl_rpp_context(pTHX_ SV **mark, U8 gimme, SSize_t extra)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 1026

=over 4

=item C<rpp_extend>
X<rpp_extend>

NOTE: C<rpp_extend> is B<experimental> and may change or be
removed without notice.

Ensures that there is space on the stack to push C<n> items, extending it
if necessary.

=over 3

 void       rpp_extend(      SSize_t n)
 void  Perl_rpp_extend(pTHX_ SSize_t n)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 388

=over 4

=item C<rpp_invoke_xs>
X<rpp_invoke_xs>

NOTE: C<rpp_invoke_xs> is B<experimental> and may change or be
removed without notice.

Call the XS function associated with C<cv>. Wraps the call if necessary to
handle XS functions which are not aware of reference-counted stacks.

=over 3

 void       rpp_invoke_xs(      CV *cv)
 void  Perl_rpp_invoke_xs(pTHX_ CV *cv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 1157

=over 4

=item C<rpp_is_lone>
X<rpp_is_lone>

NOTE: C<rpp_is_lone> is B<experimental> and may change or be
removed without notice.

Indicates whether the stacked SV C<sv> (assumed to be not yet popped off
the stack) is only kept alive due to a single reference from the argument
stack and/or and the temps stack.

This can used for example to decide whether the copying of return values
in rvalue context can be skipped, or whether it shouldn't be assigned to
in lvalue context.

=over 3

 bool       rpp_is_lone(      SV *sv)
 bool  Perl_rpp_is_lone(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 1122

=over 4

=item C<rpp_pop_1_norc>
X<rpp_pop_1_norc>

NOTE: C<rpp_pop_1_norc> is B<experimental> and may change or be
removed without notice.

Pop and return the top item off the argument stack and update
C<PL_stack_sp>. It's similar to rpp_popfree_1(), except that it actually
returns a value, and it I<doesn't> decrement the SV's reference count.
On non-C<PERL_RC_STACK> builds it actually increments the SV's reference
count.

This is useful in cases where the popped value is immediately embedded
somewhere e.g. via av_store(), allowing you skip decrementing and then
immediately incrementing the reference count again (and risk prematurely
freeing the SV if it had a RC of 1). On non-RC builds, the reference count
bookkeeping still works too, which is why it should be used rather than
a simple C<*PL_stack_sp-->.

=over 3

 SV *       rpp_pop_1_norc()
 SV *  Perl_rpp_pop_1_norc(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 585

=over 4

=item C<rpp_popfree_to>
X<rpp_popfree_to>

NOTE: C<rpp_popfree_to> is B<experimental> and may change or be
removed without notice.

Pop and free all items on the argument stack above C<sp>. On return,
C<PL_stack_sp> will be equal to C<sp>.

=over 3

 void       rpp_popfree_to(      SV **sp)
 void  Perl_rpp_popfree_to(pTHX_ SV **sp)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 411

=over 4

=item C<rpp_popfree_to_NN>
X<rpp_popfree_to_NN>

NOTE: C<rpp_popfree_to_NN> is B<experimental> and may change or be
removed without notice.

A variant of rpp_popfree_to() which assumes that all the pointers being
popped off the stack are non-NULL.

=over 3

 void       rpp_popfree_to_NN(      SV **sp)
 void  Perl_rpp_popfree_to_NN(pTHX_ SV **sp)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 438

=over 4

=item C<rpp_popfree_1>
X<rpp_popfree_1>

NOTE: C<rpp_popfree_1> is B<experimental> and may change or be
removed without notice.

Pop and free the top item on the argument stack and update C<PL_stack_sp>.

=over 3

 void       rpp_popfree_1()
 void  Perl_rpp_popfree_1(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 466

=over 4

=item C<rpp_popfree_1_NN>
X<rpp_popfree_1_NN>

NOTE: C<rpp_popfree_1_NN> is B<experimental> and may change or be
removed without notice.

A variant of rpp_popfree_1() which assumes that the pointer being popped
off the stack is non-NULL.

=over 3

 void       rpp_popfree_1_NN()
 void  Perl_rpp_popfree_1_NN(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 489

=over 4

=item C<rpp_popfree_2>
X<rpp_popfree_2>

NOTE: C<rpp_popfree_2> is B<experimental> and may change or be
removed without notice.

Pop and free the top two items on the argument stack and update
C<PL_stack_sp>.

=over 3

 void       rpp_popfree_2()
 void  Perl_rpp_popfree_2(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 514

=over 4

=item C<rpp_popfree_2_NN>
X<rpp_popfree_2_NN>

NOTE: C<rpp_popfree_2_NN> is B<experimental> and may change or be
removed without notice.

A variant of rpp_popfree_2() which assumes that the two pointers being
popped off the stack are non-NULL.

=over 3

 void       rpp_popfree_2_NN()
 void  Perl_rpp_popfree_2_NN(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 541

=over 4

=item C<rpp_push_1>

=item C<rpp_push_IMM>

=item C<rpp_push_2>

=item C<rpp_xpush_1>

=item C<rpp_xpush_IMM>

=item C<rpp_xpush_2>
X<rpp_push_IMM>X<rpp_push_1>X<rpp_push_2>X<rpp_xpush_IMM>X<rpp_xpush_1>
X<rpp_xpush_2>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

Push one or two SVs onto the stack, incrementing their reference counts
and updating C<PL_stack_sp>. With the C<x> variants, it extends the stack
first. The C<IMM> variants assume that the single argument is an immortal
such as <&PL_sv_undef> and, for efficiency, will skip incrementing its
reference count.

=over 3

 void       rpp_push_1   (      SV *sv)
 void  Perl_rpp_push_1   (pTHX_ SV *sv)
 void       rpp_push_IMM (      SV *sv)
 void  Perl_rpp_push_IMM (pTHX_ SV *sv)
 void       rpp_push_2   (      SV *sv1, SV *sv2)
 void  Perl_rpp_push_2   (pTHX_ SV *sv1, SV *sv2)
 void       rpp_xpush_1  (      SV *sv)
 void  Perl_rpp_xpush_1  (pTHX_ SV *sv)
 void       rpp_xpush_IMM(      SV *sv)
 void  Perl_rpp_xpush_IMM(pTHX_ SV *sv)
 void       rpp_xpush_2  (      SV *sv1, SV *sv2)
 void  Perl_rpp_xpush_2  (pTHX_ SV *sv1, SV *sv2)

=back

=back

=for hackers
rpp_push_1 declared in embed.fnc; all in group documented at inline.h, line 621
rpp_push_IMM declared in embed.fnc
rpp_push_2 declared in embed.fnc
rpp_xpush_1 declared in embed.fnc
rpp_xpush_IMM declared in embed.fnc
rpp_xpush_2 declared in embed.fnc

=over 4

=item C<rpp_push_1_norc>
X<rpp_push_1_norc>

NOTE: C<rpp_push_1_norc> is B<experimental> and may change or be
removed without notice.

Push C<sv> onto the stack without incrementing its reference count, and
update C<PL_stack_sp>. On non-PERL_RC_STACK builds, mortalise too.

This is most useful where an SV has just been created and already has a
reference count of 1, but has not yet been anchored anywhere.

=over 3

 void       rpp_push_1_norc(      SV *sv)
 void  Perl_rpp_push_1_norc(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 704

=over 4

=item C<rpp_push_2*>

Described under C<L</rpp_push_1>>

=back

=over 4

=item C<rpp_replace_at>
X<rpp_replace_at>

NOTE: C<rpp_replace_at> is B<experimental> and may change or be
removed without notice.

Replace the SV at address sp within the stack with C<sv>, while suitably
adjusting reference counts. Equivalent to C<*sp = sv>, except with proper
reference count handling.

=over 3

 void       rpp_replace_at(      SV **sp, SV *sv)
 void  Perl_rpp_replace_at(pTHX_ SV **sp, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 911

=over 4

=item C<rpp_replace_at_NN>
X<rpp_replace_at_NN>

NOTE: C<rpp_replace_at_NN> is B<experimental> and may change or be
removed without notice.

A variant of rpp_replace_at() which assumes that the SV pointer on the
stack is non-NULL.

=over 3

 void       rpp_replace_at_NN(      SV **sp, SV *sv)
 void  Perl_rpp_replace_at_NN(pTHX_ SV **sp, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 938

=over 4

=item C<rpp_replace_at_norc>
X<rpp_replace_at_norc>

NOTE: C<rpp_replace_at_norc> is B<experimental> and may change or be
removed without notice.

Replace the SV at address sp within the stack with C<sv>, while suitably
adjusting the reference count of the old SV. Equivalent to C<*sp = sv>,
except with proper reference count handling.

C<sv>'s reference count doesn't get incremented. On non-C<PERL_RC_STACK>
builds, it gets mortalised too.

This is most useful where an SV has just been created and already has a
reference count of 1, but has not yet been anchored anywhere.

=over 3

 void       rpp_replace_at_norc(      SV **sp, SV *sv)
 void  Perl_rpp_replace_at_norc(pTHX_ SV **sp, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 966

=over 4

=item C<rpp_replace_at_norc_NN>
X<rpp_replace_at_norc_NN>

NOTE: C<rpp_replace_at_norc_NN> is B<experimental> and may change or be
removed without notice.

A variant of rpp_replace_at_norc() which assumes that the SV pointer on the
stack is non-NULL.

=over 3

 void       rpp_replace_at_norc_NN(      SV **sp, SV *sv)
 void  Perl_rpp_replace_at_norc_NN(pTHX_ SV **sp, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 999

=over 4

=item C<rpp_replace_1_1>

=item C<rpp_replace_1_1_NN>

=item C<rpp_replace_1_IMM_NN>
X<rpp_replace_1_IMM_NN>X<rpp_replace_1_1>X<rpp_replace_1_1_NN>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

Replace the current top stack item with C<sv>, while suitably adjusting
reference counts. Equivalent to rpp_popfree_1(); rpp_push_1(sv), but
is more efficient and handles both SVs being the same.

The C<_NN> variant assumes that the pointer on the stack to the SV being
freed is non-NULL.

The C<IMM_NN> variant is like the C<_NN> variant, but in addition, assumes
that the single argument is an immortal such as <&PL_sv_undef> and, for
efficiency, will skip incrementing its reference count.

=over 3

 void       rpp_replace_1_1     (      SV *sv)
 void  Perl_rpp_replace_1_1     (pTHX_ SV *sv)
 void       rpp_replace_1_1_NN  (      SV *sv)
 void  Perl_rpp_replace_1_1_NN  (pTHX_ SV *sv)
 void       rpp_replace_1_IMM_NN(      SV *sv)
 void  Perl_rpp_replace_1_IMM_NN(pTHX_ SV *sv)

=back

=back

=for hackers
rpp_replace_1_1 declared in embed.fnc; all in group documented at inline.h, line 730
rpp_replace_1_1_NN declared in embed.fnc
rpp_replace_1_IMM_NN declared in embed.fnc

=over 4

=item C<rpp_replace_2_1>

=item C<rpp_replace_2_1_NN>

=item C<rpp_replace_2_IMM_NN>
X<rpp_replace_2_IMM_NN>X<rpp_replace_2_1>X<rpp_replace_2_1_NN>

NOTE: all these forms are B<experimental> and may change or be
removed without notice.

Replace the current top to stacks item with C<sv>, while suitably
adjusting reference counts. Equivalent to rpp_popfree_2(); rpp_push_1(sv),
but is more efficient and handles SVs being the same.

The C<_NN> variant assumes that the pointers on the stack to the SVs being
freed are non-NULL.

The C<IMM_NN> variant is like the C<_NN> variant, but in addition, assumes
that the single argument is an immortal such as <&PL_sv_undef> and, for
efficiency, will skip incrementing its reference count.

=over 3

 void       rpp_replace_2_1     (      SV *sv)
 void  Perl_rpp_replace_2_1     (pTHX_ SV *sv)
 void       rpp_replace_2_1_NN  (      SV *sv)
 void  Perl_rpp_replace_2_1_NN  (pTHX_ SV *sv)
 void       rpp_replace_2_IMM_NN(      SV *sv)
 void  Perl_rpp_replace_2_IMM_NN(pTHX_ SV *sv)

=back

=back

=for hackers
rpp_replace_2_1 declared in embed.fnc; all in group documented at inline.h, line 805
rpp_replace_2_1_NN declared in embed.fnc
rpp_replace_2_IMM_NN declared in embed.fnc

=over 4

=item C<rpp_stack_is_rc>
X<rpp_stack_is_rc>

NOTE: C<rpp_stack_is_rc> is B<experimental> and may change or be
removed without notice.

Returns a boolean value indicating whether the stack is currently
reference-counted. Note that if the stack is split (bottom half RC, top
half non-RC), this function returns false, even if the top half currently
contains zero items.

=over 3

 bool       rpp_stack_is_rc()
 bool  Perl_rpp_stack_is_rc(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 1099

=over 4

=item C<rpp_try_AMAGIC_1>

=item C<rpp_try_AMAGIC_2>
X<rpp_try_AMAGIC_1>X<rpp_try_AMAGIC_2>

NOTE: both forms are B<experimental> and may change or be
removed without notice.

Check whether either of the one or two SVs at the top of the stack is
magical or a ref, and in either case handle it specially: invoke get
magic, call an overload method, or replace a ref with a temporary numeric
value, as appropriate. If this function returns true, it indicates that
the correct return value is already on the stack. Intended to be used at
the beginning of the PP function for unary or binary ops.

=over 3

 bool       rpp_try_AMAGIC_1(      int method, int flags)
 bool  Perl_rpp_try_AMAGIC_1(pTHX_ int method, int flags)
 bool       rpp_try_AMAGIC_2(      int method, int flags)
 bool  Perl_rpp_try_AMAGIC_2(pTHX_ int method, int flags)

=back

=back

=for hackers
rpp_try_AMAGIC_1 declared in embed.fnc; all in group documented at inline.h, line 1069
rpp_try_AMAGIC_2 declared in embed.fnc

=over 4

=item C<rpp_xpush_IMM*>

=item C<rpp_xpush_1*>

=item C<rpp_xpush_2*>

Described under C<L</rpp_push_1>>

=back

=over 4

=item C<XSPP_wrapped>
X<XSPP_wrapped>

NOTE: C<XSPP_wrapped> is B<experimental> and may change or be
removed without notice.

Declare and wrap a non-reference-counted PP-style function.
On traditional perl builds where the stack isn't reference-counted, this
just produces a function declaration like

  OP * xsppw_name(pTHX)

Conversely, in ref-counted builds it creates xsppw_name() as a small
wrapper function which calls the real function via a wrapper which
processes the args and return values to ensure that reference counts are
properly handled for code which uses old-style dSP, PUSHs(), POPs() etc,
which don't adjust the reference counts of the items they manipulate.

xsppw_nargs indicates how many arguments the function consumes off the
stack. It can be a constant value or an expression, such as

    ((PL_op->op_flags & OPf_STACKED) ? 2 : 1)

Alternatively if xsppw_nlists is 1, it indicates that the PP function
consumes a list (or - rarely - if 2, consumes two lists, like
pp_aassign()), as indicated by the top markstack position.

This is intended as a temporary fix when converting XS code to run under
PERL_RC_STACK builds. In the longer term, the PP function should be
rewritten to replace PUSHs() etc with rpp_push_1() etc.

=over 3

   XSPP_wrapped(xsppw_name, I32 xsppw_nargs, I32 xsppw_nlists)

=back

=back

=for hackers
Declared and documented at pp.h, line 14

=head1 REGEXP Functions
X<RX_OFFS_END>X<RX_OFFS_START>X<RX_OFFS_VALID>X<RXp_OFFS_END>
X<RXp_OFFS_START>X<RXp_OFFS_VALID>

=over 4

=item C<pregcomp>

=item C<pregexec>

Described in L<perlreguts>.

=over 3

 REGEXP *       pregcomp(      SV * const pattern,
                               const U32 flags)
 REGEXP *  Perl_pregcomp(pTHX_ SV * const pattern,
                               const U32 flags)
 I32            pregexec(      REGEXP * const prog,
                               char *stringarg, char *strend,
                               char *strbeg, SSize_t minend,
                               SV *screamer, U32 nosave)
 I32       Perl_pregexec(pTHX_ REGEXP * const prog,
                               char *stringarg, char *strend,
                               char *strbeg, SSize_t minend,
                               SV *screamer, U32 nosave)

=back

=back

=for hackers
pregcomp declared in embed.fnc; all in group documented at pod/perlreguts.pod, line 774
pregexec declared in embed.fnc

=over 4

=item C<re_compile>
X<re_compile>

Compile the regular expression pattern C<pattern>, returning a pointer to the
compiled object for later matching with the internal regex engine.

This function is typically used by a custom regexp engine C<.comp()> function
to hand off to the core regexp engine those patterns it doesn't want to handle
itself (typically passing through the same flags it was called with).  In
almost all other cases, a regexp should be compiled by calling L</C<pregcomp>>
to compile using the currently active regexp engine.

If C<pattern> is already a C<REGEXP>, this function does nothing but return a
pointer to the input.  Otherwise the PV is extracted and treated like a string
representing a pattern.  See L<perlre>.

The possible flags for C<rx_flags> are documented in L<perlreapi>.  Their names
all begin with C<RXf_>.

=over 3

 REGEXP *       re_compile(      SV * const pattern,
                                 U32 orig_rx_flags)
 REGEXP *  Perl_re_compile(pTHX_ SV * const pattern,
                                 U32 orig_rx_flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at regcomp.c, line 446

=over 4

=item C<re_dup_guts>
X<re_dup_guts>

Duplicate a regexp.

This routine is expected to clone a given regexp structure. It is only
compiled under USE_ITHREADS.

After all of the core data stored in struct regexp is duplicated
the C<regexp_engine.dupe> method is used to copy any private data
stored in the *pprivate pointer. This allows extensions to handle
any duplication they need to do.

=over 3

 void       re_dup_guts(      const REGEXP *sstr, REGEXP *dstr,
                              CLONE_PARAMS *param)
 void  Perl_re_dup_guts(pTHX_ const REGEXP *sstr, REGEXP *dstr,
                              CLONE_PARAMS *param)

=back

=back

=for hackers
Declared in embed.fnc; documented at regcomp.c, line 13602

=over 4

=item C<REGEX_LOCALE_CHARSET>

=item C<REGEXP>

Described in L<perlreapi>.

=back

=for hackers
REGEX_LOCALE_CHARSET all in group documented at pod/perlreapi.pod, line 168
REGEXP 

=over 4

=item C<regexp>
X<regexp>

The regexp/REGEXP struct, see L<perlreapi> for further documentation
on the individual fields. The struct is ordered so that the most
commonly used fields are placed at the start.

Any patch that adds items to this struct will need to include
changes to F<sv.c> (C<Perl_re_dup()>) and F<regcomp.c>
(C<pregfree()>). This involves freeing or cloning items in the
regexp's data array based on the data item's type.

=back

=for hackers
Declared and documented at regexp.h, line 123

=over 4

=item C<regexp_engine>
X<regexp_engine>

When a regexp is compiled, its C<engine> field is then set to point at
the appropriate structure, so that when it needs to be used Perl can find
the right routines to do so.

In order to install a new regexp handler, C<$^H{regcomp}> is set
to an integer which (when casted appropriately) resolves to one of these
structures.  When compiling, the C<comp> method is executed, and the
resulting C<regexp> structure's engine field is expected to point back at
the same structure.

The pTHX_ symbol in the definition is a macro used by Perl under threading
to provide an extra argument to the routine holding a pointer back to
the interpreter that is executing the regexp. So under threading all
routines get an extra argument.

=back

=for hackers
Declared and documented at pod/perlreapi.pod, line 58

=over 4

=item C<regexp_paren_pair>

Described in L<perlreapi>.

=back

=for hackers
Documented at pod/perlreapi.pod, line 854

=over 4

=item C<regmatch_info>
X<regmatch_info>

Some basic information about the current match that is created by
Perl_regexec_flags and then passed to regtry(), regmatch() etc.
It is allocated as a local var on the stack, so nothing should be
stored in it that needs preserving or clearing up on croak().
For that, see the aux_info and aux_info_eval members of the
regmatch_state union.

=back

=for hackers
Declared and documented at regexp.h, line 811

=over 4

=item C<REXEC_COPY_SKIP_POST>

=item C<REXEC_COPY_SKIP_PRE>

=item C<REXEC_COPY_STR>

=item C<RX_BUFF_IDX_CARET_FULLMATCH>

=item C<RX_BUFF_IDX_CARET_POSTMATCH>

=item C<RX_BUFF_IDX_CARET_PREMATCH>

=item C<RX_BUFF_IDX_FULLMATCH>

=item C<RX_BUFF_IDX_POSTMATCH>

=item C<RX_BUFF_IDX_PREMATCH>

=item C<RX_MATCH_COPIED>

=item C<RXapif_ALL>

=item C<RXapif_CLEAR>

=item C<RXapif_DELETE>

=item C<RXapif_EXISTS>

=item C<RXapif_FETCH>

=item C<RXapif_FIRSTKEY>

=item C<RXapif_NEXTKEY>

=item C<RXapif_ONE>

=item C<RXapif_REGNAME>

=item C<RXapif_REGNAMES>

=item C<RXapif_REGNAMES_COUNT>

=item C<RXapif_SCALAR>

=item C<RXapif_STORE>

=item C<RXf_NO_INPLACE_SUBST>

=item C<RXf_NULL>

=item C<RXf_SKIPWHITE>

=item C<RXf_SPLIT>

=item C<RXf_START_ONLY>

=item C<RXf_WHITE>

=item C<RXf_PMf_EXTENDED>

=item C<RXf_PMf_FOLD>

=item C<RXf_PMf_KEEPCOPY>

=item C<RXf_PMf_MULTILINE>

=item C<RXf_PMf_SINGLELINE>

=item C<RXf_SKIPWHITE*>

=item C<RXf_SPLIT*>

=item C<RXf_START_ONLY*>

=item C<RXf_WHITE*>

=item C<struct regexp>

=item C<SV_SAVED_COPY>

Described in L<perlreapi>.

=over 3

   RX_MATCH_COPIED(const REGEXP * rx_sv)

=back

=back

=for hackers
REXEC_COPY_SKIP_POST all in group documented at pod/perlreapi.pod, line 913
REXEC_COPY_SKIP_PRE 
REXEC_COPY_STR 
RX_BUFF_IDX_CARET_FULLMATCH 
RX_BUFF_IDX_CARET_POSTMATCH 
RX_BUFF_IDX_CARET_PREMATCH 
RX_BUFF_IDX_FULLMATCH 
RX_BUFF_IDX_POSTMATCH 
RX_BUFF_IDX_PREMATCH 
RX_MATCH_COPIED 
RXapif_ALL 
RXapif_CLEAR 
RXapif_DELETE 
RXapif_EXISTS 
RXapif_FETCH 
RXapif_FIRSTKEY 
RXapif_NEXTKEY 
RXapif_ONE 
RXapif_REGNAME 
RXapif_REGNAMES 
RXapif_REGNAMES_COUNT 
RXapif_SCALAR 
RXapif_STORE 
RXf_NO_INPLACE_SUBST 
RXf_NULL 
RXf_SKIPWHITE 
RXf_SPLIT 
RXf_START_ONLY 
RXf_WHITE 
RXf_PMf_EXTENDED 
RXf_PMf_FOLD 
RXf_PMf_KEEPCOPY 
RXf_PMf_MULTILINE 
RXf_PMf_SINGLELINE 
struct regexp 
SV_SAVED_COPY 

=over 4

=item C<SvRX>
X<SvRX>

Convenience macro to get the REGEXP from a SV.  This is approximately
equivalent to the following snippet:

    if (SvMAGICAL(sv))
        mg_get(sv);
    if (SvROK(sv))
        sv = MUTABLE_SV(SvRV(sv));
    if (SvTYPE(sv) == SVt_REGEXP)
        return (REGEXP*) sv;

C<NULL> will be returned if a REGEXP* is not found.

=over 3

 REGEXP *  SvRX(SV *sv)

=back

=back

=for hackers
Declared and documented at regexp.h, line 357

=over 4

=item C<SvRXOK>
X<SvRXOK>

Returns a boolean indicating whether the SV (or the one it references)
is a REGEXP.

If you want to do something with the REGEXP* later use SvRX instead
and check for NULL.

=over 3

 bool  SvRXOK(SV* sv)

=back

=back

=for hackers
Declared and documented at regexp.h, line 371

=head1 Reports and Formats

These are used in the simple report generation feature of Perl.
See L<perlform>.


=over 4

=item C<IoBOTTOM_GV>

=item C<IoBOTTOM_NAME>

=item C<IoFMT_GV>

=item C<IoFMT_NAME>

=item C<IoLINES>

=item C<IoLINES_LEFT>

=item C<IoPAGE>

=item C<IoPAGE_LEN>

=item C<IoTOP_GV>

=item C<IoTOP_NAME>

Described in L<perlguts>.

=over 3

 GV *    IoBOTTOM_GV  (IO *io)
 char *  IoBOTTOM_NAME(IO *io)
 GV *    IoFMT_GV     (IO *io)
 char *  IoFMT_NAME   (IO *io)
 IV      IoLINES      (IO *io)
 IV      IoLINES_LEFT (IO *io)
 IV      IoPAGE       (IO *io)
 IV      IoPAGE_LEN   (IO *io)
 GV *    IoTOP_GV     (IO *io)
 char *  IoTOP_NAME   (IO *io)

=back

=back

=for hackers
IoBOTTOM_GV all in group documented at pod/perlguts.pod, line 1373
IoBOTTOM_NAME 
IoFMT_GV 
IoFMT_NAME 
IoLINES 
IoLINES_LEFT 
IoPAGE 
IoPAGE_LEN 
IoTOP_GV 
IoTOP_NAME 

=head1 Signals

=over 4

=item C<HAS_SIGINFO_SI_ADDR>
X<HAS_SIGINFO_SI_ADDR>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_addr> member

=back

=for hackers
Declared and documented at config.h, line 990

=over 4

=item C<HAS_SIGINFO_SI_BAND>
X<HAS_SIGINFO_SI_BAND>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_band> member

=back

=for hackers
Declared and documented at config.h, line 992

=over 4

=item C<HAS_SIGINFO_SI_ERRNO>
X<HAS_SIGINFO_SI_ERRNO>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_errno> member

=back

=for hackers
Declared and documented at config.h, line 987

=over 4

=item C<HAS_SIGINFO_SI_PID>
X<HAS_SIGINFO_SI_PID>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_pid> member

=back

=for hackers
Declared and documented at config.h, line 988

=over 4

=item C<HAS_SIGINFO_SI_STATUS>
X<HAS_SIGINFO_SI_STATUS>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_status> member

=back

=for hackers
Declared and documented at config.h, line 991

=over 4

=item C<HAS_SIGINFO_SI_UID>
X<HAS_SIGINFO_SI_UID>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_uid> member

=back

=for hackers
Declared and documented at config.h, line 989

=over 4

=item C<HAS_SIGINFO_SI_VALUE>
X<HAS_SIGINFO_SI_VALUE>

This symbol, if defined, indicates that C<siginfo_t> has the
C<si_value> member

=back

=for hackers
Declared and documented at config.h, line 993

=over 4

=item C<PERL_SIGNALS_UNSAFE_FLAG>
X<PERL_SIGNALS_UNSAFE_FLAG>

If this bit in C<PL_signals> is set, the system is uing the pre-Perl 5.8
unsafe signals.  See L<perlrun/PERL_SIGNALS> and L<perlipc/Deferred Signals
(Safe Signals)>.

=over 3

 U32  PERL_SIGNALS_UNSAFE_FLAG

=back

=back

=for hackers
Declared and documented at perl.h, line 8371

=over 4

=item C<rsignal>
X<rsignal>

A wrapper for the C library functions L<sigaction(2)> or L<signal(2)>.
Use this instead of those libc functions, as the Perl version gives the
safest available implementation, and knows things that interact with the
rest of the perl interpreter.

=over 3

 Sighandler_t       rsignal(      int i, Sighandler_t t)
 Sighandler_t  Perl_rsignal(pTHX_ int i, Sighandler_t t)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2949

=over 4

=item C<rsignal_state>
X<rsignal_state>

Returns a the current signal handler for signal C<signo>.
See L</C<rsignal>>.

=over 3

 Sighandler_t       rsignal_state(      int i)
 Sighandler_t  Perl_rsignal_state(pTHX_ int i)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2989

=over 4

=item C<SIG_NAME>
X<SIG_NAME>

This symbol contains a list of signal names in order of
signal number. This is intended
to be used as a static array initialization, like this:

 char *sig_name[] = { SIG_NAME };

The signals in the list are separated with commas, and each signal
is surrounded by double quotes. There is no leading C<SIG> in the signal
name, i.e. C<SIGQUIT> is known as "C<QUIT>".
Gaps in the signal numbers (up to C<NSIG>) are filled in with C<NUMnn>,
etc., where nn is the actual signal number (e.g. C<NUM37>).
The signal number for C<sig_name[i]> is stored in C<sig_num[i]>.
The last element is 0 to terminate the list with a C<NULL>.  This
corresponds to the 0 at the end of the C<sig_name_init> list.
Note that this variable is initialized from the C<sig_name_init>,
not from C<sig_name> (which is unused).

=back

=for hackers
Declared and documented at config.h, line 2247

=over 4

=item C<SIG_NUM>
X<SIG_NUM>

This symbol contains a list of signal numbers, in the same order as the
C<SIG_NAME> list. It is suitable for static array initialization, as in:

 int sig_num[] = { SIG_NUM };

The signals in the list are separated with commas, and the indices
within that list and the C<SIG_NAME> list match, so it's easy to compute
the signal name from a number or vice versa at the price of a small
dynamic linear lookup.
Duplicates are allowed, but are moved to the end of the list.
The signal number corresponding to C<sig_name[i]> is C<sig_number[i]>.
if (i < C<NSIG>) then C<sig_number[i]> == i.
The last element is 0, corresponding to the 0 at the end of
the C<sig_name_init> list.
Note that this variable is initialized from the C<sig_num_init>,
not from C<sig_num> (which is unused).

=back

=for hackers
Declared and documented at config.h, line 2248

=over 4

=item C<SIG_SIZE>
X<SIG_SIZE>

This variable contains the number of elements of the C<SIG_NAME>
and C<SIG_NUM> arrays, excluding the final C<NULL> entry.

=back

=for hackers
Declared and documented at config.h, line 2249

=over 4

=item C<Sigjmp_buf>
X<Sigjmp_buf>

This is the buffer type to be used with Sigsetjmp and Siglongjmp.

=back

=for hackers
Declared and documented at config.h, line 1021

=over 4

=item C<Siglongjmp>
X<Siglongjmp>

This macro is used in the same way as C<siglongjmp()>, but will invoke
traditional C<longjmp()> if siglongjmp isn't available.
See C<L</HAS_SIGSETJMP>>.

=over 3

 void  Siglongjmp(jmp_buf env, int val)

=back

=back

=for hackers
Declared at handy.h, line 36; documented at config.h, line 1023

=over 4

=item C<Sigsetjmp>
X<Sigsetjmp>

This macro is used in the same way as C<sigsetjmp()>, but will invoke
traditional C<setjmp()> if sigsetjmp isn't available.
See C<L</HAS_SIGSETJMP>>.

=over 3

 int  Sigsetjmp(jmp_buf env, int savesigs)

=back

=back

=for hackers
Declared at handy.h, line 35; documented at config.h, line 1022

=over 4

=item C<whichsig>

=item C<whichsig_pv>

=item C<whichsig_pvn>

=item C<whichsig_sv>
X<whichsig>X<whichsig_pv>X<whichsig_pvn>X<whichsig_sv>

These all convert a signal name into its corresponding signal number;
returning -1 if no corresponding number was found.

They differ only in the source of the signal name:

C<whichsig_pv> takes the name from the C<NUL>-terminated string starting at
C<sig>.

C<whichsig> is merely a different spelling, a synonym, of C<whichsig_pv>.

C<whichsig_pvn> takes the name from the string starting at C<sig>, with length
C<len> bytes.

C<whichsig_sv> takes the name from the PV stored in the SV C<sigsv>.

=over 3

 I32       whichsig    (      const char *sig)
 I32       whichsig_pv (      const char *sig)
 I32  Perl_whichsig_pv (pTHX_ const char *sig)
 I32       whichsig_pvn(      const char *sig, STRLEN len)
 I32  Perl_whichsig_pvn(pTHX_ const char *sig, STRLEN len)
 I32       whichsig_sv (      SV *sigsv)
 I32  Perl_whichsig_sv (pTHX_ SV *sigsv)

=back

=back

=for hackers
whichsig declared in embed.fnc; all in group documented at mg.c, line 3535
whichsig_pv declared in embed.fnc
whichsig_pvn declared in embed.fnc
whichsig_sv declared in embed.fnc

=head1 Site configuration

These variables give details as to where various libraries,
installation destinations, I<etc.>, go, as well as what various
installation options were selected


=over 4

=item C<ARCHLIB>
X<ARCHLIB>

This variable, if defined, holds the name of the directory in
which the user wants to put architecture-dependent public
library files for perl5.  It is most often a local directory
such as F</usr/local/lib>.  Programs using this variable must be
prepared to deal with filename expansion.  If C<ARCHLIB> is the
same as C<PRIVLIB>, it is not defined, since presumably the
program already searches C<PRIVLIB>.

=back

=for hackers
Declared and documented at config.h, line 1238

=over 4

=item C<ARCHLIB_EXP>
X<ARCHLIB_EXP>

This symbol contains the ~name expanded version of C<ARCHLIB>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1239

=over 4

=item C<ARCHNAME>
X<ARCHNAME>

This symbol holds a string representing the architecture name.
It may be used to construct an architecture-dependant pathname
where library files may be held under a private library, for
instance.

=back

=for hackers
Declared and documented at config.h, line 4518

=over 4

=item C<BIN>
X<BIN>

This symbol holds the path of the bin directory where the package will
be installed. Program must be prepared to deal with ~name substitution.

=back

=for hackers
Declared and documented at config.h, line 1253

=over 4

=item C<BIN_EXP>
X<BIN_EXP>

This symbol is the filename expanded version of the C<BIN> symbol, for
programs that do not want to deal with that at run-time.

=back

=for hackers
Declared and documented at config.h, line 1254

=over 4

=item C<INSTALL_USR_BIN_PERL>
X<INSTALL_USR_BIN_PERL>

This symbol, if defined, indicates that Perl is to be installed
also as F</usr/bin/perl>.

=back

=for hackers
Declared and documented at config.h, line 1270

=over 4

=item C<MULTIARCH>
X<MULTIARCH>

This symbol, if defined, signifies that the build
process will produce some binary files that are going to be
used in a cross-platform environment.  This is the case for
example with the NeXT "fat" binaries that contain executables
for several C<CPUs>.

=back

=for hackers
Declared and documented at config.h, line 778

=over 4

=item C<PERL_INC_VERSION_LIST>
X<PERL_INC_VERSION_LIST>

This variable specifies the list of subdirectories in over
which F<perl.c>:C<incpush()> and F<lib/lib.pm> will automatically
search when adding directories to @C<INC>, in a format suitable
for a C initialization string.  See the C<inc_version_list> entry
in Porting/Glossary for more details.

=back

=for hackers
Declared and documented at config.h, line 1264

=over 4

=item C<PERL_OTHERLIBDIRS>
X<PERL_OTHERLIBDIRS>

This variable contains a colon-separated set of paths for the perl
binary to search for additional library files or modules.
These directories will be tacked to the end of @C<INC>.
Perl will automatically search below each path for version-
and architecture-specific directories.  See C<L</PERL_INC_VERSION_LIST>>
for more details.

=back

=for hackers
Declared and documented at config.h, line 1280

=over 4

=item C<PERL_RELOCATABLE_INC>
X<PERL_RELOCATABLE_INC>

This symbol, if defined, indicates that we'd like to relocate entries
in @C<INC> at run time based on the location of the perl binary.

=back

=for hackers
Declared and documented at config.h, line 1255

=over 4

=item C<PERL_TARGETARCH>
X<PERL_TARGETARCH>

This symbol, if defined, indicates the target architecture
Perl has been cross-compiled to.  Undefined if not a cross-compile.

=back

=for hackers
Declared and documented at config.h, line 2260

=over 4

=item C<PERL_USE_DEVEL>
X<PERL_USE_DEVEL>

This symbol, if defined, indicates that Perl was configured with
C<-Dusedevel>, to enable development features.  This should not be
done for production builds.

=back

=for hackers
Declared and documented at config.h, line 2268

=over 4

=item C<PERL_VENDORARCH>
X<PERL_VENDORARCH>

If defined, this symbol contains the name of a private library.
The library is private in the sense that it needn't be in anyone's
execution path, but it should be accessible by the world.
It may have a ~ on the front.
The standard distribution will put nothing in this directory.
Vendors who distribute perl may wish to place their own
architecture-dependent modules and extensions in this directory with

 MakeMaker Makefile.PL INSTALLDIRS=vendor

or equivalent.  See F<INSTALL> for details.

=back

=for hackers
Declared and documented at config.h, line 1352

=over 4

=item C<PERL_VENDORARCH_EXP>
X<PERL_VENDORARCH_EXP>

This symbol contains the ~name expanded version of C<PERL_VENDORARCH>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1353

=over 4

=item C<PERL_VENDORLIB_EXP>
X<PERL_VENDORLIB_EXP>

This symbol contains the ~name expanded version of C<VENDORLIB>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1364

=over 4

=item C<PERL_VENDORLIB_STEM>
X<PERL_VENDORLIB_STEM>

This define is C<PERL_VENDORLIB_EXP> with any trailing version-specific component
removed.  The elements in C<inc_version_list> (C<inc_version_list>.U (part of metaconfig)) can
be tacked onto this variable to generate a list of directories to search.

=back

=for hackers
Declared and documented at config.h, line 1365

=over 4

=item C<PRIVLIB>
X<PRIVLIB>

This symbol contains the name of the private library for this package.
The library is private in the sense that it needn't be in anyone's
execution path, but it should be accessible by the world.  The program
should be prepared to do ~ expansion.

=back

=for hackers
Declared and documented at config.h, line 1292

=over 4

=item C<PRIVLIB_EXP>
X<PRIVLIB_EXP>

This symbol contains the ~name expanded version of C<PRIVLIB>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1293

=over 4

=item C<SITEARCH>
X<SITEARCH>

This symbol contains the name of the private library for this package.
The library is private in the sense that it needn't be in anyone's
execution path, but it should be accessible by the world.  The program
should be prepared to do ~ expansion.
The standard distribution will put nothing in this directory.
After perl has been installed, users may install their own local
architecture-dependent modules in this directory with

 MakeMaker Makefile.PL

or equivalent.  See F<INSTALL> for details.

=back

=for hackers
Declared and documented at config.h, line 1310

=over 4

=item C<SITEARCH_EXP>
X<SITEARCH_EXP>

This symbol contains the ~name expanded version of C<SITEARCH>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1311

=over 4

=item C<SITELIB>
X<SITELIB>

This symbol contains the name of the private library for this package.
The library is private in the sense that it needn't be in anyone's
execution path, but it should be accessible by the world.  The program
should be prepared to do ~ expansion.
The standard distribution will put nothing in this directory.
After perl has been installed, users may install their own local
architecture-independent modules in this directory with

 MakeMaker Makefile.PL

or equivalent.  See F<INSTALL> for details.

=back

=for hackers
Declared and documented at config.h, line 1333

=over 4

=item C<SITELIB_EXP>
X<SITELIB_EXP>

This symbol contains the ~name expanded version of C<SITELIB>, to be used
in programs that are not prepared to deal with ~ expansion at run-time.

=back

=for hackers
Declared and documented at config.h, line 1334

=over 4

=item C<SITELIB_STEM>
X<SITELIB_STEM>

This define is C<SITELIB_EXP> with any trailing version-specific component
removed.  The elements in C<inc_version_list> (C<inc_version_list>.U (part of metaconfig)) can
be tacked onto this variable to generate a list of directories to search.

=back

=for hackers
Declared and documented at config.h, line 1335

=over 4

=item C<STARTPERL>
X<STARTPERL>

This variable contains the string to put in front of a perl
script to make sure (one hopes) that it runs with perl and not
some shell.

=back

=for hackers
Declared and documented at config.h, line 4270

=over 4

=item C<USE_BSD_GETPGRP>
X<USE_BSD_GETPGRP>

This symbol, if defined, indicates that getpgrp needs one
arguments whereas C<USG> one needs none.

=back

=for hackers
Declared and documented at config.h, line 1658

=over 4

=item C<USE_BSD_SETPGRP>
X<USE_BSD_SETPGRP>

This symbol, if defined, indicates that setpgrp needs two
arguments whereas C<USG> one needs none.  See also C<L</HAS_SETPGID>>
for a C<POSIX> interface.

=back

=for hackers
Declared and documented at config.h, line 1867

=over 4

=item C<USE_C_BACKTRACE>
X<USE_C_BACKTRACE>

This symbol, if defined, indicates that Perl should
be built with support for backtrace.

=back

=for hackers
Declared and documented at config.h, line 4335

=over 4

=item C<USE_CPLUSPLUS>
X<USE_CPLUSPLUS>

This symbol, if defined, indicates that a C++ compiler was
used to compiled Perl and will be used to compile extensions.

=back

=for hackers
Declared and documented at config.h, line 2402

=over 4

=item C<USE_CROSS_COMPILE>
X<USE_CROSS_COMPILE>

This symbol, if defined, indicates that Perl is being cross-compiled.

=back

=for hackers
Declared and documented at config.h, line 2259

=over 4

=item C<USE_DTRACE>
X<USE_DTRACE>

This symbol, if defined, indicates that Perl should
be built with support for DTrace.

=back

=for hackers
Declared and documented at config.h, line 4347

=over 4

=item C<USE_DYNAMIC_LOADING>
X<USE_DYNAMIC_LOADING>

This symbol, if defined, indicates that dynamic loading of
some sort is available.

=back

=for hackers
Declared and documented at config.h, line 3654

=over 4

=item C<USE_FAST_STDIO>
X<USE_FAST_STDIO>

This symbol, if defined, indicates that Perl should
be built to use 'fast stdio'.
Defaults to define in Perls 5.8 and earlier, to undef later.

=back

=for hackers
Declared and documented at config.h, line 4355

=over 4

=item C<USE_ITHREADS>
X<USE_ITHREADS>

This symbol, if defined, indicates that Perl should be built to
use the interpreter-based threading implementation.

=back

=for hackers
Declared and documented at config.h, line 5287

=over 4

=item C<USE_KERN_PROC_PATHNAME>
X<USE_KERN_PROC_PATHNAME>

This symbol, if defined, indicates that we can use sysctl with
C<KERN_PROC_PATHNAME> to get a full path for the executable, and hence
convert $^X to an absolute path.

=back

=for hackers
Declared and documented at config.h, line 4363

=over 4

=item C<USE_LARGE_FILES>
X<USE_LARGE_FILES>

This symbol, if defined, indicates that large file support
should be used when available.

=back

=for hackers
Declared and documented at config.h, line 4370

=over 4

=item C<USE_LONG_DOUBLE>
X<USE_LONG_DOUBLE>

This symbol, if defined, indicates that long doubles should
be used when available.

=back

=for hackers
Declared and documented at config.h, line 4378

=over 4

=item C<USE_MORE_BITS>
X<USE_MORE_BITS>

This symbol, if defined, indicates that 64-bit interfaces and
long doubles should be used when available.

=back

=for hackers
Declared and documented at config.h, line 4386

=over 4

=item C<USE_NSGETEXECUTABLEPATH>
X<USE_NSGETEXECUTABLEPATH>

This symbol, if defined, indicates that we can use C<_NSGetExecutablePath>
and realpath to get a full path for the executable, and hence convert
$^X to an absolute path.

=back

=for hackers
Declared and documented at config.h, line 4402

=over 4

=item C<USE_PERLIO>
X<USE_PERLIO>

This symbol, if defined, indicates that the PerlIO abstraction should
be used throughout.  If not defined, stdio should be
used in a fully backward compatible manner.

=back

=for hackers
Declared and documented at config.h, line 4410

=over 4

=item C<USE_QUADMATH>
X<USE_QUADMATH>

This symbol, if defined, indicates that the quadmath library should
be used when available.

=back

=for hackers
Declared and documented at config.h, line 4418

=over 4

=item C<USE_REENTRANT_API>
X<USE_REENTRANT_API>

This symbol, if defined, indicates that Perl should
try to use the various C<_r> versions of library functions.
This is extremely experimental.

=back

=for hackers
Declared and documented at config.h, line 5290

=over 4

=item C<USE_SEMCTL_SEMID_DS>
X<USE_SEMCTL_SEMID_DS>

This symbol, if defined, indicates that C<struct semid_ds> * is
used for semctl C<IPC_STAT>.

=back

=for hackers
Declared and documented at config.h, line 2001

=over 4

=item C<USE_SEMCTL_SEMUN>
X<USE_SEMCTL_SEMUN>

This symbol, if defined, indicates that C<union semun> is
used for semctl C<IPC_STAT>.

=back

=for hackers
Declared and documented at config.h, line 2000

=over 4

=item C<USE_SITECUSTOMIZE>
X<USE_SITECUSTOMIZE>

This symbol, if defined, indicates that sitecustomize should
be used.

=back

=for hackers
Declared and documented at config.h, line 3330

=over 4

=item C<USE_SOCKS>
X<USE_SOCKS>

This symbol, if defined, indicates that Perl should
be built to use socks.

=back

=for hackers
Declared and documented at config.h, line 4426

=over 4

=item C<USE_STAT_BLOCKS>
X<USE_STAT_BLOCKS>

This symbol is defined if this system has a stat structure declaring
C<st_blksize> and C<st_blocks>.

=back

=for hackers
Declared and documented at config.h, line 1965

=over 4

=item C<USE_STDIO_BASE>
X<USE_STDIO_BASE>

This symbol is defined if the C<_base> field (or similar) of the
stdio C<FILE> structure can be used to access the stdio buffer for
a file handle.  If this is defined, then the C<FILE_base(fp)> macro
will also be defined and should be used to access this field.
Also, the C<FILE_bufsiz(fp)> macro will be defined and should be used
to determine the number of bytes in the buffer.  C<USE_STDIO_BASE>
will never be defined unless C<USE_STDIO_PTR> is.

=back

=for hackers
Declared and documented at config.h, line 1111

=over 4

=item C<USE_STDIO_PTR>
X<USE_STDIO_PTR>

This symbol is defined if the C<_ptr> and C<_cnt> fields (or similar)
of the stdio C<FILE> structure can be used to access the stdio buffer
for a file handle.  If this is defined, then the C<FILE_ptr(fp)>
and C<FILE_cnt(fp)> macros will also be defined and should be used
to access these fields.

=back

=for hackers
Declared and documented at config.h, line 1081

=over 4

=item C<USE_STRICT_BY_DEFAULT>
X<USE_STRICT_BY_DEFAULT>

This symbol, if defined, enables additional defaults.
At this time it only enables implicit strict by default.

=back

=for hackers
Declared and documented at config.h, line 4341

=over 4

=item C<USE_THREADS>
X<USE_THREADS>

This symbol, if defined, indicates that Perl should
be built to use threads.  At present, it is a synonym for
and C<USE_ITHREADS>, but eventually the source ought to be
changed to use this to mean C<_any_> threading implementation.

=back

=for hackers
Declared and documented at config.h, line 5288

=over 4

=item C<USE_64_BIT_ALL>
X<USE_64_BIT_ALL>

This symbol, if defined, indicates that 64-bit integers should
be used when available.  If not defined, the native integers
will be used (be they 32 or 64 bits).  The maximal possible
64-bitness is employed: LP64 or C<ILP64>, meaning that you will
be able to use more than 2 gigabytes of memory.  This mode is
even more binary incompatible than C<USE_64_BIT_INT>. You may not
be able to run the resulting executable in a 32-bit C<CPU> at all or
you may need at least to reboot your OS to 64-bit mode.

=back

=for hackers
Declared and documented at config.h, line 4328

=over 4

=item C<USE_64_BIT_INT>
X<USE_64_BIT_INT>

This symbol, if defined, indicates that 64-bit integers should
be used when available.  If not defined, the native integers
will be employed (be they 32 or 64 bits).  The minimal possible
64-bitness is used, just enough to get 64-bit integers into Perl.
This may mean using for example "long longs", while your memory
may still be limited to 2 gigabytes.

=back

=for hackers
Declared and documented at config.h, line 4325

=head1 Sockets configuration values

=over 4

=item C<HAS_SOCKADDR_IN6>
X<HAS_SOCKADDR_IN6>

This symbol, if defined, indicates the availability of
C<struct sockaddr_in6>;

=back

=for hackers
Declared and documented at config.h, line 1952

=over 4

=item C<HAS_SOCKADDR_SA_LEN>
X<HAS_SOCKADDR_SA_LEN>

This symbol, if defined, indicates that the C<struct sockaddr>
structure has a member called C<sa_len>, indicating the length of
the structure.

=back

=for hackers
Declared and documented at config.h, line 1951

=over 4

=item C<HAS_SOCKADDR_STORAGE>
X<HAS_SOCKADDR_STORAGE>

This symbol, if defined, indicates the availability of
C<struct sockaddr_storage>;

=back

=for hackers
Declared and documented at config.h, line 1953

=over 4

=item C<HAS_SOCKATMARK>
X<HAS_SOCKATMARK>

This symbol, if defined, indicates that the C<sockatmark> routine is
available to test whether a socket is at the out-of-band mark.

=back

=for hackers
Declared and documented at config.h, line 3348

=over 4

=item C<HAS_SOCKET>
X<HAS_SOCKET>

This symbol, if defined, indicates that the C<BSD> C<socket> interface is
supported.

=back

=for hackers
Declared and documented at config.h, line 1949

=over 4

=item C<HAS_SOCKETPAIR>
X<HAS_SOCKETPAIR>

This symbol, if defined, indicates that the C<BSD> C<socketpair()> call is
supported.

=back

=for hackers
Declared and documented at config.h, line 1950

=over 4

=item C<HAS_SOCKS5_INIT>
X<HAS_SOCKS5_INIT>

This symbol, if defined, indicates that the C<socks5_init> routine is
available to initialize C<SOCKS> 5.

=back

=for hackers
Declared and documented at config.h, line 3362

=over 4

=item C<I_SOCKS>
X<I_SOCKS>

This symbol, if defined, indicates that F<socks.h> exists and
should be included.

=over 3

 #ifdef I_SOCKS
     #include <socks.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 3802

=over 4

=item C<I_SYS_SOCKIO>
X<I_SYS_SOCKIO>

This symbol, if defined, indicates the F<sys/sockio.h> should be included
to get socket ioctl options, like C<SIOCATMARK>.

=over 3

 #ifdef I_SYS_SOCKIO
     #include <sys_sockio.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 668

=head1 Source Filters

=over 4

=item C<apply_builtin_cv_attributes>
X<apply_builtin_cv_attributes>

Given an OP_LIST containing attribute definitions, filter it for known builtin
attributes to apply to the cv, returning a possibly-smaller list containing
just the remaining ones.

=over 3

 OP *       apply_builtin_cv_attributes(      CV *cv,
                                              OP *attrlist)
 OP *  Perl_apply_builtin_cv_attributes(pTHX_ CV *cv,
                                              OP *attrlist)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 12762

=over 4

=item C<filter_add>

Described in L<perlfilter>.

=over 3

 SV *       filter_add(      filter_t funcp, SV *datasv)
 SV *  Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)

=back

=back

=for hackers
Declared in embed.fnc; documented at pod/perlfilter.pod, line 296

=over 4

=item C<filter_del>
X<filter_del>

Delete most recently added instance of the filter function argument

=over 3

 void       filter_del(      filter_t funcp)
 void  Perl_filter_del(pTHX_ filter_t funcp)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 4937

=over 4

=item C<filter_read>

Described in L<perlfilter>.

=over 3

 I32       filter_read(      int idx, SV *buf_sv, int maxlen)
 I32  Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at pod/perlfilter.pod, line 297

=over 4

=item C<scan_vstring>
X<scan_vstring>

Returns a pointer to the next character after the parsed
vstring, as well as updating the passed in sv.

Function must be called like

        sv = sv_2mortal(newSV(5));
        s = scan_vstring(s,e,sv);

where s and e are the start and end of the string.
The sv should already be large enough to store the vstring
passed in, for performance reasons.

This function may croak if fatal warnings are enabled in the
calling scope, hence the sv_2mortal in the example (to prevent
a leak).  Make sure to do SvREFCNT_inc afterwards if you use
sv_2mortal.

=over 3

 char *       scan_vstring(      const char *s,
                                 const char * const e, SV *sv)
 char *  Perl_scan_vstring(pTHX_ const char *s,
                                 const char * const e, SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 13261

=over 4

=item C<start_subparse>
X<start_subparse>

Set things up for parsing a subroutine.

If C<is_format> is non-zero, the input is to be considered a format sub
(a specialised sub used to implement perl's C<format> feature); else a
normal C<sub>.

C<flags> are added to the flags for C<PL_compcv>.  C<flags> may include the
C<CVf_IsMETHOD> bit, which causes the new subroutine to be a method.

This returns the value of C<PL_savestack_ix> that was in effect upon entry to
the function;

=over 3

 I32       start_subparse(      I32 is_format, U32 flags)
 I32  Perl_start_subparse(pTHX_ I32 is_format, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at toke.c, line 12686

=head1 Stack Manipulation Macros

=over 4

=item C<dMARK>
X<dMARK>

Declare a stack marker variable, C<mark>, for the XSUB.  See C<L</MARK>> and
C<L</dORIGMARK>>.

=over 3

   dMARK;

=back

=back

=for hackers
Declared and documented at pp.h, line 89

=over 4

=item C<dORIGMARK>
X<dORIGMARK>

Saves the original stack mark for the XSUB.  See C<L</ORIGMARK>>.

=over 3

   dORIGMARK;

=back

=back

=for hackers
Declared and documented at pp.h, line 93

=over 4

=item C<dSP>
X<dSP>

Declares a local copy of perl's stack pointer for the XSUB, available via
the C<SP> macro.  See C<L</SP>>.

=over 3

   dSP;

=back

=back

=for hackers
Declared and documented at pp.h, line 78

=over 4

=item C<dTARGET>
X<dTARGET>

Declare that this function uses C<TARG>, and initializes it

=over 3

   dTARGET;

=back

=back

=for hackers
Declared and documented at pp.h, line 157

=over 4

=item C<EXTEND>
X<EXTEND>

Used to extend the argument stack for an XSUB's return values.  Once
used, guarantees that there is room for at least C<nitems> to be pushed
onto the stack.

=over 3

 void  EXTEND(SP, SSize_t nitems)

=back

=back

=for hackers
Declared and documented at pp.h, line 242

=over 4

=item C<MARK>
X<MARK>

Stack marker variable for the XSUB.  See C<L</dMARK>>.

=back

=for hackers
Declared and documented at pp.h, line 71

=over 4

=item C<mPUSHi>
X<mPUSHi>

Push an integer onto the stack.  The stack must have room for this element.
Does not use C<TARG>.  See also C<L</PUSHi>>, C<L</mXPUSHi>> and C<L</XPUSHi>>.

=over 3

 void  mPUSHi(IV iv)

=back

=back

=for hackers
Declared and documented at pp.h, line 344

=over 4

=item C<mPUSHn>
X<mPUSHn>

Push a double onto the stack.  The stack must have room for this element.
Does not use C<TARG>.  See also C<L</PUSHn>>, C<L</mXPUSHn>> and C<L</XPUSHn>>.

=over 3

 void  mPUSHn(NV nv)

=back

=back

=for hackers
Declared and documented at pp.h, line 340

=over 4

=item C<mPUSHp>
X<mPUSHp>

Push a string onto the stack.  The stack must have room for this element.
The C<len> indicates the length of the string.  Does not use C<TARG>.
See also C<L</PUSHp>>, C<L</mXPUSHp>> and C<L</XPUSHp>>.

=over 3

 void  mPUSHp(char* str, STRLEN len)

=back

=back

=for hackers
Declared and documented at pp.h, line 331

=over 4

=item C<mPUSHpvs>
X<mPUSHpvs>

A variation on C<mPUSHp> that takes a literal string and calculates its size
directly.

=over 3

 void  mPUSHpvs("literal string")

=back

=back

=for hackers
Declared and documented at pp.h, line 336

=over 4

=item C<mPUSHs>
X<mPUSHs>

Push an SV onto the stack and mortalizes the SV.  The stack must have room
for this element.  Does not use C<TARG>.  See also C<L</PUSHs>> and
C<L</mXPUSHs>>.

=over 3

 void  mPUSHs(SV* sv)

=back

=back

=for hackers
Declared and documented at pp.h, line 321

=over 4

=item C<mPUSHu>
X<mPUSHu>

Push an unsigned integer onto the stack.  The stack must have room for this
element.  Does not use C<TARG>.  See also C<L</PUSHu>>, C<L</mXPUSHu>> and
C<L</XPUSHu>>.

=over 3

 void  mPUSHu(UV uv)

=back

=back

=for hackers
Declared and documented at pp.h, line 348

=over 4

=item C<mXPUSHi>
X<mXPUSHi>

Push an integer onto the stack, extending the stack if necessary.
Does not use C<TARG>.  See also C<L</XPUSHi>>, C<L</mPUSHi>> and C<L</PUSHi>>.

=over 3

 void  mXPUSHi(IV iv)

=back

=back

=for hackers
Declared and documented at pp.h, line 375

=over 4

=item C<mXPUSHn>
X<mXPUSHn>

Push a double onto the stack, extending the stack if necessary.
Does not use C<TARG>.  See also C<L</XPUSHn>>, C<L</mPUSHn>> and C<L</PUSHn>>.

=over 3

 void  mXPUSHn(NV nv)

=back

=back

=for hackers
Declared and documented at pp.h, line 371

=over 4

=item C<mXPUSHp>
X<mXPUSHp>

Push a string onto the stack, extending the stack if necessary.  The C<len>
indicates the length of the string.  Does not use C<TARG>.  See also
C<L</XPUSHp>>, C<mPUSHp> and C<PUSHp>.

=over 3

 void  mXPUSHp(char* str, STRLEN len)

=back

=back

=for hackers
Declared and documented at pp.h, line 362

=over 4

=item C<mXPUSHpvs>
X<mXPUSHpvs>

A variation on C<mXPUSHp> that takes a literal string and calculates its size
directly.

=over 3

 void  mXPUSHpvs("literal string")

=back

=back

=for hackers
Declared and documented at pp.h, line 367

=over 4

=item C<mXPUSHs>
X<mXPUSHs>

Push an SV onto the stack, extending the stack if necessary and mortalizes
the SV.  Does not use C<TARG>.  See also C<L</XPUSHs>> and C<L</mPUSHs>>.

=over 3

 void  mXPUSHs(SV* sv)

=back

=back

=for hackers
Declared and documented at pp.h, line 353

=over 4

=item C<mXPUSHu>
X<mXPUSHu>

Push an unsigned integer onto the stack, extending the stack if necessary.
Does not use C<TARG>.  See also C<L</XPUSHu>>, C<L</mPUSHu>> and C<L</PUSHu>>.

=over 3

 void  mXPUSHu(UV uv)

=back

=back

=for hackers
Declared and documented at pp.h, line 379

=over 4

=item C<newXSproto>
X<newXSproto>

Used by C<xsubpp> to hook up XSUBs as Perl subs.  Adds Perl prototypes to
the subs.

=back

=for hackers
Declared and documented at XSUB.h, line 268

=over 4

=item C<ORIGMARK>
X<ORIGMARK>

The original stack mark for the XSUB.  See C<L</dORIGMARK>>.

=back

=for hackers
Declared and documented at pp.h, line 96

=over 4

=item C<PL_markstack>

=item C<PL_markstack_ptr>

=item C<PL_savestack>

=item C<PL_savestack_ix>

=item C<PL_scopestack>

=item C<PL_scopestack_ix>

=item C<PL_scopestack_name>

=item C<PL_stack_base>

=item C<PL_stack_sp>

=item C<PL_tmps_floor>

=item C<PL_tmps_ix>

=item C<PL_tmps_stack>

Described in L<perlguts>.

=back

=for hackers
PL_markstack all in group documented at pod/perlguts.pod, line 4035
PL_markstack_ptr 
PL_savestack 
PL_savestack_ix 
PL_scopestack 
PL_scopestack_ix 
PL_scopestack_name 
PL_stack_base 
PL_stack_sp 
PL_tmps_floor 
PL_tmps_ix 
PL_tmps_stack 

=over 4

=item C<POPi>
X<POPi>

Pops an integer off the stack.

=over 3

 IV  POPi

=back

=back

=for hackers
Declared and documented at pp.h, line 192

=over 4

=item C<POPl>
X<POPl>

Pops a long off the stack.

=over 3

 long  POPl

=back

=back

=for hackers
Declared and documented at pp.h, line 198

=over 4

=item C<POPn>
X<POPn>

Pops a double off the stack.

=over 3

 NV  POPn

=back

=back

=for hackers
Declared and documented at pp.h, line 189

=over 4

=item C<POPp>

=item C<POPpx>
X<POPp>X<POPpx>

These each pop a string off the stack.
There are two names for historical reasons.

=over 3

 char*  POPp
 char*  POPpx

=back

=back

=for hackers
POPp declared at pp.h, line 180; all in group documented at pp.h, line 180
POPpx declared at pp.h, line 181

=over 4

=item C<POPpbytex>
X<POPpbytex>

Pops a string off the stack which must consist of bytes i.e. characters < 256.

=over 3

 char*  POPpbytex

=back

=back

=for hackers
Declared and documented at pp.h, line 186

=over 4

=item C<POPpx*>

Described under C<L</POPp>>

=back

=over 4

=item C<POPs>
X<POPs>

Pops an SV off the stack.

=over 3

 SV*  POPs

=back

=back

=for hackers
Declared and documented at pp.h, line 177

=over 4

=item C<POPu>
X<POPu>

Pops an unsigned integer off the stack.

=over 3

 UV  POPu

=back

=back

=for hackers
Declared and documented at pp.h, line 195

=over 4

=item C<POPul>
X<POPul>

Pops an unsigned long off the stack.

=over 3

 long  POPul

=back

=back

=for hackers
Declared and documented at pp.h, line 201

=over 4

=item C<PUSHi>
X<PUSHi>

Push an integer onto the stack.  The stack must have room for this element.
Handles 'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be
called to declare it.  Do not call multiple C<TARG>-oriented macros to 
return lists from XSUB's - see C<L</mPUSHi>> instead.  See also C<L</XPUSHi>>
and C<L</mXPUSHi>>.

=over 3

 void  PUSHi(IV iv)

=back

=back

=for hackers
Declared and documented at pp.h, line 270

=over 4

=item C<PUSHMARK>
X<PUSHMARK>

Opening bracket for arguments on a callback.  See C<L</PUTBACK>> and
L<perlcall>.

=over 3

 void  PUSHMARK(SP)

=back

=back

=for hackers
Declared and documented at pp.h, line 74

=over 4

=item C<PUSHmortal>
X<PUSHmortal>

Push a new mortal SV onto the stack.  The stack must have room for this
element.  Does not use C<TARG>.  See also C<L</PUSHs>>, C<L</XPUSHmortal>> and
C<L</XPUSHs>>.

=over 3

 void  PUSHmortal

=back

=back

=for hackers
Declared and documented at pp.h, line 326

=over 4

=item C<PUSHn>
X<PUSHn>

Push a double onto the stack.  The stack must have room for this element.
Handles 'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be
called to declare it.  Do not call multiple C<TARG>-oriented macros to
return lists from XSUB's - see C<L</mPUSHn>> instead.  See also C<L</XPUSHn>>
and C<L</mXPUSHn>>.

=over 3

 void  PUSHn(NV nv)

=back

=back

=for hackers
Declared and documented at pp.h, line 263

=over 4

=item C<PUSHp>
X<PUSHp>

Push a string onto the stack.  The stack must have room for this element.
The C<len> indicates the length of the string.  Handles 'set' magic.  Uses
C<TARG>, so C<dTARGET> or C<dXSTARG> should be called to declare it.  Do not
call multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mPUSHp>> instead.  See also C<L</XPUSHp>> and C<L</mXPUSHp>>.

=over 3

 void  PUSHp(char* str, STRLEN len)

=back

=back

=for hackers
Declared and documented at pp.h, line 252

=over 4

=item C<PUSHpvs>
X<PUSHpvs>

A variation on C<PUSHp> that takes a literal string and calculates its size
directly.

=over 3

 void  PUSHpvs("literal string")

=back

=back

=for hackers
Declared and documented at pp.h, line 259

=over 4

=item C<PUSHs>
X<PUSHs>

Push an SV onto the stack.  The stack must have room for this element.
Does not handle 'set' magic.  Does not use C<TARG>.  See also
C<L</PUSHmortal>>, C<L</XPUSHs>>, and C<L</XPUSHmortal>>.

=over 3

 void  PUSHs(SV* sv)

=back

=back

=for hackers
Declared and documented at pp.h, line 247

=over 4

=item C<PUSHu>
X<PUSHu>

Push an unsigned integer onto the stack.  The stack must have room for this
element.  Handles 'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG>
should be called to declare it.  Do not call multiple C<TARG>-oriented
macros to return lists from XSUB's - see C<L</mPUSHu>> instead.  See also
C<L</XPUSHu>> and C<L</mXPUSHu>>.

=over 3

 void  PUSHu(UV uv)

=back

=back

=for hackers
Declared and documented at pp.h, line 277

=over 4

=item C<PUTBACK>
X<PUTBACK>

Closing bracket for XSUB arguments.  This is usually handled by C<xsubpp>.
See C<L</PUSHMARK>> and L<perlcall> for other uses.

=over 3

   PUTBACK;

=back

=back

=for hackers
Declared and documented at pp.h, line 173

=over 4

=item C<SAVEt_INT>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 4144

=over 4

=item C<SP>
X<SP>

Stack pointer.  This is usually handled by C<xsubpp>.  See C<L</dSP>> and
C<SPAGAIN>.

=back

=for hackers
Declared and documented at pp.h, line 67

=over 4

=item C<SPAGAIN>
X<SPAGAIN>

Refetch the stack pointer.  Used after a callback.  See L<perlcall>.

=over 3

   SPAGAIN;

=back

=back

=for hackers
Declared and documented at pp.h, line 99

=over 4

=item C<SSNEW>

=item C<SSNEWa>

=item C<SSNEWat>

=item C<SSNEWt>
X<SSNEW>X<SSNEWa>X<SSNEWat>X<SSNEWt>

These each temporarily allocate data on the savestack, returning an SSize_t
index into the savestack, because a pointer would get broken if the savestack
is moved on reallocation.  Use L</C<SSPTR>> to convert the returned index into
a pointer.

The forms differ in that plain C<SSNEW> allocates C<size> bytes;
C<SSNEWt> and C<SSNEWat> allocate C<size> objects, each of which is type
C<type>;
and <SSNEWa> and C<SSNEWat> make sure to align the new data to an C<align>
boundary.  The most useful value for the alignment is likely to be
L</C<MEM_ALIGNBYTES>>.  The alignment will be preserved through savestack
reallocation B<only> if realloc returns data aligned to a size divisible by
"align"!

=over 3

 SSize_t  SSNEW  (Size_t size)
 SSize_t  SSNEWa (Size_t size, Size_t align)
 SSize_t  SSNEWat(Size_t size, type, Size_t align)
 SSize_t  SSNEWt (Size_t size, type)

=back

=back

=for hackers
SSNEW declared at scope.h, line 263; all in group documented at scope.h, line 263
SSNEWa declared at scope.h, line 264
SSNEWat declared at scope.h, line 265
SSNEWt declared at scope.h, line 266

=over 4

=item C<SSPTR>

=item C<SSPTRt>
X<SSPTR>X<SSPTRt>

These convert the C<index> returned by L/<C<SSNEW>> and kin into actual pointers.

The difference is that C<SSPTR> casts the result to C<type>, and C<SSPTRt>
casts it to a pointer of that C<type>.

=over 3

 type    SSPTR (SSize_t index, type)
 type *  SSPTRt(SSize_t index, type)

=back

=back

=for hackers
SSPTR declared at scope.h, line 282; all in group documented at scope.h, line 282
SSPTRt declared at scope.h, line 283

=over 4

=item C<TARG>
X<TARG>

C<TARG> is short for "target".  It is an entry in the pad that an OPs
C<op_targ> refers to.  It is scratchpad space, often used as a return
value for the OP, but some use it for other purposes.

=over 3

   TARG;

=back

=back

=for hackers
Declared and documented at pp.h, line 109

=over 4

=item C<TOPs>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 4011

=over 4

=item C<XPUSHi>
X<XPUSHi>

Push an integer onto the stack, extending the stack if necessary.  Handles
'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be called to
declare it.  Do not call multiple C<TARG>-oriented macros to return lists
from XSUB's - see C<L</mXPUSHi>> instead.  See also C<L</PUSHi>> and
C<L</mPUSHi>>.

=over 3

 void  XPUSHi(IV iv)

=back

=back

=for hackers
Declared and documented at pp.h, line 307

=over 4

=item C<XPUSHmortal>
X<XPUSHmortal>

Push a new mortal SV onto the stack, extending the stack if necessary.
Does not use C<TARG>.  See also C<L</XPUSHs>>, C<L</PUSHmortal>> and
C<L</PUSHs>>.

=over 3

 void  XPUSHmortal

=back

=back

=for hackers
Declared and documented at pp.h, line 357

=over 4

=item C<XPUSHn>
X<XPUSHn>

Push a double onto the stack, extending the stack if necessary.  Handles
'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be called to
declare it.  Do not call multiple C<TARG>-oriented macros to return lists
from XSUB's - see C<L</mXPUSHn>> instead.  See also C<L</PUSHn>> and
C<L</mPUSHn>>.

=over 3

 void  XPUSHn(NV nv)

=back

=back

=for hackers
Declared and documented at pp.h, line 300

=over 4

=item C<XPUSHp>
X<XPUSHp>

Push a string onto the stack, extending the stack if necessary.  The C<len>
indicates the length of the string.  Handles 'set' magic.  Uses C<TARG>, so
C<dTARGET> or C<dXSTARG> should be called to declare it.  Do not call
multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mXPUSHp>> instead.  See also C<L</PUSHp>> and C<L</mPUSHp>>.

=over 3

 void  XPUSHp(char* str, STRLEN len)

=back

=back

=for hackers
Declared and documented at pp.h, line 289

=over 4

=item C<XPUSHpvs>
X<XPUSHpvs>

A variation on C<XPUSHp> that takes a literal string and calculates its size
directly.

=over 3

 void  XPUSHpvs("literal string")

=back

=back

=for hackers
Declared and documented at pp.h, line 296

=over 4

=item C<XPUSHs>
X<XPUSHs>

Push an SV onto the stack, extending the stack if necessary.  Does not
handle 'set' magic.  Does not use C<TARG>.  See also C<L</XPUSHmortal>>,
C<PUSHs> and C<PUSHmortal>.

=over 3

 void  XPUSHs(SV* sv)

=back

=back

=for hackers
Declared and documented at pp.h, line 284

=over 4

=item C<XPUSHu>
X<XPUSHu>

Push an unsigned integer onto the stack, extending the stack if necessary.
Handles 'set' magic.  Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be
called to declare it.  Do not call multiple C<TARG>-oriented macros to
return lists from XSUB's - see C<L</mXPUSHu>> instead.  See also C<L</PUSHu>> and
C<L</mPUSHu>>.

=over 3

 void  XPUSHu(UV uv)

=back

=back

=for hackers
Declared and documented at pp.h, line 314

=over 4

=item C<XS_APIVERSION_BOOTCHECK>
X<XS_APIVERSION_BOOTCHECK>

Macro to verify that the perl api version an XS module has been compiled against
matches the api version of the perl interpreter it's being loaded into.

=over 3

   XS_APIVERSION_BOOTCHECK;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 282

=over 4

=item C<XS_VERSION>
X<XS_VERSION>

The version identifier for an XS module.  This is usually
handled automatically by C<ExtUtils::MakeMaker>.  See
C<L</XS_VERSION_BOOTCHECK>>.

=back

=for hackers
Declared and documented at XSUB.h, line 272

=over 4

=item C<XS_VERSION_BOOTCHECK>
X<XS_VERSION_BOOTCHECK>

Macro to verify that a PM module's C<$VERSION> variable matches the XS
module's C<XS_VERSION> variable.  This is usually handled automatically by
C<xsubpp>.  See L<perlxs/"The VERSIONCHECK: Keyword">.

=over 3

   XS_VERSION_BOOTCHECK;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 277

=over 4

=item C<XSRETURN>
X<XSRETURN>

Return from XSUB, indicating number of items on the stack.  This is usually
handled by C<xsubpp>.

=over 3

 void  XSRETURN(int nitems)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 240

=over 4

=item C<XSRETURN_EMPTY>
X<XSRETURN_EMPTY>

Return an empty list from an XSUB immediately.

=over 3

   XSRETURN_EMPTY;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 265

=over 4

=item C<XSRETURN_IV>
X<XSRETURN_IV>

Return an integer from an XSUB immediately.  Uses C<XST_mIV>.

=over 3

 void  XSRETURN_IV(IV iv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 244

=over 4

=item C<XSRETURN_NO>
X<XSRETURN_NO>

Return C<&PL_sv_no> from an XSUB immediately.  Uses C<XST_mNO>.

=over 3

   XSRETURN_NO;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 256

=over 4

=item C<XSRETURN_NV>
X<XSRETURN_NV>

Return a double from an XSUB immediately.  Uses C<XST_mNV>.

=over 3

 void  XSRETURN_NV(NV nv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 250

=over 4

=item C<XSRETURN_PV>
X<XSRETURN_PV>

Return a copy of a string from an XSUB immediately.  Uses C<XST_mPV>.

=over 3

 void  XSRETURN_PV(char* str)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 253

=over 4

=item C<XSRETURN_UNDEF>
X<XSRETURN_UNDEF>

Return C<&PL_sv_undef> from an XSUB immediately.  Uses C<XST_mUNDEF>.

=over 3

   XSRETURN_UNDEF;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 262

=over 4

=item C<XSRETURN_UV>
X<XSRETURN_UV>

Return an integer from an XSUB immediately.  Uses C<XST_mUV>.

=over 3

 void  XSRETURN_UV(IV uv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 247

=over 4

=item C<XSRETURN_YES>
X<XSRETURN_YES>

Return C<&PL_sv_yes> from an XSUB immediately.  Uses C<XST_mYES>.

=over 3

   XSRETURN_YES;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 259

=over 4

=item C<XST_mIV>
X<XST_mIV>

Place an integer into the specified position C<pos> on the stack.  The
value is stored in a new mortal SV.

=over 3

 void  XST_mIV(int pos, IV iv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 212

=over 4

=item C<XST_mNO>
X<XST_mNO>

Place C<&PL_sv_no> into the specified position C<pos> on the
stack.

=over 3

 void  XST_mNO(int pos)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 228

=over 4

=item C<XST_mNV>
X<XST_mNV>

Place a double into the specified position C<pos> on the stack.  The value
is stored in a new mortal SV.

=over 3

 void  XST_mNV(int pos, NV nv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 216

=over 4

=item C<XST_mPV>
X<XST_mPV>

Place a copy of a string into the specified position C<pos> on the stack.
The value is stored in a new mortal SV.

=over 3

 void  XST_mPV(int pos, char* str)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 220

=over 4

=item C<XST_mUNDEF>
X<XST_mUNDEF>

Place C<&PL_sv_undef> into the specified position C<pos> on the
stack.

=over 3

 void  XST_mUNDEF(int pos)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 236

=over 4

=item C<XST_mUV>
X<XST_mUV>

Place an unsigned integer into the specified position C<pos> on the stack.  The
value is stored in a new mortal SV.

=over 3

 void  XST_mUV(int pos, UV uv)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 224

=over 4

=item C<XST_mYES>
X<XST_mYES>

Place C<&PL_sv_yes> into the specified position C<pos> on the
stack.

=over 3

 void  XST_mYES(int pos)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 232

=head1 String Handling

See also C<L</Unicode Support>>.


=over 4

=item C<Copy>

=item C<CopyD>
X<Copy>X<CopyD>

The XSUB-writer's interface to the C C<memcpy> function.  The C<src> is the
source, C<dest> is the destination, C<nitems> is the number of items, and
C<type> is the type.  May fail on overlapping copies.  See also C<L</Move>>.

C<CopyD> is like C<Copy> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=over 3

 void    Copy (void* src, void* dest, int nitems, type)
 void *  CopyD(void* src, void* dest, int nitems, type)

=back

=back

=for hackers
Copy declared at handy.h, line 2660; all in group documented at handy.h, line 2660
CopyD declared at handy.h, line 2661

=over 4

=item C<delimcpy>
X<delimcpy>

Copy a source buffer to a destination buffer, stopping at (but not including)
the first occurrence in the source of an unescaped (defined below) delimiter
byte, C<delim>.  The source is the bytes between S<C<from> and C<from_end> -
1>.  Similarly, the dest is C<to> up to C<to_end>.

The number of bytes copied is written to C<*retlen>.

Returns the position of the first uncopied C<delim> in the C<from> buffer, but
if there is no such occurrence before C<from_end>, then C<from_end> is returned,
and the entire buffer S<C<from> .. C<from_end> - 1> is copied.

If there is room in the destination available after the copy, an extra
terminating safety C<NUL> byte is appended (not included in the returned
length).

The error case is if the destination buffer is not large enough to accommodate
everything that should be copied.  In this situation, a value larger than
S<C<to_end> - C<to>> is written to C<*retlen>, and as much of the source as
fits will be written to the destination.  Not having room for the safety C<NUL>
is not considered an error.

In the following examples, let C<x> be the delimiter, and C<0> represent a C<NUL>
byte (B<NOT> the digit C<0>).  Then we would have

  Source     Destination
 abcxdef        abc0

provided the destination buffer is at least 4 bytes long.

An escaped delimiter is one which is immediately preceded by a single
backslash.  Escaped delimiters are copied, and the copy continues past the
delimiter; the backslash is not copied:

  Source       Destination
 abc\xdef       abcxdef0

(provided the destination buffer is at least 8 bytes long).

It's actually somewhat more complicated than that. A sequence of any odd number
of backslashes escapes the following delimiter, and the copy continues with
exactly one of the backslashes stripped.

     Source         Destination
     abc\xdef          abcxdef0
   abc\\\xdef        abc\\xdef0
 abc\\\\\xdef      abc\\\\xdef0

(as always, if the destination is large enough)

An even number of preceding backslashes does not escape the delimiter, so that
the copy stops just before it, and includes all the backslashes (no stripping;
zero is considered even):

      Source         Destination
      abcxdef          abc0
    abc\\xdef          abc\\0
  abc\\\\xdef          abc\\\\0

=over 3

 char *       delimcpy(char *to, const char *to_end,
                       const char *from, const char *from_end,
                       const int delim, I32 *retlen)
 char *  Perl_delimcpy(char *to, const char *to_end,
                       const char *from, const char *from_end,
                       const int delim, I32 *retlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 652

=over 4

=item C<do_join>
X<do_join>

This performs a Perl L<C<join>|perlfunc/join>, placing the joined output
into C<sv>.

The elements to join are in SVs, stored in a C array of pointers to SVs, from
C<**mark> to S<C<**sp - 1>>.  Hence C<*mark> is a reference to the first SV.
Each SV will be coerced into a PV if not one already.

C<delim> contains the string (or coerced into a string) that is to separate
each of the joined elements.

If any component is in UTF-8, the result will be as well, and all non-UTF-8
components will be converted to UTF-8 as necessary.

Magic and tainting are handled.

=over 3

 void       do_join(      SV *sv, SV *delim, SV **mark, SV **sp)
 void  Perl_do_join(pTHX_ SV *sv, SV *delim, SV **mark, SV **sp)

=back

=back

=for hackers
Declared in embed.fnc; documented at doop.c, line 644

=over 4

=item C<do_sprintf>
X<do_sprintf>

This performs a Perl L<C<sprintf>|perlfunc/sprintf> placing the string output
into C<sv>.

The elements to format are in SVs, stored in a C array of pointers to SVs of
length C<len>> and beginning at C<**sarg>.  The element referenced by C<*sarg>
is the format.

Magic and tainting are handled.

=over 3

 void       do_sprintf(      SV *sv, SSize_t len, SV **sarg)
 void  Perl_do_sprintf(pTHX_ SV *sv, SSize_t len, SV **sarg)

=back

=back

=for hackers
Declared in embed.fnc; documented at doop.c, line 749

=over 4

=item C<fbm_compile>
X<fbm_compile>

Analyzes the string in order to make fast searches on it using C<fbm_instr()>
-- the Boyer-Moore algorithm.

=over 3

 void       fbm_compile(      SV *sv, U32 flags)
 void  Perl_fbm_compile(pTHX_ SV *sv, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 998

=over 4

=item C<fbm_instr>
X<fbm_instr>

Returns the location of the SV in the string delimited by C<big> and
C<bigend> (C<bigend>) is the char following the last char).
It returns C<NULL> if the string can't be found.  The C<sv>
does not have to be C<fbm_compiled>, but the search will not be as fast
then.

=over 3

 char *       fbm_instr(      unsigned char *big,
                              unsigned char *bigend,
                              SV *littlestr, U32 flags)
 char *  Perl_fbm_instr(pTHX_ unsigned char *big,
                              unsigned char *bigend,
                              SV *littlestr, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1070

=over 4

=item C<foldEQ>

=item C<foldEQ_locale>
X<foldEQ>X<foldEQ_locale>

These each return true if the leading C<len> bytes of the strings C<s1> and
C<s2> are the same case-insensitively; false otherwise.

In C<foldEQ>, uppercase and lowercase ASCII range bytes match themselves and
their opposite case counterparts.  Non-cased and non-ASCII range bytes match
only themselves.

In C<foldEQ_locale>, the comparison is based on the current locale.
If that locale is UTF-8, the results are the same as C<foldEQ>, leading to
incorrect values for non-ASCII range code points.  Use C<L</foldEQ_utf8>>
instead.

=over 3

 I32       foldEQ       (      const char *a, const char *b,
                               I32 len)
 I32  Perl_foldEQ       (pTHX_ const char *a, const char *b,
                               I32 len)
 I32       foldEQ_locale(      const char *a, const char *b,
                               I32 len)
 I32  Perl_foldEQ_locale(pTHX_ const char *a, const char *b,
                               I32 len)

=back

=back

=for hackers
foldEQ declared in embed.fnc; all in group documented at inline.h, line 4029
foldEQ_locale declared in embed.fnc

=over 4

=item C<ibcmp>

=item C<ibcmp_locale>

=item C<ibcmp_utf8>
X<ibcmp>X<ibcmp_locale>X<ibcmp_utf8>

These return the complement of C<L</foldEQ>>, C<L</foldEQ_locale>>, and
C<L</foldEQ_utf8>> respectively.  Those other names are preferred, as being
clearer.

Hence, for example, C<ibcmp()> is S<C<(! foldEQ())>>

=over 3

 I32  ibcmp       (const char *a, const char *b, I32 len)
 I32  ibcmp_locale(const char *a, const char *b, I32 len)
 I32  ibcmp_utf8  (const char *s1, char **pe1, UV l1, bool u1,
                   const char *s2, char **pe2, UV l2, bool u2)

=back

=back

=for hackers
ibcmp declared in embed.fnc; all in group documented at util.h, line 37
ibcmp_locale declared in embed.fnc
ibcmp_utf8 declared in embed.fnc

=over 4

=item C<instr>
X<instr>

Same as L<strstr(3)>, which finds and returns a pointer to the first occurrence
of the NUL-terminated substring C<little> in the NUL-terminated string C<big>,
returning NULL if not found.  The terminating NUL bytes are not compared.

=over 3

 char *       instr(const char *big, const char *little)
 char *  Perl_instr(const char *big, const char *little)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.h, line 235

=over 4

=item C<memCHRs>
X<memCHRs>

Returns the position of the first occurrence of the byte C<c> in the literal
string C<"list">, or NULL if C<c> doesn't appear in C<"list">.  All bytes are
treated as unsigned char.  Thus this macro can be used to determine if C<c> is
in a set of particular characters.  Unlike L<strchr(3)>, it works even if C<c>
is C<NUL> (and the set doesn't include C<NUL>).

=over 3

 bool  memCHRs("list", char c)

=back

=back

=for hackers
Declared and documented at handy.h, line 640

=over 4

=item C<memEQ>
X<memEQ>

Test two buffers (which may contain embedded C<NUL> characters, to see if they
are equal.  The C<len> parameter indicates the number of bytes to compare.
Returns true or false.  It is undefined behavior if either of the buffers
doesn't contain at least C<len> bytes.

=over 3

 bool  memEQ(char* s1, char* s2, STRLEN len)

=back

=back

=for hackers
Declared and documented at handy.h, line 618

=over 4

=item C<memEQs>
X<memEQs>

Like L</memEQ>, but the second string is a literal enclosed in double quotes,
C<l1> gives the number of bytes in C<s1>.
Returns true or false.

=over 3

 bool  memEQs(char* s1, STRLEN l1, "s2")

=back

=back

=for hackers
Declared and documented at handy.h, line 624

=over 4

=item C<memNE>
X<memNE>

Test two buffers (which may contain embedded C<NUL> characters, to see if they
are not equal.  The C<len> parameter indicates the number of bytes to compare.
Returns true or false.  It is undefined behavior if either of the buffers
doesn't contain at least C<len> bytes.

=over 3

 bool  memNE(char* s1, char* s2, STRLEN len)

=back

=back

=for hackers
Declared and documented at handy.h, line 629

=over 4

=item C<memNEs>
X<memNEs>

Like L</memNE>, but the second string is a literal enclosed in double quotes,
C<l1> gives the number of bytes in C<s1>.
Returns true or false.

=over 3

 bool  memNEs(char* s1, STRLEN l1, "s2")

=back

=back

=for hackers
Declared and documented at handy.h, line 635

=over 4

=item C<Move>

=item C<MoveD>
X<Move>X<MoveD>

The XSUB-writer's interface to the C C<memmove> function.  The C<src> is the
source, C<dest> is the destination, C<nitems> is the number of items, and
C<type> is the type.  Can do overlapping moves.  See also C<L</Copy>>.

C<MoveD> is like C<Move> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=over 3

 void    Move (void* src, void* dest, int nitems, type)
 void *  MoveD(void* src, void* dest, int nitems, type)

=back

=back

=for hackers
Move declared at handy.h, line 2650; all in group documented at handy.h, line 2650
MoveD declared at handy.h, line 2651

=over 4

=item C<my_snprintf>
X<my_snprintf>

The C library C<snprintf> functionality, if available and
standards-compliant (uses C<vsnprintf>, actually).  However, if the
C<vsnprintf> is not available, will unfortunately use the unsafe
C<vsprintf> which can overrun the buffer (there is an overrun check,
but that may be too late).  Consider using C<sv_vcatpvf> instead, or
getting C<vsnprintf>.

=over 3

 int       my_snprintf(char *buffer, const Size_t len,
                       const char *format, ...)
 int  Perl_my_snprintf(char *buffer, const Size_t len,
                       const char *format, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 5235

=over 4

=item C<my_sprintf>
X<my_sprintf>

C<B<DEPRECATED!>>  It is planned to remove C<my_sprintf>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Do NOT use this due to the possibility of overflowing C<buffer>.  Instead use
my_snprintf()

=over 3

 int  my_sprintf(char *buffer, const char *pat, ...)

=back

=back

=for hackers
Declared and documented at perl.h, line 2281

=over 4

=item C<my_strlcat>
X<my_strlcat>

The C library C<strlcat> if available, or a Perl implementation of it.
This operates on C C<NUL>-terminated strings.

C<my_strlcat()> appends string C<src> to the end of C<dst>.  It will append at
most S<C<size - strlen(dst) - 1>> bytes.  It will then C<NUL>-terminate,
unless C<size> is 0 or the original C<dst> string was longer than C<size> (in
practice this should not happen as it means that either C<size> is incorrect or
that C<dst> is not a proper C<NUL>-terminated string).

Note that C<size> is the full size of the destination buffer and
the result is guaranteed to be C<NUL>-terminated if there is room.  Note that
room for the C<NUL> should be included in C<size>.

The return value is the total length that C<dst> would have if C<size> is
sufficiently large.  Thus it is the initial length of C<dst> plus the length of
C<src>.  If C<size> is smaller than the return, the excess was not appended.

=over 3

 Size_t       my_strlcat(char *dst, const char *src, Size_t size)
 Size_t  Perl_my_strlcat(char *dst, const char *src, Size_t size)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 4569

=over 4

=item C<my_strlcpy>
X<my_strlcpy>

The C library C<strlcpy> if available, or a Perl implementation of it.
This operates on C C<NUL>-terminated strings.

C<my_strlcpy()> copies up to S<C<size - 1>> bytes from the string C<src>
to C<dst>, C<NUL>-terminating the result if C<size> is not 0.

The return value is the total length C<src> would be if the copy completely
succeeded.  If it is larger than C<size>, the excess was not copied.

=over 3

 Size_t  my_strlcpy(char *dst, const char *src, Size_t size)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 4611

=over 4

=item C<my_strnlen>
X<my_strnlen>

The C library C<strnlen> if available, or a Perl implementation of it.

C<my_strnlen()> computes the length of the string, up to C<maxlen>
bytes.  It will never attempt to address more than C<maxlen>
bytes, making it suitable for use with strings that are not
guaranteed to be NUL-terminated.

=over 3

 Size_t       my_strnlen(const char *str, Size_t maxlen)
 Size_t  Perl_my_strnlen(const char *str, Size_t maxlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 4119

=over 4

=item C<my_vsnprintf>
X<my_vsnprintf>

The C library C<vsnprintf> if available and standards-compliant.
However, if the C<vsnprintf> is not available, will unfortunately
use the unsafe C<vsprintf> which can overrun the buffer (there is an
overrun check, but that may be too late).  Consider using
C<sv_vcatpvf> instead, or getting C<vsnprintf>.

=over 3

 int       my_vsnprintf(char *buffer, const Size_t len,
                        const char *format, va_list ap)
 int  Perl_my_vsnprintf(char *buffer, const Size_t len,
                        const char *format, va_list ap)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 5327

=over 4

=item C<NewCopy>
X<NewCopy>

Combines Newx() and Copy() into a single macro. Dest will be allocated
using Newx() and then src will be copied into it.

=over 3

 void  NewCopy(void* src, void* dest, int nitems, type)

=back

=back

=for hackers
Declared and documented at handy.h, line 2670

=over 4

=item C<ninstr>
X<ninstr>

Find the first (leftmost) occurrence of a sequence of bytes within another
sequence.  This is the Perl version of C<strstr()>, extended to handle
arbitrary sequences, potentially containing embedded C<NUL> characters (C<NUL>
is what the initial C<n> in the function name stands for; some systems have an
equivalent, C<memmem()>, but with a somewhat different API).

Another way of thinking about this function is finding a needle in a haystack.
C<big> points to the first byte in the haystack.  C<big_end> points to one byte
beyond the final byte in the haystack.  C<little> points to the first byte in
the needle.  C<little_end> points to one byte beyond the final byte in the
needle.  All the parameters must be non-C<NULL>.

The function returns C<NULL> if there is no occurrence of C<little> within
C<big>.  If C<little> is the empty string, C<big> is returned.

Because this function operates at the byte level, and because of the inherent
characteristics of UTF-8 (or UTF-EBCDIC), it will work properly if both the
needle and the haystack are strings with the same UTF-8ness, but not if the
UTF-8ness differs.

=over 3

 char *       ninstr(const char *big, const char *bigend,
                     const char *little, const char *lend)
 char *  Perl_ninstr(const char *big, const char *bigend,
                     const char *little, const char *lend)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 818

=over 4

=item C<Nullch>
X<Nullch>

Null character pointer.  (No longer available when C<PERL_CORE> is
defined.)

=back

=for hackers
Declared and documented at handy.h, line 22

=over 4

=item C<PL_na>
X<PL_na>

A scratch pad variable in which to store a C<STRLEN> value.  If would have been
better named something like C<PL_temp_strlen>.

It is is typically used with C<SvPV> when one is actually planning to discard
the returned length, (hence the length is "Not Applicable", which is how this
variable got its name).

B<BUT BEWARE>, if this is used in a situation where something that is using it
is in a call stack with something else that is using it, this variable would
get zapped, leading to hard-to-diagnose errors.

It is usually more efficient to either declare a local variable and use that
instead, or to use the C<SvPV_nolen> macro.

=over 3

 STRLEN  PL_na

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 256

=over 4

=item C<rninstr>
X<rninstr>

Like C<L</ninstr>>, but instead finds the final (rightmost) occurrence of a
sequence of bytes within another sequence, returning C<NULL> if there is no
such occurrence.

=over 3

 char *       rninstr(const char *big, const char *bigend,
                      const char *little, const char *lend)
 char *  Perl_rninstr(const char *big, const char *bigend,
                      const char *little, const char *lend)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 886

=over 4

=item C<savepv>

=item C<savepvn>

=item C<savepvs>

=item C<savesvpv>

=item C<savesharedpv>

=item C<savesharedpvn>

=item C<savesharedpvs>

=item C<savesharedsvpv>
X<savepv>X<savepvn>X<savepvs>X<savesharedpv>X<savesharedpvn>
X<savesharedpvs>X<savesharedsvpv>X<savesvpv>

Perl's version of C<strdup()> (or C<strndup()> would be if it existed).

These each return a pointer to a newly allocated string which is a duplicate of
the input string.

The forms differ in how the string to be copied is specified, and where the new
memory is allocated from.

To prevent memory leaks, the memory allocated for the new string needs to be
freed when no longer needed.  This can be done with the C<L</Safefree>>
function, or L<C<SAVEFREEPV>|perlguts/SAVEFREEPV(p)>.

The forms whose names contain C<shared> differ from the corresponding form
without that in its name, only in that the memory in the former comes from
memory shared between threads.  This is needed, because on some platforms,
Windows for example, all allocated memory owned by a thread is deallocated when
that thread ends.  So if you need that not to happen, you need to use the
shared memory forms.

The string to copy in C<savepvs> is a C language string literal surrounded by
double quotes.

The string to copy in the forms whose name contains C<svpv> comes from the PV
in the SV argument C<sv>, using C<SvPV()>

The string to copy in the remaining forms comes from the C<pv> argument.

In the case of C<savepv>, the size of the string is determined by C<strlen()>,
which means it may not contain embedded C<NUL> characters, and must have a
trailing C<NUL>.

In the case of C<savepvn>, C<len> gives the length of C<pv>, hence it may
contain embedded C<NUL> characters.  The copy will be guaranteed to have a
trailing NUL added if not already present.

=over 3

 char *       savepv        (      const char *pv)
 char *  Perl_savepv        (pTHX_ const char *pv)
 char *       savepvn       (      const char *pv, Size_t len)
 char *  Perl_savepvn       (pTHX_ const char *pv, Size_t len)
 char*        savepvs       (      "literal string")
 char *       savesvpv      (      SV *sv)
 char *  Perl_savesvpv      (pTHX_ SV *sv)
 char *       savesharedpv  (      const char *pv)
 char *  Perl_savesharedpv  (pTHX_ const char *pv)
 char *       savesharedpvn (      const char * const pv,
                                   const STRLEN len)
 char *  Perl_savesharedpvn (pTHX_ const char * const pv,
                                   const STRLEN len)
 char*        savesharedpvs (      "literal string")
 char *       savesharedsvpv(      SV *sv)
 char *  Perl_savesharedsvpv(pTHX_ SV *sv)

=back

=back

=for hackers
savepv declared in embed.fnc; all in group documented at inline.h, line 4419
savepvn declared in embed.fnc
savepvs declared at handy.h, line 447
savesvpv declared in embed.fnc
savesharedpv declared in embed.fnc
savesharedpvn declared in embed.fnc
savesharedpvs declared at handy.h, line 448
savesharedsvpv declared in embed.fnc

=over 4

=item C<STR_WITH_LEN>
X<STR_WITH_LEN>

Returns two comma separated tokens of the input literal string, and its length.
This is convenience macro which helps out in some API calls.
Note that it can't be used as an argument to macros or functions that under
some configurations might be macros, which means that it requires the full
Perl_xxx(aTHX_ ...) form for any API calls where it's used.

=over 3

 pair  STR_WITH_LEN("literal string")

=back

=back

=for hackers
Declared and documented at handy.h, line 400

=over 4

=item C<strEQ>
X<strEQ>

Test two C<NUL>-terminated strings to see if they are equal.  Returns true or
false.

=over 3

 bool  strEQ(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 588

=over 4

=item C<strGE>
X<strGE>

Test two C<NUL>-terminated strings to see if the first, C<s1>, is greater than
or equal to the second, C<s2>.  Returns true or false.

=over 3

 bool  strGE(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 604

=over 4

=item C<strGT>
X<strGT>

Test two C<NUL>-terminated strings to see if the first, C<s1>, is greater than
the second, C<s2>.  Returns true or false.

=over 3

 bool  strGT(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 600

=over 4

=item C<strLE>
X<strLE>

Test two C<NUL>-terminated strings to see if the first, C<s1>, is less than or
equal to the second, C<s2>.  Returns true or false.

=over 3

 bool  strLE(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 596

=over 4

=item C<STRLEN>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 126

=over 4

=item C<strLT>
X<strLT>

Test two C<NUL>-terminated strings to see if the first, C<s1>, is less than the
second, C<s2>.  Returns true or false.

=over 3

 bool  strLT(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 592

=over 4

=item C<strNE>
X<strNE>

Test two C<NUL>-terminated strings to see if they are different.  Returns true
or false.

=over 3

 bool  strNE(char* s1, char* s2)

=back

=back

=for hackers
Declared and documented at handy.h, line 584

=over 4

=item C<strnEQ>
X<strnEQ>

Test two C<NUL>-terminated strings to see if they are equal.  The C<len>
parameter indicates the number of bytes to compare.  Returns true or false.  (A
wrapper for C<strncmp>).

=over 3

 bool  strnEQ(char* s1, char* s2, STRLEN len)

=back

=back

=for hackers
Declared and documented at handy.h, line 613

=over 4

=item C<strnNE>
X<strnNE>

Test two C<NUL>-terminated strings to see if they are different.  The C<len>
parameter indicates the number of bytes to compare.  Returns true or false.  (A
wrapper for C<strncmp>).

=over 3

 bool  strnNE(char* s1, char* s2, STRLEN len)

=back

=back

=for hackers
Declared and documented at handy.h, line 608

=over 4

=item C<Zero>

=item C<ZeroD>
X<Zero>X<ZeroD>

The XSUB-writer's interface to the C C<memzero> function.  The C<dest> is the
destination, C<nitems> is the number of items, and C<type> is the type.

C<ZeroD> is like C<Zero> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=over 3

 void    Zero (void* dest, int nitems, type)
 void *  ZeroD(void* dest, int nitems, type)

=back

=back

=for hackers
Zero declared at handy.h, line 2674; all in group documented at handy.h, line 2674
ZeroD declared at handy.h, line 2675

=head1 SV Flags

=over 4

=item C<SVt_IV>

=item C<SVt_NULL>

=item C<SVt_NV>

=item C<SVt_PV>
X<SVt_IV>X<SVt_NULL>X<SVt_NV>X<SVt_PV>

Type flag for scalars.  See L</svtype>.

=back

=for hackers
SVt_IV declared at sv.h, line 83; all in group documented at sv.h, line 83
SVt_NULL declared at sv.h, line 80
SVt_NV declared at sv.h, line 86
SVt_PV declared at sv.h, line 89

=over 4

=item C<SVt_PVAV>
X<SVt_PVAV>

Type flag for arrays.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 113

=over 4

=item C<SVt_PVCV>
X<SVt_PVCV>

Type flag for subroutines.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 119

=over 4

=item C<SVt_PVFM>
X<SVt_PVFM>

Type flag for formats.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 122

=over 4

=item C<SVt_PVGV>
X<SVt_PVGV>

Type flag for typeglobs.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 107

=over 4

=item C<SVt_PVHV>
X<SVt_PVHV>

Type flag for hashes.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 116

=over 4

=item C<SVt_PVIO>
X<SVt_PVIO>

Type flag for I/O objects.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 125

=over 4

=item C<SVt_PVIV>

=item C<SVt_PVLV>

=item C<SVt_PVMG>

=item C<SVt_PVNV>
X<SVt_PVIV>X<SVt_PVLV>X<SVt_PVMG>X<SVt_PVNV>

Type flag for scalars.  See L</svtype>.

=back

=for hackers
SVt_PVIV declared at sv.h, line 92; all in group documented at sv.h, line 92
SVt_PVLV declared at sv.h, line 110
SVt_PVMG declared at sv.h, line 98
SVt_PVNV declared at sv.h, line 95

=over 4

=item C<SVt_PVOBJ>
X<SVt_PVOBJ>

NOTE: C<SVt_PVOBJ> is B<experimental> and may change or be
removed without notice.

Type flag for object instances.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 128

=over 4

=item C<SVt_REGEXP>
X<SVt_REGEXP>

Type flag for regular expressions.  See L</svtype>.

=back

=for hackers
Declared and documented at sv.h, line 104

=over 4

=item C<svtype>
X<svtype>

An enum of flags for Perl types.  These are found in the file F<sv.h>
in the C<svtype> enum.  Test these flags with the C<SvTYPE> macro.

The types are:

    SVt_NULL
    SVt_IV
    SVt_NV
    SVt_RV
    SVt_PV
    SVt_PVIV
    SVt_PVNV
    SVt_PVMG
    SVt_INVLIST
    SVt_REGEXP
    SVt_PVGV
    SVt_PVLV
    SVt_PVAV
    SVt_PVHV
    SVt_PVCV
    SVt_PVFM
    SVt_PVIO
    SVt_PVOBJ

These are most easily explained from the bottom up.

C<SVt_PVOBJ> is for object instances of the new `use feature 'class'` kind.
C<SVt_PVIO> is for I/O objects, C<SVt_PVFM> for formats, C<SVt_PVCV> for
subroutines, C<SVt_PVHV> for hashes and C<SVt_PVAV> for arrays.

All the others are scalar types, that is, things that can be bound to a
C<$> variable.  For these, the internal types are mostly orthogonal to
types in the Perl language.

Hence, checking C<< SvTYPE(sv) < SVt_PVAV >> is the best way to see whether
something is a scalar.

C<SVt_PVGV> represents a typeglob.  If C<!SvFAKE(sv)>, then it is a real,
incoercible typeglob.  If C<SvFAKE(sv)>, then it is a scalar to which a
typeglob has been assigned.  Assigning to it again will stop it from being
a typeglob.  C<SVt_PVLV> represents a scalar that delegates to another scalar
behind the scenes.  It is used, e.g., for the return value of C<substr> and
for tied hash and array elements.  It can hold any scalar value, including
a typeglob.  C<SVt_REGEXP> is for regular
expressions.  C<SVt_INVLIST> is for Perl
core internal use only.

C<SVt_PVMG> represents a "normal" scalar (not a typeglob, regular expression,
or delegate).  Since most scalars do not need all the internal fields of a
PVMG, we save memory by allocating smaller structs when possible.  All the
other types are just simpler forms of C<SVt_PVMG>, with fewer internal fields.
C<SVt_NULL> can only hold undef.  C<SVt_IV> can hold undef, an integer, or a
reference.  (C<SVt_RV> is an alias for C<SVt_IV>, which exists for backward
compatibility.)  C<SVt_NV> can hold undef or a double. (In builds that support
headless NVs, these could also hold a reference via a suitable offset, in the
same way that SVt_IV does, but this is not currently supported and seems to
be a rare use case.) C<SVt_PV> can hold C<undef>, a string, or a reference.
C<SVt_PVIV> is a superset of C<SVt_PV> and C<SVt_IV>. C<SVt_PVNV> is a
superset of C<SVt_PV> and C<SVt_NV>. C<SVt_PVMG> can hold anything C<SVt_PVNV>
can hold, but it may also be blessed or magical.

=back

=for hackers
Declared and documented at sv.h, line 18

=head1 SV Handling
X<PERL_MAGIC_utf8>X<SV_CATBYTES>X<SV_CATUTF8>X<SV_COW_DROP_PV>
X<SV_FORCE_UTF8_UPGRADE>X<SV_GMAGIC>X<SV_HAS_TRAILING_NUL>
X<SV_IMMEDIATE_UNREF>X<SV_NOSTEAL>X<SV_SKIP_OVERLOAD>X<SV_SMAGIC>
X<SV_UTF8_NO_ENCODING>X<SVs_TEMP>

=over 4

=item C<AV_FROM_REF>

=item C<CV_FROM_REF>

=item C<GV_FROM_REF>

=item C<HV_FROM_REF>
X<AV_FROM_REF>X<CV_FROM_REF>X<GV_FROM_REF>X<HV_FROM_REF>

The C<I<*>V_FROM_REF> macros extract the C<SvRV()> from a given reference SV
and return a suitably-cast to pointer to the referenced SV. When running
under C<-DDEBUGGING>, assertions are also applied that check that I<ref> is
definitely a reference SV that refers to an SV of the right type.

=over 3

 AV *  AV_FROM_REF(SV * ref)
 CV *  CV_FROM_REF(SV * ref)
 GV *  GV_FROM_REF(SV * ref)
 HV *  HV_FROM_REF(SV * ref)

=back

=back

=for hackers
AV_FROM_REF declared at handy.h, line 109; all in group documented at handy.h, line 109
CV_FROM_REF declared at handy.h, line 110
GV_FROM_REF declared at handy.h, line 111
HV_FROM_REF declared at handy.h, line 112

=over 4

=item C<BOOL_INTERNALS_sv_isbool>
X<BOOL_INTERNALS_sv_isbool>

Checks if a C<SvBoolFlagsOK()> sv is a bool. B<Note> that it is the
caller's responsibility to ensure that the sv is C<SvBoolFlagsOK()> before
calling this. This is only useful in specialized logic like
serialization code where performance is critical and the flags have
already been checked to be correct. Almost always you should be using
C<sv_isbool(sv)> instead.

=over 3

 bool  BOOL_INTERNALS_sv_isbool(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 840

=over 4

=item C<BOOL_INTERNALS_sv_isbool_false>
X<BOOL_INTERNALS_sv_isbool_false>

Checks if a C<SvBoolFlagsOK()> sv is a false bool. B<Note> that it is
the caller's responsibility to ensure that the sv is C<SvBoolFlagsOK()>
before calling this. This is only useful in specialized logic like
serialization code where performance is critical and the flags have
already been checked to be correct. This is B<NOT> what you should use
to check if an SV is "false", for that you should be using
C<!SvTRUE(sv)> instead.

=over 3

 bool  BOOL_INTERNALS_sv_isbool_false(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 857

=over 4

=item C<BOOL_INTERNALS_sv_isbool_true>
X<BOOL_INTERNALS_sv_isbool_true>

Checks if a C<SvBoolFlagsOK()> sv is a true bool. B<Note> that it is
the caller's responsibility to ensure that the sv is C<SvBoolFlagsOK()>
before calling this. This is only useful in specialized logic like
serialization code where performance is critical and the flags have
already been checked to be correct. This is B<NOT> what you should use
to check if an SV is "true", for that you should be using
C<SvTRUE(sv)> instead.

=over 3

 bool  BOOL_INTERNALS_sv_isbool_true(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 848

=over 4

=item C<boolSV>
X<boolSV>

Returns a true SV if C<b> is a true value, or a false SV if C<b> is 0.

See also C<L</PL_sv_yes>> and C<L</PL_sv_no>>.

=over 3

 SV *  boolSV(bool b)

=back

=back

=for hackers
Declared and documented at sv.h, line 2468

=over 4

=item C<croak_xs_usage>
X<croak_xs_usage>

A specialised variant of C<croak()> for emitting the usage message for xsubs

    croak_xs_usage(cv, "eee_yow");

works out the package name and subroutine name from C<cv>, and then calls
C<croak()>.  Hence if C<cv> is C<&ouch::awk>, it would call C<croak> as:

 diag_listed_as: SKIPME
 croak("Usage: %" SVf "::%" SVf "(%s)", "ouch" "awk",
                                                     "eee_yow");

=over 3

 void       croak_xs_usage(const CV * const cv,
                           const char * const params)
 void  Perl_croak_xs_usage(const CV * const cv,
                           const char * const params)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 378

=over 4

=item C<CV_FROM_REF*>

Described under C<L</AV_FROM_REF>>

=back

=over 4

=item C<DEFSV>
X<DEFSV>

Returns the SV associated with C<$_>

=over 3

 SV *  DEFSV

=back

=back

=for hackers
Declared and documented at perl.h, line 2059

=over 4

=item C<DEFSV_set>
X<DEFSV_set>

Associate C<sv> with C<$_>

=over 3

 void  DEFSV_set(SV * sv)

=back

=back

=for hackers
Declared and documented at perl.h, line 2062

=over 4

=item C<get_sv>
X<get_sv>

Returns the SV of the specified Perl scalar.  C<flags> are passed to
L</C<gv_fetchpv>>.  If C<GV_ADD> is set and the
Perl variable does not exist then it will be created.  If C<flags> is zero
and the variable does not exist then NULL is returned.

NOTE: the C<perl_get_sv()> form is B<deprecated>.

=over 3

 SV *       get_sv(      const char *name, I32 flags)
 SV *  Perl_get_sv(pTHX_ const char *name, I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.c, line 2893

=over 4

=item C<GV_FROM_REF*>

=item C<HV_FROM_REF*>

Described under C<L</AV_FROM_REF>>

=back

=over 4

=item C<isGV_with_GP>
X<isGV_with_GP>

Returns a boolean as to whether or not C<sv> is a GV with a pointer to a GP
(glob pointer).

=over 3

 bool  isGV_with_GP(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2498

=over 4

=item C<looks_like_number>
X<looks_like_number>

Test if the content of an SV looks like a number (or is a number).
C<Inf> and C<Infinity> are treated as numbers (so will not issue a
non-numeric warning), even if your C<atof()> doesn't grok them.  Get-magic is
ignored.

=over 3

 I32       looks_like_number(      SV * const sv)
 I32  Perl_looks_like_number(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 1854

=over 4

=item C<MUTABLE_AV>

=item C<MUTABLE_CV>

=item C<MUTABLE_GV>

=item C<MUTABLE_HV>

=item C<MUTABLE_IO>

=item C<MUTABLE_PTR>

=item C<MUTABLE_SV>
X<MUTABLE_AV>X<MUTABLE_CV>X<MUTABLE_GV>X<MUTABLE_HV>X<MUTABLE_IO>
X<MUTABLE_PTR>X<MUTABLE_SV>

The C<MUTABLE_I<*>>() macros cast pointers to the types shown, in such a way
(compiler permitting) that casting away const-ness will give a warning;
e.g.:

 const SV *sv = ...;
 AV *av1 = (AV*)sv;        <== BAD:  the const has been silently
                                     cast away
 AV *av2 = MUTABLE_AV(sv); <== GOOD: it may warn

C<MUTABLE_PTR> is the base macro used to derive new casts.  The other
already-built-in ones return pointers to what their names indicate.

=over 3

 AV *    MUTABLE_AV (AV * p)
 CV *    MUTABLE_CV (CV * p)
 GV *    MUTABLE_GV (GV * p)
 HV *    MUTABLE_HV (HV * p)
 IO *    MUTABLE_IO (IO * p)
 void *  MUTABLE_PTR(void * p)
 SV *    MUTABLE_SV (SV * p)

=back

=back

=for hackers
MUTABLE_AV declared at handy.h, line 69; all in group documented at handy.h, line 69
MUTABLE_CV declared at handy.h, line 70
MUTABLE_GV declared at handy.h, line 71
MUTABLE_HV declared at handy.h, line 72
MUTABLE_IO declared at handy.h, line 73
MUTABLE_PTR declared at handy.h, line 74
MUTABLE_SV declared at handy.h, line 75

=over 4

=item C<newRV>

=item C<newRV_inc>
X<newRV>X<newRV_inc>

These are identical.  They create an RV wrapper for an SV.  The reference count
for the original SV is incremented.

=over 3

 SV *       newRV    (      SV * const sv)
 SV *  Perl_newRV    (pTHX_ SV * const sv)
 SV *       newRV_inc(      SV * const sv)

=back

=back

=for hackers
newRV declared in embed.fnc; all in group documented at sv.h, line 2310
newRV_inc declared at sv.h, line 2311

=over 4

=item C<newRV_noinc>
X<newRV_noinc>

Creates an RV wrapper for an SV.  The reference count for the original
SV is B<not> incremented.

=over 3

 SV *       newRV_noinc(      SV * const tmpRef)
 SV *  Perl_newRV_noinc(pTHX_ SV * const tmpRef)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 965

=over 4

=item C<newSV>
X<newSV>

Creates a new SV.  A non-zero C<len> parameter indicates the number of
bytes of preallocated string space the SV should have.  An extra byte for a
trailing C<NUL> is also reserved.  (C<SvPOK> is not set for the SV even if string
space is allocated.)  The reference count for the new SV is set to 1.

In 5.9.3, C<newSV()> replaces the older C<NEWSV()> API, and drops the first
parameter, I<x>, a debug aid which allowed callers to identify themselves.
This aid has been superseded by a new build option, C<PERL_MEM_LOG> (see
L<perlhacktips/PERL_MEM_LOG>).  The older API is still there for use in XS
modules supporting older perls.

=over 3

 SV *       newSV(      const STRLEN len)
 SV *  Perl_newSV(pTHX_ const STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 5801

=over 4

=item C<newSV_false>
X<newSV_false>

Creates a new SV that is a boolean false.

=over 3

 SV *       newSV_false()
 SV *  Perl_newSV_false(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10134

=over 4

=item C<newSV_true>
X<newSV_true>

Creates a new SV that is a boolean true.

=over 3

 SV *       newSV_true()
 SV *  Perl_newSV_true(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10118

=over 4

=item C<newSV_type>
X<newSV_type>

Creates a new SV, of the type specified.  The reference count for the new SV
is set to 1.

=over 3

 SV *       newSV_type(      const svtype type)
 SV *  Perl_newSV_type(pTHX_ const svtype type)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 363

=over 4

=item C<newSV_type_mortal>
X<newSV_type_mortal>

Creates a new mortal SV, of the type specified.  The reference count for the
new SV is set to 1.

This is equivalent to
    SV* sv = sv_2mortal(newSV_type(<some type>))
and
    SV* sv = sv_newmortal();
    sv_upgrade(sv, <some_type>)
but should be more efficient than both of them. (Unless sv_2mortal is inlined
at some point in the future.)

=over 3

 SV *       newSV_type_mortal(      const svtype type)
 SV *  Perl_newSV_type_mortal(pTHX_ const svtype type)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 521

=over 4

=item C<newSVbool>
X<newSVbool>

Creates a new SV boolean.

=over 3

 SV *       newSVbool(      const bool bool_val)
 SV *  Perl_newSVbool(pTHX_ const bool bool_val)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10101

=over 4

=item C<newSVhek>
X<newSVhek>

Creates a new SV from the hash key structure.  It will generate scalars that
point to the shared string table where possible.  Returns a new (undefined)
SV if C<hek> is NULL.

=over 3

 SV *       newSVhek(      const HEK * const hek)
 SV *  Perl_newSVhek(pTHX_ const HEK * const hek)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9822

=over 4

=item C<newSVhek_mortal>
X<newSVhek_mortal>

Creates a new mortal SV from the hash key structure.  It will generate
scalars that point to the shared string table where possible.  Returns
a new (undefined) SV if C<hek> is NULL.

This is more efficient than using sv_2mortal(newSVhek( ... ))

=over 3

 SV *       newSVhek_mortal(      const HEK * const hek)
 SV *  Perl_newSVhek_mortal(pTHX_ const HEK * const hek)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9798

=over 4

=item C<newSViv>
X<newSViv>

Creates a new SV and copies an integer into it.  The reference count for the
SV is set to 1.

=over 3

 SV *       newSViv(      const IV i)
 SV *  Perl_newSViv(pTHX_ const IV i)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10040

=over 4

=item C<newSVnv>
X<newSVnv>

Creates a new SV and copies a floating point value into it.
The reference count for the SV is set to 1.

=over 3

 SV *       newSVnv(      const NV n)
 SV *  Perl_newSVnv(pTHX_ const NV n)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10019

=over 4

=item C<newSVpadname>
X<newSVpadname>

NOTE: C<newSVpadname> is B<experimental> and may change or be
removed without notice.

Creates a new SV containing the pad name.

=over 3

 SV*  newSVpadname(PADNAME *pn)

=back

=back

=for hackers
Declared and documented at sv.h, line 2577

=over 4

=item C<newSVpv>
X<newSVpv>

Creates a new SV and copies a string (which may contain C<NUL> (C<\0>)
characters) into it.  The reference count for the
SV is set to 1.  If C<len> is zero, Perl will compute the length using
C<strlen()>, (which means if you use this option, that C<s> can't have embedded
C<NUL> characters and has to have a terminating C<NUL> byte).

This function can cause reliability issues if you are likely to pass in
empty strings that are not null terminated, because it will run
strlen on the string and potentially run past valid memory.

Using L</newSVpvn> is a safer alternative for non C<NUL> terminated strings.
For string literals use L</newSVpvs> instead.  This function will work fine for
C<NUL> terminated strings, but if you want to avoid the if statement on whether
to call C<strlen> use C<newSVpvn> instead (calling C<strlen> yourself).

=over 3

 SV *       newSVpv(      const char * const s, const STRLEN len)
 SV *  Perl_newSVpv(pTHX_ const char * const s, const STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9748

=over 4

=item C<newSVpv_share>
X<newSVpv_share>

Like C<newSVpvn_share>, but takes a C<NUL>-terminated string instead of a
string/length pair.

=over 3

 SV *       newSVpv_share(      const char *s, U32 hash)
 SV *  Perl_newSVpv_share(pTHX_ const char *s, U32 hash)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9934

=over 4

=item C<newSVpvf>
X<newSVpvf>

Creates a new SV and initializes it with the string formatted like
C<sv_catpvf>.

=over 3

 SV *  Perl_newSVpvf(pTHX_ const char * const pat, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9972

=over 4

=item C<newSVpvf_nocontext>
X<newSVpvf_nocontext>

Like C<L</newSVpvf>> but does not take a thread context (C<aTHX>) parameter,
so is used in situations where the caller doesn't already have the thread
context.

=over 3

 SV *       newSVpvf_nocontext(const char * const pat, ...)
 SV *  Perl_newSVpvf_nocontext(const char * const pat, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9977

=over 4

=item C<newSVpvn>
X<newSVpvn>

Creates a new SV and copies a string into it, which may contain C<NUL> characters
(C<\0>) and other binary data.  The reference count for the SV is set to 1.
Note that if C<len> is zero, Perl will create a zero length (Perl) string.  You
are responsible for ensuring that the source buffer is at least
C<len> bytes long.  If the C<buffer> argument is NULL the new SV will be
undefined.

=over 3

 SV *       newSVpvn(      const char * const s, const STRLEN len)
 SV *  Perl_newSVpvn(pTHX_ const char * const s, const STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9777

=over 4

=item C<newSVpvn_flags>
X<newSVpvn_flags>

Creates a new SV and copies a string (which may contain C<NUL> (C<\0>)
characters) into it.  The reference count for the
SV is set to 1.  Note that if C<len> is zero, Perl will create a zero length
string.  You are responsible for ensuring that the source string is at least
C<len> bytes long.  If the C<s> argument is NULL the new SV will be undefined.
Currently the only flag bits accepted are C<SVf_UTF8> and C<SVs_TEMP>.
If C<SVs_TEMP> is set, then C<sv_2mortal()> is called on the result before
returning.  If C<SVf_UTF8> is set, C<s>
is considered to be in UTF-8 and the
C<SVf_UTF8> flag will be set on the new SV.
C<newSVpvn_utf8()> is a convenience wrapper for this function, defined as

    #define newSVpvn_utf8(s, len, u)			\
        newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)

=over 3

 SV *       newSVpvn_flags(      const char * const s,
                                 const STRLEN len,
                                 const U32 flags)
 SV *  Perl_newSVpvn_flags(pTHX_ const char * const s,
                                 const STRLEN len,
                                 const U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9673

=over 4

=item C<newSVpvn_share>
X<newSVpvn_share>

Creates a new SV with its C<SvPVX_const> pointing to a shared string in the string
table.  If the string does not already exist in the table, it is
created first.  Turns on the C<SvIsCOW> flag (or C<READONLY>
and C<FAKE> in 5.16 and earlier).  If the C<hash> parameter
is non-zero, that value is used; otherwise the hash is computed.
The string's hash can later be retrieved from the SV
with the C<L</SvSHARED_HASH>> macro.  The idea here is
that as the string table is used for shared hash keys these strings will have
C<SvPVX_const == HeKEY> and hash lookup will avoid string compare.

=over 3

 SV *       newSVpvn_share(      const char *s, I32 len, U32 hash)
 SV *  Perl_newSVpvn_share(pTHX_ const char *s, I32 len, U32 hash)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9885

=over 4

=item C<newSVpvn_utf8>
X<newSVpvn_utf8>

Creates a new SV and copies a string (which may contain C<NUL> (C<\0>)
characters) into it.  If C<utf8> is true, calls
C<SvUTF8_on> on the new SV.  Implemented as a wrapper around C<newSVpvn_flags>.

=over 3

 SV*  newSVpvn_utf8(const char* s, STRLEN len, U32 utf8)

=back

=back

=for hackers
Declared and documented at sv.h, line 2565

=over 4

=item C<newSVpvs>
X<newSVpvs>

Like C<newSVpvn>, but takes a literal string instead of a
string/length pair.

=over 3

 SV*  newSVpvs("literal string")

=back

=back

=for hackers
Declared and documented at handy.h, line 376

=over 4

=item C<newSVpvs_flags>
X<newSVpvs_flags>

Like C<newSVpvn_flags>, but takes a literal string instead of
a string/length pair.

=over 3

 SV*  newSVpvs_flags("literal string", U32 flags)

=back

=back

=for hackers
Declared and documented at handy.h, line 380

=over 4

=item C<newSVpvs_share>
X<newSVpvs_share>

Like C<newSVpvn_share>, but takes a literal string instead of
a string/length pair and omits the hash parameter.

=over 3

 SV*  newSVpvs_share("literal string")

=back

=back

=for hackers
Declared and documented at handy.h, line 384

=over 4

=item C<newSVpvz>
X<newSVpvz>

Creates a new SV initialized with an empty string, like C<newSVpvs("")>, but
with enough available space to hold a string of C<len> bytes (plus a trailing
NUL) without needing to grow.  It differs from C<L</newSV>> in that the string
is defined and initialized.

The reference count for the new SV is set to 1.

=over 3

 SV *       newSVpvz(      const STRLEN len)
 SV *  Perl_newSVpvz(pTHX_ const STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 5832

=over 4

=item C<newSVrv>
X<newSVrv>

Creates a new SV for the existing RV, C<rv>, to point to.  If C<rv> is not an
RV then it will be upgraded to one.  If C<classname> is non-null then the new
SV will be blessed in the specified package.  The new SV is returned and its
reference count is 1.  The reference count 1 is owned by C<rv>. See also
newRV_inc() and newRV_noinc() for creating a new RV properly.

=over 3

 SV *       newSVrv(      SV * const rv,
                          const char * const classname)
 SV *  Perl_newSVrv(pTHX_ SV * const rv,
                          const char * const classname)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10732

=over 4

=item C<newSVsv>

=item C<newSVsv_flags>

=item C<newSVsv_nomg>
X<newSVsv>X<newSVsv_flags>X<newSVsv_nomg>

These create a new SV which is an exact duplicate of the original SV
(using C<sv_setsv>.)

They differ only in that C<newSVsv> performs 'get' magic; C<newSVsv_nomg> skips
any magic; and C<newSVsv_flags> allows you to explicitly set a C<flags>
parameter.

=over 3

 SV *       newSVsv      (      SV * const old)
 SV *  Perl_newSVsv      (pTHX_ SV * const old)
 SV *       newSVsv_flags(      SV * const old, I32 flags)
 SV *  Perl_newSVsv_flags(pTHX_ SV * const old, I32 flags)
 SV *       newSVsv_nomg (      SV * const old)

=back

=back

=for hackers
newSVsv declared in embed.fnc; all in group documented at sv.c, line 10163
newSVsv_flags declared in embed.fnc
newSVsv_nomg declared in embed.fnc

=over 4

=item C<newSVuv>
X<newSVuv>

Creates a new SV and copies an unsigned integer into it.
The reference count for the SV is set to 1.

=over 3

 SV *       newSVuv(      const UV u)
 SV *  Perl_newSVuv(pTHX_ const UV u)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10061

=over 4

=item C<Nullsv>
X<Nullsv>

Null SV pointer.  (No longer available when C<PERL_CORE> is defined.)

=back

=for hackers
Declared and documented at handy.h, line 27

=over 4

=item C<PL_sv_no>
X<PL_sv_no>

This is the C<false> SV.  It is readonly.  See C<L</PL_sv_yes>>.  Always refer
to this as C<&PL_sv_no>.

=over 3

 SV  PL_sv_no

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 199

=over 4

=item C<PL_sv_undef>
X<PL_sv_undef>

This is the C<undef> SV.  It is readonly.  Always refer to this as
C<&PL_sv_undef>.

=over 3

 SV  PL_sv_undef

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 195

=over 4

=item C<PL_sv_yes>
X<PL_sv_yes>

This is the C<true> SV.  It is readonly.  See C<L</PL_sv_no>>.  Always refer to
this as C<&PL_sv_yes>.

=over 3

 SV  PL_sv_yes

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 203

=over 4

=item C<PL_sv_zero>
X<PL_sv_zero>

This readonly SV has a zero numeric value and a C<"0"> string value. It's
similar to C<L</PL_sv_no>> except for its string value. Can be used as a
cheap alternative to C<mXPUSHi(0)> for example.  Always refer to this as
C<&PL_sv_zero>. Introduced in 5.28.

=over 3

 SV  PL_sv_zero

=back

=back

=for hackers
Declared and documented at intrpvar.h, line 207

=over 4

=item C<SAVE_DEFSV>
X<SAVE_DEFSV>

Localize C<$_>.  See L<perlguts/Localizing changes>.

=over 3

 void  SAVE_DEFSV

=back

=back

=for hackers
Declared and documented at perl.h, line 2065

=over 4

=item C<sortsv>
X<sortsv>

In-place sort an array of SV pointers with the given comparison routine.

Currently this always uses mergesort.  See C<L</sortsv_flags>> for a more
flexible routine.

=over 3

 void       sortsv(      SV **array, size_t num_elts,
                         SVCOMPARE_t cmp)
 void  Perl_sortsv(pTHX_ SV **array, size_t num_elts,
                         SVCOMPARE_t cmp)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_sort.c, line 667

=over 4

=item C<sortsv_flags>
X<sortsv_flags>

In-place sort an array of SV pointers with the given comparison routine,
with various SORTf_* flag options.

=over 3

 void       sortsv_flags(      SV **array, size_t num_elts,
                               SVCOMPARE_t cmp, U32 flags)
 void  Perl_sortsv_flags(pTHX_ SV **array, size_t num_elts,
                               SVCOMPARE_t cmp, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at pp_sort.c, line 540

=over 4

=item C<SV>

Described in L<perlguts>.

=back

=for hackers
Documented at pod/perlguts.pod, line 34

=over 4

=item C<sv_backoff>
X<sv_backoff>

Remove any string offset.  You should normally use the C<SvOOK_off> macro
wrapper instead.

=over 3

 void       sv_backoff(SV * const sv)
 void  Perl_sv_backoff(SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 1318

=over 4

=item C<sv_bless>
X<sv_bless>

Blesses an SV into a specified package.  The SV must be an RV.  The package
must be designated by its stash (see C<L</gv_stashpv>>).  The reference count
of the SV is unaffected.

=over 3

 SV *       sv_bless(      SV * const sv,
                           NOCHECK HV * const stash)
 SV *  Perl_sv_bless(pTHX_ SV * const sv,
                           NOCHECK HV * const stash)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10913

=over 4

=item C<sv_catpv>

=item C<sv_catpv_flags>

=item C<sv_catpv_mg>

=item C<sv_catpv_nomg>

=item C<sv_catpvn>

=item C<sv_catpvn_flags>

=item C<sv_catpvn_mg>

=item C<sv_catpvn_nomg>

=item C<sv_catpvn_nomg_maybeutf8>

=item C<sv_catpvs>

=item C<sv_catpvs_flags>

=item C<sv_catpvs_mg>

=item C<sv_catpvs_nomg>
X<sv_catpv>X<sv_catpv_flags>X<sv_catpv_mg>X<sv_catpv_nomg>X<sv_catpvn>
X<sv_catpvn_flags>X<sv_catpvn_mg>X<sv_catpvn_nomg>
X<sv_catpvn_nomg_maybeutf8>X<sv_catpvs>X<sv_catpvs_flags>X<sv_catpvs_mg>
X<sv_catpvs_nomg>

These each concatenate a string onto the end of the string which is in C<dsv>.
They differ in how the catenated string is specified and in the handling of
magic and UTF-8ness.

In the C<pvs> forms, the catenated string is a C language string literal,
enclosed in double quotes.

In the C<pvn> forms, C<sstr> points to the first byte of the string to
concatenate, and an additional parameter, C<len>, specifies the number of
bytes to copy.  Hence, C<sstr> may contain embedded-NUL characters.
The caller must make sure C<sstr> contains at least C<len> bytes.

In the plain C<pv> forms, the catenated string is a C language NUL-terminated
string.

The C<_mg> forms perform both 'get' and 'set' magic on C<dsv>.

The C<_nomg> forms skip all magic.

The other forms perform only 'get' magic.

The C<_flags> forms have an extra parameter, C<flags>, which allows you to also
override the UTF-8 handling.  By supplying the C<SV_CATBYTES> flag, the
appended string is interpreted as plain bytes; by supplying instead the
C<SV_CATUTF8> flag, it will be interpreted as UTF-8, and C<dsv> will be
upgraded to UTF-8 if necessary.

C<sv_catpvn_nomg_maybeutf8> has an extra boolean parameter, C<is_utf8>, which
if C<true> indicates that C<sstr> is encoded in UTF-8; otherwise not.

For all other forms, the string appended is assumed to be valid UTF-8
if and only if the C<dsv> has the UTF-8 status set.

=over 3

 void       sv_catpv                (      SV * const dsv,
                                           const char *sstr)
 void  Perl_sv_catpv                (pTHX_ SV * const dsv,
                                           const char *sstr)
 void       sv_catpv_flags          (      SV * const dsv,
                                           const char *sstr,
                                           const I32 flags)
 void  Perl_sv_catpv_flags          (pTHX_ SV * const dsv,
                                           const char *sstr,
                                           const I32 flags)
 void       sv_catpv_mg             (     SV * const dsv,
                                          const char * const sstr)
 void  Perl_sv_catpv_mg             (pTHX_ SV * const dsv,
                                          const char * const sstr)
 void       sv_catpv_nomg           (      SV * const dsv,
                                           const char * sstr
)
 void       sv_catpvn               (      SV * const dsv,
                                           const char *sstr,
                                           STRLEN len)
 void  Perl_sv_catpvn               (pTHX_ SV * const dsv,
                                           const char *sstr,
                                           STRLEN len)
 void       sv_catpvn_flags         (      SV * const dsv,
                                           const char *sstr,
                                           const STRLEN len,
                                           const I32 flags)
 void  Perl_sv_catpvn_flags         (pTHX_ SV * const dsv,
                                           const char *sstr,
                                           const STRLEN len,
                                           const I32 flags)
 void       sv_catpvn_mg            (      SV * const dsv,
                                           const char *sstr,
                                           STRLEN len)
 void  Perl_sv_catpvn_mg            (pTHX_ SV * const dsv,
                                           const char *sstr,
                                           STRLEN len)
 void       sv_catpvn_nomg          (      SV * const dsv,
                                           const char * sstr,
                                           const STRLEN len
)
 void       sv_catpvn_nomg_maybeutf8(      SV * const dsv,
                                           const char *sstr,
                                           const STRLEN len,
                                           const I32 flags
)
 void       sv_catpvs               (      SV * const dsv,
                                           "literal string")
 void       sv_catpvs_flags         (      SV * const dsv,
                                           "literal string",
                                           I32 flags)
 void       sv_catpvs_mg            (      SV * const dsv,
                                           "literal string")
 void       sv_catpvs_nomg          (      SV * const dsv,
                                           "literal string")

=back

=back

=for hackers
sv_catpv declared in embed.fnc; all in group documented at sv.c, line 5618
sv_catpv_flags declared in embed.fnc
sv_catpv_mg declared in embed.fnc
sv_catpv_nomg declared at sv.h, line 2228
sv_catpvn declared in embed.fnc
sv_catpvn_flags declared in embed.fnc
sv_catpvn_mg declared in embed.fnc
sv_catpvn_nomg declared at sv.h, line 2226
sv_catpvn_nomg_maybeutf8 declared at sv.h, line 2296
sv_catpvs declared at handy.h, line 422
sv_catpvs_flags declared at handy.h, line 420
sv_catpvs_mg declared at handy.h, line 423
sv_catpvs_nomg declared at handy.h, line 421

=over 4

=item C<sv_catpvf>

=item C<sv_catpvf_nocontext>

=item C<sv_catpvf_mg>

=item C<sv_catpvf_mg_nocontext>

=item C<sv_vcatpvf>

=item C<sv_vcatpvf_mg>

=item C<sv_vcatpvfn>

=item C<sv_vcatpvfn_flags>
X<sv_catpvf>X<sv_catpvf_mg>X<sv_catpvf_mg_nocontext>X<sv_catpvf_nocontext>
X<sv_vcatpvf>X<sv_vcatpvf_mg>X<sv_vcatpvfn>X<sv_vcatpvfn_flags>

These each append to C<sv> the result of formatting their arguments using
C<pat> as the C<sprintf>-like pattern.  They assume that C<pat> has the same
UTF8ness as C<sv>.  It's the caller's responsibility to ensure that this is
so.

If the destination C<sv> isn't already in UTF-8, but the appended data contains
"wide" characters, C<sv> will be converted to be UTF-8.  An example is the
C<%c> format with the code point > 255.  (This is an enhancement to what libc
C<sprintf> would do in this situation.)  Other examples are given below.

The forms differ in how their arguments are specified and in the handling of
magic.

C<sv_vcatpvfn_flags> is the most general, and all the other forms are
implemented by eventually calling it.

It has two sets of argument lists, only one of which is used in any given call.
The first set, C<args>, is an encapsulated argument list of pointers to C
strings.  If it is NULL, the other list, C<svargs>, is used; it is an array
of pointers to SV's.  C<sv_count> gives how many there are in the list.

See L<C<sprintf(3)>> for details on how the formatting is done.  Some
platforms support extensions to the standard C99 definition of this function.
None of those are supported by Perl.  For example, neither C<'> (to get digit
grouping), nor C<I> (to get alternate digits) are supported.

Also, argument reordering (using format specifiers like C<%2$d> or C<%*2$d>) is
supported only when using the C<svargs> array of SVs; an exception is raised if
C<arg> is not NULL and C<pat> contains the C<$> reordering specifier.

S<C<* maybe_tainted>> is supposed to be set when running with taint checks
enabled if the results are untrustworthy (often due to the use of locales).
However, this is not currently implemented.  This argument is not used.

C<patlen> gives the length in bytes of C<pat>.  Currently, the pattern must be
NUL-terminated anyway.

C<flags> is used to specify which magic to handle or to skip, by setting or
clearing the C<SV_GMAGIC> and/or S<SV_SMAGIC> flags.

Plain C<sv_vcatpvfn> just calls C<sv_vcatpvfn_flags> setting both the
C<SV_GMAGIC> and S<SV_SMAGIC> flags, so it always handles both set and get
magic.

All the remaining forms handle 'get' magic; the forms whose name contains
C<_mg> additionally handle 'set' magic.

When using the C<svargs> array, if any of the SVs in it have their UTF-8 flag
set, C<sv> will be converted to be so too, as necessary.

None of the remaining forms use the C<svargs> array, meaning argument
reordering is not possible with them.  The arguments are generally considered
to be the same UTF8ness as the destination C<sv>, though certain Perl
extensions to the standard set of %formats can override this  (see
L<perlguts/Formatted Printing of Strings> and adjacent sections).

The forms whose name contains C<_no_context> do not take a thread
context (C<aTHX>) parameter, so are used in situations where the caller
doesn't already have the thread context.

The forms whose name contains C<vcat> use an encapsulated argument list, the
other forms use C<sprintf>-style arguments.

There are no other differences between the forms.

=over 3

 void  Perl_sv_catpvf             (pTHX_ SV * const sv,
                                         const char * const pat,
                                         ...)
 void       sv_catpvf_nocontext   (      SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_catpvf_nocontext   (      SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_catpvf_mg          (pTHX_ SV * const sv,
                                         const char * const pat,
                                         ...)
 void       sv_catpvf_mg_nocontext(      SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_catpvf_mg_nocontext(      SV * const sv,
                                         const char * const pat,
                                         ...)
 void       sv_vcatpvf            (      SV * const sv,
                                         const char * const pat,
                                         va_list * const args)
 void  Perl_sv_vcatpvf            (pTHX_ SV * const sv,
                                         const char * const pat,
                                         va_list * const args)
 void       sv_vcatpvf_mg         (      SV * const sv,
                                         const char * const pat,
                                         va_list * const args)
 void  Perl_sv_vcatpvf_mg         (pTHX_ SV * const sv,
                                         const char * const pat,
                                         va_list * const args)
 void       sv_vcatpvfn           (    SV * const sv,
                                       const char * const pat,
                                       const STRLEN patlen,
                                       va_list * const args,
                                       SV ** const svargs,
                                       const Size_t sv_count,
                                       bool * const maybe_tainted)
 void  Perl_sv_vcatpvfn           (pTHX_ SV * const sv,
                                       const char * const pat,
                                       const STRLEN patlen,
                                       va_list * const args,
                                       SV ** const svargs,
                                       const Size_t sv_count,
                                       bool * const maybe_tainted)
 void       sv_vcatpvfn_flags     (    SV * const sv,
                                       const char * const pat,
                                       const STRLEN patlen,
                                       va_list * const args,
                                       SV ** const svargs,
                                       const Size_t sv_count,
                                       bool * const maybe_tainted,
                                       const U32 flags)
 void  Perl_sv_vcatpvfn_flags     (pTHX_ SV * const sv,
                                       const char * const pat,
                                       const STRLEN patlen,
                                       va_list * const args,
                                       SV ** const svargs,
                                       const Size_t sv_count,
                                       bool * const maybe_tainted,
                                       const U32 flags)

=back

=back

=for hackers
sv_catpvf declared in embed.fnc; all in group documented at sv.c, line 11271
sv_catpvf_nocontext declared in embed.fnc
sv_catpvf_mg declared in embed.fnc
sv_catpvf_mg_nocontext declared in embed.fnc
sv_vcatpvf declared in embed.fnc
sv_vcatpvf_mg declared in embed.fnc
sv_vcatpvfn declared in embed.fnc
sv_vcatpvfn_flags declared in embed.fnc

=over 4

=item C<sv_catpvn*>

=item C<sv_catpvn_flags*>

=item C<sv_catpvn_mg*>

=item C<sv_catpvn_nomg*>

=item C<sv_catpvn_nomg_maybeutf8*>

=item C<sv_catpvs*>

=item C<sv_catpvs_flags*>

=item C<sv_catpvs_mg*>

=item C<sv_catpvs_nomg*>

Described under C<L</sv_catpv>>

=back

=over 4

=item C<sv_catsv>

=item C<sv_catsv_flags>

=item C<sv_catsv_mg>

=item C<sv_catsv_nomg>
X<sv_catsv>X<sv_catsv_flags>X<sv_catsv_mg>X<sv_catsv_nomg>

These concatenate the string from SV C<sstr> onto the end of the string in SV
C<dsv>.  If C<sstr> is null, these are no-ops; otherwise only C<dsv> is
modified.

They differ only in what magic they perform:

C<sv_catsv_mg> performs 'get' magic on both SVs before the copy, and 'set' magic
on C<dsv> afterwards.

C<sv_catsv> performs just 'get' magic, on both SVs.

C<sv_catsv_nomg> skips all magic.

C<sv_catsv_flags> has an extra C<flags> parameter which allows you to use
C<SV_GMAGIC> and/or C<SV_SMAGIC> to specify any combination of magic handling
(although either both or neither SV will have 'get' magic applied to it.)

C<sv_catsv>, C<sv_catsv_mg>, and C<sv_catsv_nomg> are implemented
in terms of C<sv_catsv_flags>.

=over 3

 void       sv_catsv      (      SV * const dsv, SV * const sstr)
 void  Perl_sv_catsv      (pTHX_ SV * const dsv, SV * const sstr)
 void       sv_catsv_flags(      SV * const dsv, SV * const sstr,
                                 const I32 flags)
 void  Perl_sv_catsv_flags(pTHX_ SV * const dsv, SV * const sstr,
                                 const I32 flags)
 void       sv_catsv_mg   (      SV * const dsv, SV * const sstr)
 void  Perl_sv_catsv_mg   (pTHX_ SV * const dsv, SV * const sstr)
 void       sv_catsv_nomg (      SV * const dsv, SV * const sstr)

=back

=back

=for hackers
sv_catsv declared in embed.fnc; all in group documented at sv.c, line 5718
sv_catsv_flags declared in embed.fnc
sv_catsv_mg declared in embed.fnc
sv_catsv_nomg declared at sv.h, line 2237

=over 4

=item C<SV_CHECK_THINKFIRST>
X<SV_CHECK_THINKFIRST>

Remove any encumbrances from C<sv>, that need to be taken care of before it
is modifiable.  For example if it is Copy on Write (COW), now is the time to
make that copy.

If you know that you are about to change the PV value of C<sv>, instead use
L</C<SV_CHECK_THINKFIRST_COW_DROP>> to avoid the write that would be
immediately written again.

=over 3

 void  SV_CHECK_THINKFIRST(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2196

=over 4

=item C<SV_CHECK_THINKFIRST_COW_DROP>
X<SV_CHECK_THINKFIRST_COW_DROP>

Call this when you are about to replace the PV value in C<sv>, which is
potentially copy-on-write.  It stops any sharing with other SVs, so that no
Copy on Write (COW) actually happens.  This COW would be useless, as it would
immediately get changed to something else.  This function also removes any
other encumbrances that would be problematic when changing C<sv>.

=over 3

 void  SV_CHECK_THINKFIRST_COW_DROP(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2166

=over 4

=item C<sv_chop>
X<sv_chop>

Efficient removal of characters from the beginning of the string buffer.
C<SvPOK(sv)>, or at least C<SvPOKp(sv)>, must be true and C<ptr> must be a
pointer to somewhere inside the string buffer.  C<ptr> becomes the first
character of the adjusted string.  Uses the C<OOK> hack.  On return, only
C<SvPOK(sv)> and C<SvPOKp(sv)> among the C<OK> flags will be true.

Beware: after this function returns, C<ptr> and SvPVX_const(sv) may no longer
refer to the same chunk of data.

The unfortunate similarity of this function's name to that of Perl's C<chop>
operator is strictly coincidental.  This function works from the left;
C<chop> works from the right.

=over 3

 void       sv_chop(      SV * const sv, const char * const ptr)
 void  Perl_sv_chop(pTHX_ SV * const sv, const char * const ptr)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 5514

=over 4

=item C<sv_clear>
X<sv_clear>

Clear an SV: call any destructors, free up any memory used by the body,
and free the body itself.  The SV's head is I<not> freed, although
its type is set to all 1's so that it won't inadvertently be assumed
to be live during global destruction etc.
This function should only be called when C<REFCNT> is zero.  Most of the time
you'll want to call C<SvREFCNT_dec> instead.

=over 3

 void       sv_clear(      SV * const orig_sv)
 void  Perl_sv_clear(pTHX_ SV * const orig_sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6715

=over 4

=item C<sv_cmp>

=item C<sv_cmp_flags>
X<sv_cmp>X<sv_cmp_flags>

These each compare the strings in two SVs,  returning -1, 0, or 1 indicating
whether the string in C<sv1> is less than, equal to, or greater than the string
in C<sv2>.  They are UTF-8 and S<C<'use bytes'>> aware, and will coerce their
arguments to strings if necessary.

C<sv_cmp> always handles 'get' magic.
C<sv_cmp_flags> only does so if C<flags> contains C<SV_GMAGIC>.
Otherwise, the two forms behave identically.

See also C<L</sv_cmp_locale>>.

=over 3

 I32       sv_cmp      (      SV * const sv1, SV * const sv2)
 I32  Perl_sv_cmp      (pTHX_ SV * const sv1, SV * const sv2)
 I32       sv_cmp_flags(      SV * const sv1, SV * const sv2,
                              const U32 flags)
 I32  Perl_sv_cmp_flags(pTHX_ SV * const sv1, SV * const sv2,
                              const U32 flags)

=back

=back

=for hackers
sv_cmp declared in embed.fnc; all in group documented at sv.c, line 8301
sv_cmp_flags declared in embed.fnc

=over 4

=item C<sv_cmp_locale>

=item C<sv_cmp_locale_flags>
X<sv_cmp_locale>X<sv_cmp_locale_flags>

These each compare the strings in two SVs in a locale-aware manner, returning
-1, 0, or 1 indicating whether the string in C<sv1> is less than, equal to, or
greater than the string in C<sv2>.

They are UTF-8 and S<C<'use bytes'>> aware, and will coerce their args to
strings if necessary.

C<sv_cmp_locale> always handles 'get' magic.
C<sv_cmp_locale_flags> only does so if C<flags> contains C<SV_GMAGIC>.
Otherwise, the two forms behave identically.

See also C<L</sv_cmp>>.

=over 3

 I32       sv_cmp_locale      (      SV * const sv1,
                                     SV * const sv2)
 I32  Perl_sv_cmp_locale      (pTHX_ SV * const sv1,
                                     SV * const sv2)
 I32       sv_cmp_locale_flags(      SV * const sv1,
                                     SV * const sv2,
                                     const U32 flags)
 I32  Perl_sv_cmp_locale_flags(pTHX_ SV * const sv1,
                                     SV * const sv2,
                                     const U32 flags)

=back

=back

=for hackers
sv_cmp_locale declared in embed.fnc; all in group documented at sv.c, line 8530
sv_cmp_locale_flags declared in embed.fnc

=over 4

=item C<sv_collxfrm>

=item C<sv_collxfrm_flags>
X<sv_collxfrm>X<sv_collxfrm_flags>

These each add Collate Transform magic to an SV if it doesn't already have it.

Any scalar variable may carry C<PERL_MAGIC_collxfrm> magic that contains the
scalar data of the variable, but transformed to such a format that a normal
memory comparison can be used to compare the data according to the locale
settings.

C<sv_collxfrm> always handles 'get' magic.
C<sv_collxfrm_flags> only does so if C<flags> contains C<SV_GMAGIC>.
Otherwise, the two forms behave identically.

=over 3

 char *       sv_collxfrm      (      SV * const sv,
                                      STRLEN * const nxp)
 char *  Perl_sv_collxfrm      (pTHX_ SV * const sv,
                                      STRLEN * const nxp)
 char *       sv_collxfrm_flags(      SV * const sv,
                                      STRLEN * const nxp,
                                      I32 const flags)
 char *  Perl_sv_collxfrm_flags(pTHX_ SV * const sv,
                                      STRLEN * const nxp,
                                      I32 const flags)

=back

=back

=for hackers
sv_collxfrm declared in embed.fnc; all in group documented at sv.c, line 8624
sv_collxfrm_flags declared in embed.fnc

=over 4

=item C<sv_copypv>

=item C<sv_copypv_flags>

=item C<sv_copypv_nomg>
X<sv_copypv>X<sv_copypv_flags>X<sv_copypv_nomg>

These copy a stringified representation of the source SV into the
destination SV.  They automatically perform coercion of numeric values into
strings.  Guaranteed to preserve the C<UTF8> flag even from overloaded objects.
Similar in nature to C<sv_2pv[_flags]> but they operate directly on an SV
instead of just the string.  Mostly they use L</C<sv_2pv_flags>> to
do the work, except when that would lose the UTF-8'ness of the PV.

The three forms differ only in whether or not they perform 'get magic' on
C<sv>.  C<sv_copypv_nomg> skips 'get magic'; C<sv_copypv> performs it; and
C<sv_copypv_flags> either performs it (if the C<SV_GMAGIC> bit is set in
C<flags>) or doesn't (if that bit is cleared).

=over 3

 void       sv_copypv      (      SV * const dsv, SV * const ssv)
 void  Perl_sv_copypv      (pTHX_ SV * const dsv, SV * const ssv)
 void       sv_copypv_flags(      SV * const dsv, SV * const ssv,
                                  const I32 flags)
 void  Perl_sv_copypv_flags(pTHX_ SV * const dsv, SV * const ssv,
                                  const I32 flags)
 void       sv_copypv_nomg (      SV * const dsv, SV * const ssv)

=back

=back

=for hackers
sv_copypv declared in embed.fnc; all in group documented at sv.c, line 3236
sv_copypv_flags declared in embed.fnc
sv_copypv_nomg declared in embed.fnc

=over 4

=item C<sv_dec>

=item C<sv_dec_nomg>
X<sv_dec>X<sv_dec_nomg>

These auto-decrement the value in the SV, doing string to numeric conversion
if necessary.  They both handle operator overloading.

They differ only in that:

C<sv_dec> handles 'get' magic; C<sv_dec_nomg> skips 'get' magic.

=over 3

 void       sv_dec     (      SV * const sv)
 void  Perl_sv_dec     (pTHX_ SV * const sv)
 void       sv_dec_nomg(      SV * const sv)
 void  Perl_sv_dec_nomg(pTHX_ SV * const sv)

=back

=back

=for hackers
sv_dec declared in embed.fnc; all in group documented at sv.c, line 9461
sv_dec_nomg declared in embed.fnc

=over 4

=item C<sv_derived_from>

=item C<sv_derived_from_hv>

=item C<sv_derived_from_pv>

=item C<sv_derived_from_pvn>

=item C<sv_derived_from_sv>
X<sv_derived_from>X<sv_derived_from_hv>X<sv_derived_from_pv>
X<sv_derived_from_pvn>X<sv_derived_from_sv>

These each return a boolean indicating whether C<sv> is derived from the
specified class I<at the C level>.  To check derivation at the Perl level, call
C<isa()> as a normal Perl method.

In C<sv_derived_from_hv>, the class name is C<HvNAME(hv)> (which would
presumably represent a stash).  Its UTF8ness is C<HvNAMEUTF8(hv)>.

In C<sv_derived_from> and C<sv_derived_from_pv>, the class name is given by
C<name>, which is a NUL-terminated C string.  In C<sv_derived_from>, the name
is never considered to be encoded as UTF-8.

The remaining forms differ only in how the class name is specified;
they all have a C<flags> parameter. Currently, the only significant value for
which is C<SVf_UTF8> to indicate that the class name is encoded as such.

In C<sv_derived_from_sv>, the class name is extracted from C<namesv>.
This is the preferred form.  The class name is considered to be in UTF-8 if
C<namesv> is marked as such.

In C<sv_derived_from_pvn>, C<len> gives the length of C<name>, so the latter
may contain embedded NUL characters.

=over 3

 bool       sv_derived_from    (      SV *sv,
                                      const char * const name)
 bool  Perl_sv_derived_from    (pTHX_ SV *sv,
                                      const char * const name)
 bool       sv_derived_from_hv (      SV *sv, HV *hv)
 bool  Perl_sv_derived_from_hv (pTHX_ SV *sv, HV *hv)
 bool       sv_derived_from_pv (      SV *sv,
                                      const char * const name,
                                      U32 flags)
 bool  Perl_sv_derived_from_pv (pTHX_ SV *sv,
                                      const char * const name,
                                      U32 flags)
 bool       sv_derived_from_pvn(      SV *sv,
                                      const char * const name,
                                      const STRLEN len, U32 flags)
 bool  Perl_sv_derived_from_pvn(pTHX_ SV *sv,
                                      const char * const name,
                                      const STRLEN len, U32 flags)
 bool       sv_derived_from_sv (      SV *sv, SV *namesv,
                                      U32 flags)
 bool  Perl_sv_derived_from_sv (pTHX_ SV *sv, SV *namesv,
                                      U32 flags)

=back

=back

=for hackers
sv_derived_from declared in embed.fnc; all in group documented at universal.c, line 126
sv_derived_from_hv declared in embed.fnc
sv_derived_from_pv declared in embed.fnc
sv_derived_from_pvn declared in embed.fnc
sv_derived_from_sv declared in embed.fnc

=over 4

=item C<sv_does>
X<sv_does>

Like L</sv_does_pv>, but doesn't take a C<flags> parameter.

=over 3

 bool       sv_does(      SV *sv, const char * const name)
 bool  Perl_sv_does(pTHX_ SV *sv, const char * const name)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 331

=over 4

=item C<sv_does_pv>
X<sv_does_pv>

Like L</sv_does_sv>, but takes a nul-terminated string instead of an SV.

=over 3

 bool       sv_does_pv(      SV *sv, const char * const name,
                             U32 flags)
 bool  Perl_sv_does_pv(pTHX_ SV *sv, const char * const name,
                             U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 346

=over 4

=item C<sv_does_pvn>
X<sv_does_pvn>

Like L</sv_does_sv>, but takes a string/length pair instead of an SV.

=over 3

 bool       sv_does_pvn(      SV *sv, const char * const name,
                              const STRLEN len, U32 flags)
 bool  Perl_sv_does_pvn(pTHX_ SV *sv, const char * const name,
                              const STRLEN len, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 362

=over 4

=item C<sv_does_sv>
X<sv_does_sv>

Returns a boolean indicating whether the SV performs a specific, named role.
The SV can be a Perl object or the name of a Perl class.

=over 3

 bool       sv_does_sv(      SV *sv, SV *namesv, U32 flags)
 bool  Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 265

=over 4

=item C<sv_eq>

=item C<sv_eq_flags>
X<sv_eq>X<sv_eq_flags>

These each return a boolean indicating whether or not the strings in the two
SVs are equal.  If S<C<'use bytes'>> is in effect, the comparison is
byte-by-byte; otherwise character-by-character.  Each will coerce its args to
strings if necessary.

They differ only in that C<sv_eq> always processes get magic, while
C<sv_eq_flags> processes get magic only when the C<flags> parameter has the
C<SV_GMAGIC> bit set.

These functions do not handle operator overloading.  For versions that do,
see instead C<L</sv_streq>> or C<L</sv_streq_flags>>.

=over 3

 I32       sv_eq      (      SV *sv1, SV *sv2)
 I32  Perl_sv_eq      (pTHX_ SV *sv1, SV *sv2)
 I32       sv_eq_flags(      SV *sv1, SV *sv2, const U32 flags)
 I32  Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)

=back

=back

=for hackers
sv_eq declared in embed.fnc; all in group documented at sv.c, line 8127
sv_eq_flags declared in embed.fnc

=over 4

=item C<sv_force_normal>

=item C<sv_force_normal_flags>
X<sv_force_normal>X<sv_force_normal_flags>

Undo various types of fakery on an SV, where fakery means
"more than" a string:

=over

=item if the PV is a shared string

make a private copy

=item if we're a ref

stop refing.  This is done by calling C<L</sv_unref_flags>>.
In C<sv_force_normal_flags>, the C<flags> parameter gets passed to
that function.

=item if we're a glob

downgrade to an C<xpvmg>;

=item if we're a copy-on-write scalar

this is the on-write time when we do the copy, and is also used locally

=item if this is a vstring

drop the vstring magic

=item in C<sv_force_normal_flags> if C<SV_COW_DROP_PV> is set in C<flags>

a copy-on-write scalar drops its PV buffer (if any) and becomes C<SvPOK_off>
rather than making a copy.  (Used where this scalar is about to be set to some
other value.)

=back

Other than what was mentioned above, the two forms behave identically.
This is because C<sv_force_normal> merely calls C<sv_force_normal_flags> with
C<flags> set to 0.

=over 3

 void       sv_force_normal      (      SV *sv)
 void  Perl_sv_force_normal      (pTHX_ SV *sv)
 void       sv_force_normal_flags(      SV * const sv,
                                        const U32 flags)
 void  Perl_sv_force_normal_flags(pTHX_ SV * const sv,
                                        const U32 flags)

=back

=back

=for hackers
sv_force_normal declared in embed.fnc; all in group documented at sv.c, line 5388
sv_force_normal_flags declared in embed.fnc

=over 4

=item C<sv_free>
X<sv_free>

Decrement an SV's reference count, and if it drops to zero, call
C<sv_clear> to invoke destructors and free up any memory used by
the body; finally, deallocating the SV's head itself.
Normally called via a wrapper macro C<SvREFCNT_dec>.

=over 3

 void       sv_free(      SV * const sv)
 void  Perl_sv_free(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 7315

=over 4

=item C<sv_get_backrefs>
X<sv_get_backrefs>

NOTE: C<sv_get_backrefs> is B<experimental> and may change or be
removed without notice.

If C<sv> is the target of a weak reference then it returns the back
references structure associated with the sv; otherwise return C<NULL>.

When returning a non-null result the type of the return is relevant. If it
is an AV then the elements of the AV are the weak reference RVs which
point at this item. If it is any other type then the item itself is the
weak reference.

See also C<Perl_sv_add_backref()>, C<Perl_sv_del_backref()>,
C<Perl_sv_kill_backrefs()>

=over 3

 SV *       sv_get_backrefs(SV * const sv)
 SV *  Perl_sv_get_backrefs(SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6177

=over 4

=item C<sv_gets>
X<sv_gets>

Get a line from the filehandle and store it into the SV, optionally
appending to the currently-stored string.  If C<append> is not 0, the
line is appended to the SV instead of overwriting it.  C<append> should
be set to the byte offset that the appended string should start at
in the SV (typically, C<SvCUR(sv)> is a suitable choice).

=over 3

 char *       sv_gets(      SV * const sv, PerlIO * const fp,
                            SSize_t append)
 char *  Perl_sv_gets(pTHX_ SV * const sv, PerlIO * const fp,
                            SSize_t append)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 8822

=over 4

=item C<sv_inc>

=item C<sv_inc_nomg>
X<sv_inc>X<sv_inc_nomg>

These auto-increment the value in the SV, doing string to numeric conversion
if necessary.  They both handle operator overloading.

They differ only in that C<sv_inc> performs 'get' magic; C<sv_inc_nomg> skips
any magic.

=over 3

 void       sv_inc     (      SV * const sv)
 void  Perl_sv_inc     (pTHX_ SV * const sv)
 void       sv_inc_nomg(      SV * const sv)
 void  Perl_sv_inc_nomg(pTHX_ SV * const sv)

=back

=back

=for hackers
sv_inc declared in embed.fnc; all in group documented at sv.c, line 9277
sv_inc_nomg declared in embed.fnc

=over 4

=item C<sv_insert>

=item C<sv_insert_flags>
X<sv_insert>X<sv_insert_flags>

These insert and/or replace a string at the specified offset/length within the
SV.  Similar to the Perl C<substr()> function, with C<littlelen> bytes starting
at C<little> replacing C<len> bytes of the string in C<bigstr> starting at
C<offset>.  They handle get magic.

C<sv_insert_flags> is identical to plain C<sv_insert>, but the extra C<flags>
are passed to the C<SvPV_force_flags> operation that is internally applied to
C<bigstr>.

=over 3

 void       sv_insert      (      SV * const bigstr,
                                  const STRLEN offset,
                                  const STRLEN len,
                                  const char * const little,
                                  const STRLEN littlelen)
 void  Perl_sv_insert      (pTHX_ SV * const bigstr,
                                  const STRLEN offset,
                                  const STRLEN len,
                                  const char * const little,
                                  const STRLEN littlelen)
 void       sv_insert_flags(      SV * const bigstr,
                                  const STRLEN offset,
                                  const STRLEN len,
                                  const char *little,
                                  const STRLEN littlelen,
                                  const U32 flags)
 void  Perl_sv_insert_flags(pTHX_ SV * const bigstr,
                                  const STRLEN offset,
                                  const STRLEN len,
                                  const char *little,
                                  const STRLEN littlelen,
                                  const U32 flags)

=back

=back

=for hackers
sv_insert declared in embed.fnc; all in group documented at sv.c, line 6510
sv_insert_flags declared in embed.fnc

=over 4

=item C<sv_isa>
X<sv_isa>

Returns a boolean indicating whether the SV is blessed into the specified
class.

This does not check for subtypes or method overloading. Use C<sv_isa_sv> to
verify an inheritance relationship in the same way as the C<isa> operator by
respecting any C<isa()> method overloading; or C<sv_derived_from_sv> to test
directly on the actual object type.

=over 3

 int       sv_isa(      SV *sv, const char * const name)
 int  Perl_sv_isa(pTHX_ SV *sv, const char * const name)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10696

=over 4

=item C<sv_isa_sv>
X<sv_isa_sv>

Returns a boolean indicating whether the SV is an object reference and is
derived from the specified class, respecting any C<isa()> method overloading
it may have. Returns false if C<sv> is not a reference to an object, or is
not derived from the specified class.

This is the function used to implement the behaviour of the C<isa> operator.

Does not invoke magic on C<sv>.

Not to be confused with the older C<sv_isa> function, which does not use an
overloaded C<isa()> method, nor will check subclassing.

=over 3

 bool       sv_isa_sv(      SV *sv, SV *namesv)
 bool  Perl_sv_isa_sv(pTHX_ SV *sv, SV *namesv)

=back

=back

=for hackers
Declared in embed.fnc; documented at universal.c, line 200

=over 4

=item C<sv_isobject>
X<sv_isobject>

Returns a boolean indicating whether the SV is an RV pointing to a blessed
object.  If the SV is not an RV, or if the object is not blessed, then this
will return false.

=over 3

 int       sv_isobject(      SV *sv)
 int  Perl_sv_isobject(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10672

=over 4

=item C<sv_len>
X<sv_len>

Returns the length of the string in the SV.  Handles magic and type
coercion and sets the UTF8 flag appropriately.  See also C<L</SvCUR>>, which
gives raw access to the C<xpv_cur> slot.

=over 3

 STRLEN       sv_len(      SV * const sv)
 STRLEN  Perl_sv_len(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 7408

=over 4

=item C<sv_len_utf8>

=item C<sv_len_utf8_nomg>
X<sv_len_utf8>X<sv_len_utf8_nomg>

These return the number of characters in the string in an SV, counting wide
UTF-8 bytes as a single character.  Both handle type coercion.
They differ only in that C<sv_len_utf8> performs 'get' magic;
C<sv_len_utf8_nomg> skips any magic.

=over 3

 STRLEN       sv_len_utf8     (      SV * const sv)
 STRLEN  Perl_sv_len_utf8     (pTHX_ SV * const sv)
 STRLEN       sv_len_utf8_nomg(      SV * const sv)
 STRLEN  Perl_sv_len_utf8_nomg(pTHX_ SV * const sv)

=back

=back

=for hackers
sv_len_utf8 declared in embed.fnc; all in group documented at sv.c, line 7430
sv_len_utf8_nomg declared in embed.fnc

=over 4

=item C<sv_magic>
X<sv_magic>

Adds magic to an SV.  First upgrades C<sv> to type C<SVt_PVMG> if
necessary, then adds a new magic item of type C<how> to the head of the
magic list.

See C<L</sv_magicext>> (which C<sv_magic> now calls) for a description of the
handling of the C<name> and C<namlen> arguments.

You need to use C<sv_magicext> to add magic to C<SvREADONLY> SVs and also
to add more than one instance of the same C<how>.

=over 3

 void       sv_magic(      SV * const sv, SV * const obj,
                           const int how, const char * const name,
                           const I32 namlen)
 void  Perl_sv_magic(pTHX_ SV * const sv, SV * const obj,
                           const int how, const char * const name,
                           const I32 namlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 5959

=over 4

=item C<sv_magicext>
X<sv_magicext>

Adds magic to an SV, upgrading it if necessary.  Applies the
supplied C<vtable> and returns a pointer to the magic added.

Note that C<sv_magicext> will allow things that C<sv_magic> will not.
In particular, you can add magic to C<SvREADONLY> SVs, and add more than
one instance of the same C<how>.

If C<namlen> is greater than zero then a C<savepvn> I<copy> of C<name> is
stored, if C<namlen> is zero then C<name> is stored as-is and - as another
special case - if C<(name && namlen == HEf_SVKEY)> then C<name> is assumed
to contain an SV* and is stored as-is with its C<REFCNT> incremented.

(This is now used as a subroutine by C<sv_magic>.)

=over 3

 MAGIC *       sv_magicext(      SV * const sv, SV * const obj,
                                 const int how,
                                 const MGVTBL * const vtbl,
                                 const char * const name,
                                 const I32 namlen)
 MAGIC *  Perl_sv_magicext(pTHX_ SV * const sv, SV * const obj,
                                 const int how,
                                 const MGVTBL * const vtbl,
                                 const char * const name,
                                 const I32 namlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 5854

=over 4

=item C<sv_mortalcopy>

=item C<sv_mortalcopy_flags>
X<sv_mortalcopy>X<sv_mortalcopy_flags>

These each create a new SV which is a copy of the original SV (using
C<L</sv_setsv>>).  The new SV is marked as mortal.  It will be destroyed
"soon", either by an
explicit call to C<FREETMPS>, or by an implicit call at places such as
statement boundaries.  See also C<L</sv_newmortal>> and C<L</sv_2mortal>>.

The two forms are identical, except C<sv_mortalcopy_flags> has an extra
C<flags> parameter, the contents of which are passed along to
C<L</sv_setsv_flags>>.

=over 3

 SV *       sv_mortalcopy      (      SV * const oldsv)
 SV *  Perl_sv_mortalcopy      (pTHX_ SV * const oldsv)
 SV *       sv_mortalcopy_flags(      SV * const oldsv, U32 flags)
 SV *  Perl_sv_mortalcopy_flags(pTHX_ SV * const oldsv, U32 flags)

=back

=back

=for hackers
sv_mortalcopy declared in embed.fnc; all in group documented at sv.c, line 9614
sv_mortalcopy_flags declared in embed.fnc

=over 4

=item C<sv_newmortal>
X<sv_newmortal>

Creates a new null SV which is mortal.  The reference count of the SV is
set to 1.  It will be destroyed "soon", either by an explicit call to
C<FREETMPS>, or by an implicit call at places such as statement boundaries.
See also C<L</sv_mortalcopy>> and C<L</sv_2mortal>>.

=over 3

 SV *       sv_newmortal()
 SV *  Perl_sv_newmortal(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9650

=over 4

=item C<sv_nolocking>
X<sv_nolocking>

C<B<DEPRECATED!>>  It is planned to remove C<sv_nolocking>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Dummy routine which "locks" an SV when there is no locking module present.
Exists to avoid test for a C<NULL> function pointer and because it could
potentially warn under some level of strict-ness.

"Superseded" by C<sv_nosharing()>.

=over 3

 void       sv_nolocking(      SV *sv)
 void  Perl_sv_nolocking(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mathoms.c, line 442

=over 4

=item C<sv_nounlocking>
X<sv_nounlocking>

C<B<DEPRECATED!>>  It is planned to remove C<sv_nounlocking>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

Dummy routine which "unlocks" an SV when there is no locking module present.
Exists to avoid test for a C<NULL> function pointer and because it could
potentially warn under some level of strict-ness.

"Superseded" by C<sv_nosharing()>.

=over 3

 void       sv_nounlocking(      SV *sv)
 void  Perl_sv_nounlocking(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at mathoms.c, line 463

=over 4

=item C<sv_numeq>

=item C<sv_numeq_flags>
X<sv_numeq>X<sv_numeq_flags>

These each return a boolean indicating whether the numbers in the two SV
arguments are identical.  Those arguments will be coerced to numbers if
necessary.  A C<NULL> SV is treated as C<undef>.

In C<sv_numeq_flags>, if C<flags> has the C<SV_GMAGIC> bit set, 'get' magic is
handled.

And unless C<flags> has the C<SV_SKIP_OVERLOAD> bit set, an attempt to use
C<==> overloading will be made. If such overloading does not exist or the flag
is set, then regular numerical comparison will be used instead.

C<sv_numeq> merely calls C<sv_numeq_flags> with just the C<SV_GMAGIC> bit set.
This function basically behaves like the Perl code C<$sv1 == $sv2>.

=over 3

 bool       sv_numeq      (      SV *sv1, SV *sv2)
 bool       sv_numeq_flags(      SV *sv1, SV *sv2,
                                 const U32 flags)
 bool  Perl_sv_numeq_flags(pTHX_ SV *sv1, SV *sv2,
                                 const U32 flags)

=back

=back

=for hackers
sv_numeq declared in embed.fnc; all in group documented at sv.c, line 8252
sv_numeq_flags declared in embed.fnc

=over 4

=item C<sv_pos_b2u>

=item C<sv_pos_b2u_flags>
X<sv_pos_b2u>X<sv_pos_b2u_flags>

These each count the number of UTF-8 encoded characters in the PV of C<sv>.
The entire PV is not necessarily looked at, just the first so-many bytes.
The byte count is given by C<*offsetp> in C<sv_pos_b2u>, and by C<offset> in
C<sv_pos_b2u_flags>.

The caller must ensure that the PV contains at least as many bytes as the count
passed in.

C<sv_pos_b2u> returns C<void>, instead updating C<*offsetp> to the character
count.
C<sv_pos_b2u_flags> returns the character count.

C<sv_pos_b2u_flags> is preferred as C<offsetp> is a C<*I32>, which limits the
size it can handle to 2Gb.

Both handle type coercion.

C<sv_pos_b2u> always handles 'get' magic.
C<sv_pos_b2u_flags> only handles 'get' magic when C<flags> contains
C<SV_GMAGIC>.

In fact, C<sv_pos_b2u_flags> passes C<flags> to C<SvPV_flags>, and C<flags>
usually should be C<SV_GMAGIC|SV_CONST_RETURN>.
C<sv_pos_b2u> automatically causes C<SV_CONST_RETURN> to be passed to
C<SvPV_flags>.

Both functions use and update C<PERL_MAGIC_utf8>.

=over 3

 void         sv_pos_b2u      (      SV * const sv,
                                     I32 * const offsetp)
 void    Perl_sv_pos_b2u      (pTHX_ SV * const sv,
                                     I32 * const offsetp)
 STRLEN       sv_pos_b2u_flags(      SV * const sv,
                                     STRLEN const offset,
                                     U32 flags)
 STRLEN  Perl_sv_pos_b2u_flags(pTHX_ SV * const sv,
                                     STRLEN const offset,
                                     U32 flags)

=back

=back

=for hackers
sv_pos_b2u declared in embed.fnc; all in group documented at sv.c, line 7960
sv_pos_b2u_flags declared in embed.fnc

=over 4

=item C<sv_pos_u2b>

=item C<sv_pos_u2b_flags>
X<sv_pos_u2b>X<sv_pos_u2b_flags>

These each find out how many bytes are occupied by the first so-many
UTF-8-encoded characters in the PV of C<sv>.  The character count is passed by
C<*offsetp> in C<sv_pos_u2b>, and by C<uoffset> in C<sv_pos_u2b_flags>.

Optionally, they also count how many bytes are in the next so-many
UTF-8-encoded characters.  This option is chosen in both functions by passing a
non-NULL C<lenp> to them, and setting C<*lenp> to the desired character count.
The functions update C<*lenp> with the byte count.

C<sv_pos_u2b> returns C<void>, instead updating C<*offsetp> to the byte count.
C<sv_pos_u2b_flags> returns the byte count.

C<sv_pos_u2b_flags> is preferred as C<offsetp> is a C<*I32>, which limits the
size it can handle to 2Gb.

Both handle type coercion.

C<sv_pos_u2b> always handles 'get' magic.
C<sv_pos_u2b_flags> only handles 'get' magic when C<flags> contains
C<SV_GMAGIC>.

In fact, C<sv_pos_u2b_flags> passes C<flags> to C<SvPV_flags>, and C<flags>
usually should be C<SV_GMAGIC|SV_CONST_RETURN>.
C<sv_pos_u2b> automatically causes C<SV_CONST_RETURN> to be passed to
C<SvPV_flags>.

Both functions use and update C<PERL_MAGIC_utf8>.

=over 3

 void         sv_pos_u2b      (      SV * const sv,
                                     I32 * const offsetp,
                                     I32 * const lenp)
 void    Perl_sv_pos_u2b      (pTHX_ SV * const sv,
                                     I32 * const offsetp,
                                     I32 * const lenp)
 STRLEN       sv_pos_u2b_flags(      SV * const sv,
                                     STRLEN uoffset,
                                     STRLEN * const lenp,
                                     U32 flags)
 STRLEN  Perl_sv_pos_u2b_flags(pTHX_ SV * const sv,
                                     STRLEN uoffset,
                                     STRLEN * const lenp,
                                     U32 flags)

=back

=back

=for hackers
sv_pos_u2b declared in embed.fnc; all in group documented at sv.c, line 7674
sv_pos_u2b_flags declared in embed.fnc

=over 4

=item C<sv_pvn_force_flags>
X<sv_pvn_force_flags>

Get a sensible string out of the SV somehow.
If C<flags> has the C<SV_GMAGIC> bit set, will C<L</mg_get>> on C<sv> if
appropriate, else not.  C<sv_pvn_force> and C<sv_pvn_force_nomg> are
implemented in terms of this function.
You normally want to use the various wrapper macros instead: see
C<L</SvPV_force>> and C<L</SvPV_force_nomg>>.

=over 3

 char *       sv_pvn_force_flags(      SV * const sv,
                                       STRLEN * const lp,
                                       const U32 flags)
 char *  Perl_sv_pvn_force_flags(pTHX_ SV * const sv,
                                       STRLEN * const lp,
                                       const U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10472

=over 4

=item C<sv_ref>
X<sv_ref>

Returns a SV describing what the SV passed in is a reference to.

dst can be a SV to be set to the description or NULL, in which case a
mortal SV is returned.

If ob is true and the SV is blessed, the description is the class
name, otherwise it is the type of the SV, "SCALAR", "ARRAY" etc.

=over 3

 SV *       sv_ref(      SV *dst, const SV * const sv,
                         const int ob)
 SV *  Perl_sv_ref(pTHX_ SV *dst, const SV * const sv,
                         const int ob)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10637

=over 4

=item C<sv_reftype>
X<sv_reftype>

Returns a string describing what the SV is a reference to.

If ob is true and the SV is blessed, the string is the class name,
otherwise it is the type of the SV, "SCALAR", "ARRAY" etc.

=over 3

 const char *       sv_reftype(      const SV * const sv,
                                     const int ob)
 const char *  Perl_sv_reftype(pTHX_ const SV * const sv,
                                     const int ob)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10575

=over 4

=item C<sv_replace>
X<sv_replace>

Make the first argument a copy of the second, then delete the original.
The target SV physically takes over ownership of the body of the source SV
and inherits its flags; however, the target keeps any magic it owns,
and any magic in the source is discarded.
Note that this is a rather specialist SV copying operation; most of the
time you'll want to use C<sv_setsv> or one of its many macro front-ends.

=over 3

 void       sv_replace(      SV * const sv, SV * const nsv)
 void  Perl_sv_replace(pTHX_ SV * const sv, SV * const nsv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6618

=over 4

=item C<sv_report_used>
X<sv_report_used>

Dump the contents of all SVs not yet freed (debugging aid).

=over 3

 void       sv_report_used()
 void  Perl_sv_report_used(pTHX)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 417

=over 4

=item C<sv_reset>
X<sv_reset>

Underlying implementation for the C<reset> Perl function.
Note that the perl-level function is vaguely deprecated.

=over 3

 void       sv_reset(      const char *s, HV * const stash)
 void  Perl_sv_reset(pTHX_ const char *s, HV * const stash)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10197

=over 4

=item C<sv_rvunweaken>
X<sv_rvunweaken>

Unweaken a reference: Clear the C<SvWEAKREF> flag on this RV; remove
the backreference to this RV from the array of backreferences
associated with the target SV, increment the refcount of the target.
Silently ignores C<undef> and warns on non-weak references.

=over 3

 SV *       sv_rvunweaken(      SV * const sv)
 SV *  Perl_sv_rvunweaken(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6141

=over 4

=item C<sv_rvweaken>
X<sv_rvweaken>

Weaken a reference: set the C<SvWEAKREF> flag on this RV; give the
referred-to SV C<PERL_MAGIC_backref> magic if it hasn't already; and
push a back-reference to this RV onto the array of backreferences
associated with that magic.  If the RV is magical, set magic will be
called after the RV is cleared.  Silently ignores C<undef> and warns
on already-weak references.

=over 3

 SV *       sv_rvweaken(      SV * const sv)
 SV *  Perl_sv_rvweaken(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6105

=over 4

=item C<sv_set_bool>
X<sv_set_bool>

Equivalent to C<sv_setsv(sv, bool_val ? &Pl_sv_yes : &PL_sv_no)>, but
may be made more efficient in the future. Doesn't handle set magic.

The perl equivalent is C<$sv = !!$expr;>.

Introduced in perl 5.35.11.

=over 3

 void       sv_set_bool(      SV *sv, const bool bool_val)
 void  Perl_sv_set_bool(pTHX_ SV *sv, const bool bool_val)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 4876

=over 4

=item C<sv_set_false>
X<sv_set_false>

Equivalent to C<sv_setsv(sv, &PL_sv_no)>, but may be made more
efficient in the future. Doesn't handle set magic.

The perl equivalent is C<$sv = !1;>.

Introduced in perl 5.35.11.

=over 3

 void       sv_set_false(      SV *sv)
 void  Perl_sv_set_false(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 4856

=over 4

=item C<sv_set_true>
X<sv_set_true>

Equivalent to C<sv_setsv(sv, &PL_sv_yes)>, but may be made more
efficient in the future. Doesn't handle set magic.

The perl equivalent is C<$sv = !0;>.

Introduced in perl 5.35.11.

=over 3

 void       sv_set_true(      SV *sv)
 void  Perl_sv_set_true(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 4836

=over 4

=item C<sv_set_undef>
X<sv_set_undef>

Equivalent to C<sv_setsv(sv, &PL_sv_undef)>, but more efficient.
Doesn't handle set magic.

The perl equivalent is C<$sv = undef;>. Note that it doesn't free any string
buffer, unlike C<undef $sv>.

Introduced in perl 5.25.12.

=over 3

 void       sv_set_undef(      SV *sv)
 void  Perl_sv_set_undef(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 4776

=over 4

=item C<sv_setbool>

=item C<sv_setbool_mg>
X<sv_setbool>X<sv_setbool_mg>

These set an SV to a true or false boolean value, upgrading first if necessary.

They differ only in that C<sv_setbool_mg> handles 'set' magic; C<sv_setbool>
does not.

=over 3

 void  sv_setbool   (SV *sv, bool b)
 void  sv_setbool_mg(SV *sv, bool b)

=back

=back

=for hackers
sv_setbool declared at sv.h, line 2480; all in group documented at sv.h, line 2480
sv_setbool_mg declared at sv.h, line 2481

=over 4

=item C<sv_setiv>

=item C<sv_setiv_mg>
X<sv_setiv>X<sv_setiv_mg>

These copy an integer into the given SV, upgrading first if necessary.

They differ only in that C<sv_setiv_mg> handles 'set' magic; C<sv_setiv> does
not.

=over 3

 void       sv_setiv   (      SV * const sv, const IV num)
 void  Perl_sv_setiv   (pTHX_ SV * const sv, const IV num)
 void       sv_setiv_mg(      SV * const sv, const IV i)
 void  Perl_sv_setiv_mg(pTHX_ SV * const sv, const IV i)

=back

=back

=for hackers
sv_setiv declared in embed.fnc; all in group documented at sv.c, line 1498
sv_setiv_mg declared in embed.fnc

=over 4

=item C<sv_setnv>

=item C<sv_setnv_mg>
X<sv_setnv>X<sv_setnv_mg>

These copy a double into the given SV, upgrading first if necessary.

They differ only in that C<sv_setnv_mg> handles 'set' magic; C<sv_setnv> does
not.

=over 3

 void       sv_setnv   (      SV * const sv, const NV num)
 void  Perl_sv_setnv   (pTHX_ SV * const sv, const NV num)
 void       sv_setnv_mg(      SV * const sv, const NV num)
 void  Perl_sv_setnv_mg(pTHX_ SV * const sv, const NV num)

=back

=back

=for hackers
sv_setnv declared in embed.fnc; all in group documented at sv.c, line 1615
sv_setnv_mg declared in embed.fnc

=over 4

=item C<sv_setpv>

=item C<sv_setpv_mg>

=item C<sv_setpvn>

=item C<sv_setpvn_fresh>

=item C<sv_setpvn_mg>

=item C<sv_setpvs>

=item C<sv_setpvs_mg>
X<sv_setpv>X<sv_setpv_mg>X<sv_setpvn>X<sv_setpvn_fresh>X<sv_setpvn_mg>
X<sv_setpvs>X<sv_setpvs_mg>

These copy a string into the SV C<sv>, making sure it is C<L</SvPOK_only>>.

In the C<pvs> forms, the string must be a C literal string, enclosed in double
quotes.

In the C<pvn> forms, the first byte of the string is pointed to by C<ptr>, and
C<len> indicates the number of bytes to be copied, potentially including
embedded C<NUL> characters.

In the plain C<pv> forms, C<ptr> points to a NUL-terminated C string.  That is,
it points to the first byte of the string, and the copy proceeds up through the
first encountered C<NUL> byte.

In the forms that take a C<ptr> argument, if it is NULL, the SV will become
undefined.

B<The UTF-8 flag is not changed by these functions.>

A terminating NUL byte is guaranteed in the result.

The C<_mg> forms handle 'set' magic; the other forms skip all magic.

C<sv_setpvn_fresh> is a cut-down alternative to C<sv_setpvn>, intended ONLY
to be used with a fresh sv that has been upgraded to a SVt_PV, SVt_PVIV,
SVt_PVNV, or SVt_PVMG.

=over 3

 void       sv_setpv       (      SV * const sv,
                                  const char * const ptr)
 void  Perl_sv_setpv       (pTHX_ SV * const sv,
                                  const char * const ptr)
 void       sv_setpv_mg    (      SV * const sv,
                                  const char * const ptr)
 void  Perl_sv_setpv_mg    (pTHX_ SV * const sv,
                                  const char * const ptr)
 void       sv_setpvn      (      SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void  Perl_sv_setpvn      (pTHX_ SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void       sv_setpvn_fresh(      SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void  Perl_sv_setpvn_fresh(pTHX_ SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void       sv_setpvn_mg   (      SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void  Perl_sv_setpvn_mg   (pTHX_ SV * const sv,
                                  const char * const ptr,
                                  const STRLEN len)
 void       sv_setpvs      (      SV *const sv, "literal string")
 void       sv_setpvs_mg   (      SV *const sv, "literal string")

=back

=back

=for hackers
sv_setpv declared in embed.fnc; all in group documented at sv.c, line 5022
sv_setpv_mg declared in embed.fnc
sv_setpvn declared in embed.fnc
sv_setpvn_fresh declared in embed.fnc
sv_setpvn_mg declared in embed.fnc
sv_setpvs declared at handy.h, line 436
sv_setpvs_mg declared at handy.h, line 437

=over 4

=item C<sv_setpv_bufsize>
X<sv_setpv_bufsize>

Sets the SV to be a string of C<cur> bytes length, with at least
C<len> bytes available.   Ensures that there is a null byte at C<SvEND>.

Returns a char * pointer to the SvPV buffer.

The caller must set the first C<cur> bytes of C<sv> before the first use of its
contents.  This means that if C<cur> is zero, the SV is immediately fully
formed and ready to use, just like any other SV containing an empty string.

=over 3

 char  *       sv_setpv_bufsize(      SV * const sv,
                                      const STRLEN cur,
                                      const STRLEN len)
 char  *  Perl_sv_setpv_bufsize(pTHX_ SV * const sv,
                                      const STRLEN cur,
                                      const STRLEN len)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 4988

=over 4

=item C<sv_setpv_mg*>

Described under C<L</sv_setpv>>

=back

=over 4

=item C<sv_setpvf>

=item C<sv_setpvf_mg>

=item C<sv_setpvf_mg_nocontext>

=item C<sv_setpvf_nocontext>
X<sv_setpvf>X<sv_setpvf_mg>X<sv_setpvf_mg_nocontext>X<sv_setpvf_nocontext>

These work like C<L</sv_catpvf>> but copy the text into the SV instead of
appending it.

The differences between these are:

C<sv_setpvf_mg> and C<sv_setpvf_mg_nocontext> perform 'set' magic; C<sv_setpvf>
and C<sv_setpvf_nocontext> skip all magic.

C<sv_setpvf_nocontext> and C<sv_setpvf_mg_nocontext> do not take a thread
context (C<aTHX>) parameter, so are used in situations where the caller
doesn't already have the thread context.

B<The UTF-8 flag is not changed by these functions.>

=over 3

 void  Perl_sv_setpvf             (pTHX_ SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_setpvf_mg          (pTHX_ SV * const sv,
                                         const char * const pat,
                                         ...)
 void       sv_setpvf_mg_nocontext(      SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_setpvf_mg_nocontext(      SV * const sv,
                                         const char * const pat,
                                         ...)
 void       sv_setpvf_nocontext   (      SV * const sv,
                                         const char * const pat,
                                         ...)
 void  Perl_sv_setpvf_nocontext   (      SV * const sv,
                                         const char * const pat,
                                         ...)

=back

=back

=for hackers
sv_setpvf declared in embed.fnc; all in group documented at sv.c, line 11149
sv_setpvf_mg declared in embed.fnc
sv_setpvf_mg_nocontext declared in embed.fnc
sv_setpvf_nocontext declared in embed.fnc

=over 4

=item C<sv_setpvn*>

=item C<sv_setpvn_fresh*>

=item C<sv_setpvn_mg*>

=item C<sv_setpvs*>

=item C<sv_setpvs_mg*>

Described under C<L</sv_setpv>>

=back

=over 4

=item C<sv_setref_iv>
X<sv_setref_iv>

Copies an integer into a new SV, optionally blessing the SV.  The C<rv>
argument will be upgraded to an RV.  That RV will be modified to point to
the new SV.  The C<classname> argument indicates the package for the
blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
will have a reference count of 1, and the RV will be returned.

=over 3

 SV *       sv_setref_iv(      SV * const rv,
                               const char * const classname,
                               const IV iv)
 SV *  Perl_sv_setref_iv(pTHX_ SV * const rv,
                               const char * const classname,
                               const IV iv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10825

=over 4

=item C<sv_setref_nv>
X<sv_setref_nv>

Copies a double into a new SV, optionally blessing the SV.  The C<rv>
argument will be upgraded to an RV.  That RV will be modified to point to
the new SV.  The C<classname> argument indicates the package for the
blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
will have a reference count of 1, and the RV will be returned.

=over 3

 SV *       sv_setref_nv(      SV * const rv,
                               const char * const classname,
                               const NV nv)
 SV *  Perl_sv_setref_nv(pTHX_ SV * const rv,
                               const char * const classname,
                               const NV nv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10867

=over 4

=item C<sv_setref_pv>
X<sv_setref_pv>

Copies a pointer into a new SV, optionally blessing the SV.  The C<rv>
argument will be upgraded to an RV.  That RV will be modified to point to
the new SV.  If the C<pv> argument is C<NULL>, then C<PL_sv_undef> will be placed
into the SV.  The C<classname> argument indicates the package for the
blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
will have a reference count of 1, and the RV will be returned.

Do not use with other Perl types such as HV, AV, SV, CV, because those
objects will become corrupted by the pointer copy process.

Note that C<sv_setref_pvn> copies the string while this copies the pointer.

=over 3

 SV *       sv_setref_pv(      SV * const rv,
                               const char * const classname,
                               void * const pv)
 SV *  Perl_sv_setref_pv(pTHX_ SV * const rv,
                               const char * const classname,
                               void * const pv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10793

=over 4

=item C<sv_setref_pvn>
X<sv_setref_pvn>

Copies a string into a new SV, optionally blessing the SV.  The length of the
string must be specified with C<n>.  The C<rv> argument will be upgraded to
an RV.  That RV will be modified to point to the new SV.  The C<classname>
argument indicates the package for the blessing.  Set C<classname> to
C<NULL> to avoid the blessing.  The new SV will have a reference count
of 1, and the RV will be returned.

Note that C<sv_setref_pv> copies the pointer while this copies the string.

=over 3

 SV *       sv_setref_pvn(      SV * const rv,
                                const char * const classname,
                                const char * const pv,
                                const STRLEN n)
 SV *  Perl_sv_setref_pvn(pTHX_ SV * const rv,
                                const char * const classname,
                                const char * const pv,
                                const STRLEN n)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10888

=over 4

=item C<sv_setref_pvs>
X<sv_setref_pvs>

Like C<sv_setref_pvn>, but takes a literal string instead of
a string/length pair.

=over 3

 SV *  sv_setref_pvs(SV *const rv, const char *const classname,
                     "literal string")

=back

=back

=for hackers
Declared and documented at handy.h, line 388

=over 4

=item C<sv_setref_uv>
X<sv_setref_uv>

Copies an unsigned integer into a new SV, optionally blessing the SV.  The C<rv>
argument will be upgraded to an RV.  That RV will be modified to point to
the new SV.  The C<classname> argument indicates the package for the
blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
will have a reference count of 1, and the RV will be returned.

=over 3

 SV *       sv_setref_uv(      SV * const rv,
                               const char * const classname,
                               const UV uv)
 SV *  Perl_sv_setref_uv(pTHX_ SV * const rv,
                               const char * const classname,
                               const UV uv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10846

=over 4

=item C<sv_setrv_inc>

=item C<sv_setrv_inc_mg>
X<sv_setrv_inc>X<sv_setrv_inc_mg>

As C<sv_setrv_noinc> but increments the reference count of I<ref>.

C<sv_setrv_inc_mg> will invoke 'set' magic on the SV; C<sv_setrv_inc> will
not.

=over 3

 void       sv_setrv_inc   (      SV * const sv, SV * const ref)
 void  Perl_sv_setrv_inc   (pTHX_ SV * const sv, SV * const ref)
 void       sv_setrv_inc_mg(      SV * const sv, SV * const ref)
 void  Perl_sv_setrv_inc_mg(pTHX_ SV * const sv, SV * const ref)

=back

=back

=for hackers
sv_setrv_inc declared in embed.fnc; all in group documented at sv.c, line 1716
sv_setrv_inc_mg declared in embed.fnc

=over 4

=item C<sv_setrv_noinc>

=item C<sv_setrv_noinc_mg>
X<sv_setrv_noinc>X<sv_setrv_noinc_mg>

Copies an SV pointer into the given SV as an SV reference, upgrading it if
necessary. After this, C<SvRV(sv)> is equal to I<ref>. This does not adjust
the reference count of I<ref>. The reference I<ref> must not be NULL.

C<sv_setrv_noinc_mg> will invoke 'set' magic on the SV; C<sv_setrv_noinc> will
not.

=over 3

 void       sv_setrv_noinc   (      SV * const sv, SV * const ref)
 void  Perl_sv_setrv_noinc   (pTHX_ SV * const sv, SV * const ref)
 void       sv_setrv_noinc_mg(      SV * const sv, SV * const ref)
 void  Perl_sv_setrv_noinc_mg(pTHX_ SV * const sv, SV * const ref)

=back

=back

=for hackers
sv_setrv_noinc declared in embed.fnc; all in group documented at sv.c, line 1680
sv_setrv_noinc_mg declared in embed.fnc

=over 4

=item C<sv_setsv>

=item C<sv_setsv_flags>

=item C<sv_setsv_mg>

=item C<sv_setsv_nomg>
X<sv_setsv>X<sv_setsv_flags>X<sv_setsv_mg>X<sv_setsv_nomg>

These copy the contents of the source SV C<ssv> into the destination SV C<dsv>.
C<ssv> may be destroyed if it is mortal, so don't use these functions if
the source SV needs to be reused.
Loosely speaking, they perform a copy-by-value, obliterating any previous
content of the destination.

They differ only in that:

C<sv_setsv> calls 'get' magic on C<ssv>, but skips 'set' magic on C<dsv>.

C<sv_setsv_mg> calls both 'get' magic on C<ssv> and 'set' magic on C<dsv>.

C<sv_setsv_nomg> skips all magic.

C<sv_setsv_flags> has a C<flags> parameter which you can use to specify any
combination of magic handling, and also you can specify C<SV_NOSTEAL> so that
the buffers of temps will not be stolen.

You probably want to instead use one of the assortment of wrappers, such as
C<L</SvSetSV>>, C<L</SvSetSV_nosteal>>, C<L</SvSetMagicSV>> and
C<L</SvSetMagicSV_nosteal>>.

C<sv_setsv_flags> is the primary function for copying scalars, and most other
copy-ish functions and macros use it underneath.

=over 3

 void       sv_setsv      (      SV *dsv, SV *ssv)
 void  Perl_sv_setsv      (pTHX_ SV *dsv, SV *ssv)
 void       sv_setsv_flags(      SV *dsv, SV *ssv,
                                 const I32 flags)
 void  Perl_sv_setsv_flags(pTHX_ SV *dsv, SV *ssv,
                                 const I32 flags)
 void       sv_setsv_mg   (      SV * const dsv, SV * const ssv)
 void  Perl_sv_setsv_mg   (pTHX_ SV * const dsv, SV * const ssv)
 void       sv_setsv_nomg (      SV *dsv, SV *ssv)

=back

=back

=for hackers
sv_setsv declared in embed.fnc; all in group documented at sv.c, line 3757
sv_setsv_flags declared in embed.fnc
sv_setsv_mg declared in embed.fnc
sv_setsv_nomg declared at sv.h, line 2236

=over 4

=item C<sv_setuv>

=item C<sv_setuv_mg>
X<sv_setuv>X<sv_setuv_mg>

These copy an unsigned integer into the given SV, upgrading first if necessary.


They differ only in that C<sv_setuv_mg> handles 'set' magic; C<sv_setuv> does
not.

=over 3

 void       sv_setuv   (      SV * const sv, const UV num)
 void  Perl_sv_setuv   (pTHX_ SV * const sv, const UV num)
 void       sv_setuv_mg(      SV * const sv, const UV u)
 void  Perl_sv_setuv_mg(pTHX_ SV * const sv, const UV u)

=back

=back

=for hackers
sv_setuv declared in embed.fnc; all in group documented at sv.c, line 1568
sv_setuv_mg declared in embed.fnc

=over 4

=item C<sv_streq>

=item C<sv_streq_flags>
X<sv_streq>X<sv_streq_flags>

These each return a boolean indicating whether the strings in the two SVs are
identical.

C<sv_streq_flags> is the more general form, having a C<flags> argument that
affects its behavior in two ways.  It coerces its args to strings if necessary,
treating a C<NULL> argument as C<undef>.  It correctly handles the UTF8 flag.

If C<flags> has the C<SV_GMAGIC> bit set, 'get' magic will be handled.

If flags does not have the C<SV_SKIP_OVERLOAD> bit set, an attempt to use
C<eq> overloading will be made. If such overloading does not exist or the
flag is set, then regular string comparison will be used instead.

C<sv_streq> merely calls C<sv_streq_flags> with C<flags> set to just
C<SV_GMAGIC>. This function basically behaves like the Perl code
S<C<$sv1 eq $sv2>>.

=over 3

 bool       sv_streq      (      SV *sv1, SV *sv2)
 bool       sv_streq_flags(      SV *sv1, SV *sv2,
                                 const U32 flags)
 bool  Perl_sv_streq_flags(pTHX_ SV *sv1, SV *sv2,
                                 const U32 flags)

=back

=back

=for hackers
sv_streq declared in embed.fnc; all in group documented at sv.c, line 8197
sv_streq_flags declared in embed.fnc

=over 4

=item C<sv_unmagic>
X<sv_unmagic>

Removes all magic of type C<type> from an SV.

=over 3

 int       sv_unmagic(      SV * const sv, const int type)
 int  Perl_sv_unmagic(pTHX_ SV * const sv, const int type)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6075

=over 4

=item C<sv_unmagicext>
X<sv_unmagicext>

Removes all magic of type C<type> with the specified C<vtbl> from an SV.

=over 3

 int       sv_unmagicext(      SV * const sv, const int type,
                               const MGVTBL *vtbl)
 int  Perl_sv_unmagicext(pTHX_ SV * const sv, const int type,
                               const MGVTBL *vtbl)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 6090

=over 4

=item C<sv_unref>

=item C<sv_unref_flags>
X<sv_unref>X<sv_unref_flags>

These each unset the RV status of the SV, and decrement the reference count of
whatever was being referenced by the RV.  This can almost be thought of
as a reversal of C<L</newSVrv>>.

C<sv_unref_flags> has an extra parameter, C<flags>, which can contain
the C<SV_IMMEDIATE_UNREF> bit to force the reference count to be decremented 
no matter what.

When that bit isn't set, or with plain C<sv_unref> always, the reference count
will not be immediately decremented if the count is 1.  Instead, it will be
scheduled to be freed at a time of perl's choosing.

Other than the ability to force immediate action, the two forms behave
identically.

See C<L</SvROK_off>>.

=over 3

 void       sv_unref      (      SV *sv)
 void  Perl_sv_unref      (pTHX_ SV *sv)
 void       sv_unref_flags(      SV * const ref, const U32 flags)
 void  Perl_sv_unref_flags(pTHX_ SV * const ref, const U32 flags)

=back

=back

=for hackers
sv_unref declared in embed.fnc; all in group documented at sv.c, line 11018
sv_unref_flags declared in embed.fnc

=over 4

=item C<sv_upgrade>
X<sv_upgrade>

Upgrade an SV to a more complex form.  Generally adds a new body type to the
SV, then copies across as much information as possible from the old body.
It croaks if the SV is already in a more complex form than requested.  You
generally want to use the C<SvUPGRADE> macro wrapper, which checks the type
before calling C<sv_upgrade>, and hence does not croak.  See also
C<L</svtype>>.

=over 3

 void       sv_upgrade(      SV * const sv, svtype new_type)
 void  Perl_sv_upgrade(pTHX_ SV * const sv, svtype new_type)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 947

=over 4

=item C<sv_usepvn>

=item C<sv_usepvn_flags>

=item C<sv_usepvn_mg>
X<sv_usepvn>X<sv_usepvn_flags>X<sv_usepvn_mg>

These tell an SV to use C<ptr> for its string value.  Normally SVs have
their string stored inside the SV, but these tell the SV to use an
external string instead.

C<ptr> should point to memory that was allocated
by L</C<Newx>>.  It must be
the start of a C<Newx>-ed block of memory, and not a pointer to the
middle of it (beware of L<C<OOK>|perlguts/Offsets> and copy-on-write),
and not be from a non-C<Newx> memory allocator like C<malloc>.  The
string length, C<len>, must be supplied.  By default this function
will L</C<Renew>> (i.e. realloc, move) the memory pointed to by C<ptr>,
so that the pointer should not be freed or used by the programmer after giving
it to C<sv_usepvn>, and neither should any pointers from "behind" that pointer
(I<e.g.>, S<C<ptr> + 1>) be used.

In the C<sv_usepvn_flags> form, if S<C<flags & SV_SMAGIC>> is true,
C<SvSETMAGIC> is called before returning.
And if S<C<flags & SV_HAS_TRAILING_NUL>> is true, then C<ptr[len]> must be
C<NUL>, and the realloc will be skipped (I<i.e.>, the buffer is actually at
least 1 byte longer than C<len>, and already meets the requirements for storing
in C<SvPVX>).

C<sv_usepvn> is merely C<sv_usepvn_flags> with C<flags> set to 0, so 'set'
magic is skipped.

C<sv_usepvn_mg> is merely C<sv_usepvn_flags> with C<flags> set to C<SV_SMAGIC>,
so 'set' magic is performed.

=over 3

 void       sv_usepvn      (      SV *sv, char *ptr, STRLEN len)
 void  Perl_sv_usepvn      (pTHX_ SV *sv, char *ptr, STRLEN len)
 void       sv_usepvn_flags(      SV * const sv, char *ptr,
                                  const STRLEN len,
                                  const U32 flags)
 void  Perl_sv_usepvn_flags(pTHX_ SV * const sv, char *ptr,
                                  const STRLEN len,
                                  const U32 flags)
 void       sv_usepvn_mg   (      SV *sv, char *ptr, STRLEN len)
 void  Perl_sv_usepvn_mg   (pTHX_ SV *sv, char *ptr, STRLEN len)

=back

=back

=for hackers
sv_usepvn declared in embed.fnc; all in group documented at sv.c, line 5204
sv_usepvn_flags declared in embed.fnc
sv_usepvn_mg declared in embed.fnc

=over 4

=item C<sv_utf8_decode>
X<sv_utf8_decode>

If the PV of the SV is an octet sequence in Perl's extended UTF-8
and contains a multiple-byte character, the C<SvUTF8> flag is turned on
so that it looks like a character.  If the PV contains only single-byte
characters, the C<SvUTF8> flag stays off.
Scans PV for validity and returns FALSE if the PV is invalid UTF-8.

=over 3

 bool       sv_utf8_decode(      SV * const sv)
 bool  Perl_sv_utf8_decode(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 3699

=over 4

=item C<sv_utf8_downgrade>

=item C<sv_utf8_downgrade_flags>

=item C<sv_utf8_downgrade_nomg>
X<sv_utf8_downgrade>X<sv_utf8_downgrade_flags>X<sv_utf8_downgrade_nomg>

These attempt to convert the PV of an SV from characters to bytes.  If the PV
contains a character that cannot fit in a byte, this conversion will fail; in
this case, C<FALSE> is returned if C<fail_ok> is true; otherwise they croak.

They are not a general purpose Unicode to byte encoding interface:
use the C<Encode> extension for that.

They differ only in that:

C<sv_utf8_downgrade> processes 'get' magic on C<sv>.

C<sv_utf8_downgrade_nomg> does not.

C<sv_utf8_downgrade_flags> has an additional C<flags> parameter in which you can specify
C<SV_GMAGIC> to process 'get' magic, or leave it cleared to not process 'get' magic.

=over 3

 bool       sv_utf8_downgrade      (      SV * const sv,
                                          const bool fail_ok)
 bool  Perl_sv_utf8_downgrade      (pTHX_ SV * const sv,
                                          const bool fail_ok)
 bool       sv_utf8_downgrade_flags(      SV * const sv,
                                          const bool fail_ok,
                                          const U32 flags)
 bool  Perl_sv_utf8_downgrade_flags(pTHX_ SV * const sv,
                                          const bool fail_ok,
                                          const U32 flags)
 bool       sv_utf8_downgrade_nomg (      SV * const sv,
                                          const bool fail_ok)

=back

=back

=for hackers
sv_utf8_downgrade declared in embed.fnc; all in group documented at sv.c, line 3608
sv_utf8_downgrade_flags declared in embed.fnc
sv_utf8_downgrade_nomg declared in embed.fnc

=over 4

=item C<sv_utf8_encode>
X<sv_utf8_encode>

Converts the PV of an SV to UTF-8, but then turns the C<SvUTF8>
flag off so that it looks like octets again.

=over 3

 void       sv_utf8_encode(      SV * const sv)
 void  Perl_sv_utf8_encode(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 3678

=over 4

=item C<sv_utf8_upgrade>

=item C<sv_utf8_upgrade_flags>

=item C<sv_utf8_upgrade_flags_grow>

=item C<sv_utf8_upgrade_nomg>
X<sv_utf8_upgrade>X<sv_utf8_upgrade_flags>X<sv_utf8_upgrade_flags_grow>
X<sv_utf8_upgrade_nomg>

These convert the PV of an SV to its UTF-8-encoded form.
The SV is forced to string form if it is not already.
They always set the C<SvUTF8> flag to avoid future validity checks even if the
whole string is the same in UTF-8 as not.
They return the number of bytes in the converted string

The forms differ in just two ways.  The main difference is whether or not they
perform 'get magic' on C<sv>.  C<sv_utf8_upgrade_nomg> skips 'get magic';
C<sv_utf8_upgrade> performs it; and C<sv_utf8_upgrade_flags> and
C<sv_utf8_upgrade_flags_grow> either perform it (if the C<SV_GMAGIC> bit is set
in C<flags>) or don't (if that bit is cleared).

The other difference is that C<sv_utf8_upgrade_flags_grow> has an additional
parameter, C<extra>, which allows the caller to specify an amount of space to
be reserved as spare beyond what is needed for the actual conversion.  This is
used when the caller knows it will soon be needing yet more space, and it is
more efficient to request space from the system in a single call.
This form is otherwise identical to C<sv_utf8_upgrade_flags>.

These are not a general purpose byte encoding to Unicode interface: use the
Encode extension for that.

The C<SV_FORCE_UTF8_UPGRADE> flag is now ignored.

=over 3

 STRLEN       sv_utf8_upgrade           (      SV *sv)
 STRLEN  Perl_sv_utf8_upgrade           (pTHX_ SV *sv)
 STRLEN       sv_utf8_upgrade_flags     (      SV * const sv,
                                               const I32 flags)
 STRLEN       sv_utf8_upgrade_flags_grow(      SV * const sv,
                                               const I32 flags,
                                               STRLEN extra)
 STRLEN  Perl_sv_utf8_upgrade_flags_grow(pTHX_ SV * const sv,
                                               const I32 flags,
                                               STRLEN extra)
 STRLEN       sv_utf8_upgrade_nomg      (      SV *sv)

=back

=back

=for hackers
sv_utf8_upgrade declared in embed.fnc; all in group documented at sv.c, line 3414
sv_utf8_upgrade_flags declared in embed.fnc
sv_utf8_upgrade_flags_grow declared in embed.fnc
sv_utf8_upgrade_nomg declared in embed.fnc

=over 4

=item C<sv_vcatpvf*>

=item C<sv_vcatpvf_mg*>

=item C<sv_vcatpvfn*>

=item C<sv_vcatpvfn_flags*>

Described under C<L</sv_catpvf>>

=back

=over 4

=item C<sv_vsetpvf>

=item C<sv_vsetpvf_mg>
X<sv_vsetpvf>X<sv_vsetpvf_mg>

These work like C<L</sv_vcatpvf>> but copy the text into the SV instead of
appending it.

They differ only in that C<sv_vsetpvf_mg> performs 'set' magic;
C<sv_vsetpvf> skips all magic.

They are usually used via their frontends, C<L</sv_setpvf>> and
C<L</sv_setpvf_mg>>.

B<The UTF-8 flag is not changed by these functions.>

=over 3

 void       sv_vsetpvf   (      SV * const sv,
                                const char * const pat,
                                va_list * const args)
 void  Perl_sv_vsetpvf   (pTHX_ SV * const sv,
                                const char * const pat,
                                va_list * const args)
 void       sv_vsetpvf_mg(      SV * const sv,
                                const char * const pat,
                                va_list * const args)
 void  Perl_sv_vsetpvf_mg(pTHX_ SV * const sv,
                                const char * const pat,
                                va_list * const args)

=back

=back

=for hackers
sv_vsetpvf declared in embed.fnc; all in group documented at sv.c, line 11184
sv_vsetpvf_mg declared in embed.fnc

=over 4

=item C<sv_vsetpvfn>
X<sv_vsetpvfn>

Works like C<sv_vcatpvfn> but copies the text into the SV instead of
appending it.

B<The UTF-8 flag is not changed by this function.>

Usually used via one of its frontends L</C<sv_vsetpvf>> and
L</C<sv_vsetpvf_mg>>.

=over 3

 void       sv_vsetpvfn(      SV * const sv,
                              const char * const pat,
                              const STRLEN patlen,
                              va_list * const args,
                              SV ** const svargs,
                              const Size_t sv_count,
                              bool * const maybe_tainted)
 void  Perl_sv_vsetpvfn(pTHX_ SV * const sv,
                              const char * const pat,
                              const STRLEN patlen,
                              va_list * const args,
                              SV ** const svargs,
                              const Size_t sv_count,
                              bool * const maybe_tainted)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 11391

=over 4

=item C<sv_2cv>
X<sv_2cv>

Using various gambits, try to get a CV from an SV; in addition, try if
possible to set C<*st> and C<*gvp> to the stash and GV associated with it.
The flags in C<lref> are passed to C<gv_fetchsv>.

=over 3

 CV *       sv_2cv(      SV *sv, HV ** const st, GV ** const gvp,
                         const I32 lref)
 CV *  Perl_sv_2cv(pTHX_ SV *sv, HV ** const st, GV ** const gvp,
                         const I32 lref)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10352

=over 4

=item C<sv_2io>
X<sv_2io>

Using various gambits, try to get an IO from an SV: the IO slot if its a
GV; or the recursive result if we're an RV; or the IO slot of the symbol
named after the PV if we're a string.

'Get' magic is ignored on the C<sv> passed in, but will be called on
C<SvRV(sv)> if C<sv> is an RV.

=over 3

 IO *       sv_2io(      SV * const sv)
 IO *  Perl_sv_2io(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 10292

=over 4

=item C<sv_2iv_flags>
X<sv_2iv_flags>

Return the integer value of an SV, doing any necessary string
conversion.  If C<flags> has the C<SV_GMAGIC> bit set, does an C<mg_get()> first.
Normally used via the C<SvIV(sv)> and C<SvIVx(sv)> macros.

=over 3

 IV       sv_2iv_flags(      SV * const sv, const I32 flags)
 IV  Perl_sv_2iv_flags(pTHX_ SV * const sv, const I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 2344

=over 4

=item C<sv_2mortal>
X<sv_2mortal>

Marks an existing SV as mortal.  The SV will be destroyed "soon", either
by an explicit call to C<FREETMPS>, or by an implicit call at places such as
statement boundaries.  C<SvTEMP()> is turned on which means that the SV's
string buffer can be "stolen" if this SV is copied.  See also
C<L</sv_newmortal>> and C<L</sv_mortalcopy>>.

=over 3

 SV *       sv_2mortal(      SV * const sv)
 SV *  Perl_sv_2mortal(pTHX_ SV * const sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9724

=over 4

=item C<sv_2nv_flags>
X<sv_2nv_flags>

Return the num value of an SV, doing any necessary string or integer
conversion.  If C<flags> has the C<SV_GMAGIC> bit set, does an C<mg_get()> first.
Normally used via the C<SvNV(sv)> and C<SvNVx(sv)> macros.

=over 3

 NV       sv_2nv_flags(      SV * const sv, const I32 flags)
 NV  Perl_sv_2nv_flags(pTHX_ SV * const sv, const I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 2525

=over 4

=item C<sv_2pv>

=item C<sv_2pv_flags>
X<sv_2pv>X<sv_2pv_flags>

These implement the various forms of the L<perlapi/C<SvPV>> macros.
The macros are the preferred interface.

These return a pointer to the string value of an SV (coercing it to a string if
necessary), and set C<*lp> to its length in bytes.

The forms differ in that plain C<sv_2pvbyte> always processes 'get' magic; and
C<sv_2pvbyte_flags> processes 'get' magic if and only if C<flags> contains
C<SV_GMAGIC>.

=over 3

 char *       sv_2pv      (      SV *sv, STRLEN *lp)
 char *  Perl_sv_2pv      (pTHX_ SV *sv, STRLEN *lp)
 char *       sv_2pv_flags(      SV * const sv, STRLEN * const lp,
                                 const U32 flags)
 char *  Perl_sv_2pv_flags(pTHX_ SV * const sv, STRLEN * const lp,
                                 const U32 flags)

=back

=back

=for hackers
sv_2pv declared in embed.fnc; all in group documented at sv.c, line 2907
sv_2pv_flags declared in embed.fnc

=over 4

=item C<sv_2pvbyte>

=item C<sv_2pvbyte_flags>
X<sv_2pvbyte>X<sv_2pvbyte_flags>

These implement the various forms of the L<perlapi/C<SvPVbyte>> macros.
The macros are the preferred interface.

These return a pointer to the byte-encoded representation of the SV, and set
C<*lp> to its length.  If the SV is marked as being encoded as UTF-8, it will
be downgraded, if possible, to a byte string.  If the SV cannot be downgraded,
they croak.

The forms differ in that plain C<sv_2pvbyte> always processes 'get' magic; and
C<sv_2pvbyte_flags> processes 'get' magic if and only if C<flags> contains
C<SV_GMAGIC>.

=over 3

 char *       sv_2pvbyte      (      SV *sv, STRLEN * const lp)
 char *  Perl_sv_2pvbyte      (pTHX_ SV *sv, STRLEN * const lp)
 char *       sv_2pvbyte_flags(      SV *sv, STRLEN * const lp,
                                     const U32 flags)
 char *  Perl_sv_2pvbyte_flags(pTHX_ SV *sv, STRLEN * const lp,
                                     const U32 flags)

=back

=back

=for hackers
sv_2pvbyte declared in embed.fnc; all in group documented at sv.c, line 3272
sv_2pvbyte_flags declared in embed.fnc

=over 4

=item C<sv_2pvutf8>

=item C<sv_2pvutf8_flags>
X<sv_2pvutf8>X<sv_2pvutf8_flags>

These implement the various forms of the L<perlapi/C<SvPVutf8>> macros.
The macros are the preferred interface.

These return a pointer to the UTF-8-encoded representation of the SV, and set
C<*lp> to its length in bytes.  They may cause the SV to be upgraded to UTF-8
as a side-effect.

The forms differ in that plain C<sv_2pvutf8> always processes 'get' magic; and
C<sv_2pvutf8_flags> processes 'get' magic if and only if C<flags> contains
C<SV_GMAGIC>.

=over 3

 char *       sv_2pvutf8      (      SV *sv, STRLEN * const lp)
 char *  Perl_sv_2pvutf8      (pTHX_ SV *sv, STRLEN * const lp)
 char *       sv_2pvutf8_flags(      SV *sv, STRLEN * const lp,
                                     const U32 flags)
 char *  Perl_sv_2pvutf8_flags(pTHX_ SV *sv, STRLEN * const lp,
                                     const U32 flags)

=back

=back

=for hackers
sv_2pvutf8 declared in embed.fnc; all in group documented at sv.c, line 3310
sv_2pvutf8_flags declared in embed.fnc

=over 4

=item C<sv_2uv_flags>
X<sv_2uv_flags>

Return the unsigned integer value of an SV, doing any necessary string
conversion.  If C<flags> has the C<SV_GMAGIC> bit set, does an C<mg_get()> first.
Normally used via the C<SvUV(sv)> and C<SvUVx(sv)> macros.

=over 3

 UV       sv_2uv_flags(      SV * const sv, const I32 flags)
 UV  Perl_sv_2uv_flags(pTHX_ SV * const sv, const I32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 2440

=over 4

=item C<SvAMAGIC>
X<SvAMAGIC>

Returns a boolean as to whether C<sv> has overloading (active magic) enabled or
not.

=over 3

 bool  SvAMAGIC(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1154

=over 4

=item C<SvAMAGIC_off>
X<SvAMAGIC_off>

Indicate that C<sv> has overloading (active magic) disabled.

=over 3

 void       SvAMAGIC_off(SV *sv)
 void  Perl_SvAMAGIC_off(SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 740

=over 4

=item C<SvAMAGIC_on>
X<SvAMAGIC_on>

Indicate that C<sv> has overloading (active magic) enabled.

=over 3

 void       SvAMAGIC_on(SV *sv)
 void  Perl_SvAMAGIC_on(SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 723

=over 4

=item C<SvBoolFlagsOK>
X<SvBoolFlagsOK>

Returns a bool indicating whether the SV has the right flags set such
that it is safe to call C<BOOL_INTERNALS_sv_isbool()> or
C<BOOL_INTERNALS_sv_isbool_true()> or
C<BOOL_INTERNALS_sv_isbool_false()>. Currently equivalent to
C<SvIandPOK(sv)> or C<SvIOK(sv) && SvPOK(sv)>. Serialization may want to
unroll this check. If so you are strongly recommended to add code like
C<assert(SvBoolFlagsOK(sv));> B<before> calling using any of the
BOOL_INTERNALS macros.

=over 3

 U32  SvBoolFlagsOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 817

=over 4

=item C<SvCUR>
X<SvCUR>

Returns the length, in bytes, of the PV inside the SV.
Note that this may not match Perl's C<length>; for that, use
C<sv_len_utf8(sv)>. See C<L</SvLEN>> also.

=over 3

 STRLEN  SvCUR(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 925

=over 4

=item C<SvCUR_set>
X<SvCUR_set>

Sets the current length, in bytes, of the C string which is in the SV.
See C<L</SvCUR>> and C<SvIV_set>>.

=over 3

 void  SvCUR_set(SV* sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 981

=over 4

=item C<SvEND>
X<SvEND>

Returns a pointer to the spot just after the last character in
the string which is in the SV, where there is usually a trailing
C<NUL> character (even though Perl scalars do not strictly require it).
See C<L</SvCUR>>.  Access the character as C<*(SvEND(sv))>.

Warning: If C<SvCUR> is equal to C<SvLEN>, then C<SvEND> points to
unallocated memory.

=over 3

 char*  SvEND(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 934

=over 4

=item C<SvGAMAGIC>
X<SvGAMAGIC>

Returns true if the SV has get magic or
overloading.  If either is true then
the scalar is active data, and has the potential to return a new value every
time it is accessed.  Hence you must be careful to
only read it once per user logical operation and work
with that returned value.  If neither is true then
the scalar's value cannot change unless written to.

=over 3

 U32  SvGAMAGIC(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1209

=over 4

=item C<SvGETMAGIC>
X<SvGETMAGIC>

Invokes C<L</mg_get>> on an SV if it has 'get' magic.  For example, this
will call C<FETCH> on a tied variable.  As of 5.37.1, this function is
guaranteed to evaluate its argument exactly once.

=over 3

 void       SvGETMAGIC(      SV *sv)
 void  Perl_SvGETMAGIC(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 590

=over 4

=item C<SvGROW>
X<SvGROW>

Expands the character buffer in the SV so that it has room for the
indicated number of bytes (remember to reserve space for an extra trailing
C<NUL> character).  Calls C<sv_grow> to perform the expansion if necessary.
Returns a pointer to the character
buffer.  SV must be of type >= C<SVt_PV>.  One
alternative is to call C<sv_grow> if you are not sure of the type of SV.

You might mistakenly think that C<len> is the number of bytes to add to the
existing size, but instead it is the total size C<sv> should be.

=over 3

 char *  SvGROW(SV* sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 2363

=over 4

=item C<SvIandPOK>
X<SvIandPOK>

Returns a bool indicating whether the SV is both C<SvPOK()> and
C<SvIOK()> at the same time. Equivalent to C<SvIOK(sv) && SvPOK(sv)> but
more efficient.

=over 3

 U32  SvIandPOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 827

=over 4

=item C<SvIandPOK_off>
X<SvIandPOK_off>

Unsets the PV and IV status of an SV in one operation. Equivalent to
C<SvIOK_off(sv); SvPK_off(v);> but more efficient.

=over 3

 void  SvIandPOK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 836

=over 4

=item C<SvIandPOK_on>
X<SvIandPOK_on>

Tells an SV that is a string and a number in one operation. Equivalent
to C<SvIOK_on(sv); SvPOK_on(sv);> but more efficient.

=over 3

 void  SvIandPOK_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 832

=over 4

=item C<SvIOK>
X<SvIOK>

Returns a U32 value indicating whether the SV contains an integer.

=over 3

 U32  SvIOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 763

=over 4

=item C<SvIOK_notUV>
X<SvIOK_notUV>

Returns a boolean indicating whether the SV contains a signed integer.

=over 3

 bool  SvIOK_notUV(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 788

=over 4

=item C<SvIOK_off>
X<SvIOK_off>

Unsets the IV status of an SV.

=over 3

 void  SvIOK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 769

=over 4

=item C<SvIOK_on>
X<SvIOK_on>

Tells an SV that it is an integer.

=over 3

 void  SvIOK_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 766

=over 4

=item C<SvIOK_only>
X<SvIOK_only>

Tells an SV that it is an integer and disables all other C<OK> bits.

=over 3

 void  SvIOK_only(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 772

=over 4

=item C<SvIOK_only_UV>
X<SvIOK_only_UV>

Tells an SV that it is an unsigned integer and disables all other C<OK> bits.

=over 3

 void  SvIOK_only_UV(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 775

=over 4

=item C<SvIOK_UV>
X<SvIOK_UV>

Returns a boolean indicating whether the SV contains an integer that must be
interpreted as unsigned.  A non-negative integer whose value is within the
range of both an IV and a UV may be flagged as either C<SvUOK> or C<SvIOK>.

=over 3

 bool  SvIOK_UV(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 778

=over 4

=item C<SvIOKp>
X<SvIOKp>

Returns a U32 value indicating whether the SV contains an integer.  Checks
the B<private> setting.  Use C<SvIOK> instead.

=over 3

 U32  SvIOKp(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 751

=over 4

=item C<SvIsBOOL>
X<SvIsBOOL>

Returns true if the SV is one of the special boolean constants (PL_sv_yes or
PL_sv_no), or is a regular SV whose last assignment stored a copy of one.

=over 3

 bool  SvIsBOOL(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1198

=over 4

=item C<SvIsCOW>
X<SvIsCOW>

Returns a U32 value indicating whether the SV is Copy-On-Write (either shared
hash key scalars, or full Copy On Write scalars if 5.9.0 is configured for
COW).

=over 3

 U32  SvIsCOW(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1923

=over 4

=item C<SvIsCOW_shared_hash>
X<SvIsCOW_shared_hash>

Returns a boolean indicating whether the SV is Copy-On-Write shared hash key
scalar.

=over 3

 bool  SvIsCOW_shared_hash(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1928

=over 4

=item C<SvIV>

=item C<SvIV_nomg>

=item C<SvIVx>
X<SvIV>X<SvIV_nomg>X<SvIVx>

These each coerce the given SV to IV and return it.  The returned value in many
circumstances will get stored in C<sv>'s IV slot, but not in all cases.  (Use
C<L</sv_setiv>> to make sure it does).

As of 5.37.1, all are guaranteed to evaluate C<sv> only once.

C<SvIVx> is now identical to C<SvIV>, but prior to 5.37.1, it was the only form
guaranteed to evaluate C<sv> only once.

C<SvIV_nomg> is the same as C<SvIV>, but does not perform 'get' magic.

=over 3

 IV       SvIV     (      SV *sv)
 IV  Perl_SvIV     (pTHX_ SV *sv)
 IV       SvIV_nomg(      SV *sv)
 IV  Perl_SvIV_nomg(pTHX_ SV *sv)
 IV       SvIVx    (      SV *sv)

=back

=back

=for hackers
SvIV declared in embed.fnc; all in group documented at sv_inline.h, line 771
SvIV_nomg declared in embed.fnc
SvIVx declared at sv_inline.h, line 773

=over 4

=item C<SvIV_set>
X<SvIV_set>

Set the value of the IV pointer in sv to val.  It is possible to perform
the same function of this macro with an lvalue assignment to C<SvIVX>.
With future Perls, however, it will be more efficient to use
C<SvIV_set> instead of the lvalue assignment to C<SvIVX>.

=over 3

 void  SvIV_set(SV* sv, IV val)

=back

=back

=for hackers
Declared and documented at sv.h, line 946

=over 4

=item C<SvIVX>
X<SvIVX>

Returns the raw value in the SV's IV slot, without checks or conversions.
Only use when you are sure C<SvIOK> is true.  See also C<L</SvIV>>.

=over 3

 IV  SvIVX(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 889

=over 4

=item C<SvIVx*>

Described under C<L</SvIV>>

=back

=over 4

=item C<SvLEN>
X<SvLEN>

Returns the size of the string buffer in the SV, not including any part
attributable to C<SvOOK>.  See C<L</SvCUR>>.

=over 3

 STRLEN  SvLEN(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 930

=over 4

=item C<SvLEN_set>
X<SvLEN_set>

Set the size of the string buffer for the SV. See C<L</SvLEN>>.

=over 3

 void  SvLEN_set(SV* sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 985

=over 4

=item C<SvLOCK>
X<SvLOCK>

Arranges for a mutual exclusion lock to be obtained on C<sv> if a suitable module
has been loaded.

=over 3

 void  SvLOCK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2353

=over 4

=item C<SvMAGIC_set>
X<SvMAGIC_set>

Set the value of the MAGIC pointer in C<sv> to val.  See C<L</SvIV_set>>.

=over 3

 void  SvMAGIC_set(SV* sv, MAGIC* val)

=back

=back

=for hackers
Declared and documented at sv.h, line 975

=over 4

=item C<SvNIOK>
X<SvNIOK>

Returns a U32 value indicating whether the SV contains a number, integer or
double.

=over 3

 U32  SvNIOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 736

=over 4

=item C<SvNIOK_off>
X<SvNIOK_off>

Unsets the NV/IV status of an SV.

=over 3

 void  SvNIOK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 744

=over 4

=item C<SvNIOKp>
X<SvNIOKp>

Returns a U32 value indicating whether the SV contains a number, integer or
double.  Checks the B<private> setting.  Use C<SvNIOK> instead.

=over 3

 U32  SvNIOKp(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 740

=over 4

=item C<SvNOK>
X<SvNOK>

Returns a U32 value indicating whether the SV contains a double.

=over 3

 U32  SvNOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 791

=over 4

=item C<SvNOK_off>
X<SvNOK_off>

Unsets the NV status of an SV.

=over 3

 void  SvNOK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 797

=over 4

=item C<SvNOK_on>
X<SvNOK_on>

Tells an SV that it is a double.

=over 3

 void  SvNOK_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 794

=over 4

=item C<SvNOK_only>
X<SvNOK_only>

Tells an SV that it is a double and disables all other OK bits.

=over 3

 void  SvNOK_only(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 800

=over 4

=item C<SvNOKp>
X<SvNOKp>

Returns a U32 value indicating whether the SV contains a double.  Checks the
B<private> setting.  Use C<SvNOK> instead.

=over 3

 U32  SvNOKp(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 755

=over 4

=item C<SvNV>

=item C<SvNV_nomg>

=item C<SvNVx>
X<SvNV>X<SvNV_nomg>X<SvNVx>

These each coerce the given SV to NV and return it.  The returned value in many
circumstances will get stored in C<sv>'s NV slot, but not in all cases.  (Use
C<L</sv_setnv>> to make sure it does).

As of 5.37.1, all are guaranteed to evaluate C<sv> only once.

C<SvNVx> is now identical to C<SvNV>, but prior to 5.37.1, it was the only form
guaranteed to evaluate C<sv> only once.

C<SvNV_nomg> is the same as C<SvNV>, but does not perform 'get' magic.

=over 3

 NV       SvNV     (      SV *sv)
 NV  Perl_SvNV     (pTHX_ SV *sv)
 NV       SvNV_nomg(      SV *sv)
 NV  Perl_SvNV_nomg(pTHX_ SV *sv)
 NV       SvNVx    (      SV *sv)

=back

=back

=for hackers
SvNV declared in embed.fnc; all in group documented at sv_inline.h, line 786
SvNV_nomg declared in embed.fnc
SvNVx declared at sv_inline.h, line 788

=over 4

=item C<SvNV_set>
X<SvNV_set>

Set the value of the NV pointer in C<sv> to val.  See C<L</SvIV_set>>.

=over 3

 void  SvNV_set(SV* sv, NV val)

=back

=back

=for hackers
Declared and documented at sv.h, line 952

=over 4

=item C<SvNVX>
X<SvNVX>

Returns the raw value in the SV's NV slot, without checks or conversions.
Only use when you are sure C<SvNOK> is true.  See also C<L</SvNV>>.

=over 3

 NV  SvNVX(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 900

=over 4

=item C<SvNVx*>

Described under C<L</SvNV>>

=back

=over 4

=item C<SvOK>
X<SvOK>

Returns a U32 value indicating whether the value is defined.  This is
only meaningful for scalars.

=over 3

 U32  SvOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 747

=over 4

=item C<SvOOK>
X<SvOOK>

Returns a U32 indicating whether the pointer to the string buffer is offset.
This hack is used internally to speed up removal of characters from the
beginning of a C<L</SvPV>>.  When C<SvOOK> is true, then the start of the
allocated string buffer is actually C<SvOOK_offset()> bytes before C<SvPVX>.
This offset used to be stored in C<SvIVX>, but is now stored within the spare
part of the buffer.

=over 3

 U32  SvOOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 869

=over 4

=item C<SvOOK_off>
X<SvOOK_off>

Remove any string offset.

=over 3

 void  SvOOK_off(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1120

=over 4

=item C<SvOOK_offset>
X<SvOOK_offset>

Reads into C<len> the offset from C<SvPVX> back to the true start of the
allocated buffer, which will be non-zero if C<sv_chop> has been used to
efficiently remove characters from start of the buffer.  Implemented as a
macro, which takes the address of C<len>, which must be of type C<STRLEN>.
Evaluates C<sv> more than once.  Sets C<len> to 0 if C<SvOOK(sv)> is false.

=over 3

 void  SvOOK_offset(SV*sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 2587

=over 4

=item C<SvPOK>
X<SvPOK>

Returns a U32 value indicating whether the SV contains a character
string.

=over 3

 U32  SvPOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 803

=over 4

=item C<SvPOK_off>
X<SvPOK_off>

Unsets the PV status of an SV.

=over 3

 void  SvPOK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 810

=over 4

=item C<SvPOK_on>
X<SvPOK_on>

Tells an SV that it is a string.

=over 3

 void  SvPOK_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 807

=over 4

=item C<SvPOK_only>
X<SvPOK_only>

Tells an SV that it is a string and disables all other C<OK> bits.
Will also turn off the UTF-8 status.

=over 3

 void  SvPOK_only(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 813

=over 4

=item C<SvPOK_only_UTF8>
X<SvPOK_only_UTF8>

Tells an SV that it is a string and disables all other C<OK> bits,
and leaves the UTF-8 status as it was.

=over 3

 void  SvPOK_only_UTF8(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1077

=over 4

=item C<SvPOKp>
X<SvPOKp>

Returns a U32 value indicating whether the SV contains a character string.
Checks the B<private> setting.  Use C<SvPOK> instead.

=over 3

 U32  SvPOKp(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 759

=over 4

=item C<SvPV>

=item C<SvPV_const>

=item C<SvPV_flags>

=item C<SvPV_flags_const>

=item C<SvPV_flags_mutable>

=item C<SvPV_mutable>

=item C<SvPV_nolen>

=item C<SvPV_nolen_const>

=item C<SvPV_nomg>

=item C<SvPV_nomg_const>

=item C<SvPV_nomg_const_nolen>

=item C<SvPV_nomg_nolen>

=item C<SvPVbyte>

=item C<SvPVbyte_nolen>

=item C<SvPVbyte_nomg>

=item C<SvPVbyte_or_null>

=item C<SvPVbyte_or_null_nomg>

=item C<SvPVbytex>

=item C<SvPVbytex_nolen>

=item C<SvPVutf8>

=item C<SvPVutf8_nolen>

=item C<SvPVutf8_nomg>

=item C<SvPVutf8_or_null>

=item C<SvPVutf8_or_null_nomg>

=item C<SvPVutf8x>

=item C<SvPVx>

=item C<SvPVx_const>

=item C<SvPVx_nolen>

=item C<SvPVx_nolen_const>
X<SvPV>X<SvPV_const>X<SvPV_flags>X<SvPV_flags_const>X<SvPV_flags_mutable>
X<SvPV_mutable>X<SvPV_nolen>X<SvPV_nolen_const>X<SvPV_nomg>
X<SvPV_nomg_const>X<SvPV_nomg_const_nolen>X<SvPV_nomg_nolen>X<SvPVbyte>
X<SvPVbyte_nolen>X<SvPVbyte_nomg>X<SvPVbyte_or_null>
X<SvPVbyte_or_null_nomg>X<SvPVbytex>X<SvPVbytex_nolen>X<SvPVutf8>
X<SvPVutf8_nolen>X<SvPVutf8_nomg>X<SvPVutf8_or_null>
X<SvPVutf8_or_null_nomg>X<SvPVutf8x>X<SvPVx>X<SvPVx_const>X<SvPVx_nolen>
X<SvPVx_nolen_const>

These each return a pointer to the string in C<sv>, or a stringified form of
C<sv> if it does not contain a string.  The SV may cache the stringified
version becoming C<SvPOK>.

This is a very basic and common operation, so there are lots of slightly
different versions of it.

Note that there is no guarantee that the return value of C<SvPV(sv)>, for
example, is equal to C<SvPVX(sv)>, or that C<SvPVX(sv)> contains valid data, or
that successive calls to C<SvPV(sv)> (or another of these forms) will return
the same pointer value each time.  This is due to the way that things like
overloading and Copy-On-Write are handled.  In these cases, the return value
may point to a temporary buffer or similar.  If you absolutely need the
C<SvPVX> field to be valid (for example, if you intend to write to it), then
see C<L</SvPV_force>>.

The differences between the forms are:

The forms with neither C<byte> nor C<utf8> in their names (e.g., C<SvPV> or
C<SvPV_nolen>) can expose the SV's internal string buffer. If
that buffer consists entirely of bytes 0-255 and includes any bytes above
127, then you B<MUST> consult C<SvUTF8> to determine the actual code points
the string is meant to contain. Generally speaking, it is probably safer to
prefer C<SvPVbyte>, C<SvPVutf8>, and the like. See
L<perlguts/How do I pass a Perl string to a C library?> for more details.

The forms with C<flags> in their names allow you to use the C<flags> parameter
to specify to process 'get' magic (by setting the C<SV_GMAGIC> flag) or to skip
'get' magic (by clearing it).  The other forms process 'get' magic, except for
the ones with C<nomg> in their names, which skip 'get' magic.

The forms that take a C<len> parameter will set that variable to the byte
length of the resultant string (these are macros, so don't use C<&len>).

The forms with C<nolen> in their names indicate they don't have a C<len>
parameter.  They should be used only when it is known that the PV is a C
string, terminated by a NUL byte, and without intermediate NUL characters; or
when you don't care about its length.

The forms with C<const> in their names return S<C<const char *>> so that the
compiler will hopefully complain if you were to try to modify the contents of
the string (unless you cast away const yourself).

The other forms return a mutable pointer so that the string is modifiable by
the caller; this is emphasized for the ones with C<mutable> in their names.

As of 5.38, all forms are guaranteed to evaluate C<sv> exactly once.  For
earlier Perls, use a form whose name ends with C<x> for single evaluation.

C<SvPVutf8> is like C<SvPV>, but converts C<sv> to UTF-8 first if not already
UTF-8.  Similarly, the other forms with C<utf8> in their names correspond to
their respective forms without.

C<SvPVutf8_or_null> and C<SvPVutf8_or_null_nomg> don't have corresponding
non-C<utf8> forms.  Instead they are like C<SvPVutf8_nomg>, but when C<sv> is
undef, they return C<NULL>.

C<SvPVbyte> is like C<SvPV>, but converts C<sv> to byte representation first if
currently encoded as UTF-8.  If C<sv> cannot be downgraded from UTF-8, it
croaks.  Similarly, the other forms with C<byte> in their names correspond to
their respective forms without.

C<SvPVbyte_or_null> doesn't have a corresponding non-C<byte> form.  Instead it
is like C<SvPVbyte>, but when C<sv> is undef, it returns C<NULL>.

=over 3

 char*        SvPV                 (SV* sv, STRLEN len)
 const char*  SvPV_const           (SV* sv, STRLEN len)
 char*        SvPV_flags           (SV* sv, STRLEN len, U32 flags)
 const char*  SvPV_flags_const     (SV* sv, STRLEN len, U32 flags)
 char*        SvPV_flags_mutable   (SV* sv, STRLEN len, U32 flags)
 char*        SvPV_mutable         (SV* sv, STRLEN len)
 char*        SvPV_nolen           (SV* sv)
 const char*  SvPV_nolen_const     (SV* sv)
 char*        SvPV_nomg            (SV* sv, STRLEN len)
 const char*  SvPV_nomg_const      (SV* sv, STRLEN len)
 const char*  SvPV_nomg_const_nolen(SV* sv)
 char*        SvPV_nomg_nolen      (SV* sv)
 char*        SvPVbyte             (SV* sv, STRLEN len)
 char*        SvPVbyte_nolen       (SV* sv)
 char*        SvPVbyte_nomg        (SV* sv, STRLEN len)
 char*        SvPVbyte_or_null     (SV* sv, STRLEN len)
 char*        SvPVbyte_or_null_nomg(SV* sv, STRLEN len)
 char*        SvPVbytex            (SV* sv, STRLEN len)
 char*        SvPVbytex_nolen      (SV* sv)
 char*        SvPVutf8             (SV* sv, STRLEN len)
 char*        SvPVutf8_nolen       (SV* sv)
 char*        SvPVutf8_nomg        (SV* sv, STRLEN len)
 char*        SvPVutf8_or_null     (SV* sv, STRLEN len)
 char*        SvPVutf8_or_null_nomg(SV* sv, STRLEN len)
 char*        SvPVutf8x            (SV* sv, STRLEN len)
 char*        SvPVx                (SV* sv, STRLEN len)
 const char*  SvPVx_const          (SV* sv, STRLEN len)
 char*        SvPVx_nolen          (SV* sv)
 const char*  SvPVx_nolen_const    (SV* sv)

=back

=back

=for hackers
SvPV declared at sv.h, line 1803; all in group documented at sv.h, line 1803
SvPV_const declared at sv.h, line 1804
SvPV_flags declared at sv.h, line 1805
SvPV_flags_const declared at sv.h, line 1806
SvPV_flags_mutable declared at sv.h, line 1807
SvPV_mutable declared at sv.h, line 1808
SvPV_nolen declared at sv.h, line 1809
SvPV_nolen_const declared at sv.h, line 1810
SvPV_nomg declared at sv.h, line 1811
SvPV_nomg_const declared at sv.h, line 1812
SvPV_nomg_const_nolen declared at sv.h, line 1813
SvPV_nomg_nolen declared at sv.h, line 1814
SvPVbyte declared at sv.h, line 1815
SvPVbyte_nolen declared at sv.h, line 1816
SvPVbyte_nomg declared at sv.h, line 1817
SvPVbyte_or_null declared at sv.h, line 1818
SvPVbyte_or_null_nomg declared at sv.h, line 1819
SvPVbytex declared at sv.h, line 1820
SvPVbytex_nolen declared at sv.h, line 1821
SvPVutf8 declared at sv.h, line 1822
SvPVutf8_nolen declared at sv.h, line 1823
SvPVutf8_nomg declared at sv.h, line 1824
SvPVutf8_or_null declared at sv.h, line 1825
SvPVutf8_or_null_nomg declared at sv.h, line 1826
SvPVutf8x declared at sv.h, line 1827
SvPVx declared at sv.h, line 1828
SvPVx_const declared at sv.h, line 1829
SvPVx_nolen declared at sv.h, line 1830
SvPVx_nolen_const declared at sv.h, line 1831

=over 4

=item C<SvPV_force>

=item C<SvPV_force_flags>

=item C<SvPV_force_flags_mutable>

=item C<SvPV_force_flags_nolen>

=item C<SvPV_force_mutable>

=item C<SvPV_force_nolen>

=item C<SvPV_force_nomg>

=item C<SvPV_force_nomg_nolen>

=item C<SvPVbyte_force>

=item C<SvPVbytex_force>

=item C<SvPVutf8_force>

=item C<SvPVutf8x_force>

=item C<SvPVx_force>
X<SvPV_force>X<SvPV_force_flags>X<SvPV_force_flags_mutable>
X<SvPV_force_flags_nolen>X<SvPV_force_mutable>X<SvPV_force_nolen>
X<SvPV_force_nomg>X<SvPV_force_nomg_nolen>X<SvPVbyte_force>
X<SvPVbytex_force>X<SvPVutf8_force>X<SvPVutf8x_force>X<SvPVx_force>

These are like C<L</SvPV>>, returning the string in the SV, but will force the
SV into containing a string (C<L</SvPOK>>), and only a string
(C<L</SvPOK_only>>), by hook or by crook.  You need to use one of these
C<force> routines if you are going to update the C<L</SvPVX>> directly.

Note that coercing an arbitrary scalar into a plain PV will potentially
strip useful data from it.  For example if the SV was C<SvROK>, then the
referent will have its reference count decremented, and the SV itself may
be converted to an C<SvPOK> scalar with a string buffer containing a value
such as C<"ARRAY(0x1234)">.

The differences between the forms are:

The forms with C<flags> in their names allow you to use the C<flags> parameter
to specify to perform 'get' magic (by setting the C<SV_GMAGIC> flag) or to skip
'get' magic (by clearing it).  The other forms do perform 'get' magic, except
for the ones with C<nomg> in their names, which skip 'get' magic.

The forms that take a C<len> parameter will set that variable to the byte
length of the resultant string (these are macros, so don't use C<&len>).

The forms with C<nolen> in their names indicate they don't have a C<len>
parameter.  They should be used only when it is known that the PV is a C
string, terminated by a NUL byte, and without intermediate NUL characters; or
when you don't care about its length.

The forms with C<mutable> in their names are effectively the same as those without,
but the name emphasizes that the string is modifiable by the caller, which it is
in all the forms.

C<SvPVutf8_force> is like C<SvPV_force>, but converts C<sv> to UTF-8 first if
not already UTF-8.

C<SvPVutf8x_force> is like C<SvPVutf8_force>, but guarantees to evaluate C<sv>
only once; use the more efficient C<SvPVutf8_force> otherwise.

C<SvPVbyte_force> is like C<SvPV_force>, but converts C<sv> to byte
representation first if currently encoded as UTF-8.  If the SV cannot be
downgraded from UTF-8, this croaks.

C<SvPVbytex_force> is like C<SvPVbyte_force>, but guarantees to evaluate C<sv>
only once; use the more efficient C<SvPVbyte_force> otherwise.

=over 3

 char*  SvPV_force              (SV* sv, STRLEN len)
 char*  SvPV_force_flags        (SV * sv, STRLEN len, U32 flags)
 char*  SvPV_force_flags_mutable(SV * sv, STRLEN len, U32 flags)
 char*  SvPV_force_flags_nolen  (SV * sv, U32 flags)
 char*  SvPV_force_mutable      (SV * sv, STRLEN len)
 char*  SvPV_force_nolen        (SV* sv)
 char*  SvPV_force_nomg         (SV* sv, STRLEN len)
 char*  SvPV_force_nomg_nolen   (SV * sv)
 char*  SvPVbyte_force          (SV * sv, STRLEN len)
 char*  SvPVbytex_force         (SV * sv, STRLEN len)
 char*  SvPVutf8_force          (SV * sv, STRLEN len)
 char*  SvPVutf8x_force         (SV * sv, STRLEN len)
 char*  SvPVx_force             (SV* sv, STRLEN len)

=back

=back

=for hackers
SvPV_force declared at sv.h, line 1746; all in group documented at sv.h, line 1746
SvPV_force_flags declared at sv.h, line 1747
SvPV_force_flags_mutable declared at sv.h, line 1748
SvPV_force_flags_nolen declared at sv.h, line 1749
SvPV_force_mutable declared at sv.h, line 1750
SvPV_force_nolen declared at sv.h, line 1751
SvPV_force_nomg declared at sv.h, line 1752
SvPV_force_nomg_nolen declared at sv.h, line 1753
SvPVbyte_force declared at sv.h, line 1754
SvPVbytex_force declared at sv.h, line 1755
SvPVutf8_force declared at sv.h, line 1756
SvPVutf8x_force declared at sv.h, line 1757
SvPVx_force declared at sv.h, line 1758

=over 4

=item C<SvPV_free>
X<SvPV_free>

Frees the PV buffer in C<sv>, leaving things in a precarious state, so should
only be used as part of a larger operation

=over 3

 void  SvPV_free(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1599

=over 4

=item C<SvPV_mutable*>

=item C<SvPV_nolen*>

=item C<SvPV_nolen_const*>

=item C<SvPV_nomg*>

=item C<SvPV_nomg_const*>

=item C<SvPV_nomg_const_nolen*>

=item C<SvPV_nomg_nolen*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPV_renew>
X<SvPV_renew>

Low level micro optimization of C<L</SvGROW>>.  It is generally better to use
C<SvGROW> instead.  This is because C<SvPV_renew> ignores potential issues that
C<SvGROW> handles.  C<sv> needs to have a real C<PV> that is unencumbered by
things like COW.  Using C<SV_CHECK_THINKFIRST> or
C<SV_CHECK_THINKFIRST_COW_DROP> before calling this should clean it up, but
why not just use C<SvGROW> if you're not sure about the provenance?

=over 3

 void  SvPV_renew(SV* sv, STRLEN len)

=back

=back

=for hackers
Declared and documented at sv.h, line 1563

=over 4

=item C<SvPV_set>
X<SvPV_set>

This is probably not what you want to use, you probably wanted
L</sv_usepvn_flags> or L</sv_setpvn> or L</sv_setpvs>.

Set the value of the PV pointer in C<sv> to the Perl allocated
C<NUL>-terminated string C<val>.  See also C<L</SvIV_set>>.

Remember to free the previous PV buffer. There are many things to check.
Beware that the existing pointer may be involved in copy-on-write or other
mischief, so do C<SvOOK_off(sv)> and use C<sv_force_normal> or
C<SvPV_force> (or check the C<SvIsCOW> flag) first to make sure this
modification is safe. Then finally, if it is not a COW, call
C<L</SvPV_free>> to free the previous PV buffer.

=over 3

 void  SvPV_set(SV* sv, char* val)

=back

=back

=for hackers
Declared and documented at sv.h, line 955

=over 4

=item C<SvPV_shrink_to_cur>
X<SvPV_shrink_to_cur>

Trim any trailing unused memory in the PV of C<sv>, which needs to have a real
C<PV> that is unencumbered by things like COW.  Think first before using this
functionality.  Is the space saving really worth giving up COW?  Will the
needed size of C<sv> stay the same?

If the answers are both yes, then use L</C<SV_CHECK_THINKFIRST>> or
L</C<SV_CHECK_THINKFIRST_COW_DROP>> before calling this.

=over 3

 void  SvPV_shrink_to_cur(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1580

=over 4

=item C<SvPVbyte*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVbyte_force*>

Described under C<L</SvPV_force>>

=back

=over 4

=item C<SvPVbyte_nolen*>

=item C<SvPVbyte_nomg*>

=item C<SvPVbyte_or_null*>

=item C<SvPVbyte_or_null_nomg*>

=item C<SvPVbytex*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVbytex_force*>

Described under C<L</SvPV_force>>

=back

=over 4

=item C<SvPVbytex_nolen*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVCLEAR>
X<SvPVCLEAR>

Ensures that sv is a SVt_PV and that its SvCUR is 0, and that it is
properly null terminated. Equivalent to sv_setpvs(""), but more efficient.

=over 3

 char *  SvPVCLEAR(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2374

=over 4

=item C<SvPVCLEAR_FRESH>
X<SvPVCLEAR_FRESH>

Like SvPVCLEAR, but optimized for newly-minted SVt_PV/PVIV/PVNV/PVMG
that already have a PV buffer allocated, but no SvTHINKFIRST.

=over 3

 char *  SvPVCLEAR_FRESH(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2378

=over 4

=item C<SvPVutf8*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVutf8_force*>

Described under C<L</SvPV_force>>

=back

=over 4

=item C<SvPVutf8_nolen*>

=item C<SvPVutf8_nomg*>

=item C<SvPVutf8_or_null*>

=item C<SvPVutf8_or_null_nomg*>

=item C<SvPVutf8x*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVutf8x_force*>

Described under C<L</SvPV_force>>

=back

=over 4

=item C<SvPVX>

=item C<SvPVX_const>

=item C<SvPVX_mutable>

=item C<SvPVXx>
X<SvPVX>X<SvPVX_const>X<SvPVX_mutable>X<SvPVXx>

These return a pointer to the physical string in the SV.  The SV must contain a
string.  Prior to 5.9.3 it is not safe to execute these unless the SV's
type >= C<SVt_PV>.

These are also used to store the name of an autoloaded subroutine in an XS
AUTOLOAD routine.  See L<perlguts/Autoloading with XSUBs>.

C<SvPVXx> is identical to C<SvPVX>.

C<SvPVX_mutable> is merely a synonym for C<SvPVX>, but its name emphasizes that
the string is modifiable by the caller.

C<SvPVX_const> differs in that the return value has been cast so that the
compiler will complain if you were to try to modify the contents of the string,
(unless you cast away const yourself).

=over 3

 char*        SvPVX        (SV* sv)
 const char*  SvPVX_const  (SV* sv)
 char*        SvPVX_mutable(SV* sv)
 char*        SvPVXx       (SV* sv)

=back

=back

=for hackers
SvPVX declared at sv.h, line 904; all in group documented at sv.h, line 904
SvPVX_const declared at sv.h, line 905
SvPVX_mutable declared at sv.h, line 906
SvPVXx declared at sv.h, line 907

=over 4

=item C<SvPVx*>

=item C<SvPVx_const*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVx_force*>

Described under C<L</SvPV_force>>

=back

=over 4

=item C<SvPVx_nolen*>

=item C<SvPVx_nolen_const*>

Described under C<L</SvPV>>

=back

=over 4

=item C<SvPVXtrue>
X<SvPVXtrue>

Returns a boolean as to whether or not C<sv> contains a PV that is considered
TRUE.  FALSE is returned if C<sv> doesn't contain a PV, or if the PV it does
contain is zero length, or consists of just the single character '0'.  Every
other PV value is considered TRUE.

As of Perl v5.37.1, C<sv> is evaluated exactly once; in earlier releases, it
could be evaluated more than once.

=over 3

 bool       SvPVXtrue(      SV *sv)
 bool  Perl_SvPVXtrue(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv_inline.h, line 554

=over 4

=item C<SvPVXx*>

Described under C<L</SvPVX>>

=back

=over 4

=item C<SvREADONLY>
X<SvREADONLY>

Returns true if the argument is readonly, otherwise returns false.
Exposed to perl code via Internals::SvREADONLY().

=over 3

 U32  SvREADONLY(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1288

=over 4

=item C<SvREADONLY_off>
X<SvREADONLY_off>

Mark an object as not-readonly. Exactly what this mean depends on the
object type. Exposed to perl code via Internals::SvREADONLY().

=over 3

 U32  SvREADONLY_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1296

=over 4

=item C<SvREADONLY_on>
X<SvREADONLY_on>

Mark an object as readonly. Exactly what this means depends on the object
type. Exposed to perl code via Internals::SvREADONLY().

=over 3

 U32  SvREADONLY_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1292

=over 4

=item C<SvREFCNT>
X<SvREFCNT>

Returns the value of the object's reference count. Exposed
to perl code via Internals::SvREFCNT().

=over 3

 U32  SvREFCNT(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 296

=over 4

=item C<SvREFCNT_dec>

=item C<SvREFCNT_dec_set_NULL>

=item C<SvREFCNT_dec_ret_NULL>

=item C<SvREFCNT_dec_NN>
X<SvREFCNT_dec>X<SvREFCNT_dec_NN>X<SvREFCNT_dec_ret_NULL>
X<SvREFCNT_dec_set_NULL>

These decrement the reference count of the given SV.

C<SvREFCNT_dec_NN> may only be used when C<sv> is known to not be C<NULL>.

The function C<SvREFCNT_dec_ret_NULL()> is identical to the
C<SvREFCNT_dec()> except it returns a NULL C<SV *>.  It is used by
C<SvREFCNT_dec_set_NULL()> which is a macro which will, when passed a
non-NULL argument, decrement the reference count of its argument and
then set it to NULL. You can replace code of the following form:

    if (sv) {
       SvREFCNT_dec_NN(sv);
       sv = NULL;
    }

with

    SvREFCNT_dec_set_NULL(sv);

=over 3

 void       SvREFCNT_dec         (      SV *sv)
 void  Perl_SvREFCNT_dec         (pTHX_ SV *sv)
 void       SvREFCNT_dec_set_NULL(      SV *sv)
 SV *       SvREFCNT_dec_ret_NULL(      SV *sv)
 SV *  Perl_SvREFCNT_dec_ret_NULL(pTHX_ SV *sv)
 void       SvREFCNT_dec_NN      (      SV *sv)
 void  Perl_SvREFCNT_dec_NN      (pTHX_ SV *sv)

=back

=back

=for hackers
SvREFCNT_dec declared in embed.fnc; all in group documented at sv.h, line 339
SvREFCNT_dec_set_NULL declared in embed.fnc
SvREFCNT_dec_ret_NULL declared in embed.fnc
SvREFCNT_dec_NN declared in embed.fnc

=over 4

=item C<SvREFCNT_inc>

=item C<SvREFCNT_inc_NN>

=item C<SvREFCNT_inc_simple>

=item C<SvREFCNT_inc_simple_NN>

=item C<SvREFCNT_inc_simple_void>

=item C<SvREFCNT_inc_simple_void_NN>

=item C<SvREFCNT_inc_void>

=item C<SvREFCNT_inc_void_NN>
X<SvREFCNT_inc>X<SvREFCNT_inc_NN>X<SvREFCNT_inc_simple>
X<SvREFCNT_inc_simple_NN>X<SvREFCNT_inc_simple_void>
X<SvREFCNT_inc_simple_void_NN>X<SvREFCNT_inc_void>X<SvREFCNT_inc_void_NN>

These all increment the reference count of the given SV.
The ones without C<void> in their names return the SV.

C<SvREFCNT_inc> is the base operation; the rest are optimizations if various
input constraints are known to be true; hence, all can be replaced with
C<SvREFCNT_inc>.

C<SvREFCNT_inc_NN> can only be used if you know C<sv> is not C<NULL>.  Since we
don't have to check the NULLness, it's faster and smaller.

C<SvREFCNT_inc_void> can only be used if you don't need the
return value.  The macro doesn't need to return a meaningful value.

C<SvREFCNT_inc_void_NN> can only be used if you both don't need the return
value, and you know that C<sv> is not C<NULL>.  The macro doesn't need to
return a meaningful value, or check for NULLness, so it's smaller and faster.

C<SvREFCNT_inc_simple> can only be used with expressions without side
effects.  Since we don't have to store a temporary value, it's faster.

C<SvREFCNT_inc_simple_NN> can only be used with expressions without side
effects and you know C<sv> is not C<NULL>.  Since we don't have to store a
temporary value, nor check for NULLness, it's faster and smaller.

C<SvREFCNT_inc_simple_void> can only be used with expressions without side
effects and you don't need the return value.

C<SvREFCNT_inc_simple_void_NN> can only be used with expressions without side
effects, you don't need the return value, and you know C<sv> is not C<NULL>.

=over 3

 SV *       SvREFCNT_inc               (SV *sv)
 SV *  Perl_SvREFCNT_inc               (SV *sv)
 SV *       SvREFCNT_inc_NN            (SV *sv)
 SV *  Perl_SvREFCNT_inc_NN            (SV *sv)
 SV *       SvREFCNT_inc_simple        (SV *sv)
 SV *       SvREFCNT_inc_simple_NN     (SV *sv)
 void       SvREFCNT_inc_simple_void   (SV *sv)
 void       SvREFCNT_inc_simple_void_NN(SV *sv)
 void       SvREFCNT_inc_void          (SV *sv)
 void  Perl_SvREFCNT_inc_void          (SV *sv)
 void       SvREFCNT_inc_void_NN       (SV *sv)

=back

=back

=for hackers
SvREFCNT_inc declared in embed.fnc; all in group documented at sv.h, line 300
SvREFCNT_inc_NN declared in embed.fnc
SvREFCNT_inc_simple declared at sv.h, line 378
SvREFCNT_inc_simple_NN declared at sv.h, line 401
SvREFCNT_inc_simple_void declared at sv.h, line 387
SvREFCNT_inc_simple_void_NN declared at sv.h, line 403
SvREFCNT_inc_void declared in embed.fnc
SvREFCNT_inc_void_NN declared at sv.h, line 402

=over 4

=item C<SvROK>
X<SvROK>

Tests if the SV is an RV.

=over 3

 U32  SvROK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 877

=over 4

=item C<SvROK_off>
X<SvROK_off>

Unsets the RV status of an SV.

=over 3

 void  SvROK_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 883

=over 4

=item C<SvROK_on>
X<SvROK_on>

Tells an SV that it is an RV.

=over 3

 void  SvROK_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 880

=over 4

=item C<SvRV>
X<SvRV>

Dereferences an RV to return the SV.

=over 3

 SV*  SvRV(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 886

=over 4

=item C<SvRV_set>
X<SvRV_set>

Set the value of the RV pointer in C<sv> to val.  See C<L</SvIV_set>>.

=over 3

 void  SvRV_set(SV* sv, SV* val)

=back

=back

=for hackers
Declared and documented at sv.h, line 972

=over 4

=item C<SvSETMAGIC>
X<SvSETMAGIC>

Invokes C<L</mg_set>> on an SV if it has 'set' magic.  This is necessary
after modifying a scalar, in case it is a magical variable like C<$|>
or a tied variable (it calls C<STORE>).  This macro evaluates its
argument more than once.

=over 3

 void  SvSETMAGIC(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2326

=over 4

=item C<SvSetMagicSV>

=item C<SvSetMagicSV_nosteal>

=item C<SvSetSV>

=item C<SvSetSV_nosteal>
X<SvSetMagicSV>X<SvSetMagicSV_nosteal>X<SvSetSV>X<SvSetSV_nosteal>

if C<dsv> is the same as C<ssv>, these do nothing.  Otherwise they all call
some form of C<L</sv_setsv>>.  They may evaluate their arguments more than
once.

The only differences are:

C<SvSetMagicSV> and C<SvSetMagicSV_nosteal> perform any required 'set' magic
afterwards on the destination SV; C<SvSetSV> and C<SvSetSV_nosteal> do not.

C<SvSetSV_nosteal> C<SvSetMagicSV_nosteal> call a non-destructive version of
C<sv_setsv>.

=over 3

 void  SvSetMagicSV        (SV* dsv, SV* ssv)
 void  SvSetMagicSV_nosteal(SV* dsv, SV* ssv)
 void  SvSetSV             (SV* dsv, SV* ssv)
 void  SvSetSV_nosteal     (SV* dsv, SV* ssv)

=back

=back

=for hackers
SvSetMagicSV declared at sv.h, line 2332; all in group documented at sv.h, line 2332
SvSetMagicSV_nosteal 
SvSetSV 
SvSetSV_nosteal 

=over 4

=item C<SvSHARE>
X<SvSHARE>

Arranges for C<sv> to be shared between threads if a suitable module
has been loaded.

=over 3

 void  SvSHARE(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2349

=over 4

=item C<SvSHARED_HASH>
X<SvSHARED_HASH>

Returns the hash for C<sv> created by C<L</newSVpvn_share>>.

=over 3

 struct hek*  SvSHARED_HASH(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2099

=over 4

=item C<SvSTASH>
X<SvSTASH>

Returns the stash of the SV.

=over 3

 HV*  SvSTASH(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 943

=over 4

=item C<SvSTASH_set>
X<SvSTASH_set>

Set the value of the STASH pointer in C<sv> to val.  See C<L</SvIV_set>>.

=over 3

 void  SvSTASH_set(SV* sv, HV* val)

=back

=back

=for hackers
Declared and documented at sv.h, line 978

=over 4

=item C<SvTRUE>

=item C<SvTRUE_NN>

=item C<SvTRUE_nomg>

=item C<SvTRUE_nomg_NN>

=item C<SvTRUEx>
X<SvTRUE>X<SvTRUE_NN>X<SvTRUE_nomg>X<SvTRUE_nomg_NN>X<SvTRUEx>

These return a boolean indicating whether Perl would evaluate the SV as true or
false.  See C<L</SvOK>> for a defined/undefined test.

As of Perl 5.32, all are guaranteed to evaluate C<sv> only once.  Prior to that
release, only C<SvTRUEx> guaranteed single evaluation; now C<SvTRUEx> is
identical to C<SvTRUE>.

C<SvTRUE_nomg> and C<TRUE_nomg_NN> do not perform 'get' magic; the others do
unless the scalar is already C<SvPOK>, C<SvIOK>, or C<SvNOK> (the public, not
the private flags).

C<SvTRUE_NN> is like C<L</SvTRUE>>, but C<sv> is assumed to be
non-null (NN).  If there is a possibility that it is NULL, use plain
C<SvTRUE>.

C<SvTRUE_nomg_NN> is like C<L</SvTRUE_nomg>>, but C<sv> is assumed to be
non-null (NN).  If there is a possibility that it is NULL, use plain
C<SvTRUE_nomg>.

=over 3

 bool       SvTRUE        (      SV *sv)
 bool  Perl_SvTRUE        (pTHX_ SV *sv)
 bool       SvTRUE_NN     (      SV *sv)
 bool  Perl_SvTRUE_NN     (pTHX_ SV *sv)
 bool       SvTRUE_nomg   (      SV *sv)
 bool  Perl_SvTRUE_nomg   (pTHX_ SV *sv)
 bool       SvTRUE_nomg_NN(      SV *sv)
 bool       SvTRUEx       (      SV *sv)

=back

=back

=for hackers
SvTRUE declared in embed.fnc; all in group documented at sv.h, line 1898
SvTRUE_NN declared in embed.fnc
SvTRUE_nomg declared in embed.fnc
SvTRUE_nomg_NN declared at sv.h, line 2066
SvTRUEx declared at sv.h, line 2065

=over 4

=item C<SvTYPE>
X<SvTYPE>

Returns the type of the SV.  See C<L</svtype>>.

=over 3

 svtype  SvTYPE(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 363

=over 4

=item C<SvUNLOCK>
X<SvUNLOCK>

Releases a mutual exclusion lock on C<sv> if a suitable module
has been loaded.

=over 3

 void  SvUNLOCK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 2357

=over 4

=item C<SvUOK>
X<SvUOK>

Returns a boolean indicating whether the SV contains an integer that must be
interpreted as unsigned.  A non-negative integer whose value is within the
range of both an IV and a UV may be flagged as either C<SvUOK> or C<SvIOK>.

=over 3

 bool  SvUOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 783

=over 4

=item C<SvUPGRADE>
X<SvUPGRADE>

Used to upgrade an SV to a more complex form.  Uses C<sv_upgrade> to
perform the upgrade if necessary.  See C<L</svtype>>.

=over 3

 void  SvUPGRADE(SV* sv, svtype type)

=back

=back

=for hackers
Declared and documented at sv.h, line 366

=over 4

=item C<SvUTF8>
X<SvUTF8>

Returns a U32 value indicating the UTF-8 status of an SV.  If things are set-up
properly, this indicates whether or not the SV contains UTF-8 encoded data.
You should use this I<after> a call to C<L</SvPV>> or one of its variants, in
case any call to string overloading updates the internal flag.

If you want to take into account the L<bytes> pragma, use C<L</DO_UTF8>>
instead.

=over 3

 U32  SvUTF8(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1060

=over 4

=item C<SvUTF8_off>
X<SvUTF8_off>

Unsets the UTF-8 status of an SV (the data is not changed, just the flag).
Do not use frivolously.

=over 3

 void  SvUTF8_off(SV *sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1073

=over 4

=item C<SvUTF8_on>
X<SvUTF8_on>

Turn on the UTF-8 status of an SV (the data is not changed, just the flag).
Do not use frivolously.

=over 3

 void  SvUTF8_on(SV *sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1069

=over 4

=item C<SvUV>

=item C<SvUV_nomg>

=item C<SvUVx>
X<SvUV>X<SvUV_nomg>X<SvUVx>

These each coerce the given SV to UV and return it.  The returned value in many
circumstances will get stored in C<sv>'s UV slot, but not in all cases.  (Use
C<L</sv_setuv>> to make sure it does).

As of 5.37.1, all are guaranteed to evaluate C<sv> only once.

C<SvUVx> is now identical to C<SvUV>, but prior to 5.37.1, it was the only form
guaranteed to evaluate C<sv> only once.

=over 3

 UV       SvUV     (      SV *sv)
 UV  Perl_SvUV     (pTHX_ SV *sv)
 UV       SvUV_nomg(      SV *sv)
 UV  Perl_SvUV_nomg(pTHX_ SV *sv)
 UV       SvUVx    (      SV *sv)

=back

=back

=for hackers
SvUV declared in embed.fnc; all in group documented at sv_inline.h, line 801
SvUV_nomg declared in embed.fnc
SvUVx declared at sv_inline.h, line 803

=over 4

=item C<SvUV_set>
X<SvUV_set>

Set the value of the UV pointer in C<sv> to val.  See C<L</SvIV_set>>.

=over 3

 void  SvUV_set(SV* sv, UV val)

=back

=back

=for hackers
Declared and documented at sv.h, line 969

=over 4

=item C<SvUVX>
X<SvUVX>

Returns the raw value in the SV's UV slot, without checks or conversions.
Only use when you are sure C<SvIOK> is true.  See also C<L</SvUV>>.

=over 3

 UV  SvUVX(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 893

=over 4

=item C<SvUVx*>

Described under C<L</SvUV>>

=back

=over 4

=item C<SvUVXx>
X<SvUVXx>

C<B<DEPRECATED!>>  It is planned to remove C<SvUVXx>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

This is an unnecessary synonym for L</SvUVX>

=over 3

 UV  SvUVXx(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 897

=over 4

=item C<SvVOK>
X<SvVOK>

Returns a boolean indicating whether the SV contains a v-string.

=over 3

 bool  SvVOK(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 866

=over 4

=item C<SvVSTRING_mg>
X<SvVSTRING_mg>

Returns the vstring magic, or NULL if none

=over 3

 MAGIC*  SvVSTRING_mg(SV * sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1106

=over 4

=item C<uiv_2buf>
X<uiv_2buf>

This function converts an IV or UV to its string representation.

It is used internally by sv_2pv_flags() and do_print().

=over 3

 char *       uiv_2buf(char * const buf, const IV iv, UV uv,
                       const int is_uv, char ** const peob)
 char *  Perl_uiv_2buf(char * const buf, const IV iv, UV uv,
                       const int is_uv, char ** const peob)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 2806

=over 4

=item C<vnewSVpvf>
X<vnewSVpvf>

Like C<L</newSVpvf>> but the arguments are an encapsulated argument list.

=over 3

 SV *       vnewSVpvf(      const char * const pat,
                            va_list * const args)
 SV *  Perl_vnewSVpvf(pTHX_ const char * const pat,
                            va_list * const args)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 9982

=head1 Tainting

=over 4

=item C<SvTAINT>
X<SvTAINT>

Taints an SV if tainting is enabled, and if some input to the current
expression is tainted--usually a variable, but possibly also implicit
inputs such as locale settings.  C<SvTAINT> propagates that taintedness to
the outputs of an expression in a pessimistic fashion; i.e., without paying
attention to precisely which outputs are influenced by which inputs.

=over 3

 void  SvTAINT(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1717

=over 4

=item C<SvTAINTED>
X<SvTAINTED>

Checks to see if an SV is tainted.  Returns TRUE if it is, FALSE if
not.

=over 3

 bool  SvTAINTED(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1702

=over 4

=item C<SvTAINTED_off>
X<SvTAINTED_off>

Untaints an SV.  Be I<very> careful with this routine, as it short-circuits
some of Perl's fundamental security features.  XS module authors should not
use this function unless they fully understand all the implications of
unconditionally untainting the value.  Untainting should be done in the
standard perl fashion, via a carefully crafted regexp, rather than directly
untainting variables.

=over 3

 void  SvTAINTED_off(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1709

=over 4

=item C<SvTAINTED_on>
X<SvTAINTED_on>

Marks an SV as tainted if tainting is enabled.

=over 3

 void  SvTAINTED_on(SV* sv)

=back

=back

=for hackers
Declared and documented at sv.h, line 1706

=head1 Time

=over 4

=item C<ASCTIME_R_PROTO>
X<ASCTIME_R_PROTO>

This symbol encodes the prototype of C<asctime_r>.
It is zero if C<d_asctime_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_asctime_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4531

=over 4

=item C<CTIME_R_PROTO>
X<CTIME_R_PROTO>

This symbol encodes the prototype of C<ctime_r>.
It is zero if C<d_ctime_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_ctime_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4570

=over 4

=item C<GMTIME_MAX>
X<GMTIME_MAX>

This symbol contains the maximum value for the C<time_t> offset that
the system function gmtime () accepts, and defaults to 0

=back

=for hackers
Declared and documented at config.h, line 4301

=over 4

=item C<GMTIME_MIN>
X<GMTIME_MIN>

This symbol contains the minimum value for the C<time_t> offset that
the system function gmtime () accepts, and defaults to 0

=back

=for hackers
Declared and documented at config.h, line 4302

=over 4

=item C<GMTIME_R_PROTO>
X<GMTIME_R_PROTO>

This symbol encodes the prototype of C<gmtime_r>.
It is zero if C<d_gmtime_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_gmtime_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4947

=over 4

=item C<HAS_ASCTIME_R>
X<HAS_ASCTIME_R>

This symbol, if defined, indicates that the C<asctime_r> routine
is available to asctime re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4530

=over 4

=item C<HAS_ASCTIME64>
X<HAS_ASCTIME64>

This symbol, if defined, indicates that the C<asctime64> () routine is
available to do the 64bit variant of asctime ()

=back

=for hackers
Declared and documented at config.h, line 3528

=over 4

=item C<HAS_CTIME_R>
X<HAS_CTIME_R>

This symbol, if defined, indicates that the C<ctime_r> routine
is available to ctime re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4569

=over 4

=item C<HAS_CTIME64>
X<HAS_CTIME64>

This symbol, if defined, indicates that the C<ctime64> () routine is
available to do the 64bit variant of ctime ()

=back

=for hackers
Declared and documented at config.h, line 3523

=over 4

=item C<HAS_DIFFTIME>
X<HAS_DIFFTIME>

This symbol, if defined, indicates that the C<difftime> routine is
available.

=back

=for hackers
Declared and documented at config.h, line 77

=over 4

=item C<HAS_DIFFTIME64>
X<HAS_DIFFTIME64>

This symbol, if defined, indicates that the C<difftime64> () routine is
available to do the 64bit variant of difftime ()

=back

=for hackers
Declared and documented at config.h, line 3527

=over 4

=item C<HAS_FUTIMES>
X<HAS_FUTIMES>

This symbol, if defined, indicates that the C<futimes> routine is
available to change file descriptor time stamps with C<struct timevals>.

=back

=for hackers
Declared and documented at config.h, line 2714

=over 4

=item C<HAS_GETITIMER>
X<HAS_GETITIMER>

This symbol, if defined, indicates that the C<getitimer> routine is
available to return interval timers.

=back

=for hackers
Declared and documented at config.h, line 2751

=over 4

=item C<HAS_GETTIMEOFDAY>
X<HAS_GETTIMEOFDAY>

This symbol, if defined, indicates that the C<gettimeofday()> system
call is available for a sub-second accuracy clock. Usually, the file
F<sys/resource.h> needs to be included (see C<L</I_SYS_RESOURCE>>).
The type "Timeval" should be used to refer to "C<struct timeval>".

=back

=for hackers
Declared and documented at config.h, line 146

=over 4

=item C<HAS_GMTIME_R>
X<HAS_GMTIME_R>

This symbol, if defined, indicates that the C<gmtime_r> routine
is available to gmtime re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4946

=over 4

=item C<HAS_GMTIME64>
X<HAS_GMTIME64>

This symbol, if defined, indicates that the C<gmtime64> () routine is
available to do the 64bit variant of gmtime ()

=back

=for hackers
Declared and documented at config.h, line 3525

=over 4

=item C<HAS_LOCALTIME_R>
X<HAS_LOCALTIME_R>

This symbol, if defined, indicates that the C<localtime_r> routine
is available to localtime re-entrantly.

=back

=for hackers
Declared and documented at config.h, line 4981

=over 4

=item C<HAS_LOCALTIME64>
X<HAS_LOCALTIME64>

This symbol, if defined, indicates that the C<localtime64> () routine is
available to do the 64bit variant of localtime ()

=back

=for hackers
Declared and documented at config.h, line 3524

=over 4

=item C<HAS_MKTIME>
X<HAS_MKTIME>

This symbol, if defined, indicates that the C<mktime> routine is
available.

=back

=for hackers
Declared and documented at config.h, line 264

=over 4

=item C<HAS_MKTIME64>
X<HAS_MKTIME64>

This symbol, if defined, indicates that the C<mktime64> () routine is
available to do the 64bit variant of mktime ()

=back

=for hackers
Declared and documented at config.h, line 3526

=over 4

=item C<HAS_NANOSLEEP>
X<HAS_NANOSLEEP>

This symbol, if defined, indicates that the C<nanosleep>
system call is available to sleep with 1E-9 sec accuracy.

=back

=for hackers
Declared and documented at config.h, line 3090

=over 4

=item C<HAS_SETITIMER>
X<HAS_SETITIMER>

This symbol, if defined, indicates that the C<setitimer> routine is
available to set interval timers.

=back

=for hackers
Declared and documented at config.h, line 3289

=over 4

=item C<HAS_STRFTIME>
X<HAS_STRFTIME>

This symbol, if defined, indicates that the C<strftime> routine is
available to do time formatting.

=back

=for hackers
Declared and documented at config.h, line 3420

=over 4

=item C<HAS_TIME>
X<HAS_TIME>

This symbol, if defined, indicates that the C<time()> routine exists.

=back

=for hackers
Declared and documented at config.h, line 5300

=over 4

=item C<HAS_TIMEGM>
X<HAS_TIMEGM>

This symbol, if defined, indicates that the C<timegm> routine is
available to do the opposite of gmtime ()

=back

=for hackers
Declared and documented at config.h, line 3534

=over 4

=item C<HAS_TIMES>
X<HAS_TIMES>

This symbol, if defined, indicates that the C<times()> routine exists.
Note that this became obsolete on some systems (C<SUNOS>), which now
use C<getrusage()>. It may be necessary to include F<sys/times.h>.

=back

=for hackers
Declared and documented at config.h, line 5308

=over 4

=item C<HAS_TM_TM_GMTOFF>
X<HAS_TM_TM_GMTOFF>

This symbol, if defined, indicates to the C program that
the C<struct tm> has a C<tm_gmtoff> field.

=back

=for hackers
Declared and documented at config.h, line 1147

=over 4

=item C<HAS_TM_TM_ZONE>
X<HAS_TM_TM_ZONE>

This symbol, if defined, indicates to the C program that
the C<struct tm> has a C<tm_zone> field.

=back

=for hackers
Declared and documented at config.h, line 1146

=over 4

=item C<HAS_TZNAME>
X<HAS_TZNAME>

This symbol, if defined, indicates that the C<tzname[]> array is
available to access timezone names.

=back

=for hackers
Declared and documented at config.h, line 551

=over 4

=item C<HAS_USLEEP>
X<HAS_USLEEP>

This symbol, if defined, indicates that the C<usleep> routine is
available to let the process sleep on a sub-second accuracy.

=back

=for hackers
Declared and documented at config.h, line 563

=over 4

=item C<HAS_USLEEP_PROTO>
X<HAS_USLEEP_PROTO>

This symbol, if defined, indicates that the system provides
a prototype for the C<usleep()> function.  Otherwise, it is up
to the program to supply one.  A good guess is

 extern int usleep(useconds_t);

=back

=for hackers
Declared and documented at config.h, line 3593

=over 4

=item C<I_TIME>
X<I_TIME>

This symbol is always defined, and indicates to the C program that
it should include F<time.h>.

=over 3

 #ifdef I_TIME
     #include <time.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 1143

=over 4

=item C<I_UTIME>
X<I_UTIME>

This symbol, if defined, indicates to the C program that it should
include F<utime.h>.

=over 3

 #ifdef I_UTIME
     #include <utime.h>
 #endif


=back

=back

=for hackers
Declared and documented at config.h, line 741

=over 4

=item C<L_R_TZSET>
X<L_R_TZSET>

If C<localtime_r()> needs tzset, it is defined in this define

=back

=for hackers
Declared and documented at config.h, line 4969

=over 4

=item C<LOCALTIME_MAX>
X<LOCALTIME_MAX>

This symbol contains the maximum value for the C<time_t> offset that
the system function localtime () accepts, and defaults to 0

=back

=for hackers
Declared and documented at config.h, line 4303

=over 4

=item C<LOCALTIME_MIN>
X<LOCALTIME_MIN>

This symbol contains the minimum value for the C<time_t> offset that
the system function localtime () accepts, and defaults to 0

=back

=for hackers
Declared and documented at config.h, line 4304

=over 4

=item C<LOCALTIME_R_NEEDS_TZSET>
X<LOCALTIME_R_NEEDS_TZSET>

Many libc's C<localtime_r> implementations do not call tzset,
making them differ from C<localtime()>, and making timezone
changes using $C<ENV>{TZ} without explicitly calling tzset
impossible. This symbol makes us call tzset before C<localtime_r>

=back

=for hackers
Declared and documented at config.h, line 4965

=over 4

=item C<LOCALTIME_R_PROTO>
X<LOCALTIME_R_PROTO>

This symbol encodes the prototype of C<localtime_r>.
It is zero if C<d_localtime_r> is undef, and one of the
C<REENTRANT_PROTO_T_ABC> macros of F<reentr.h> if C<d_localtime_r>
is defined.

=back

=for hackers
Declared and documented at config.h, line 4982

=over 4

=item C<mini_mktime>
X<mini_mktime>

normalise S<C<struct tm>> values without the localtime() semantics (and
overhead) of mktime().

=over 3

 void       mini_mktime(struct tm *ptm)
 void  Perl_mini_mktime(struct tm *ptm)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 3895

=over 4

=item C<sv_strftime_tm>

=item C<sv_strftime_ints>

=item C<my_strftime>
X<my_strftime>X<sv_strftime_ints>X<sv_strftime_tm>

These implement the libc strftime().

On failure, they return NULL, and set C<errno> to C<EINVAL>.

C<sv_strftime_tm> and C<sv_strftime_ints> are preferred, as they transparently
handle the UTF-8ness of the current locale, the input C<fmt>, and the returned
result.  Only if the current C<LC_TIME> locale is a UTF-8 one (and S<C<use
bytes>> is not in effect) will the result be marked as UTF-8.

C<my_strftime> is kept for backwards compatibility.  Knowing if its result
should be considered UTF-8 or not requires significant extra logic.

Note that all three functions are always executed in the underlying
C<LC_TIME> locale of the program, giving results based on that locale.

The functions differ as follows:

C<sv_strftime_tm> takes a pointer to a filled-in S<C<struct tm>> parameter.  It
ignores the values of the C<wday> and C<yday> fields in it.  The other fields
give enough information to accurately calculate these values, and are used for
that purpose.

The caller assumes ownership of the returned SV with a reference count of 1.

C<sv_strftime_ints> takes a bunch of integer parameters that together
completely define a given time.  It calculates the S<C<struct tm>> to pass to
libc strftime(), and calls that function.

The value of C<isdst> is used as follows:

=over

=item 0

No daylight savings time is in effect

=item E<gt>0

Check if daylight savings time is in effect, and adjust the results
accordingly.

=item E<lt>0

This value is reserved for internal use by the L<POSIX> module for backwards
compatibility purposes.

=back

The caller assumes ownership of the returned SV with a reference count of 1.

C<my_strftime> is like C<sv_strftime_ints> except that:

=over

=item The C<fmt> parameter and the return are S<C<char *>> instead of
S<C<SV *>>.

This means the UTF-8ness of the result is unspecified.  The result MUST be
arranged to be FREED BY THE CALLER).

=item The C<is_dst> parameter is ignored.

Daylight savings time is never considered to be in effect.

=item It has extra parameters C<yday> and C<wday> that are ignored.

These exist only for historical reasons; the values for the corresponding
fields in S<C<struct tm>> are calculated from the other arguments.

=back

Note that all three functions are always executed in the underlying C<LC_TIME>
locale of the program, giving results based on that locale.

=over 3

 SV *         sv_strftime_tm  (      SV *fmt,
                                     const struct tm *mytm)
 SV *    Perl_sv_strftime_tm  (pTHX_ SV *fmt,
                                     const struct tm *mytm)
 SV *         sv_strftime_ints(      SV *fmt, int sec, int min,
                                     int hour, int mday, int mon,
                                     int year, int isdst)
 SV *    Perl_sv_strftime_ints(pTHX_ SV *fmt, int sec, int min,
                                     int hour, int mday, int mon,
                                     int year, int isdst)
 char *       my_strftime     (      const char *fmt, int sec,
                                     int min, int hour, int mday,
                                     int mon, int year, int wday,
                                     int yday, int isdst)
 char *  Perl_my_strftime     (pTHX_ const char *fmt, int sec,
                                     int min, int hour, int mday,
                                     int mon, int year, int wday,
                                     int yday, int isdst)

=back

=back

=for hackers
sv_strftime_tm declared in embed.fnc; all in group documented at locale.c, line 8146
sv_strftime_ints declared in embed.fnc
my_strftime declared in embed.fnc

=head1 Typedef names

=over 4

=item C<DB_Hash_t>
X<DB_Hash_t>

This symbol contains the type of the prefix structure element
in the F<db.h> header file.  In older versions of DB, it was
int, while in newer ones it is C<size_t>.

=back

=for hackers
Declared and documented at config.h, line 3708

=over 4

=item C<DB_Prefix_t>
X<DB_Prefix_t>

This symbol contains the type of the prefix structure element
in the F<db.h> header file.  In older versions of DB, it was
int, while in newer ones it is C<u_int32_t>.

=back

=for hackers
Declared and documented at config.h, line 3709

=over 4

=item C<Direntry_t>
X<Direntry_t>

This symbol is set to 'C<struct direct>' or 'C<struct dirent>' depending on
whether dirent is available or not. You should use this pseudo type to
portably declare your directory entries.

=back

=for hackers
Declared and documented at config.h, line 2040

=over 4

=item C<Fpos_t>
X<Fpos_t>

This symbol holds the type used to declare file positions in libc.
It can be C<fpos_t>, long, uint, etc... It may be necessary to include
F<sys/types.h> to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5315

=over 4

=item C<Free_t>
X<Free_t>

This variable contains the return type of C<free()>.  It is usually
void, but occasionally int.

=back

=for hackers
Declared and documented at config.h, line 2190

=over 4

=item C<Gid_t>
X<Gid_t>

This symbol holds the return type of C<getgid()> and the type of
argument to C<setrgid()> and related functions.  Typically,
it is the type of group ids in the kernel. It can be int, ushort,
C<gid_t>, etc... It may be necessary to include F<sys/types.h> to get
any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5340

=over 4

=item C<Gid_t_f>
X<Gid_t_f>

This symbol defines the format string used for printing a C<Gid_t>.

=back

=for hackers
Declared and documented at config.h, line 5320

=over 4

=item C<Gid_t_sign>
X<Gid_t_sign>

This symbol holds the signedness of a C<Gid_t>.
1 for unsigned, -1 for signed.

=back

=for hackers
Declared and documented at config.h, line 5326

=over 4

=item C<Gid_t_size>
X<Gid_t_size>

This symbol holds the size of a C<Gid_t> in bytes.

=back

=for hackers
Declared and documented at config.h, line 5331

=over 4

=item C<Groups_t>
X<Groups_t>

This symbol holds the type used for the second argument to
C<getgroups()> and C<setgroups()>.  Usually, this is the same as
gidtype (C<gid_t>) , but sometimes it isn't.
It can be int, ushort, C<gid_t>, etc...
It may be necessary to include F<sys/types.h> to get any
typedef'ed information.  This is only required if you have
C<getgroups()> or C<setgroups()>..

=back

=for hackers
Declared and documented at config.h, line 598

=over 4

=item C<Malloc_t>
X<Malloc_t>

This symbol is the type of pointer returned by malloc and realloc.

=back

=for hackers
Declared and documented at config.h, line 2189

=over 4

=item C<Mmap_t>
X<Mmap_t>

This symbol holds the return type of the C<mmap()> system call
(and simultaneously the type of the first argument).
Usually set to 'void *' or 'C<caddr_t>'.

=back

=for hackers
Declared and documented at config.h, line 1831

=over 4

=item C<Mode_t>
X<Mode_t>

This symbol holds the type used to declare file modes
for systems calls.  It is usually C<mode_t>, but may be
int or unsigned short.  It may be necessary to include F<sys/types.h>
to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5363

=over 4

=item C<Netdb_hlen_t>
X<Netdb_hlen_t>

This symbol holds the type used for the 2nd argument
to C<gethostbyaddr()>.

=back

=for hackers
Declared and documented at config.h, line 4494

=over 4

=item C<Netdb_host_t>
X<Netdb_host_t>

This symbol holds the type used for the 1st argument
to C<gethostbyaddr()>.

=back

=for hackers
Declared and documented at config.h, line 4493

=over 4

=item C<Netdb_name_t>
X<Netdb_name_t>

This symbol holds the type used for the argument to
C<gethostbyname()>.

=back

=for hackers
Declared and documented at config.h, line 4495

=over 4

=item C<Netdb_net_t>
X<Netdb_net_t>

This symbol holds the type used for the 1st argument to
C<getnetbyaddr()>.

=back

=for hackers
Declared and documented at config.h, line 4496

=over 4

=item C<Off_t>
X<Off_t>

This symbol holds the type used to declare offsets in the kernel.
It can be int, long, C<off_t>, etc... It may be necessary to include
F<sys/types.h> to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5353

=over 4

=item C<Off_t_size>
X<Off_t_size>

This symbol holds the number of bytes used by the C<Off_t>.

=back

=for hackers
Declared and documented at config.h, line 5355

=over 4

=item C<Pid_t>
X<Pid_t>

This symbol holds the type used to declare process ids in the kernel.
It can be int, uint, C<pid_t>, etc... It may be necessary to include
F<sys/types.h> to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5370

=over 4

=item C<Rand_seed_t>
X<Rand_seed_t>

This symbol defines the type of the argument of the
random seed function.

=back

=for hackers
Declared and documented at config.h, line 1205

=over 4

=item C<Select_fd_set_t>
X<Select_fd_set_t>

This symbol holds the type used for the 2nd, 3rd, and 4th
arguments to select.  Usually, this is 'C<fd_set> *', if C<HAS_FD_SET>
is defined, and 'int *' otherwise.  This is only useful if you
have C<select()>, of course.

=back

=for hackers
Declared and documented at config.h, line 4504

=over 4

=item C<Shmat_t>
X<Shmat_t>

This symbol holds the return type of the C<shmat()> system call.
Usually set to 'void *' or 'char *'.

=back

=for hackers
Declared and documented at config.h, line 1905

=over 4

=item C<Signal_t>
X<Signal_t>

This symbol's value is either "void" or "int", corresponding to the
appropriate return type of a signal handler.  Thus, you can declare
a signal handler using "C<Signal_t> (*handler)()", and define the
handler using "C<Signal_t> C<handler(sig)>".

=back

=for hackers
Declared and documented at config.h, line 2020

=over 4

=item C<Size_t>
X<Size_t>

This symbol holds the type used to declare length parameters
for string functions.  It is usually C<size_t>, but may be
unsigned long, int, etc.  It may be necessary to include
F<sys/types.h> to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5383

=over 4

=item C<Size_t_size>
X<Size_t_size>

This symbol holds the size of a C<Size_t> in bytes.

=back

=for hackers
Declared and documented at config.h, line 5375

=over 4

=item C<Sock_size_t>
X<Sock_size_t>

This symbol holds the type used for the size argument of
various socket calls (just the base type, not the pointer-to).

=back

=for hackers
Declared and documented at config.h, line 4510

=over 4

=item C<SSize_t>
X<SSize_t>

This symbol holds the type used by functions that return
a count of bytes or an error condition.  It must be a signed type.
It is usually C<ssize_t>, but may be long or int, etc.
It may be necessary to include F<sys/types.h> or F<unistd.h>
to get any typedef'ed information.
We will pick a type such that C<sizeof(SSize_t)> == C<sizeof(Size_t)>.

=back

=for hackers
Declared and documented at config.h, line 1217

=over 4

=item C<Time_t>
X<Time_t>

This symbol holds the type returned by C<time()>. It can be long,
or C<time_t> on C<BSD> sites (in which case F<sys/types.h> should be
included).

=back

=for hackers
Declared and documented at config.h, line 5301

=over 4

=item C<Uid_t>
X<Uid_t>

This symbol holds the type used to declare user ids in the kernel.
It can be int, ushort, C<uid_t>, etc... It may be necessary to include
F<sys/types.h> to get any typedef'ed information.

=back

=for hackers
Declared and documented at config.h, line 5406

=over 4

=item C<Uid_t_f>
X<Uid_t_f>

This symbol defines the format string used for printing a C<Uid_t>.

=back

=for hackers
Declared and documented at config.h, line 5388

=over 4

=item C<Uid_t_sign>
X<Uid_t_sign>

This symbol holds the signedness of a C<Uid_t>.
1 for unsigned, -1 for signed.

=back

=for hackers
Declared and documented at config.h, line 5394

=over 4

=item C<Uid_t_size>
X<Uid_t_size>

This symbol holds the size of a C<Uid_t> in bytes.

=back

=for hackers
Declared and documented at config.h, line 5399

=head1 Unicode Support
X<UNI_DISPLAY_BACKSLASH>X<UNI_DISPLAY_BACKSPACE>X<UNI_DISPLAY_ISPRINT>
X<UNI_DISPLAY_QQ>X<UNI_DISPLAY_REGEX>X<UNICODE_DISALLOW_ABOVE_31_BIT>
X<UNICODE_DISALLOW_ILLEGAL_C9_INTERCHANGE>
X<UNICODE_DISALLOW_ILLEGAL_INTERCHANGE>X<UNICODE_DISALLOW_NONCHAR>
X<UNICODE_DISALLOW_PERL_EXTENDED>X<UNICODE_DISALLOW_SUPER>
X<UNICODE_DISALLOW_SURROGATE>X<UNICODE_WARN_ABOVE_31_BIT>
X<UNICODE_WARN_ILLEGAL_C9_INTERCHANGE>X<UNICODE_WARN_ILLEGAL_INTERCHANGE>
X<UNICODE_WARN_NONCHAR>X<UNICODE_WARN_PERL_EXTENDED>X<UNICODE_WARN_SUPER>
X<UNICODE_WARN_SURROGATE>X<UTF8_ALLOW_CONTINUATION>X<UTF8_ALLOW_EMPTY>
X<UTF8_ALLOW_LONG>X<UTF8_ALLOW_NON_CONTINUATION>X<UTF8_ALLOW_OVERFLOW>
X<UTF8_ALLOW_PERL_EXTENDED>X<UTF8_ALLOW_SHORT>X<UTF8_CHECK_ONLY>
X<UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE>
X<UTF8_DISALLOW_ILLEGAL_INTERCHANGE>X<UTF8_DISALLOW_NONCHAR>
X<UTF8_DISALLOW_PERL_EXTENDED>X<UTF8_DISALLOW_SUPER>
X<UTF8_DISALLOW_SURROGATE>X<UTF8_GOT_CONTINUATION>X<UTF8_GOT_EMPTY>
X<UTF8_GOT_LONG>X<UTF8_GOT_NON_CONTINUATION>X<UTF8_GOT_NONCHAR>
X<UTF8_GOT_OVERFLOW>X<UTF8_GOT_PERL_EXTENDED>X<UTF8_GOT_SHORT>
X<UTF8_GOT_SUPER>X<UTF8_GOT_SURROGATE>X<UTF8_WARN_ILLEGAL_C9_INTERCHANGE>
X<UTF8_WARN_ILLEGAL_INTERCHANGE>X<UTF8_WARN_NONCHAR>
X<UTF8_WARN_PERL_EXTENDED>X<UTF8_WARN_SUPER>X<UTF8_WARN_SURROGATE>

L<perlguts/Unicode Support> has an introduction to this API.

See also C<L</Character classification>>,
C<L</Character case changing>>,
and C<L</String Handling>>.
Various functions outside this section also work specially with
Unicode.  Search for the string "utf8" in this document.


=over 4

=item C<BOM_UTF8>
X<BOM_UTF8>

This is a macro that evaluates to a string constant of the  UTF-8 bytes that
define the Unicode BYTE ORDER MARK (U+FEFF) for the platform that perl
is compiled on.  This allows code to use a mnemonic for this character that
works on both ASCII and EBCDIC platforms.
S<C<sizeof(BOM_UTF8) - 1>> can be used to get its length in
bytes.

=back

=for hackers
Declared and documented at unicode_constants.h, line 29

=over 4

=item C<bytes_cmp_utf8>
X<bytes_cmp_utf8>

Compares the sequence of characters (stored as octets) in C<b>, C<blen> with the
sequence of characters (stored as UTF-8)
in C<u>, C<ulen>.  Returns 0 if they are
equal, -1 or -2 if the first string is less than the second string, +1 or +2
if the first string is greater than the second string.

-1 or +1 is returned if the shorter string was identical to the start of the
longer string.  -2 or +2 is returned if
there was a difference between characters
within the strings.

=over 3

 int       bytes_cmp_utf8(      const U8 *b, STRLEN blen,
                                const U8 *u, STRLEN ulen)
 int  Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen,
                                const U8 *u, STRLEN ulen)

=back

=back

=for hackers
Declared in embed.fnc; documented at utf8.c, line 2761

=over 4

=item C<bytes_from_utf8*>

Described under C<L</utf8_to_bytes_overwrite>>

=back

=over 4

=item C<bytes_to_utf8>

=item C<bytes_to_utf8_free_me>

=item C<bytes_to_utf8_temp_pv>
X<bytes_to_utf8>X<bytes_to_utf8_free_me>X<bytes_to_utf8_temp_pv>

These each convert a string C<s> of length C<*lenp> bytes from the native
encoding into UTF-8 (UTF-EBCDIC on EBCDIC platforms), returning a pointer to
the UTF-8 string, and setting C<*lenp> to its length in bytes.

C<bytes_to_utf8> always allocates new memory for the result, making sure it is
NUL-terminated.

C<bytes_to_utf8_free_me> simply returns a pointer to the input string if the
string's UTF-8 representation is the same as its native representation.
Otherwise, it behaves like C<bytes_to_utf8>, returning a pointer to new memory
containing the conversion of the input.  In other words, it returns the input
string if converting the string would be a no-op.  Note that when no new string
is allocated, the function can't add a NUL to the original string if one wasn't
already there.

In both cases, the caller is responsible for arranging for any new memory to
get freed.

C<bytes_to_utf8_temp_pv> simply returns a pointer to the input string if the
string's UTF-8 representation is the same as its native representation, thus
behaving like C<bytes_to_utf8_free_me> in this situation.  Otherwise, it
behaves like C<bytes_to_utf8>, returning a pointer to new memory containing the
conversion of the input.  The difference is that it also arranges for the new
memory to automatically be freed by calling C<L</SAVEFREEPV>> on it.

C<bytes_to_utf8_free_me> takes an extra parameter, C<free_me> to communicate.
to the caller that memory was allocated or not.  If that parameter is NULL,
C<bytes_to_utf8_free_me> acts identically to C<bytes_to_utf8>, always
allocating new memory.

But when it is a non-NULL pointer, C<bytes_to_utf8_free_me> stores into it
either NULL if no memory was allocated; or a pointer to that new memory.  This
allows the following convenient paradigm:

 void * free_me;
 U8 converted = bytes_to_utf8_free_me(string, &len, &free_me);

 ...

 Safefree(free_me);

You don't have to know if memory was allocated or not.  Just call C<Safefree>
unconditionally.  C<free_me> will contain a suitable value to pass to
C<Safefree> for it to do the right thing, regardless.
Your design is likely flawed if you find yourself using C<free_me> for anything
other than passing to C<Safefree>.

Upon return, the number of variants in the string can be computed by having
saved the value of C<*lenp> before the call, and subtracting the after-call
value of C<*lenp> from it.

If you want to convert to UTF-8 from encodings other than the native (Latin1 or
EBCDIC), see L</sv_recode_to_utf8>().

=over 3

 U8 *       bytes_to_utf8        (      const U8 *s, STRLEN *lenp)
 U8 *  Perl_bytes_to_utf8        (pTHX_ const U8 *s, STRLEN *lenp)
 U8 *       bytes_to_utf8_free_me(      const U8 *s, STRLEN *lenp,
                                        void **free_me)
 U8 *  Perl_bytes_to_utf8_free_me(pTHX_ const U8 *s, STRLEN *lenp,
                                        void **free_me)
 U8 *       bytes_to_utf8_temp_pv(      const U8 *s, STRLEN *lenp)
 U8 *  Perl_bytes_to_utf8_temp_pv(pTHX_ const U8 *s, STRLEN *lenp)

=back

=back

=for hackers
bytes_to_utf8 declared in embed.fnc; all in group documented at utf8.c, line 3292
bytes_to_utf8_free_me declared in embed.fnc
bytes_to_utf8_temp_pv declared in embed.fnc

=over 4

=item C<c9strict_utf8_to_uv*>

Described under C<L</utf8_to_uv>>

=back

=over 4

=item C<DO_UTF8>
X<DO_UTF8>

Returns a bool giving whether or not the PV in C<sv> is to be treated as being
encoded in UTF-8.

You should use this I<after> a call to C<SvPV()> or one of its variants, in
case any call to string overloading updates the internal UTF-8 encoding flag.

=over 3

 bool  DO_UTF8(SV* sv)

=back

=back

=for hackers
Declared and documented at utf8.h, line 945

=over 4

=item C<extended_utf8_to_uv*>

Described under C<L</utf8_to_uv>>

=back

=over 4

=item C<foldEQ_utf8>
X<foldEQ_utf8>

Returns true if the leading portions of the strings C<s1> and C<s2> (either or
both of which may be in UTF-8) are the same case-insensitively; false
otherwise.  How far into the strings to compare is determined by other input
parameters.

If C<u1> is true, the string C<s1> is assumed to be in UTF-8-encoded Unicode;
otherwise it is assumed to be in native 8-bit encoding.  Correspondingly for
C<u2> with respect to C<s2>.

If the byte length C<l1> is non-zero, it says how far into C<s1> to check for
fold equality.  In other words, C<s1>+C<l1> will be used as a goal to reach.
The scan will not be considered to be a match unless the goal is reached, and
scanning won't continue past that goal.  Correspondingly for C<l2> with respect
to C<s2>.

If C<pe1> is non-C<NULL> and the pointer it points to is not C<NULL>, that
pointer is considered an end pointer to the position 1 byte past the maximum
point in C<s1> beyond which scanning will not continue under any circumstances.
(This routine assumes that UTF-8 encoded input strings are not malformed;
malformed input can cause it to read past C<pe1>).  This means that if both
C<l1> and C<pe1> are specified, and C<pe1> is less than C<s1>+C<l1>, the match
will never be successful because it can never
get as far as its goal (and in fact is asserted against).  Correspondingly for
C<pe2> with respect to C<s2>.

At least one of C<s1> and C<s2> must have a goal (at least one of C<l1> and
C<l2> must be non-zero), and if both do, both have to be
reached for a successful match.   Also, if the fold of a character is multiple
characters, all of them must be matched (see tr21 reference below for
'folding').

Upon a successful match, if C<pe1> is non-C<NULL>,
it will be set to point to the beginning of the I<next> character of C<s1>
beyond what was matched.  Correspondingly for C<pe2> and C<s2>.

For case-insensitiveness, the "casefolding" of Unicode is used
instead of upper/lowercasing both the characters, see
L<https://www.unicode.org/reports/tr21/> (Case Mappings).

=over 3

 I32  foldEQ_utf8(const char *s1, char **pe1, UV l1, bool u1,
                  const char *s2, char **pe2, UV l2, bool u2)

=back

=back

=for hackers
Declared in embed.fnc; documented at utf8.c, line 4872

=over 4

=item C<is_ascii_string*>

Described under C<L</is_utf8_invariant_string>>

=back

=over 4

=item C<is_c9strict_utf8_string*>

=item C<is_c9strict_utf8_string_loc*>

=item C<is_c9strict_utf8_string_loclen*>

Described under C<L</is_utf8_string>>

=back

=over 4

=item C<is_invariant_string*>

Described under C<L</is_utf8_invariant_string>>

=back

=over 4

=item C<is_strict_utf8_string*>

=item C<is_strict_utf8_string_loc*>

=item C<is_strict_utf8_string_loclen*>

Described under C<L</is_utf8_string>>

=back

=over 4

=item C<is_utf8_char_buf*>

Described under C<L</isUTF8_CHAR>>

=back

=over 4

=item C<is_utf8_fixed_width_buf_flags>

=item C<is_utf8_fixed_width_buf_loc_flags>

=item C<is_utf8_fixed_width_buf_loclen_flags>
X<is_utf8_fixed_width_buf_flags>X<is_utf8_fixed_width_buf_loc_flags>
X<is_utf8_fixed_width_buf_loclen_flags>

These each return TRUE if the fixed-width buffer starting at C<s> with length
C<len> is entirely valid UTF-8, subject to the restrictions given by C<flags>;
otherwise they return FALSE.

If C<flags> is 0, any well-formed UTF-8, as extended by Perl, is accepted
without restriction.  If the final few bytes of the buffer do not form a
complete code point, this will return TRUE anyway, provided that
C<L</is_utf8_valid_partial_char_flags>> returns TRUE for them.

C<flags> can be zero or any combination of the C<UTF8_DISALLOW_I<foo>> flags
accepted by C<L</utf8_to_uv>>, and with the same meanings.

The functions differ from C<L</is_utf8_string_flags>> only in that the latter
returns FALSE if the final few bytes of the string don't form a complete code
point.

C<is_utf8_fixed_width_buf_loc_flags>> does all the preceding, but takes an
extra parameter, C<ep> into which it stores the location of the failure, if
C<ep> is not NULL.  If instead the function returns TRUE, C<*ep> will point to
the beginning of any partial character at the end of the buffer; if there is no
partial character C<*ep> will contain C<s>+C<len>.

C<is_utf8_fixed_width_buf_loclen_flags>> does all the preceding, but takes
another extra parameter, C<el> into which it stores the number of complete,
valid characters found, if C<el> is not NULL.

=over 3

 bool       is_utf8_fixed_width_buf_flags       (
                                              const U8 * const s,
                                               STRLEN len,
                                               const U32 flags)
 bool       is_utf8_fixed_width_buf_loc_flags   (
                                              const U8 * const s,
                                               STRLEN len,
                                               const U8 **ep,
                                               const U32 flags)
 bool       is_utf8_fixed_width_buf_loclen_flags(
                                              const U8 * const s,
                                               STRLEN len,
                                               const U8 **ep,
                                               STRLEN *el,
                                               const U32 flags)
 bool  Perl_is_utf8_fixed_width_buf_loclen_flags(
                                              const U8 * const s,
                                               STRLEN len,
                                               const U8 **ep,
                                               STRLEN *el,
                                               const U32 flags)

=back

=back

=for hackers
is_utf8_fixed_width_buf_flags declared in embed.fnc; all in group documented at inline.h, line 3059
is_utf8_fixed_width_buf_loc_flags declared in embed.fnc
is_utf8_fixed_width_buf_loclen_flags declared in embed.fnc

=over 4

=item C<is_utf8_invariant_string>

=item C<is_utf8_invariant_string_loc>

=item C<is_ascii_string>

=item C<is_invariant_string>
X<is_ascii_string>X<is_invariant_string>X<is_utf8_invariant_string>
X<is_utf8_invariant_string_loc>

These each return TRUE if the first C<len> bytes of the string C<s> are the
same regardless of the UTF-8 encoding of the string (or UTF-EBCDIC encoding on
EBCDIC machines); otherwise they returns FALSE.  That is, they return TRUE if
they are UTF-8 invariant.  On ASCII-ish machines, all the ASCII characters and
only the ASCII characters fit this definition.  On EBCDIC machines, the
ASCII-range characters are invariant, but so also are the C1 controls.

If C<len> is 0, it will be calculated using C<strlen(s)>, (which means if you
use this option, that C<s> can't have embedded C<NUL> characters and has to
have a terminating C<NUL> byte).

All forms except C<is_utf8_invariant_string_loc> have identical behavior.  The
only difference with it is that it has an extra pointer parameter, C<ep>, into
which, if it isn't NULL, the location of the first UTF-8 variant character in
the C<ep> pointer will be stored upon failure.  If all characters are UTF-8
invariant, this function does not change the contents of C<*ep>.

C<is_invariant_string> is somewhat misleadingly named.
C<is_utf8_invariant_string> is preferred, as it indicates under what conditions
the string is invariant.

C<is_ascii_string> is misleadingly-named.  On ASCII-ish platforms, the name
isn't misleading: the ASCII-range characters are exactly the UTF-8 invariants.
But EBCDIC machines have more UTF-8 invariants than just the ASCII characters,
so the name C<is_utf8_invariant_string> is preferred.

See also
C<L</is_utf8_string>> and C<L</is_utf8_fixed_width_buf_flags>>.

=over 3

 bool       is_utf8_invariant_string    (const U8 * const s,
                                         STRLEN len)
 bool       is_utf8_invariant_string_loc(const U8 * const s,
                                         STRLEN len,
                                         const U8 **ep)
 bool  Perl_is_utf8_invariant_string_loc(const U8 * const s,
                                         STRLEN len,
                                         const U8 **ep)
 bool       is_ascii_string             (const U8 * const s,
                                         STRLEN len)
 bool       is_invariant_string         (const U8 * const s,
                                         STRLEN len)

=back

=back

=for hackers
is_utf8_invariant_string declared at inline.h, line 1396; all in group documented at inline.h, line 1362
is_utf8_invariant_string_loc declared in embed.fnc
is_ascii_string declared at utf8.h, line 135
is_invariant_string declared at utf8.h, line 136

=over 4

=item C<is_utf8_string>

=item C<is_utf8_string_loc>

=item C<is_utf8_string_loclen>

=item C<is_strict_utf8_string>

=item C<is_strict_utf8_string_loc>

=item C<is_strict_utf8_string_loclen>

=item C<is_c9strict_utf8_string>

=item C<is_c9strict_utf8_string_loc>

=item C<is_c9strict_utf8_string_loclen>

=item C<is_utf8_string_flags>

=item C<is_utf8_string_loc_flags>

=item C<is_utf8_string_loclen_flags>
X<is_c9strict_utf8_string>X<is_c9strict_utf8_string_loc>
X<is_c9strict_utf8_string_loclen>X<is_strict_utf8_string>
X<is_strict_utf8_string_loc>X<is_strict_utf8_string_loclen>
X<is_utf8_string>X<is_utf8_string_flags>X<is_utf8_string_loc>
X<is_utf8_string_loc_flags>X<is_utf8_string_loclen>
X<is_utf8_string_loclen_flags>

These each return TRUE if the first C<len> bytes of string C<s> form a valid
UTF-8 string for varying degrees of strictness, FALSE otherwise.  If C<len> is
0, it will be calculated using C<strlen(s)> (which means if you use this
option, that C<s> can't have embedded C<NUL> characters and has to have a
terminating C<NUL> byte).  Note that all characters being ASCII constitute 'a
valid UTF-8 string'.

Some of the functions also return information about the string.  Those that
have the suffix C<_loc> in their names have an extra parameter, C<ep>.  If that
is not NULL, the function stores into it the location of how far it got in
parsing C<s>.  If the function is returning TRUE, this will be a pointer to the
byte immediately after the end of C<s>.  If FALSE, it will be the location of
the first byte that fails the criteria.

The functions that instead have the suffix C<_loclen> have a second extra
parameter, C<el>.  They act as the plain C<_loc> functions do with their C<ep>
parameter, but if C<el> is not null, the functions store into it the number of
UTF-8 encoded characters found at the point where parsing stopped.  If the
function is returning TRUE, this will be the full count of the UTF-8 characters
in C<s>; if FALSE, it will be the count before the first invalid one.

C<is_utf8_string> (and C<is_utf8_string_loc> and C<is_utf8_string_loclen>)
consider Perl's extended UTF-8 to be valid.  That means that
code points above Unicode, surrogates, and non-character code points are
all considered valid by this function.  Problems may arise in interchange with
non-Perl applications, or (unlikely) between machines with different word
sizes.

C<is_strict_utf8_string> (and C<is_strict_utf8_string_loc> and
C<is_strict_utf8_string_loclen>) consider only Unicode-range (0 to 0x10FFFF)
code points to be valid, with the surrogates and non-character code points
invalid.  This level of strictness is what is safe to accept from outside
sources that use Unicode rules.

The forms whose names contain C<c9strict> conform to the level of strictness
given in
L<Unicode Corrigendum #9|http://www.unicode.org/versions/corrigendum9.html>.
This means Unicode-range code points including non-character ones are
considered valid, but not the surrogates.  This level of strictness is
considered safe for cooperating components that know how the other components
handle non-character code points.

The forms whose names contain C<_flags> allow you to customize the acceptable
level of strictness.  They have an extra parameter, C<flags> to indicate the
types of code points that are acceptable.  If C<flags> is 0, they give the
same results as C<L</is_utf8_string>> (and kin); if C<flags> is
C<UTF8_DISALLOW_ILLEGAL_INTERCHANGE>, they give the same results as
C<L</is_strict_utf8_string>> (and kin); and if C<flags> is
C<UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE>, they give the same results as
C<L</is_c9strict_utf8_string>> (and kin).  Otherwise C<flags> may be any
combination of the C<UTF8_DISALLOW_I<foo>> flags understood by
C<L</utf8_to_uv>>, with the same meanings.

It's better to use one of the non-C<_flags> functions if they give you the
desired strictness, as those have a better chance of being inlined by the C
compiler.

See also
C<L</is_utf8_invariant_string>>,
C<L</is_utf8_fixed_width_buf_flags>>,

=over 3

 bool       is_utf8_string                (const U8 *s,
                                           STRLEN len)
 bool       is_utf8_string_loc            (const U8 *s,
                                           const STRLEN len,
                                           const U8 **ep)
 bool  Perl_is_utf8_string_loc            (const U8 *s,
                                           const STRLEN len,
                                           const U8 **ep)
 bool       is_utf8_string_loclen         (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool  Perl_is_utf8_string_loclen         (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool       is_strict_utf8_string         (const U8 *s,
                                           STRLEN len)
 bool       is_strict_utf8_string_loc     (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep)
 bool       is_strict_utf8_string_loclen  (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool  Perl_is_strict_utf8_string_loclen  (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool       is_c9strict_utf8_string       (const U8 *s,
                                           STRLEN len)
 bool       is_c9strict_utf8_string_loc   (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep)
 bool       is_c9strict_utf8_string_loclen(const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool  Perl_is_c9strict_utf8_string_loclen(const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el)
 bool       is_utf8_string_flags          (const U8 *s,
                                           STRLEN len,
                                           const U32 flags)
 bool  Perl_is_utf8_string_flags          (const U8 *s,
                                           STRLEN len,
                                           const U32 flags)
 bool       is_utf8_string_loc_flags      (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           const U32 flags)
 bool       is_utf8_string_loclen_flags   (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el,
                                           const U32 flags)
 bool  Perl_is_utf8_string_loclen_flags   (const U8 *s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el,
                                           const U32 flags)

=back

=back

=for hackers
is_utf8_string declared in embed.fnc; all in group documented at inline.h, line 2058
is_utf8_string_loc declared in embed.fnc
is_utf8_string_loclen declared in embed.fnc
is_strict_utf8_string declared in embed.fnc
is_strict_utf8_string_loc declared in embed.fnc
is_strict_utf8_string_loclen declared in embed.fnc
is_c9strict_utf8_string declared in embed.fnc
is_c9strict_utf8_string_loc declared in embed.fnc
is_c9strict_utf8_string_loclen declared in embed.fnc
is_utf8_string_flags declared in embed.fnc
is_utf8_string_loc_flags declared in embed.fnc
is_utf8_string_loclen_flags declared in embed.fnc

=over 4

=item C<is_utf8_valid_partial_char>

=item C<is_utf8_valid_partial_char_flags>
X<is_utf8_valid_partial_char>X<is_utf8_valid_partial_char_flags>

These each return FALSE if the sequence of bytes starting at C<s> and looking no
further than S<C<e - 1>> is the UTF-8 encoding for one or more code points.
That is, FALSE is returned if C<s> points to at least one entire UTF-8 encoded
character.

Otherwise, they return TRUE if there exists at least one non-empty sequence of
bytes that when appended to sequence C<s>, starting at position C<e> causes the
entire sequence to be the well-formed UTF-8 of some code point

In other words they return TRUE if C<s> points to an incomplete UTF-8-encoded
code point; FALSE otherwise.

This is useful when a fixed-length buffer is being tested for being well-formed
UTF-8, but the final few bytes in it don't comprise a full character; that is,
it is split somewhere in the middle of the final code point's UTF-8
representation.  (Presumably when the buffer is refreshed with the next chunk
of data, the new first bytes will complete the partial code point.)   This
function is used to verify that the final bytes in the current buffer are in
fact the legal beginning of some code point, so that if they aren't, the
failure can be signalled without having to wait for the next read.

C<is_utf8_valid_partial_char> behaves identically to
C<is_utf8_valid_partial_char_flags> when the latter is called with a zero
C<flags> parameter.  This parameter is used to restrict the classes of code
points that are considered to be valid.  When zero, Perl's extended UTF-8 is
used.  Otherwise C<flags> can be any combination of the C<UTF8_DISALLOW_I<foo>>
flags accepted by C<L</utf8_to_uv>>.  If there is any sequence of bytes
that can complete the input partial character in such a way that a
non-prohibited character is formed, the function returns TRUE; otherwise FALSE.
Non-character code points cannot be determined based on partial character
input, so TRUE is always returned if C<s> looks like it could be the beginning
on one of those.  But many  of the other possible excluded types can be
determined from just the first one or two bytes.

=over 3

 bool       is_utf8_valid_partial_char      (const U8 * const s0,
                                             const U8 * const e)
 bool       is_utf8_valid_partial_char_flags(const U8 * const s0,
                                             const U8 * const e,
                                             const U32 flags)
 bool  Perl_is_utf8_valid_partial_char_flags(const U8 * const s0,
                                             const U8 * const e,
                                             const U32 flags)

=back

=back

=for hackers
is_utf8_valid_partial_char declared in embed.fnc; all in group documented at inline.h, line 2972
is_utf8_valid_partial_char_flags declared in embed.fnc

=over 4

=item C<isUTF8_CHAR>

=item C<isSTRICT_UTF8_CHAR>

=item C<isC9_STRICT_UTF8_CHAR>

=item C<isUTF8_CHAR_flags>

=item C<is_utf8_char_buf>
X<is_utf8_char_buf>X<isC9_STRICT_UTF8_CHAR>X<isSTRICT_UTF8_CHAR>
X<isUTF8_CHAR>X<isUTF8_CHAR_flags>

These each evaluate to non-zero if the first few bytes of the string starting
at C<s> and looking no further than S<C<e - 1>> are well-formed UTF-8 that
represents some code point, for varying degrees of strictness.  Otherwise they
evaluate to 0.  If non-zero, the value gives how many bytes starting at C<s>
comprise the code point's representation.  Any bytes remaining before C<e>, but
beyond the ones needed to form the first code point in C<s>, are not examined.

These are used to efficiently decide if the next few bytes in C<s> are
legal UTF-8 for a single character.

With C<isUTF8_CHAR>, the code point can be any that will fit in an IV on this
machine, using Perl's extension to official UTF-8 to represent those higher
than the Unicode maximum of 0x10FFFF.  That means that this will consider byte
sequences to be valid that are unrecognized or considered illegal by non-Perl
applications.

With C<L</isSTRICT_UTF8_CHAR>>, acceptable code points are restricted to those
defined by Unicode to be fully interchangeable across applications.
This means code points above the Unicode range (max legal is 0x10FFFF),
surrogates, and non-character code points are rejected.

With C<L</isC9_STRICT_UTF8_CHAR>>, acceptable code points are restricted to
those defined by Unicode to be fully interchangeable within an application.
This means code points above the Unicode range and surrogates are rejected, but
non-character code points are accepted.  See L<Unicode Corrigendum
#9|http://www.unicode.org/versions/corrigendum9.html>.

Use C<L</isUTF8_CHAR_flags>> to customize what code points are acceptable.
If C<flags> is 0, this gives the same results as C<L</isUTF8_CHAR>>;
if C<flags> is C<UTF8_DISALLOW_ILLEGAL_INTERCHANGE>, this gives the same results
as C<L</isSTRICT_UTF8_CHAR>>;
and if C<flags> is C<UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE>, this gives
the same results as C<L</isC9_STRICT_UTF8_CHAR>>.
Otherwise C<flags> may be any combination of the C<UTF8_DISALLOW_I<foo>> flags
understood by C<L</utf8_to_uv>>, with the same meanings.

The three alternative macros are for the most commonly needed validations; they
are likely to run somewhat faster than this more general one, as they can be
inlined into your code.

Use one of the C<L</is_utf8_string>> forms to check entire strings.

Note also that a UTF-8 "invariant" character (i.e. ASCII on non-EBCDIC
machines) is a valid UTF-8 character.

C<is_utf8_char_buf> is the old name for C<isUTF8_CHAR>.  Do not use it in new
code.

=over 3

 Size_t       isUTF8_CHAR          (const U8 * const s0,
                                    const U8 * const e)
 Size_t  Perl_isUTF8_CHAR          (const U8 * const s0,
                                    const U8 * const e)
 Size_t       isSTRICT_UTF8_CHAR   (const U8 * const s0,
                                    const U8 * const e)
 Size_t  Perl_isSTRICT_UTF8_CHAR   (const U8 * const s0,
                                    const U8 * const e)
 Size_t       isC9_STRICT_UTF8_CHAR(const U8 * const s0,
                                    const U8 * const e)
 Size_t  Perl_isC9_STRICT_UTF8_CHAR(const U8 * const s0,
                                    const U8 * const e)
 Size_t       isUTF8_CHAR_flags    (const U8 * const s0,
                                    const U8 * const e,
                                    const U32 flags)
 Size_t  Perl_isUTF8_CHAR_flags    (const U8 * const s0,
                                    const U8 * const e,
                                    const U32 flags)
 STRLEN       is_utf8_char_buf     (const U8 *buf,
                                    const U8 *buf_end)
 STRLEN  Perl_is_utf8_char_buf     (const U8 *buf,
                                    const U8 *buf_end)

=back

=back

=for hackers
isUTF8_CHAR declared in embed.fnc; all in group documented at inline.h, line 2336
isSTRICT_UTF8_CHAR declared in embed.fnc
isC9_STRICT_UTF8_CHAR declared in embed.fnc
isUTF8_CHAR_flags declared in embed.fnc
is_utf8_char_buf declared in embed.fnc

=over 4

=item C<LATIN1_TO_NATIVE>
X<LATIN1_TO_NATIVE>

Returns the native  equivalent of the input Latin-1 code point (including ASCII
and control characters) given by C<ch>.  Thus, C<LATIN1_TO_NATIVE(66)> on
EBCDIC platforms returns 194.  These each represent the character C<"B"> on
their respective platforms.  On ASCII platforms no conversion is needed, so
this macro expands to just its input, adding no time nor space requirements to
the implementation.

For conversion of code points potentially larger than will fit in a character,
use L</UNI_TO_NATIVE>.

=over 3

 U8  LATIN1_TO_NATIVE(U8 ch)

=back

=back

=for hackers
Declared and documented at utf8.h, line 263

=over 4

=item C<NATIVE_TO_LATIN1>
X<NATIVE_TO_LATIN1>

Returns the Latin-1 (including ASCII and control characters) equivalent of the
input native code point given by C<ch>.  Thus, C<NATIVE_TO_LATIN1(193)> on
EBCDIC platforms returns 65.  These each represent the character C<"A"> on
their respective platforms.  On ASCII platforms no conversion is needed, so
this macro expands to just its input, adding no time nor space requirements to
the implementation.

For conversion of code points potentially larger than will fit in a character,
use L</NATIVE_TO_UNI>.

=over 3

 U8  NATIVE_TO_LATIN1(U8 ch)

=back

=back

=for hackers
Declared and documented at utf8.h, line 251

=over 4

=item C<NATIVE_TO_UNI>
X<NATIVE_TO_UNI>

Returns the Unicode  equivalent of the input native code point given by C<ch>.
Thus, C<NATIVE_TO_UNI(195)> on EBCDIC platforms returns 67.  These each
represent the character C<"C"> on their respective platforms.  On ASCII
platforms no conversion is needed, so this macro expands to just its input,
adding no time nor space requirements to the implementation.

=over 3

 UV  NATIVE_TO_UNI(UV ch)

=back

=back

=for hackers
Declared and documented at utf8.h, line 275

=over 4

=item C<pv_uni_display>
X<pv_uni_display>

Build to the scalar C<dsv> a displayable version of the UTF-8 encoded string
C<spv>, length C<len>, the displayable version being at most C<pvlim> bytes
long (if longer, the rest is truncated and C<"..."> will be appended).

The C<flags> argument can have any combination of these flag bits

=over

=item C<UNI_DISPLAY_ISPRINT>

to display C<isPRINT()>able characters as themselves

=item C<UNI_DISPLAY_BACKSLASH>

to display the C<\\[nrfta\\]> as the backslashed versions (like C<"\n">)

(C<UNI_DISPLAY_BACKSLASH> is preferred over C<UNI_DISPLAY_ISPRINT> for C<"\\">).

=item C<UNI_DISPLAY_BACKSPACE>

to display C<\b> for a backspace, but only when C<UNI_DISPLAY_BACKSLASH> also
is set.

=item C<UNI_DISPLAY_REGEX>

This a shorthand for C<UNI_DISPLAY_ISPRINT> along with
C<UNI_DISPLAY_BACKSLASH>.

=item C<UNI_DISPLAY_QQ>

This a shorthand for all three C<UNI_DISPLAY_ISPRINT>,
C<UNI_DISPLAY_BACKSLASH>, and C<UNI_DISPLAY_BACKSLASH>.

=back

The pointer to the PV of the C<dsv> is returned.

See also L</sv_uni_display>.

=over 3

 char *       pv_uni_display(      SV *dsv, const U8 *spv,
                                   STRLEN len, STRLEN pvlim,
                                   UV flags)
 char *  Perl_pv_uni_display(pTHX_ SV *dsv, const U8 *spv,
                                   STRLEN len, STRLEN pvlim,
                                   UV flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at utf8.c, line 4742

=over 4

=item C<REPLACEMENT_CHARACTER_UTF8>
X<REPLACEMENT_CHARACTER_UTF8>

This is a macro that evaluates to a string constant of the  UTF-8 bytes that
define the Unicode REPLACEMENT CHARACTER (U+FFFD) for the platform that perl
is compiled on.  This allows code to use a mnemonic for this character that
works on both ASCII and EBCDIC platforms.
S<C<sizeof(REPLACEMENT_CHARACTER_UTF8) - 1>> can be used to get its length in
bytes.

=back

=for hackers
Declared and documented at unicode_constants.h, line 38

=over 4

=item C<strict_utf8_to_uv*>

Described under C<L</utf8_to_uv>>

=back

=over 4

=item C<sv_cat_decode>
X<sv_cat_decode>

C<encoding> is assumed to be an C<Encode> object, the PV of C<ssv> is
assumed to be octets in that encoding and decoding the input starts
from the position which S<C<(PV + *offset)>> pointed to.  C<dsv> will be
concatenated with the decoded UTF-8 string from C<ssv>.  Decoding will terminate
when the string C<tstr> appears in decoding output or the input ends on
the PV of C<ssv>.  The value which C<offset> points will be modified
to the last input position on C<ssv>.

Returns TRUE if the terminator was found, else returns FALSE.

=over 3

 bool       sv_cat_decode(      SV *dsv, SV *encoding, SV *ssv,
                                int *offset, char *tstr, int tlen)
 bool  Perl_sv_cat_decode(pTHX_ SV *dsv, SV *encoding, SV *ssv,
                                int *offset, char *tstr, int tlen)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 16635

=over 4

=item C<sv_recode_to_utf8>
X<sv_recode_to_utf8>

C<encoding> is assumed to be an C<Encode> object, on entry the PV
of C<sv> is assumed to be octets in that encoding, and C<sv>
will be converted into Unicode (and UTF-8).

If C<sv> already is UTF-8 (or if it is not C<POK>), or if C<encoding>
is not a reference, nothing is done to C<sv>.  If C<encoding> is not
an C<Encode::XS> Encoding object, bad things will happen.
(See L<encoding> and L<Encode>.)

The PV of C<sv> is returned.

=over 3

 char *       sv_recode_to_utf8(      SV *sv, SV *encoding)
 char *  Perl_sv_recode_to_utf8(pTHX_ SV *sv, SV *encoding)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 16558

=over 4

=item C<sv_uni_display>
X<sv_uni_display>

Build to the scalar C<dsv> a displayable version of the scalar C<sv>,
the displayable version being at most C<pvlim> bytes long
(if longer, the rest is truncated and "..." will be appended).

The C<flags> argument is as in L</pv_uni_display>().

The pointer to the PV of the C<dsv> is returned.

=over 3

 char *       sv_uni_display(      SV *dsv, SV *ssv, STRLEN pvlim,
                                   UV flags)
 char *  Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim,
                                   UV flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at utf8.c, line 4847

=over 4

=item C<UNI_TO_NATIVE>
X<UNI_TO_NATIVE>

Returns the native  equivalent of the input Unicode code point  given by C<ch>.
Thus, C<UNI_TO_NATIVE(68)> on EBCDIC platforms returns 196.  These each
represent the character C<"D"> on their respective platforms.  On ASCII
platforms no conversion is needed, so this macro expands to just its input,
adding no time nor space requirements to the implementation.

=over 3

 UV  UNI_TO_NATIVE(UV ch)

=back

=back

=for hackers
Declared and documented at utf8.h, line 283

=over 4

=item C<UNICODE_IS_NONCHAR>
X<UNICODE_IS_NONCHAR>

Returns a boolean as to whether or not C<uv> is one of the Unicode
non-character code points

=over 3

 bool  UNICODE_IS_NONCHAR(const UV uv)

=back

=back

=for hackers
Declared and documented at utf8.h, line 1079

=over 4

=item C<UNICODE_IS_REPLACEMENT>
X<UNICODE_IS_REPLACEMENT>

Returns a boolean as to whether or not C<uv> is the Unicode REPLACEMENT
CHARACTER

=over 3

 bool  UNICODE_IS_REPLACEMENT(const UV uv)

=back

=back

=for hackers
Declared and documented at utf8.h, line 997

=over 4

=item C<UNICODE_IS_SUPER>
X<UNICODE_IS_SUPER>

Returns a boolean as to whether or not C<uv> is above the maximum legal Unicode
code point of U+10FFFF.

=over 3

 bool  UNICODE_IS_SUPER(const UV uv)

=back

=back

=for hackers
Declared and documented at utf8.h, line 1025

=over 4

=item C<UNICODE_IS_SURROGATE>
X<UNICODE_IS_SURROGATE>

Returns a boolean as to whether or not C<uv> is one of the Unicode surrogate
code points

=over 3

 bool  UNICODE_IS_SURROGATE(const UV uv)

=back

=back

=for hackers
Declared and documented at utf8.h, line 971

=over 4

=item C<UNICODE_REPLACEMENT>
X<UNICODE_REPLACEMENT>

Evaluates to 0xFFFD, the code point of the Unicode REPLACEMENT CHARACTER

=back

=for hackers
Declared and documented at utf8.h, line 993

=over 4

=item C<UTF8_CHK_SKIP*>

Described under C<L</UTF8SKIP>>

=back

=over 4

=item C<utf8_distance>
X<utf8_distance>

Returns the number of UTF-8 characters between the UTF-8 pointers C<a>
and C<b>.

WARNING: use only if you *know* that the pointers point inside the
same UTF-8 buffer.

=over 3

 IV       utf8_distance(      const U8 *a, const U8 *b)
 IV  Perl_utf8_distance(pTHX_ const U8 *a, const U8 *b)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 2645

=over 4

=item C<utf8_hop>
X<utf8_hop>

Return the UTF-8 pointer C<s> displaced by C<off> characters, either
forward (if C<off> is positive) or backward (if negative).  C<s> does not need
to be pointing to the starting byte of a character.  If it isn't, one count of
C<off> will be used up to get to the start of the next character for forward
hops, and to the start of the current character for negative ones.

WARNING: Prefer L</utf8_hop_safe> to this one.

Do NOT use this function unless you B<know> C<off> is within
the UTF-8 data pointed to by C<s> B<and> that on entry C<s> is aligned
on the first byte of a character or just after the last byte of a character.

=over 3

 U8 *       utf8_hop(const U8 *s, SSize_t off)
 U8 *  Perl_utf8_hop(const U8 *s, SSize_t off)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 2665

=over 4

=item C<utf8_hop_back>

=item C<utf8_hop_back_overshoot>
X<utf8_hop_back>X<utf8_hop_back_overshoot>

These each take as input a string encoded as UTF-8 which starts at C<start>,
and a position into it given by C<s>, and return the position within it that is
C<s> displaced by up to C<off> characters backwards.

If there are fewer than C<off> characters between C<start> and C<s>, the
functions return C<start>.

The functions differ in that C<utf8_hop_back_overshoot> can return how many
characters C<off> beyond the edge the request was for.  When its parameter,
C<&remaining>, is not NULL, the function stores into it the count of the
excess; zero if the request was completely fulfilled.  The actual number of
characters that were displaced can then be calculated as S<C<off - remaining>>.
This function acts identically to plain C<utf8_hop_back> when this parameter is
NULL.

C<s> does not need to be pointing to the starting byte of a character.  If it
isn't, one count of C<off> will be used up to get to that start.

C<off> must be non-positive, and if zero, no action is taken; C<s> is returned
unchanged.  That it otherwise must be negative means that the earlier
description is a lie, to avoid burdening you with this detail too soon.  An
C<off> of C<-2> means to displace two characters backwards, so the displacement
is actually the absolute value of C<off>.  C<remaining> will also be
non-positive.  If there was only one character between C<start> and C<s>, and a
displacement of C<-2> was requested, C<remaining> would be set to C<-1>.  The
subtraction formula works, yielding the result that only C<-1> character was
displaced.

=over 3

 U8 *       utf8_hop_back          (const U8 *s, SSize_t off,
                                    const U8 * const start)
 U8 *  Perl_utf8_hop_back          (const U8 *s, SSize_t off,
                                    const U8 * const start)
 U8 *       utf8_hop_back_overshoot(const U8 *s, SSize_t off,
                                    const U8 * const start,
                                    SSize_t *remaining)
 U8 *  Perl_utf8_hop_back_overshoot(const U8 *s, SSize_t off,
                                    const U8 * const start,
                                    SSize_t *remaining)

=back

=back

=for hackers
utf8_hop_back declared in embed.fnc; all in group documented at inline.h, line 2814
utf8_hop_back_overshoot declared in embed.fnc

=over 4

=item C<utf8_hop_forward>

=item C<utf8_hop_forward_overshoot>
X<utf8_hop_forward>X<utf8_hop_forward_overshoot>

These each take as input a position, C<s0>, into a string encoded as UTF-8
which ends at the byte before C<end>, and return the position within it that is
C<s0> displaced by up to C<off> characters forwards.

If there are fewer than C<off> characters between C<s0> and C<end>, the
functions return C<end>.

The functions differ in two ways

=over 4

=item *

C<utf8_hop_forward_overshoot> can return how many characters beyond the edge
the request was for.  When its parameter, C<&remaining>, is not NULL, the
function stores into it the count of the excess; zero if the request was
completely fulfilled.  The actual number of characters that were displaced can
then be calculated as S<C<off - remaining>>.

=item *

C<utf8_hop_forward> will panic if called with C<s0> already positioned at or
beyond the edge of the string ending at C<end> and the request is to go even
further over the edge.  C<utf8_hop_forward_overshoot> presumes the caller will
handle any errors, and just stores C<off> into C<remaining> without doing
anything else.

=back

(The above contains a slight lie.  When C<remaining> is NULL, the two functions
act identically.)

C<s0> does not need to be pointing to the starting byte of a character.  If it
isn't, one count of C<off> will be used up to get to that start.

C<off> must be non-negative, and if zero, no action is taken; C<s0> is returned
unchanged.

=over 3

 U8 *       utf8_hop_forward          (const U8 *s, SSize_t off,
                                       const U8 * const end)
 U8 *  Perl_utf8_hop_forward          (const U8 *s, SSize_t off,
                                       const U8 * const end)
 U8 *       utf8_hop_forward_overshoot(const U8 *s, SSize_t off,
                                       const U8 * const end,
                                       SSize_t *remaining)
 U8 *  Perl_utf8_hop_forward_overshoot(const U8 *s, SSize_t off,
                                       const U8 * const end,
                                       SSize_t *remaining)

=back

=back

=for hackers
utf8_hop_forward declared in embed.fnc; all in group documented at inline.h, line 2719
utf8_hop_forward_overshoot declared in embed.fnc

=over 4

=item C<utf8_hop_safe>

=item C<utf8_hop_overshoot>
X<utf8_hop_overshoot>X<utf8_hop_safe>

These each take as input a string encoded as UTF-8 which starts at C<start>,
ending at C<end>, and a position into it given by C<s>, and return the
position within it that is C<s> displaced by up to C<off> characters, either
forwards if C<off> is positive, or backwards if C<off> is negative.  (Nothing
is done if C<off> is 0.)

If there are fewer than C<off> characters between C<s> and the respective edge,
the functions return that edge.

The functions differ in that C<utf8_hop_overshoot> can return how many
characters beyond the edge the request was for.  When its parameter,
C<&remaining>, is not NULL, the function stores into it the count of the
excess; zero if the request was completely fulfilled.  The actual number of
characters that were displaced can then be calculated as S<C<off - remaining>>.
This function acts identically to plain C<utf8_hop_safe> when this parameter is
NULL.

C<s> does not need to be pointing to the starting byte of a character.  If it
isn't, one count of C<off> will be used up to get to that start.

To be more precise, the displacement is by the absolute value of C<off>, and
the excess count is the absolute value of C<remaining>.

=over 3

 U8 *       utf8_hop_safe     (const U8 *s, SSize_t off,
                               const U8 * const start,
                               const U8 * const end)
 U8 *  Perl_utf8_hop_safe     (const U8 *s, SSize_t off,
                               const U8 * const start,
                               const U8 * const end)
 U8 *       utf8_hop_overshoot(const U8 *s, SSize_t off,
                               const U8 * const start,
                               const U8 * const end,
                               SSize_t *remaining)
 U8 *  Perl_utf8_hop_overshoot(const U8 *s, SSize_t off,
                               const U8 * const start,
                               const U8 * const end,
                               SSize_t *remaining)

=back

=back

=for hackers
utf8_hop_safe declared in embed.fnc; all in group documented at inline.h, line 2886
utf8_hop_overshoot declared in embed.fnc

=over 4

=item C<UTF8_IS_INVARIANT>
X<UTF8_IS_INVARIANT>

Evaluates to 1 if the byte C<c> represents the same character when encoded in
UTF-8 as when not; otherwise evaluates to 0.  UTF-8 invariant characters can be
copied as-is when converting to/from UTF-8, saving time.

In spite of the name, this macro gives the correct result if the input string
from which C<c> comes is not encoded in UTF-8.

See C<L</UVCHR_IS_INVARIANT>> for checking if a UV is invariant.

=over 3

 bool  UTF8_IS_INVARIANT(char c)

=back

=back

=for hackers
Declared and documented at utf8.h, line 841

=over 4

=item C<UTF8_IS_NONCHAR>
X<UTF8_IS_NONCHAR>

Evaluates to non-zero if the first few bytes of the string starting at C<s> and
looking no further than S<C<e - 1>> are well-formed UTF-8 that represents one
of the Unicode non-character code points; otherwise it evaluates to 0.  If
non-zero, the value gives how many bytes starting at C<s> comprise the code
point's representation.

=over 3

 bool  UTF8_IS_NONCHAR(const U8 *s, const U8 *e)

=back

=back

=for hackers
Declared and documented at utf8.h, line 1103

=over 4

=item C<UTF8_IS_REPLACEMENT>
X<UTF8_IS_REPLACEMENT>

Evaluates to non-zero if the first few bytes of the string starting at C<s> and
looking no further than S<C<e - 1>> are well-formed UTF-8 that represents the
Unicode REPLACEMENT CHARACTER; otherwise it evaluates to 0.  If non-zero, the
value gives how many bytes starting at C<s> comprise the code point's
representation.

=over 3

 bool  UTF8_IS_REPLACEMENT(const U8 *s, const U8 *e)

=back

=back

=for hackers
Declared and documented at utf8.h, line 1002

=over 4

=item C<UTF8_IS_SUPER>
X<UTF8_IS_SUPER>

Recall that Perl recognizes an extension to UTF-8 that can encode code
points larger than the ones defined by Unicode, which are 0..0x10FFFF.

This macro evaluates to non-zero if the first few bytes of the string starting
at C<s> and looking no further than S<C<e - 1>> are from this UTF-8 extension;
otherwise it evaluates to 0.  If non-zero, the return is how many bytes
starting at C<s> comprise the code point's representation.

0 is returned if the bytes are not well-formed extended UTF-8, or if they
represent a code point that cannot fit in a UV on the current platform.  Hence
this macro can give different results when run on a 64-bit word machine than on
one with a 32-bit word size.

Note that it is illegal in Perl to have code points that are larger than what can
fit in an IV on the current machine; and illegal in Unicode to have any that
this macro matches

=over 3

 bool  UTF8_IS_SUPER(const U8 *s, const U8 *e)

=back

=back

=for hackers
Declared and documented at utf8.h, line 1036

=over 4

=item C<UTF8_IS_SURROGATE>
X<UTF8_IS_SURROGATE>

Evaluates to non-zero if the first few bytes of the string starting at C<s> and
looking no further than S<C<e - 1>> are well-formed UTF-8 that represents one
of the Unicode surrogate code points; otherwise it evaluates to 0.  If
non-zero, the value gives how many bytes starting at C<s> comprise the code
point's representation.

=over 3

 bool  UTF8_IS_SURROGATE(const U8 *s, const U8 *e)

=back

=back

=for hackers
Declared and documented at utf8.h, line 976

=over 4

=item C<utf8_length>
X<utf8_length>

Returns the number of characters in the sequence of UTF-8-encoded bytes starting
at C<s> and ending at the byte just before C<e>.  If <s> and <e> point to the
same place, it returns 0 with no warning raised.

If C<e E<lt> s> or if the scan would end up past C<e>, it raises a UTF8 warning
and returns the number of valid characters.

=over 3

 STRLEN       utf8_length(      const U8 *s0, const U8 *e)
 STRLEN  Perl_utf8_length(pTHX_ const U8 *s0, const U8 *e)

=back

=back

=for hackers
Declared in embed.fnc; documented at utf8.c, line 2602

=over 4

=item C<UTF8_MAXBYTES>
X<UTF8_MAXBYTES>

The maximum width of a single UTF-8 encoded character, in bytes.

NOTE: Strictly speaking Perl's UTF-8 should not be called UTF-8 since UTF-8
is an encoding of Unicode, and Unicode's upper limit, 0x10FFFF, can be
expressed with 4 bytes.  However, Perl thinks of UTF-8 as a way to encode
non-negative integers in a binary format, even those above Unicode.

=back

=for hackers
Declared and documented at utf8.h, line 477

=over 4

=item C<UTF8_MAXBYTES_CASE>
X<UTF8_MAXBYTES_CASE>

The maximum number of UTF-8 bytes a single Unicode character can
uppercase/lowercase/titlecase/fold into.

=back

=for hackers
Declared and documented at utf8.h, line 695

=over 4

=item C<UTF8_SAFE_SKIP*>

=item C<UTF8_SKIP*>

Described under C<L</UTF8SKIP>>

=back

=over 4

=item C<utf8_to_bytes_overwrite>

=item C<utf8_to_bytes_new_pv>

=item C<utf8_to_bytes_temp_pv>

=item C<utf8_to_bytes>

=item C<bytes_from_utf8>
X<bytes_from_utf8>X<utf8_to_bytes>X<utf8_to_bytes_new_pv>
X<utf8_to_bytes_overwrite>X<utf8_to_bytes_temp_pv>

NOTE: C<utf8_to_bytes> is B<experimental> and may change or be
removed without notice.

These each convert a string encoded as UTF-8 into the equivalent native byte
representation, if possible.  The first three forms are preferred; their API is
more convenient to use, and each return C<true> if the result is in bytes;
C<false> if the conversion failed.

=over 4

=item * C<utf8_to_bytes_overwrite>

=item * C<utf8_to_bytes_new_pv>

=item * C<utf8_to_bytes_temp_pv>

These differ primarily in the form of the returned string and the allowed
constness of the input string.  In each, if the input string was already in
native bytes or was not convertible, the input isn't changed.

In each of these three functions, the input C<s_ptr> is a pointer to the string
to be converted and C<*lenp> is its length (so that the first byte will be at
C<*sptr[0]>).

C<utf8_to_bytes_overwrite> overwrites the input string with the bytes
conversion.  Hence, the input string should not be C<const>.  (Converting the
multi-byte UTF-8 encoding to single bytes never expands the result, so
overwriting is always feasible.)

Both C<utf8_to_bytes_new_pv> and C<utf8_to_bytes_temp_pv> allocate new memory
to hold the converted string, never changing the input.  Hence the input string
may be C<const>.  They differ in that C<utf8_to_bytes_temp_pv> arranges for the
new memory to automatically be freed.  With C<utf8_to_bytes_new_pv>, the caller
is responsible for freeing the memory.  As explained below, not all successful
calls result in new memory being allocated.  Hence this function also returns
to the caller (via an extra parameter, C<*free_me>) a pointer to any new
memory, or C<NULL> if none was allocated.

The functions return C<false> when the input is not well-formed UTF-8 or contains
at least one UTF-8 sequence that represents a code point that can't be
expressed as a byte.  The contents of C<*s_ptr> and C<*lenp> are not changed.
C<utf8_to_bytes_new_pv> sets C<*free_me> to C<NULL>.

They all return C<true> when either:

=over 4

=item The input turned out to already be in bytes form

The contents of C<*s_ptr> and C<*lenp> are not changed.
C<utf8_to_bytes_new_pv> sets C<*free_me> to C<NULL>.

=item The input was successfully converted

=over 4

=item For C<utf8_to_bytes_overwrite>

The input string C<*s_ptr> was overwritten with the native bytes, including a
NUL terminator.  C<*lenp> has been updated with the new length.

=item For C<utf8_to_bytes_new_pv> and C<utf8_to_bytes_temp_pv>

The input string was not changed.  Instead, new memory has been allocated
containing the translation of the input into native bytes, with a NUL
terminator byte.  C<*s_ptr> now points to that new memory, and  C<*lenp>
contains its length.

For C<utf8_to_bytes_temp_pv>, the new memory has been arranged to be
automatically freed, via a call to C<L</SAVEFREEPV>>.

For C<utf8_to_bytes_new_pv>, C<*free_me> has been set to C<*s_ptr>, and it is
the caller's responsibility to free the new memory when done using it.
The following paradigm is convenient to use for this:

 void * free_me;
 if (utf8_to_bytes_new_pv(&s, &len, &free_me) {
    ...
 }
 else {
    ...
 }

 ...

 Safefree(free_me);

C<free_me> can be used as a boolean (non-NULL meaning C<true>) to indicate that
the input was indeed changed if you need to revisit that later in the code.
Your design is likely flawed if you find yourself using C<free_me> for any
other purpose.

=back

=back

Note that in all cases, C<*s_ptr> and C<*lenp> will have correct and consistent
values, updated as was necessary.

Also note that upon successful conversion, the number of variants in the string
can be computed by having saved the value of C<*lenp> before the call, and
subtracting the after-call value of C<*lenp> from it.  This is also true for
the other two functions described below.

=item * C<utf8_to_bytes>

Plain C<utf8_to_bytes> (which has never lost its experimental status) also
converts a UTF-8 encoded string to bytes, but there are more glitches that the
caller has to be prepared to handle.

The input string is passed with one less indirection level, C<s>.

=over

=item If the conversion was a noop

The contents of C<s> and C<*lenp> are not changed, and the function returns
C<s>.

=item If the conversion was successful

The contents of C<s> were changed, and C<*lenp> updated to be the correct length.
The function returns C<s> (unchanged).

=item If the conversion failed

The contents of C<s> were not changed.

The function returns NULL and sets C<*lenp> to -1, cast to C<STRLEN>.
This means that you will have to use a temporary containing the string length
to pass to the function if you will need the value afterwards.

=back

=item * C<bytes_from_utf8>

C<bytes_from_utf8> also converts a potentially UTF-8 encoded string C<s> to
bytes.  It preserves C<s>, allocating new memory for the converted string.

In contrast to the other functions, the input string to this one need not
be UTF-8.  If not, the caller has set C<*is_utf8p> to be C<false>, and the
function does nothing, returning the original C<s>.

Also do nothing if there are code points in the string not expressible in
native byte encoding, returning the original C<s>.

Otherwise, C<*is_utf8p> is set to 0, and the return value is a pointer to a
newly created string containing the native byte equivalent of C<s>, and whose
length is returned in C<*lenp>, updated.  The new string is C<NUL>-terminated.
The caller is responsible for arranging for the memory used by this string to
get freed.

The major problem with this function is that memory is allocated and filled
even when the input string was already in bytes form.

=back

New code should use the first three functions listed above.

=over 3

 bool       utf8_to_bytes_overwrite(      U8 **s_ptr,
                                          STRLEN *lenp)
 bool  Perl_utf8_to_bytes_overwrite(pTHX_ U8 **s_ptr,
                                          STRLEN *lenp)
 bool       utf8_to_bytes_new_pv   (      U8 const **s_ptr,
                                          STRLEN *lenp,
                                          void **free_me)
 bool  Perl_utf8_to_bytes_new_pv   (pTHX_ U8 const **s_ptr,
                                          STRLEN *lenp,
                                          void **free_me)
 bool       utf8_to_bytes_temp_pv  (      U8 const **s_ptr,
                                          STRLEN *lenp)
 bool  Perl_utf8_to_bytes_temp_pv  (pTHX_ U8 const **s_ptr,
                                          STRLEN *lenp)
 U8 *       utf8_to_bytes          (      U8 *s, STRLEN *lenp)
 U8 *  Perl_utf8_to_bytes          (pTHX_ U8 *s, STRLEN *lenp)
 U8 *       bytes_from_utf8        (      const U8 *s,
                                          STRLEN *lenp,
                                          bool *is_utf8p)
 U8 *  Perl_bytes_from_utf8        (pTHX_ const U8 *s,
                                          STRLEN *lenp,
                                          bool *is_utf8p)

=back

=back

=for hackers
utf8_to_bytes_overwrite declared in embed.fnc; all in group documented at utf8.c, line 2827
utf8_to_bytes_new_pv declared in embed.fnc
utf8_to_bytes_temp_pv declared in embed.fnc
utf8_to_bytes declared in embed.fnc
bytes_from_utf8 declared in embed.fnc

=over 4

=item C<utf8_to_uv>

=item C<extended_utf8_to_uv>

=item C<strict_utf8_to_uv>

=item C<c9strict_utf8_to_uv>

=item C<utf8_to_uv_or_die>

=item C<utf8_to_uvchr_buf>

=item C<utf8_to_uvchr>
X<c9strict_utf8_to_uv>X<extended_utf8_to_uv>X<strict_utf8_to_uv>
X<utf8_to_uv>X<utf8_to_uv_or_die>X<utf8_to_uvchr>X<utf8_to_uvchr_buf>

C<B<DEPRECATED!>>  It is planned to remove C<utf8_to_uvchr>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

These functions each translate from UTF-8 to UTF-32 (or UTF-64 on 64 bit
platforms).  In other words, to a code point ordinal value.  (On EBCDIC
platforms, the initial encoding is UTF-EBCDIC, and the output is a native code
point).

For example, the string "A" would be converted to the number 65 on an ASCII
platform, and to 193 on an EBCDIC one.  Converting the string "ABC" would yield
the same results, as the functions stop after the first character converted.
Converting the string "\N{LATIN CAPITAL LETTER A WITH MACRON} plus anything
more in the string" would yield the number 0x100 on both types of platforms,
since the first character is U+0100.

The functions whose names contain C<to_uvchr> are older than the functions
whose names don't have C<chr> in them.  The API in the older functions is
harder to use correctly, and so they are kept only for backwards compatibility,
and may eventually become deprecated.  If you are writing a module and use
L<Devel::PPPort>, your code can use the new functions back to at least Perl
v5.7.1.

All the functions accept, without complaint, well-formed UTF-8 for any
non-problematic Unicode code point 0 .. 0x10FFFF.  There are two types of
Unicode problematic code points:  surrogate characters and non-character code
points.  (See L<perlunicode>.)  Some of the functions reject one or both of
these.  Private use characters and those code points yet to be assigned to a
particular character are never considered problematic.  Additionally, most of
the functions accept non-Unicode code points, those starting at 0x110000.

There are two sets of these functions:

=over 4

=item C<utf8_to_uv> forms

Almost all code should use only C<utf8_to_uv>, C<extended_utf8_to_uv>,
C<strict_utf8_to_uv>, C<c9strict_utf8_to_uv>, or C<utf8_to_uv_or_die>.  The
other functions are either the problematic old form, or are for specialized
uses.

C<utf8_to_uv_or_die> has a simpler interface than the other four, for use when
any errors encountered should be fatal.  It throws an exception with any errors
found, otherwise it returns the code point the input sequence represents.

The other four functions each return C<true> if the sequence of bytes starting
at C<s> form a complete, legal UTF-8 (or UTF-EBCDIC) sequence for a code point;
or false otherwise.  They take an extra parameter, the address of an IV,
C<&cp>.  C<*cp> will be set to the native code point value the sequence
represents, and C<*advance> will be set to its length, in bytes.

If the functions returns C<false>, C<*cp> is set to the Unicode REPLACEMENT
CHARACTER, and C<*advance> to the next position along C<s>, where the next
possible UTF-8 character could begin.  Failing to use this position as the next
starting point during parsing of strings has led to successful attacks by
crafted inputs.

The functions only examine as many bytes along C<s> as are needed to form a
complete UTF-8 representation of a single code point; they never examine the
byte at C<e>, or beyond.  They return false (or die in the case of
C<utf8_to_uv_or_die>) if the code point requires more than S<C<e - s>> bytes to
represent.

The functions differ only in what flavor of UTF-8 they accept.  All reject
syntactically invalid UTF-8.

=over 4

=item * C<strict_utf8_to_uv>

additionally rejects any UTF-8 that translates into a code point that isn't
specified by Unicode to be freely exchangeable, namely the surrogate characters
and non-character code points (besides non-Unicode code points, any above
0x10FFFF).  It does not raise a warning when rejecting these.

=item * C<c9strict_utf8_to_uv>

instead uses the exchangeable definition given by Unicode's Corregendum #9,
which accepts non-character code points while still rejecting surrogates.  It
does not raise a warning when rejecting these.

=item * C<utf8_to_uv>

=item * C<utf8_to_uv_or die>

accept all syntactically valid UTF-8, as extended by Perl to allow 64-bit code
points to be encoded.

C<extended_utf8_to_uv> is merely a synonym for C<utf8_to_uv>.  Use this form
to draw attention to the fact that it accepts any code point.  But since
Perl programs traditionally do this by default, plain C<utf8_to_uv> is the form
most often used.

=back

Whenever syntactically invalid input is rejected, an explanatory warning
message is raised, unless C<utf8> warnings (or the appropriate subcategory) are
turned off.  A given input sequence may contain multiple malformations, giving
rise to multiple warnings, as the functions attempt to find and report on all
malformations in a sequence.  All the possible malformations are listed in
C<L</utf8_to_uv_msgs>>, with some examples of multiple ones for the same
sequence.  You can use that function or C<L</utf8_to_uv_flags>> to exert more
control over the input that is considered acceptable, and the warnings that are
raised.

Often, C<s> is an arbitrarily long string containing the UTF-8 representations
of many code points in a row, and these functions are called in the course of
parsing C<s> to find all those code points.

If your code doesn't know how to deal with illegal input, as would be typical
of a low level routine, the loop could look like:

 while (s < e) {
     Size_t advance;
     UV cp;
     (void) utf8_to_uv(s, e, &cp, &advance);
     <handle 'cp'>
     s += advance;
 }

A REPLACEMENT CHARACTER will be inserted everywhere that malformed input
occurs.  Obviously, we aren't expecting such outcomes, but your code will be
protected from attacks and many harmful effects that could otherwise occur.

If the situation is such that it would be a bug for the input to be invalid, a
somewhat simpler loop suffices:

 while (s < e) {
     Size_t advance;
     UV cp = utf8_to_uv_or_die(s, e, &advance);
     <handle 'cp'>
     s += advance;
 }

This will throw an exception on invalid input, so your code doesn't have to
concern itself with that possibility.

If you do have a plan for handling malformed input, you could instead write:

 while (s < e) {
     Size_t advance;
     UV cp;

     if (UNLIKELY(! utf8_to_uv(s, e, &cp, &advance)) {
         <bail out or convert to handleable>
     }

     <handle 'cp'>

     s += advance;
 }

You may pass NULL to these functions instead of a pointer to your C<advance>
variable.  But the only legitimate case to do this is if you are only examining
the first character in C<s>, and have no plans to ever look further.  You could
also advance by using C<UTF8SKIP>, but this gives the correct result if and
only if the input is well-formed; and this practice has led to successful
attacks against such code; and it is extra work always, as the functions have
already done the equivalent work and return the correct value in C<advance>,
regardless of whether the input is well-formed or not.

Except with C<utf8_to_uv_or_die>, you must always pass a non-NULL pointer into
which to store the (first) code point C<s> represents.  If you don't care about
this value, you should be using one of the C<L</isUTF8_CHAR>> functions
instead.

=item C<utf8_to_uvchr> forms

These are the old form equivalents of C<utf8_to_uv> (and its synonym,
C<extended_utf8_to_uv>).  They are C<utf8_to_uvchr> and C<utf8_to_uvchr_buf>.
There is no old form equivalent of either C<strict_utf8_to_uv> nor
C<c9strict_utf8_to_uv>.

C<utf8_to_uvchr> is DEPRECATED.  Do NOT use it; it is a security hole ready to
bring destruction onto you and yours.

C<utf8_to_uvchr_buf> is discouraged and may eventually become deprecated.  It
checks if the sequence of bytes starting at C<s> form a complete, legal UTF-8
(or UTF-EBCDIC) sequence for a code point.  If so, it returns the code point
value the sequence represents, and C<*retlen> will be set to its length, in
bytes.  Thus, the next possible character in C<s> begins at S<C<s + *retlen>>.

The function only examines as many bytes along C<s> as are needed to form a
complete UTF-8 representation of a single code point, but it never examines
the byte at C<e>, or beyond.

If the sequence examined starting at C<s> is not legal Perl extended UTF-8, the
translation fails, and the resultant behavior unfortunately depends on if the
warnings category "utf8" is enabled or not.

=over 4

=item If C<'utf8'> warnings are disabled

The Unicode REPLACEMENT CHARACTER is silently returned, and C<*retlen> is set
(if C<retlen> isn't C<NULL>) so that (S<C<s> + C<*retlen>>) is the next
possible position in C<s> that could begin a non-malformed character.

But note that it is ambiguous whether a REPLACEMENT CHARACTER was actually in
the input, or if this function synthetically generated one.  In the unlikely
event that you care, you'd have to examine the input to disambiguate.

=item If C<'utf8'> warnings are enabled

A warning will be displayed, and 0 is returned and C<*retlen> is set (if
C<retlen> isn't C<NULL>) to -1.

But note that 0 may also be returned if S<*s> is a legal NUL character.  This
means that you have to disambiguate a 0 return.  You can do this by checking
that the first byte of C<s> is indeed a NUL; or by making sure to always pass a
non-NULL C<retlen> pointer, and by examining it.

Also note that should you wish to proceed with parsing C<s>, you have no easy
way of knowing where to start looking in it for the next possible character.
It is important to look in the right place to prevent attacks on your code.
It would be better to have instead called an equivalent function that provides
this information; any of the C<utf8_to_uv> series, or C<L</utf8n_to_uvchr>>.

=back

Because of these quirks, C<utf8_to_uvchr_buf> is very difficult to use
correctly and handle all cases.  Generally, you need to bail out at the first
failure it finds.

The deprecated C<utf8_to_uvchr> behaves the same way as C<utf8_to_uvchr_buf> for
well-formed input, and for the malformations it is capable of finding, but
doesn't find all of them, and it can read beyond the end of the input buffer,
which is why it is deprecated.

=back

The C<utf8_to_uv()> family of functions is preferred because they make it
easier to write code safe from attacks.  You should be converting to them; this
will result in simpler, more robust code.

=over 3

 bool       utf8_to_uv         (      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool  Perl_utf8_to_uv         (      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool       extended_utf8_to_uv(      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool  Perl_extended_utf8_to_uv(      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool       strict_utf8_to_uv  (      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool  Perl_strict_utf8_to_uv  (      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool       c9strict_utf8_to_uv(      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 bool  Perl_c9strict_utf8_to_uv(      const U8 * const s,
                                      const U8 * const e,
                                      UV *cp_p, Size_t *advance_p)
 UV         utf8_to_uv_or_die  (      const U8 * const s,
                                      const U8 *e,
                                      Size_t *advance_p)
 UV    Perl_utf8_to_uv_or_die  (      const U8 * const s,
                                      const U8 *e,
                                      Size_t *advance_p)
 UV         utf8_to_uvchr_buf  (      const U8 *s, const U8 *send,
                                      STRLEN *retlen)
 UV    Perl_utf8_to_uvchr_buf  (pTHX_ const U8 *s, const U8 *send,
                                      STRLEN *retlen)
 UV         utf8_to_uvchr      (      const U8 *s, STRLEN *retlen)
 UV    Perl_utf8_to_uvchr      (pTHX_ const U8 *s, STRLEN *retlen)

=back

=back

=for hackers
utf8_to_uv declared in embed.fnc; all in group documented at utf8.c, line 1022
extended_utf8_to_uv declared in embed.fnc
strict_utf8_to_uv declared in embed.fnc
c9strict_utf8_to_uv declared in embed.fnc
utf8_to_uv_or_die declared in embed.fnc
utf8_to_uvchr_buf declared in embed.fnc
utf8_to_uvchr declared in embed.fnc

=over 4

=item C<utf8_to_uv_errors*>

Described under C<L</utf8_to_uv_msgs>>

=back

=over 4

=item C<utf8_to_uv_flags>

=item C<utf8n_to_uvchr>
X<utf8_to_uv_flags>X<utf8n_to_uvchr>

These functions are extensions of C<L</utf8_to_uv>>, where you need
more control over what UTF-8 sequences are acceptable.  These functions are
unlikely to be needed except for specialized purposes.

C<utf8n_to_uvchr> is more like an extension of C<utf8_to_uvchr_buf>, but
with fewer quirks, and a different method of specifying the bytes in C<s> it is
allowed to examine.  It has a C<curlen> parameter instead of an C<e> parameter,
so the furthest byte in C<s> it can look at is S<C<s + curlen - 1>>.  Its
return value is, like C<utf8_to_uvchr_buf>, ambiguous with respect to the NUL
and REPLACEMENT characters, but the value of C<*retlen> can be relied on
(except with the C<UTF8_CHECK_ONLY> flag described below) to know where the
next possible character along C<s> starts, removing that quirk.  Hence, you
always should use C<*retlen> to determine where the next character in C<s>
starts.

These functions have an additional parameter, C<flags>, besides the ones in
C<utf8_to_uv> and C<utf8_to_uvchr_buf>, which can be used to broaden or
restrict what is acceptable UTF-8.  C<flags> has the same meaning and behavior
in both functions.  When C<flags> is 0, these functions accept any
syntactically valid Perl-extended-UTF-8 sequence that doesn't overflow the
platform's word size.

There are flags that apply to accepting particular sequences, and flags that
apply to raising warnings about encountering sequences.  Each type is
independent of the other.  You can reject and not warn; warn and still accept;
or both reject and warn.  Rejecting means that the sequence gets translated
into the Unicode REPLACEMENT CHARACTER instead of what it was meant to
represent.

Unless otherwise stated below, warnings are subject to the C<utf8> warnings
category being on.

=over 4

=item C<UTF8_CHECK_ONLY>

This suppresses any warnings.  And it changes what is stored into
C<*retlen> with the C<uvchr> family of functions (for the worse).  It is not
likely to be of use to you.  You can use C<UTF8_ALLOW_ANY> (described below) to
also turn off warnings, and that flag doesn't adversely affect C<*retlen>.

This flag is ignored if C<UTF8_DIE_IF_MALFORMED> is also set.

=item C<UTF8_FORCE_WARN_IF_MALFORMED>

Normally, no warnings are generated if warnings are turned off lexically or
globally, regardless of any flags to the contrary.  But this flag effectively
turns on warnings temporarily for the duration of this function's execution.

Do not use it lightly.

This flag is ignored if C<UTF8_CHECK_ONLY> is also set.

=item C<UTF8_DISALLOW_SURROGATE>

=item C<UTF8_WARN_SURROGATE>

These reject and/or warn about UTF-8 sequences that represent surrogate
characters.  The warning categories C<utf8> and C<non_unicode> control if
warnings are actually raised.

=item C<UTF8_DISALLOW_NONCHAR>

=item C<UTF8_WARN_NONCHAR>

These reject and/or warn about UTF-8 sequences that represent non-character
code points.  The warning categories C<utf8> and C<nonchar> control if warnings
are actually raised.

=item C<UTF8_DISALLOW_SUPER>

=item C<UTF8_WARN_SUPER>

These reject and/or warn about UTF-8 sequences that represent code points
above 0x10FFFF.  The warning categories C<utf8> and C<non_unicode> control if
warnings are actually raised.

=item C<UTF8_DISALLOW_ILLEGAL_INTERCHANGE>

=item C<UTF8_WARN_ILLEGAL_INTERCHANGE>

These are the same as having selected all three of the corresponding SURROGATE,
NONCHAR and SUPER flags listed above.

All such code points are not considered to be safely freely exchangeable
between processes.

=item C<UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE>

=item C<UTF8_WARN_ILLEGAL_C9_INTERCHANGE>

These are the same as having selected both the corresponding SURROGATE and
SUPER flags listed above.

Unicode issued L<Unicode Corrigendum
#9|https://www.unicode.org/versions/corrigendum9.html> to allow non-character
code points to be exchanged by processes aware of the possibility.  (They are
still discouraged, however.)  For more discussion see
L<perlunicode/Noncharacter code points>.

=item C<UTF8_DISALLOW_PERL_EXTENDED>

=item C<UTF8_WARN_PERL_EXTENDED>

These reject and/or warn on encountering sequences that require Perl's
extension to UTF-8 to represent them.   These are all for code points above
0x10FFFF, so these sequences are a subset of the ones controlled by SUPER or
either of the illegal interchange sets of flags.  The warning categories
C<utf8>, C<non_unicode>, and C<portable> control if warnings are actually
raised.

Perl predates Unicode, and earlier standards allowed for code points up through
0x7FFF_FFFF (2**31 - 1).  Perl, of course, would like you to be able to
represent in UTF-8 any code point available on the platform.  To do so, some
extension must be used to express them.  Perl uses a natural extension to UTF-8
to represent the ones up to 2**36-1, and invented a further extension to
represent even higher ones, so that any code point that fits in a 64-bit word
can be represented.  We lump both of these extensions together and refer to
them as Perl extended UTF-8.  There exist other extensions that people have
invented, incompatible with Perl's.

On EBCDIC platforms starting in Perl v5.24, the Perl extension for representing
extremely high code points kicks in at 0x3FFF_FFFF (2**30 -1), which is lower
than on ASCII.  Prior to that, code points 2**31 and higher were simply
unrepresentable, and a different, incompatible method was used to represent
code points between 2**30 and 2**31 - 1.

It is likely that programs written in something other than Perl would not be
able to read files that contain these; nor would Perl understand files written
by something that uses a different extension.  Hence, you can specify that
above-Unicode code points are generally accepted and/or warned about, but still
exclude the ones that require this extension to represent.

=item C<UTF8_ALLOW_ANY> and kin

Other flags can be passed to allow, in a limited way, syntactic malformations
and/or overflowing the number of bits available in a UV on the platform.
The functions will not treat the relevant malformations as errors, hence will
not raise any warnings for them.  C<utf8_to_uv_msgs> will return C<true>.

B<However, all such malformations translate to the REPLACEMENT CHARACTER>,
regardless of any of the flags.

The only such flag that you would ever have any reason to use is
C<UTF8_ALLOW_ANY> which applies to any of the syntactic malformations and
overflow, except for empty input.  The other flags are analogous to ones in
the C<_GOT_> bits list in C<L</utf8_to_uv_msgs>>.

=item C<UTF8_DIE_IF_MALFORMED>

If the function would otherwise return C<false>, it instead croaks.  The
C<UTF8_FORCE_WARN_IF_MALFORMED> flag is effectively turned on so that the cause
of the croak is displayed.

=back

=over 3

 bool       utf8_to_uv_flags(const U8 * const s,
                             const U8 * const e, UV *cp_p,
                             Size_t *advance_p, U32 flags)
 bool  Perl_utf8_to_uv_flags(const U8 * const s,
                             const U8 * const e, UV *cp_p,
                             Size_t *advance_p, U32 flags)
 UV         utf8n_to_uvchr  (const U8 *s, STRLEN curlen,
                             STRLEN *retlen, const U32 flags)
 UV    Perl_utf8n_to_uvchr  (const U8 *s, STRLEN curlen,
                             STRLEN *retlen, const U32 flags)

=back

=back

=for hackers
utf8_to_uv_flags declared in embed.fnc; all in group documented at utf8.c, line 1262
utf8n_to_uvchr declared in embed.fnc

=over 4

=item C<utf8_to_uv_msgs>

=item C<utf8n_to_uvchr_msgs>

=item C<utf8_to_uv_errors>

=item C<utf8n_to_uvchr_error>
X<utf8_to_uv_errors>X<utf8_to_uv_msgs>X<utf8n_to_uvchr_error>
X<utf8n_to_uvchr_msgs>

These functions are extensions of C<L</utf8_to_uv_flags>> and
C<L</utf8n_to_uvchr>>.  They are used for the highly specialized purpose of
when the caller needs to know the exact malformations that were encountered
and/or the diagnostics that would be raised.

They each take one or two extra parameters, pointers to where to store this
information.  The functions with C<_msgs> in their names return both types, so
take two extra parameters; those with C<_error> return just the malformations,
so take just one extra parameter.  When the extra parameters are both 0, the
functions behave identically to the function they extend.

When the C<errors> parameter is not NULL, it should be the address of a U32
variable, into which the functions store a bitmap, described just below, with a
bit set for each malformation the function found; 0 if none.  The C<ALLOW>-type
flags are ignored when determining the content of this variable.  That is, even
if you "allow" a particular malformation, if it is encountered, the
corresponding bit will be set to notify you that one was encountered.
However, the bits for conditions that are accepted by default aren't set
unless the flags passed to the function indicate that they should be
rejected or warned about when encountering them.  These are explicitly
noted in the list below along with the controlling flags.

The bits returned in C<errors> and their meanings are:

=over 4

=item C<UTF8_GOT_CONTINUATION>

The input sequence was malformed in that the first byte was a UTF-8
continuation byte.

=item C<UTF8_GOT_EMPTY>

The input parameters indicated the length of C<s> is 0.  Technically, this a
coding error, not a malformation; you should check before calling these
functions if there is actually anything to convert.  But perl needs to be able
to recover from bad input, and this is how it does it.

=item C<UTF8_GOT_LONG>

The input sequence was malformed in that there is some other sequence that
evaluates to the same code point, but that sequence is shorter than this one.

Until Unicode 3.1, it was legal for programs to accept this malformation, but
it was discovered that this created security issues.

=item C<UTF8_GOT_NONCHAR>

The code point represented by the input UTF-8 sequence is for a Unicode
non-character code point.
This bit is set only if the input C<flags> parameter contains either the
C<UTF8_DISALLOW_NONCHAR> or the C<UTF8_WARN_NONCHAR> flags.

=item C<UTF8_GOT_NON_CONTINUATION>

The input sequence was malformed in that a non-continuation-type byte was found
in a position where only a continuation-type one should be.  See also
C<L</UTF8_GOT_SHORT>>.

=item C<UTF8_GOT_OVERFLOW>

The input sequence was malformed in that it is for a code point that is not
representable in the number of bits available in an IV on the current platform.

=item C<UTF8_GOT_PERL_EXTENDED>

The input sequence is not standard UTF-8, but a Perl extension.  This bit is
set only if the input C<flags> parameter contains either the
C<UTF8_DISALLOW_PERL_EXTENDED> or the C<UTF8_WARN_PERL_EXTENDED> flags.

=item C<UTF8_GOT_SHORT>

The input sequence was malformed in that C<curlen> is smaller than required for
a complete sequence.  In other words, the input is for a partial character
sequence.

C<UTF8_GOT_SHORT> and C<UTF8_GOT_NON_CONTINUATION> both indicate a too short
sequence.  The difference is that C<UTF8_GOT_NON_CONTINUATION> indicates always
that there is an error, while C<UTF8_GOT_SHORT> means that an incomplete
sequence was looked at.   If no other flags are present, it means that the
sequence was valid as far as it went.  Depending on the application, this could
mean one of three things:

=over 4

=item *

The C<e> or C<curlen> parameters passed in were too small, and the function
was prevented from examining all the necessary bytes.

=item *

The buffer being looked at is based on reading data, and the data received so
far stopped in the middle of a character, so that the next read will
read the remainder of this character.  (It is up to the caller to deal with the
split bytes somehow.)

=item *

This is a real error, and the partial sequence is all we're going to get.

=back

=item C<UTF8_GOT_SUPER>

The input sequence was malformed in that it is for a non-Unicode code point;
that is, one above the legal Unicode maximum.
This bit is set only if the input C<flags> parameter contains either the
C<UTF8_DISALLOW_SUPER> or the C<UTF8_WARN_SUPER> flags.

=item C<UTF8_GOT_SURROGATE>

The input sequence was malformed in that it is for a Unicode UTF-16 surrogate
code point.
This bit is set only if the input C<flags> parameter contains either the
C<UTF8_DISALLOW_SURROGATE> or the C<UTF8_WARN_SURROGATE> flags.

=back

Note that more than one bit may have been set by these functions.  This is
because it is possible for multiple malformations to be present in the same
sequence.  An example would be an overlong sequence evaluating to a surrogate
when surrogates are forbidden.  Another example is overflow; standard UTF-8
never overflows, so something that does must have been expressed using Perl's
extended UTF-8.  It also is above all legal Unicode code points.  So there will
be a bit set for up to all three of these things.  1) Overflow always; 2)
perl-extended if the calling flags indicate those should be rejected or warned
about; and 3) above-Unicode, provided the calling flags indicate those should
be rejected or warned about.

If you don't care about the system's messages text nor warning categories, you
can customize error handling by calling one of the C<_error> functions, using
either of the flags C<UTF8_ALLOW_ANY> or C<UTF8_CHECK_ONLY> to suppress any
warnings, and then examine the C<*errors> return.  If you don't use those
flags, warnings will be raised as usual.

But if you do care, instead use one of the functions with C<_msgs> in their
names.  These allow you to completely customize error handling by suppressing
any warnings that would otherwise be raised; instead returning all relevant
information in a structure specified by an extra parameter, C<msgs>, a pointer
to a variable which has been declared to be an C<AV*>, and into which the
function creates a new AV to store information, described below, about all the
malformations that were encountered.

When this parameter is non-NULL, the C<UTF8_DIE_IF_MALFORMED> and
C<UTF8_FORCE_WARN_IF_MALFORMED> flags are asserted against in DEBUGGING builds,
and are ignored in non-DEBUGGING ones.  The C<UTF8_CHECK_ONLY> flag is always
ignored.

What is considered a malformation is affected by C<flags>, the same as
described in C<L</utf8_to_uv_flags>>.  No array element is generated for
malformations that are "allowed" by the input flags, in contrast to the
bitmap returned in a non-NULL C<*errors>.

Each element of the C<msgs> AV array is an anonymous hash with the following
three key-value pairs:

=over 4

=item C<text>

A C<SVpv> containing the text of the message about the problematic input.
This text is identical to any warning that otherwise would have been raised if
the appropriate warning categories were enabled.

=item C<warn_categories>

This is 0 if the C<flags> parameter to the function would ordinarily not have
caused the message to be output as a warning; otherwise it is the warning
category (or categories) that would have been used to generate a warning for
C<text>, packed into a C<SVuv>.  For example, if C<flags> contains
C<UTF8_DISALLOW_SURROGATE>, but not C<UTF8_WARN_SURROGATE>, this would be 0 if
the input was a surrogate.

=item C<flag>

A C<SVuv> containing a single flag bit associated with this message.  The bit
corresponds to some bit in the C<*errors> return value, such as
C<UTF8_GOT_LONG>.

=back

The array is sorted so that element C<[0]> contains the first message that
would have otherwise been raised; C<[1]>, the second; and so on.

You thus can completely override the normal error handling; you can check the
lexical warnings state (or not) when choosing what to do with the returned
messages.

The caller, of course, is responsible for freeing any returned AV.

=over 3

 bool       utf8_to_uv_msgs     (const U8 * const s0, const U8 *e,
                                 UV *cp_p, Size_t *advance_p,
                                 U32 flags, U32 *errors,
                                 AV **msgs)
 bool  Perl_utf8_to_uv_msgs     (const U8 * const s0, const U8 *e,
                                 UV *cp_p, Size_t *advance_p,
                                 U32 flags, U32 *errors,
                                 AV **msgs)
 UV         utf8n_to_uvchr_msgs (const U8 * const s0,
                                 STRLEN curlen, STRLEN *retlen,
                                 const U32 flags, U32 *errors,
                                 AV **msgs)
 UV    Perl_utf8n_to_uvchr_msgs (const U8 * const s0,
                                 STRLEN curlen, STRLEN *retlen,
                                 const U32 flags, U32 *errors,
                                 AV **msgs)
 bool       utf8_to_uv_errors   (const U8 * const s,
                                 const U8 * const e, UV *cp_p,
                                 Size_t *advance_p, U32 flags,
                                 U32 *errors)
 bool  Perl_utf8_to_uv_errors   (const U8 * const s,
                                 const U8 * const e, UV *cp_p,
                                 Size_t *advance_p, U32 flags,
                                 U32 *errors)
 UV         utf8n_to_uvchr_error(const U8 *s, STRLEN curlen,
                                 STRLEN *retlen, const U32 flags,
                                 U32 *errors)
 UV    Perl_utf8n_to_uvchr_error(const U8 *s, STRLEN curlen,
                                 STRLEN *retlen, const U32 flags,
                                 U32 *errors)

=back

=back

=for hackers
utf8_to_uv_msgs declared in embed.fnc; all in group documented at utf8.c, line 1421
utf8n_to_uvchr_msgs declared in embed.fnc
utf8_to_uv_errors declared in embed.fnc
utf8n_to_uvchr_error declared in embed.fnc

=over 4

=item C<utf8_to_uv_or_die*>

=item C<utf8_to_uvchr*>

=item C<utf8_to_uvchr_buf*>

Described under C<L</utf8_to_uv>>

=back

=over 4

=item C<utf8n_to_uvchr*>

Described under C<L</utf8_to_uv_flags>>

=back

=over 4

=item C<utf8ness_t>
X<utf8ness_t>

This typedef is used by several core functions that return PV strings, to
indicate the UTF-8ness of those strings.

(If you write a new function, you probably should instead return the PV in an
SV with the UTF-8 flag of the SV properly set, rather than use this mechanism.)

The possible values this can be are:

=over

=item C<UTF8NESS_YES>

This means the string definitely should be treated as a sequence of
UTF-8-encoded characters.

Most code that needs to handle this typedef should be of the form:

 if (utf8ness_flag == UTF8NESS_YES) {
     treat as utf8;  // like turning on an SV UTF-8 flag
 }

=item C<UTF8NESS_NO>

This means the string definitely should be treated as a sequence of bytes, not
encoded as UTF-8.

=item C<UTF8NESS_IMMATERIAL>

This means it is equally valid to treat the string as bytes, or as UTF-8
characters; use whichever way you want.  This happens when the string consists
entirely of characters which have the same representation whether encoded in
UTF-8 or not.

=item C<UTF8NESS_UNKNOWN>

This means it is unknown how the string should be treated.  No core function
will ever return this value to a non-core caller.  Instead, it is used by the
caller to initialize a variable to a non-legal value.  A typical call will look like:

 utf8ness_t string_is_utf8 = UTF8NESS_UNKNOWN
 const char * string = foo(arg1, arg2, ..., &string_is_utf8);
 if (string_is_utf8 == UTF8NESS_YES) {
    do something for UTF-8;
 }

=back

The following relationships hold between the enum values:

=over

=item S<C<0 E<lt>= I<enum value> E<lt>= UTF8NESS_IMMATERIAL>>

the string may be treated in code as non-UTF8

=item S<C<UTF8NESS_IMMATERIAL E<lt>= <I<enum value>>>

the string may be treated in code as encoded in UTF-8

=back

=back

=for hackers
Declared and documented at utf8.h, line 41

=over 4

=item C<UTF8SKIP>

=item C<UTF8_SKIP>

=item C<UTF8_CHK_SKIP>

=item C<UTF8_SAFE_SKIP>
X<UTF8_CHK_SKIP>X<UTF8_SAFE_SKIP>X<UTF8_SKIP>X<UTF8SKIP>

Each of these returns the number of bytes in the UTF-8 encoded character
whose first (perhaps only) byte is pointed to by C<s>.

C<UTF8SKIP> and C<UTF8_SKIP> are synonyms.  Use them when there is no
possibility that the character pointed to by C<s> is malformed.

If there is a possibility of malformed input, use instead:

=over

=item C<L</UTF8_SAFE_SKIP>> if you know the maximum ending pointer in the buffer pointed to by C<s>

If the buffer has enough bytes to hold the character, it returns the
same value as C<UTF8SKIP> and C<UTF8_SKIP> would.  If the buffer has
fewer bytes than can fit, it returns the number of bytes available in
the buffer, which could be 0 if S<C<s E<gt>= e>>.  On DEBUGGING builds,
it asserts that S<C<s E<lt>= e>>.

=item C<L</UTF8_CHK_SKIP>> if you don't know the maximum ending pointer

This version doesn't blindly assume that the input string pointed to by
C<s> is well-formed, but verifies that there isn't a NUL terminating
character before the expected end of the next character in C<s>.  The
length C<UTF8_CHK_SKIP> returns stops just before any such NUL.

Perl tends to add NULs, as an insurance policy, after the end of strings in
SV's, so it is likely that using this macro on an SV string will prevent
inadvertent reading beyond the end of the input buffer, even if it is
malformed UTF-8.

This macro is intended to be used by XS modules where the inputs could be
malformed, and it isn't feasible to restructure to use the safer
C<L</UTF8_SAFE_SKIP>>, for example when interfacing with a C library.

=back

=over 3

 STRLEN  UTF8SKIP      (const char* s)
 STRLEN  UTF8_SKIP     (const char* s)
 STRLEN  UTF8_CHK_SKIP (const char* s)
 STRLEN  UTF8_SAFE_SKIP(const char* s, const char* e)

=back

=back

=for hackers
UTF8SKIP declared at utf8.h, line 784; all in group documented at utf8.h, line 784
UTF8_SKIP declared at utf8.h, line 785
UTF8_CHK_SKIP declared at utf8.h, line 786
UTF8_SAFE_SKIP declared at utf8.h, line 787

=over 4

=item C<uv_to_utf8>

=item C<uv_to_utf8_flags>

=item C<uvchr_to_utf8>

=item C<uvchr_to_utf8_flags>
X<uv_to_utf8>X<uv_to_utf8_flags>X<uvchr_to_utf8>X<uvchr_to_utf8_flags>

These each add the UTF-8 representation of the native code point C<uv> to the
end of the string C<d>; C<d> should have at least C<UVCHR_SKIP(uv)+1> (up to
C<UTF8_MAXBYTES+1>) free bytes available.  The return value is the pointer to
the byte after the end of the new character.  In other words,

    d = uv_to_utf8(d, uv);

This is the Unicode-aware way of saying

    *(d++) = uv;

(C<uvchr_to_utf8> is a synonym for C<uv_to_utf8>.)

C<uv_to_utf8_flags> is used to make some classes of code points problematic in
some way.  C<uv_to_utf8> is effectively the same as calling C<uv_to_utf8_flags>
with C<flags> set to 0, meaning no class of code point is considered
problematic.  That means any input code point from 0..C<IV_MAX> is considered
to be fine.  C<IV_MAX> is typically 0x7FFF_FFFF in a 32-bit word.

(C<uvchr_to_utf8_flags> is a synonym for C<uv_to_utf8_flags>).

A code point can be problematic in one of two ways.  Its use could just raise a
warning, and/or it could be forbidden with the function failing, and returning
NULL.

The potential classes of problematic code points and the flags that make them
so are:

If C<uv> is a Unicode surrogate code point and C<UNICODE_WARN_SURROGATE> is set,
the function will raise a warning, provided UTF8 warnings are enabled.  If
instead C<UNICODE_DISALLOW_SURROGATE> is set, the function will fail and return
NULL.  If both flags are set, the function will both warn and return NULL.

Similarly, the C<UNICODE_WARN_NONCHAR> and C<UNICODE_DISALLOW_NONCHAR> flags
affect how the function handles a Unicode non-character.

And likewise, the C<UNICODE_WARN_SUPER> and C<UNICODE_DISALLOW_SUPER> flags
affect the handling of code points that are above the Unicode maximum of
0x10FFFF.  Languages other than Perl may not be able to accept files that
contain these.

The flag C<UNICODE_WARN_ILLEGAL_INTERCHANGE> selects all three of
the above WARN flags; and C<UNICODE_DISALLOW_ILLEGAL_INTERCHANGE> selects all
three DISALLOW flags.  C<UNICODE_DISALLOW_ILLEGAL_INTERCHANGE> restricts the
allowed inputs to the strict UTF-8 traditionally defined by Unicode.
Similarly, C<UNICODE_WARN_ILLEGAL_C9_INTERCHANGE> and
C<UNICODE_DISALLOW_ILLEGAL_C9_INTERCHANGE> are shortcuts to select the
above-Unicode and surrogate flags, but not the non-character ones, as
defined in
L<Unicode Corrigendum #9|https://www.unicode.org/versions/corrigendum9.html>.
See L<perlunicode/Noncharacter code points>.

Extremely high code points were never specified in any standard, and require an
extension to UTF-8 to express, which Perl does.  It is likely that programs
written in something other than Perl would not be able to read files that
contain these; nor would Perl understand files written by something that uses a
different extension.  For these reasons, there is a separate set of flags that
can warn and/or disallow these extremely high code points, even if other
above-Unicode ones are accepted.  They are the C<UNICODE_WARN_PERL_EXTENDED>
and C<UNICODE_DISALLOW_PERL_EXTENDED> flags.  For more information see
C<L</UTF8_GOT_PERL_EXTENDED>>.  Of course C<UNICODE_DISALLOW_SUPER> will
treat all above-Unicode code points, including these, as malformations.  (Note
that the Unicode standard considers anything above 0x10FFFF to be illegal, but
there are standards predating it that allow up to 0x7FFF_FFFF (2**31 -1))

A somewhat misleadingly named synonym for C<UNICODE_WARN_PERL_EXTENDED> is
retained for backward compatibility: C<UNICODE_WARN_ABOVE_31_BIT>.  Similarly,
C<UNICODE_DISALLOW_ABOVE_31_BIT> is usable instead of the more accurately named
C<UNICODE_DISALLOW_PERL_EXTENDED>.  The names are misleading because on EBCDIC
platforms,these flags can apply to code points that actually do fit in 31 bits.
The new names accurately describe the situation in all cases.

=over 3

 U8 *       uv_to_utf8         (      U8 *d, UV uv)
 U8 *  Perl_uv_to_utf8         (pTHX_ U8 *d, UV uv)
 U8 *       uv_to_utf8_flags   (      U8 *d, UV uv, UV flags)
 U8 *  Perl_uv_to_utf8_flags   (pTHX_ U8 *d, UV uv, UV flags)
 U8 *       uvchr_to_utf8      (      U8 *d, UV uv)
 U8 *       uvchr_to_utf8_flags(      U8 *d, UV uv, UV flags)

=back

=back

=for hackers
uv_to_utf8 declared in embed.fnc; all in group documented at utf8.c, line 378
uv_to_utf8_flags declared in embed.fnc
uvchr_to_utf8 declared in embed.fnc
uvchr_to_utf8_flags declared in embed.fnc

=over 4

=item C<uv_to_utf8_msgs>

=item C<uvchr_to_utf8_flags_msgs>
X<uv_to_utf8_msgs>X<uvchr_to_utf8_flags_msgs>

These functions are identical.  THEY SHOULD BE USED IN ONLY VERY SPECIALIZED
CIRCUMSTANCES.

Most code should use C<L</uv_to_utf8_flags>()> rather than call this directly.

This function is for code that wants any warning and/or error messages to be
returned to the caller rather than be displayed.  Any message that would have
been displayed if all lexical warnings are enabled will instead be returned.

It is just like C<L</uvchr_to_utf8_flags>> but it takes an extra parameter
placed after all the others, C<msgs>.  If this parameter is 0, this function
behaves identically to C<L</uvchr_to_utf8_flags>>.  Otherwise, C<msgs> should
be a pointer to an C<HV *> variable, in which this function creates a new HV to
contain any appropriate message.  The hash has three key-value pairs, as
follows:

=over 4

=item C<text>

The text of the message as a C<SVpv>.

=item C<warn_categories>

The warning category (or categories) packed into a C<SVuv>.

=item C<flag_bit>

A single flag bit associated with this message, in a C<SVuv>.
The bit corresponds to some bit in the C<*errors> return value.
The possibilities are:

=over

=item C<UNICODE_GOT_SURROGATE>

=item C<UNICODE_GOT_NONCHAR>

=item C<UNICODE_GOT_SUPER>

=item C<UNICODE_GOT_PERL_EXTENDED>

=back

=back

It's important to note that specifying this parameter as non-null will cause
any warning this function would otherwise generate to be suppressed, and
instead be placed in C<*msgs>.  The caller can check the lexical warnings state
(or not) when choosing what to do with the returned message.

Only a single message is returned; if a code point requires Perl extended UTF-8
to represent, it is also above-Unicode.  If either the
C<UNICODE_WARN_PERL_EXTENDED> or C<UNICODE_DISALLOW_PERL_EXTENDED> flags are
set, the return is controlled by them; if neither is set, the return is
controlled by the  C<UNICODE_WARN_SUPER> and C<UNICODE_DISALLOW_SUPER> flags.

The caller, of course, is responsible for freeing any returned HV.

=over 3

 U8 *       uv_to_utf8_msgs         (      U8 *d, UV uv, UV flags,
                                           HV **msgs)
 U8 *  Perl_uv_to_utf8_msgs         (pTHX_ U8 *d, UV uv, UV flags,
                                           HV **msgs)
 U8 *       uvchr_to_utf8_flags_msgs(      U8 *d, UV uv, UV flags,
                                           HV **msgs)

=back

=back

=for hackers
uv_to_utf8_msgs declared in embed.fnc; all in group documented at utf8.c, line 146
uvchr_to_utf8_flags_msgs declared in embed.fnc

=over 4

=item C<UVCHR_IS_INVARIANT>
X<UVCHR_IS_INVARIANT>

Evaluates to 1 if the representation of code point C<cp> is the same whether or
not it is encoded in UTF-8; otherwise evaluates to 0.  UTF-8 invariant
characters can be copied as-is when converting to/from UTF-8, saving time.
C<cp> is Unicode if above 255; otherwise is platform-native.

=over 3

 bool  UVCHR_IS_INVARIANT(UV cp)

=back

=back

=for hackers
Declared and documented at utf8.h, line 437

=over 4

=item C<UVCHR_SKIP>
X<UVCHR_SKIP>

returns the number of bytes required to represent the code point C<cp> when
encoded as UTF-8.  C<cp> is a native (ASCII or EBCDIC) code point if less than
255; a Unicode code point otherwise.

=over 3

 STRLEN  UVCHR_SKIP(UV cp)

=back

=back

=for hackers
Declared and documented at utf8.h, line 587

=over 4

=item C<uvchr_to_utf8*>

=item C<uvchr_to_utf8_flags*>

Described under C<L</uv_to_utf8>>

=back

=over 4

=item C<uvchr_to_utf8_flags_msgs*>

Described under C<L</uv_to_utf8_msgs>>

=back

=head1 Utility Functions

=over 4

=item C<C_ARRAY_END>
X<C_ARRAY_END>

Returns a pointer to one element past the final element of the input C array.

=over 3

 void *  C_ARRAY_END(void *a)

=back

=back

=for hackers
Declared and documented at handy.h, line 2907

=over 4

=item C<C_ARRAY_LENGTH>
X<C_ARRAY_LENGTH>

Returns the number of elements in the input C array (so you want your
zero-based indices to be less than but not equal to).

=over 3

 STRLEN  C_ARRAY_LENGTH(void *a)

=back

=back

=for hackers
Declared and documented at handy.h, line 2902

=over 4

=item C<getcwd_sv>
X<getcwd_sv>

Fill C<sv> with current working directory

=over 3

 int       getcwd_sv(      SV *sv)
 int  Perl_getcwd_sv(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 4099

=over 4

=item C<IN_PERL_COMPILETIME>
X<IN_PERL_COMPILETIME>

Returns 1 if this macro is being called during the compilation phase of the
program; otherwise 0;

=over 3

 bool  IN_PERL_COMPILETIME

=back

=back

=for hackers
Declared and documented at cop.h, line 1355

=over 4

=item C<IN_PERL_RUNTIME>
X<IN_PERL_RUNTIME>

Returns 1 if this macro is being called during the execution phase of the
program; otherwise 0;

=over 3

 bool  IN_PERL_RUNTIME

=back

=back

=for hackers
Declared and documented at cop.h, line 1359

=over 4

=item C<IS_SAFE_SYSCALL>
X<IS_SAFE_SYSCALL>

Same as L</is_safe_syscall>.

=over 3

 bool  IS_SAFE_SYSCALL(const char *pv, STRLEN len,
                       const char *what, const char *op_name)

=back

=back

=for hackers
Declared and documented at perl.h, line 8415

=over 4

=item C<is_safe_syscall>
X<is_safe_syscall>

Test that the given C<pv> (with length C<len>) doesn't contain any internal
C<NUL> characters.
If it does, set C<errno> to C<ENOENT>, optionally warn using the C<syscalls>
category, and return FALSE.

Return TRUE if the name is safe.

C<what> and C<op_name> are used in any warning.

Used by the C<IS_SAFE_SYSCALL()> macro.

=over 3

 bool       is_safe_syscall(      const char *pv, STRLEN len,
                                  const char *what,
                                  const char *op_name)
 bool  Perl_is_safe_syscall(pTHX_ const char *pv, STRLEN len,
                                  const char *what,
                                  const char *op_name)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 3298

=over 4

=item C<my_setenv>
X<my_setenv>

A wrapper for the C library L<setenv(3)>.  Don't use the latter, as the perl
version has desirable safeguards

=over 3

 void       my_setenv(      const char *nam, const char *val)
 void  Perl_my_setenv(pTHX_ const char *nam, const char *val)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2385

=over 4

=item C<newPADxVOP>
X<newPADxVOP>

Constructs, checks and returns an op containing a pad offset.  C<type> is
the opcode, which should be one of C<OP_PADSV>, C<OP_PADAV>, C<OP_PADHV>
or C<OP_PADCV>.  The returned op will have the C<op_targ> field set by
the C<padix> argument.

This is convenient when constructing a large optree in nested function
calls, as it avoids needing to store the pad op directly to set the
C<op_targ> field as a side-effect. For example

    o = op_append_elem(OP_LINESEQ, o,
        newPADxVOP(OP_PADSV, 0, padix));

=over 3

 OP *       newPADxVOP(      I32 type, I32 flags, PADOFFSET padix)
 OP *  Perl_newPADxVOP(pTHX_ I32 type, I32 flags, PADOFFSET padix)

=back

=back

=for hackers
Declared in embed.fnc; documented at inline.h, line 3995

=over 4

=item C<phase_name>
X<phase_name>

Returns the given phase's name as a NUL-terminated string.

For example, to print a stack trace that includes the current
interpreter phase you might do:

    const char* phase_name = phase_name(PL_phase);
    mess("This is weird. (Perl phase: %s)", phase_name);

=over 3

 const char * const  phase_name(enum perl_phase)

=back

=back

=for hackers
Declared in embed.fnc; documented at perl.h, line 5838

=over 4

=item C<PoisonFree>

=item C<Poison>
X<Poison>X<PoisonFree>

These each call C<PoisonWith(0xEF)> for catching access to freed memory.

=over 3

 void  PoisonFree(void* dest, int nitems, type)
 void  Poison    (void* dest, int nitems, type)

=back

=back

=for hackers
PoisonFree declared at handy.h, line 2698; all in group documented at handy.h, line 2698
Poison declared at handy.h, line 2699

=over 4

=item C<PoisonNew>
X<PoisonNew>

C<PoisonWith(0xAB)> for catching access to allocated but uninitialized memory.

=over 3

 void  PoisonNew(void* dest, int nitems, type)

=back

=back

=for hackers
Declared and documented at handy.h, line 2694

=over 4

=item C<PoisonWith>
X<PoisonWith>

Fill up memory with a byte pattern (a byte repeated over and over
again) that hopefully catches attempts to access uninitialized memory.

=over 3

 void  PoisonWith(void* dest, int nitems, type, U8 byte)

=back

=back

=for hackers
Declared and documented at handy.h, line 2689

=over 4

=item C<StructCopy>
X<StructCopy>

This is an architecture-independent macro that does a shallow copy of one
structure to another.

=over 3

 void  StructCopy(type *src, type *dest, type)

=back

=back

=for hackers
Declared and documented at handy.h, line 2685

=over 4

=item C<sv_destroyable>
X<sv_destroyable>

Dummy routine which reports that object can be destroyed when there is no
sharing module present.  It ignores its single SV argument, and returns
'true'.  Exists to avoid test for a C<NULL> function pointer and because it
could potentially warn under some level of strict-ness.

=over 3

 bool       sv_destroyable(      SV *sv)
 bool  Perl_sv_destroyable(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 4554

=over 4

=item C<sv_nosharing>
X<sv_nosharing>

Dummy routine which "shares" an SV when there is no sharing module present.
Or "locks" it.  Or "unlocks" it.  In other
words, ignores its single SV argument.
Exists to avoid test for a C<NULL> function pointer and because it could
potentially warn under some level of strict-ness.

=over 3

 void       sv_nosharing(      SV *sv)
 void  Perl_sv_nosharing(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 4534

=head1 Versioning

=over 4

=item C<new_version>
X<new_version>

Returns a new version object based on the passed in SV:

    SV *sv = new_version(SV *ver);

Does not alter the passed in ver SV.  See "upg_version" if you
want to upgrade the SV.

=over 3

 SV *       new_version(      SV *ver)
 SV *  Perl_new_version(pTHX_ SV *ver)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 479

=over 4

=item C<PERL_REVISION>
X<PERL_REVISION>

C<B<DEPRECATED!>>  It is planned to remove C<PERL_REVISION>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

The major number component of the perl interpreter currently being compiled or
executing.  This has been C<5> from 1993 into 2020.

Instead use one of the version comparison macros.  See C<L</PERL_VERSION_EQ>>.

=back

=for hackers
Declared and documented at patchlevel.h, line 12

=over 4

=item C<PERL_SUBVERSION>
X<PERL_SUBVERSION>

C<B<DEPRECATED!>>  It is planned to remove C<PERL_SUBVERSION>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

The micro number component of the perl interpreter currently being compiled or
executing.  In stable releases this gives the dot release number for
maintenance updates.  In development releases this gives a tag for a snapshot
of the status at various points in the development cycle.

Instead use one of the version comparison macros.  See C<L</PERL_VERSION_EQ>>.

=back

=for hackers
Declared and documented at patchlevel.h, line 24

=over 4

=item C<PERL_VERSION>
X<PERL_VERSION>

C<B<DEPRECATED!>>  It is planned to remove C<PERL_VERSION>
from a future release of Perl.  Do not use it for
new code; remove it from existing code.

The minor number component of the perl interpreter currently being compiled or
executing.  Between 1993 into 2020, this has ranged from 0 to 33.

Instead use one of the version comparison macros.  See C<L</PERL_VERSION_EQ>>.

=back

=for hackers
Declared and documented at patchlevel.h, line 18

=over 4

=item C<PERL_VERSION_EQ>

=item C<PERL_VERSION_GE>

=item C<PERL_VERSION_GT>

=item C<PERL_VERSION_LE>

=item C<PERL_VERSION_LT>

=item C<PERL_VERSION_NE>
X<PERL_VERSION_EQ>X<PERL_VERSION_GE>X<PERL_VERSION_GT>X<PERL_VERSION_LE>
X<PERL_VERSION_LT>X<PERL_VERSION_NE>

Returns whether or not the perl currently being compiled has the specified
relationship to the perl given by the parameters.  For example,

 #if PERL_VERSION_GT(5,24,2)
   code that will only be compiled on perls after v5.24.2
 #else
   fallback code
 #endif

Note that this is usable in making compile-time decisions

You may use the special value '*' for the final number to mean ALL possible
values for it.  Thus,

 #if PERL_VERSION_EQ(5,31,'*')

means all perls in the 5.31 series.  And

 #if PERL_VERSION_NE(5,24,'*')

means all perls EXCEPT 5.24 ones.  And

 #if PERL_VERSION_LE(5,9,'*')

is effectively

 #if PERL_VERSION_LT(5,10,0)

This means you don't have to think so much when converting from the existing
deprecated C<PERL_VERSION> to using this macro:

 #if PERL_VERSION <= 9

becomes

 #if PERL_VERSION_LE(5,9,'*')

=over 3

 bool  PERL_VERSION_EQ(const U8 major, const U8 minor,
                       const U8 patch)
 bool  PERL_VERSION_GE(const U8 major, const U8 minor,
                       const U8 patch)
 bool  PERL_VERSION_GT(const U8 major, const U8 minor,
                       const U8 patch)
 bool  PERL_VERSION_LE(const U8 major, const U8 minor,
                       const U8 patch)
 bool  PERL_VERSION_LT(const U8 major, const U8 minor,
                       const U8 patch)
 bool  PERL_VERSION_NE(const U8 major, const U8 minor,
                       const U8 patch)

=back

=back

=for hackers
PERL_VERSION_EQ declared at handy.h, line 513; all in group documented at handy.h, line 513
PERL_VERSION_GE 
PERL_VERSION_GT 
PERL_VERSION_LE 
PERL_VERSION_LT 
PERL_VERSION_NE 

=over 4

=item C<prescan_version>
X<prescan_version>

Validate that a given string can be parsed as a version object, but doesn't
actually perform the parsing.  Can use either strict or lax validation rules.
Can optionally set a number of hint variables to save the parsing code
some time when tokenizing.

=over 3

 const char *       prescan_version(      const char *s,
                                          bool strict,
                                          const char **errstr,
                                          bool *sqv,
                                          int *ssaw_decimal,
                                          int *swidth,
                                          bool *salpha)
 const char *  Perl_prescan_version(pTHX_ const char *s,
                                          bool strict,
                                          const char **errstr,
                                          bool *sqv,
                                          int *ssaw_decimal,
                                          int *swidth,
                                          bool *salpha)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 33

=over 4

=item C<scan_version>
X<scan_version>

Returns a pointer to the next character after the parsed
version string, as well as upgrading the passed in SV to
an RV.

Function must be called with an already existing SV like

    sv = newSV(0);
    s = scan_version(s, SV *sv, bool qv);

Performs some preprocessing to the string to ensure that
it has the correct characteristics of a version.  Flags the
object if it contains an underscore (which denotes this
is an alpha version).  The boolean qv denotes that the version
should be interpreted as if it had multiple decimals, even if
it doesn't.

=over 3

 const char *       scan_version(      const char *s, SV *rv,
                                       bool qv)
 const char *  Perl_scan_version(pTHX_ const char *s, SV *rv,
                                       bool qv)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 258

=over 4

=item C<upg_version>
X<upg_version>

In-place upgrade of the supplied SV to a version object.

    SV *sv = upg_version(SV *sv, bool qv);

Returns a pointer to the upgraded SV.  Set the boolean qv if you want
to force this SV to be interpreted as an "extended" version.

=over 3

 SV *       upg_version(      SV *ver, bool qv)
 SV *  Perl_upg_version(pTHX_ SV *ver, bool qv)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 577

=over 4

=item C<vcmp>
X<vcmp>

Version object aware cmp.  Both operands must already have been
converted into version objects.

=over 3

 int       vcmp(      SV *lhv, SV *rhv)
 int  Perl_vcmp(pTHX_ SV *lhv, SV *rhv)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 1134

=over 4

=item C<vnormal>
X<vnormal>

Accepts a version object and returns the normalized string
representation.  Call like:

    sv = vnormal(rv);

NOTE: you can pass either the object directly or the SV
contained within the RV.

The SV returned has a refcount of 1.

=over 3

 SV *       vnormal(      SV *vs)
 SV *  Perl_vnormal(pTHX_ SV *vs)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 1026

=over 4

=item C<vnumify>
X<vnumify>

Accepts a version object and returns the normalized floating
point representation.  Call like:

    sv = vnumify(rv);

NOTE: you can pass either the object directly or the SV
contained within the RV.

The SV returned has a refcount of 1.

=over 3

 SV *       vnumify(      SV *vs)
 SV *  Perl_vnumify(pTHX_ SV *vs)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 952

=over 4

=item C<vstringify>
X<vstringify>

In order to maintain maximum compatibility with earlier versions
of Perl, this function will return either the floating point
notation or the multiple dotted notation, depending on whether
the original version contained 1 or more dots, respectively.

The SV returned has a refcount of 1.

=over 3

 SV *       vstringify(      SV *vs)
 SV *  Perl_vstringify(pTHX_ SV *vs)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 1085

=over 4

=item C<vverify>
X<vverify>

Validates that the SV contains valid internal structure for a version object.
It may be passed either the version object (RV) or the hash itself (HV).  If
the structure is valid, it returns the HV.  If the structure is invalid,
it returns NULL.

    SV *hv = vverify(sv);

Note that it only confirms the bare minimum structure (so as not to get
confused by derived classes which may contain additional hash entries):

=over 4

=item * The SV is an HV or a reference to an HV

=item * The hash contains a "version" key

=item * The "version" key has a reference to an AV as its value

=back

=over 3

 SV *       vverify(      SV *vs)
 SV *  Perl_vverify(pTHX_ SV *vs)

=back

=back

=for hackers
Declared in embed.fnc; documented at vutil.c, line 901

=head1 Warning and Dieing
X<WARN_ALL>X<WARN_AMBIGUOUS>X<WARN_BAREWORD>X<WARN_CLOSED>X<WARN_CLOSURE>
X<WARN_DEBUGGING>X<WARN_DEPRECATED>
X<WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED>X<WARN_DEPRECATED__DOT_IN_INC>
X<WARN_DEPRECATED__GOTO_CONSTRUCT>
X<WARN_DEPRECATED__MISSING_IMPORT_CALLED_WITH_ARGS>
X<WARN_DEPRECATED__SUBSEQUENT_USE_VERSION>
X<WARN_DEPRECATED__UNICODE_PROPERTY_NAME>
X<WARN_DEPRECATED__VERSION_DOWNGRADE>X<WARN_DIGIT>X<WARN_EXEC>
X<WARN_EXITING>X<WARN_EXPERIMENTAL>
X<WARN_EXPERIMENTAL__ARGS_ARRAY_WITH_SIGNATURES>
X<WARN_EXPERIMENTAL__BUILTIN>X<WARN_EXPERIMENTAL__CLASS>
X<WARN_EXPERIMENTAL__DECLARED_REFS>X<WARN_EXPERIMENTAL__DEFER>
X<WARN_EXPERIMENTAL__EXTRA_PAIRED_DELIMITERS>
X<WARN_EXPERIMENTAL__KEYWORD_ALL>X<WARN_EXPERIMENTAL__KEYWORD_ANY>
X<WARN_EXPERIMENTAL__PRIVATE_USE>X<WARN_EXPERIMENTAL__RE_STRICT>
X<WARN_EXPERIMENTAL__REFALIASING>X<WARN_EXPERIMENTAL__REGEX_SETS>
X<WARN_EXPERIMENTAL__TRY>X<WARN_EXPERIMENTAL__UNIPROP_WILDCARDS>
X<WARN_EXPERIMENTAL__VLB>X<WARN_GLOB>X<WARN_ILLEGALPROTO>
X<WARN_IMPRECISION>X<WARN_INPLACE>X<WARN_INTERNAL>X<WARN_IO>X<WARN_LAYER>
X<WARN_LOCALE>X<WARN_MALLOC>X<WARN_MISC>X<WARN_MISSING>X<WARN_NEWLINE>
X<WARN_NON_UNICODE>X<WARN_NONCHAR>X<WARN_NUMERIC>X<WARN_ONCE>
X<WARN_OVERFLOW>X<WARN_PACK>X<WARN_PARENTHESIS>X<WARN_PIPE>
X<WARN_PORTABLE>X<WARN_PRECEDENCE>X<WARN_PRINTF>X<WARN_PROTOTYPE>
X<WARN_QW>X<WARN_RECURSION>X<WARN_REDEFINE>X<WARN_REDUNDANT>X<WARN_REGEXP>
X<WARN_RESERVED>X<WARN_SCALAR>X<WARN_SEMICOLON>X<WARN_SEVERE>
X<WARN_SHADOW>X<WARN_SIGNAL>X<WARN_SUBSTR>X<WARN_SURROGATE>X<WARN_SYNTAX>
X<WARN_SYSCALLS>X<WARN_TAINT>X<WARN_THREADS>X<WARN_UNINITIALIZED>
X<WARN_UNOPENED>X<WARN_UNPACK>X<WARN_UNTIE>X<WARN_UTF8>X<WARN_VOID>


In all these calls, the C<U32 wI<n>> parameters are warning category
constants.  You can see the ones currently available in
L<warnings/Category Hierarchy>, just capitalize all letters in the names
and prefix them by C<WARN_>.  So, for example, the category C<void> used in a
perl program becomes C<WARN_VOID> when used in XS code and passed to one of
the calls below.


=over 4

=item C<ck_warner>

=item C<ck_warner_d>
X<ck_warner>X<ck_warner_d>

If none of the warning categories given by C<err> are enabled, do nothing;
otherwise call C<L</warner>>  or C<L</warner_nocontext>> with the passed-in
parameters;.

C<err> must be one of the C<L</packWARN>>, C<packWARN2>, C<packWARN3>,
C<packWARN4> macros populated with the appropriate number of warning
categories.

The two forms differ only in that C<ck_warner_d> should be used if warnings for
any of the categories are by default enabled.

=over 3

 void  Perl_ck_warner  (pTHX_ U32 err, const char *pat, ...)
 void  Perl_ck_warner_d(pTHX_ U32 err, const char *pat, ...)

=back

=back

=for hackers
ck_warner declared in embed.fnc; all in group documented at util.c, line 2133
ck_warner_d declared in embed.fnc

=over 4

=item C<ckWARN>

=item C<ckWARN2>

=item C<ckWARN3>

=item C<ckWARN4>
X<ckWARN>X<ckWARN2>X<ckWARN3>X<ckWARN4>

These return a boolean as to whether or not warnings are enabled for any of
the warning category(ies) parameters:  C<w>, C<w1>, ....

Should any of the categories by default be enabled even if not within the
scope of S<C<use warnings>>, instead use the C<L</ckWARN_d>> macros.

The categories must be completely independent, one may not be subclassed from
the other.

=over 3

 bool  ckWARN (U32 w)
 bool  ckWARN2(U32 w1, U32 w2)
 bool  ckWARN3(U32 w1, U32 w2, U32 w3)
 bool  ckWARN4(U32 w1, U32 w2, U32 w3, U32 w4)

=back

=back

=for hackers
ckWARN declared at warnings.h, line 200; all in group documented at warnings.h, line 200
ckWARN2 declared at warnings.h, line 201
ckWARN3 declared at warnings.h, line 202
ckWARN4 declared at warnings.h, line 203

=over 4

=item C<ckWARN_d>

=item C<ckWARN2_d>

=item C<ckWARN3_d>

=item C<ckWARN4_d>
X<ckWARN_d>X<ckWARN2_d>X<ckWARN3_d>X<ckWARN4_d>

Like C<L</ckWARN>>, but for use if and only if the warning category(ies) is by
default enabled even if not within the scope of S<C<use warnings>>.

=over 3

 bool  ckWARN_d (U32 w)
 bool  ckWARN2_d(U32 w1, U32 w2)
 bool  ckWARN3_d(U32 w1, U32 w2, U32 w3)
 bool  ckWARN4_d(U32 w1, U32 w2, U32 w3, U32 w4)

=back

=back

=for hackers
ckWARN_d declared at warnings.h, line 213; all in group documented at warnings.h, line 213
ckWARN2_d declared at warnings.h, line 214
ckWARN3_d declared at warnings.h, line 215
ckWARN4_d declared at warnings.h, line 216

=over 4

=item C<ckWARN2*>

=item C<ckWARN3*>

=item C<ckWARN4*>

Described under C<L</ckWARN>>

=back

=over 4

=item C<CLEAR_ERRSV>
X<CLEAR_ERRSV>

Clear the contents of C<$@>, setting it to the empty string.

This replaces any read-only SV with a fresh SV and removes any magic.

=over 3

 void  CLEAR_ERRSV()

=back

=back

=for hackers
Declared and documented at perl.h, line 1986

=over 4

=item C<croak>

=item C<croak_nocontext>
X<croak>X<croak_nocontext>

These are XS interfaces to Perl's C<die> function.

They take a sprintf-style format pattern and argument list, which are used to
generate a string message.  If the message does not end with a newline, then it
will be extended with some indication of the current location in the code, as
described for C<L</mess_sv>>.

The error message will be used as an exception, by default
returning control to the nearest enclosing C<eval>, but subject to
modification by a C<$SIG{__DIE__}> handler.  In any case, these croak
functions never return normally.

For historical reasons, if C<pat> is null then the contents of C<ERRSV>
(C<$@>) will be used as an error message or object instead of building an
error message from arguments.  If you want to throw a non-string object,
or build an error message in an SV yourself, it is preferable to use
the C<L</croak_sv>> function, which does not involve clobbering C<ERRSV>.

The two forms differ only in that C<croak_nocontext> does not take a thread
context (C<aTHX>) parameter.  It is usually preferred as it takes up fewer
bytes of code than plain C<Perl_croak>, and time is rarely a critical resource
when you are about to throw an exception.

=over 3

 void  Perl_croak          (pTHX_ const char *pat, ...)
 void       croak_nocontext(      const char *pat, ...)
 void  Perl_croak_nocontext(      const char *pat, ...)

=back

=back

=for hackers
croak declared in embed.fnc; all in group documented at util.c, line 1894
croak_nocontext declared in embed.fnc

=over 4

=item C<croak_no_modify>
X<croak_no_modify>

This encapsulates a common reason for dying, generating terser object code than
using the generic C<Perl_croak>.  It is exactly equivalent to
C<croak("%s", PL_no_modify)> (which expands to something like
"Modification of a read-only value attempted").

Less code used on exception code paths reduces CPU cache pressure.

=over 3

 void       croak_no_modify()
 void  Perl_croak_no_modify()

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1947

=over 4

=item C<croak_nocontext*>

Described under C<L</croak>>

=back

=over 4

=item C<croak_sv>
X<croak_sv>

This is an XS interface to Perl's C<die> function.

C<baseex> is the error message or object.  If it is a reference, it
will be used as-is.  Otherwise it is used as a string, and if it does
not end with a newline then it will be extended with some indication of
the current location in the code, as described for L</mess_sv>.

The error message or object will be used as an exception, by default
returning control to the nearest enclosing C<eval>, but subject to
modification by a C<$SIG{__DIE__}> handler.  In any case, the C<croak_sv>
function never returns normally.

To die with a simple string message, the L</croak> function may be
more convenient.

=over 3

 void       croak_sv(      SV *baseex)
 void  Perl_croak_sv(pTHX_ SV *baseex)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1831

=over 4

=item C<die>

=item C<die_nocontext>
X<die>X<die_nocontext>

These behave the same as L</croak>, except for the return type.
They should be used only where the C<OP *> return type is required.
They never actually return.

The two forms differ only in that C<die_nocontext> does not take a thread
context (C<aTHX>) parameter, so is used in situations where the caller doesn't
already have the thread context.

=over 3

 OP *  Perl_die          (pTHX_ const char *pat, ...)
 OP *       die_nocontext(      const char *pat, ...)
 OP *  Perl_die_nocontext(      const char *pat, ...)

=back

=back

=for hackers
die declared in embed.fnc; all in group documented at util.c, line 1783
die_nocontext declared in embed.fnc

=over 4

=item C<die_sv>
X<die_sv>

This behaves the same as L</croak_sv>, except for the return type.
It should be used only where the C<OP *> return type is required.
The function never actually returns.

=over 3

 OP *       die_sv(      SV *baseex)
 OP *  Perl_die_sv(pTHX_ SV *baseex)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1761

=over 4

=item C<ERRSV>
X<ERRSV>

Returns the SV for C<$@>, creating it if needed.

=over 3

 SV *  ERRSV

=back

=back

=for hackers
Declared and documented at perl.h, line 1982

=over 4

=item C<fatal_warner>
X<fatal_warner>

Like L</warner> except that it acts as if fatal warnings are enabled
for the warning.

If called when there are pending compilation errors this function may
return.

This is currently used to generate "used only once" fatal warnings
since the COP where the name being reported is no longer the current
COP when the warning is generated and may be useful for similar cases.

C<err> must be one of the C<L</packWARN>>, C<packWARN2>, C<packWARN3>,
C<packWARN4> macros populated with the appropriate number of warning
categories.

=over 3

 void  Perl_fatal_warner(pTHX_ U32 err, const char *pat, ...)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2149

=over 4

=item C<packWARN>

=item C<packWARN2>

=item C<packWARN3>

=item C<packWARN4>
X<packWARN>X<packWARN2>X<packWARN3>X<packWARN4>

These macros are used to pack warning categories into a single U32 to pass to
macros and functions that take a warning category parameter.  The number of
categories to pack is given by the name, with a corresponding number of
category parameters passed.

=over 3

 U32  packWARN (U32 w1)
 U32  packWARN2(U32 w1, U32 w2)
 U32  packWARN3(U32 w1, U32 w2, U32 w3)
 U32  packWARN4(U32 w1, U32 w2, U32 w3, U32 w4)

=back

=back

=for hackers
packWARN declared at warnings.h, line 221; all in group documented at warnings.h, line 221
packWARN2 declared at warnings.h, line 222
packWARN3 declared at warnings.h, line 223
packWARN4 declared at warnings.h, line 224

=over 4

=item C<SANE_ERRSV>
X<SANE_ERRSV>

Clean up ERRSV so we can safely set it.

This replaces any read-only SV with a fresh writable copy and removes
any magic.

=over 3

 void  SANE_ERRSV()

=back

=back

=for hackers
Declared and documented at perl.h, line 1992

=over 4

=item C<sv_regex_global_pos_clear>
X<sv_regex_global_pos_clear>

Resets the value in the regexp global match position magic, if it exists, so
that it does not take effect.

=over 3

 void       sv_regex_global_pos_clear(      SV *sv)
 void  Perl_sv_regex_global_pos_clear(pTHX_ SV *sv)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 17792

=over 4

=item C<sv_regex_global_pos_get>
X<sv_regex_global_pos_get>

If the given SV has regexp global match position magic, sets the STRLEN
pointed to by C<posp> to the current value of the position and returns true.
If not, returns false.

If flags is zero, the return value will count in units of characters.  If
the C<SV_POSBYTES> flag is present, this will count instead in units of bytes,
which may be different if the SV has the C<SvUTF8> flag set.

=over 3

 bool       sv_regex_global_pos_get(      SV *sv, STRLEN *posp,
                                          U32 flags)
 bool  Perl_sv_regex_global_pos_get(pTHX_ SV *sv, STRLEN *posp,
                                          U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 17705

=over 4

=item C<sv_regex_global_pos_set>
X<sv_regex_global_pos_set>

Sets the value in the regexp global match position magic, first adding it if
necessary.  If C<pos> is given as a negative value, this will count backwards
from the end of the string.

If flags is zero, C<pos> will count in units of characters.  If the
C<SV_POSBYTES> flag is present, this will count instead in units of bytes,
which may be different if the SV has the C<SvUTF8> flag set.  In that case, it
will be the caller's responsibility to ensure that C<pos> only lands on the
boundary between characters, and not in the middle of a multi-byte character.

=over 3

 void       sv_regex_global_pos_set(      SV *sv, STRLEN pos,
                                          U32 flags)
 void  Perl_sv_regex_global_pos_set(pTHX_ SV *sv, STRLEN pos,
                                          U32 flags)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 17736

=over 4

=item C<sv_vstring_get>
X<sv_vstring_get>

If the given SV has vstring magic, stores the length of it into the variable
addressed by C<lenp>, and returns the string pointer.  If not, returns
C<NULL>.

If a pointer is returned to the caller, it will point to memory owned by the
SV itself.  The caller is not responsible for freeing it after this call,
though it will not remain valid for longer than the lifetime of the SV itself.
The caller should take a copy of it if it needs to be accessed after this
time.

=over 3

 const char *       sv_vstring_get(      SV * const sv,
                                         STRLEN *lenp)
 const char *  Perl_sv_vstring_get(pTHX_ SV * const sv,
                                         STRLEN *lenp)

=back

=back

=for hackers
Declared in embed.fnc; documented at sv.c, line 17811

=over 4

=item C<vcroak>
X<vcroak>

This is an XS interface to Perl's C<die> function.

C<pat> and C<args> are a sprintf-style format pattern and encapsulated
argument list.  These are used to generate a string message.  If the
message does not end with a newline, then it will be extended with
some indication of the current location in the code, as described for
L</mess_sv>.

The error message will be used as an exception, by default
returning control to the nearest enclosing C<eval>, but subject to
modification by a C<$SIG{__DIE__}> handler.  In any case, the C<croak>
function never returns normally.

For historical reasons, if C<pat> is null then the contents of C<ERRSV>
(C<$@>) will be used as an error message or object instead of building an
error message from arguments.  If you want to throw a non-string object,
or build an error message in an SV yourself, it is preferable to use
the L</croak_sv> function, which does not involve clobbering C<ERRSV>.

=over 3

 void       vcroak(      const char *pat, va_list *args)
 void  Perl_vcroak(pTHX_ const char *pat, va_list *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 1861

=over 4

=item C<vfatal_warner>
X<vfatal_warner>

This is like C<L</fatal_warner>> but C<args> are an encapsulated
argument list.

=over 3

 void       vfatal_warner(      U32 err, const char *pat,
                                va_list *args)
 void  Perl_vfatal_warner(pTHX_ U32 err, const char *pat,
                                va_list *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2165

=over 4

=item C<vwarn>
X<vwarn>

This is an XS interface to Perl's C<warn> function.

This is like C<L</warn>>, but C<args> are an encapsulated
argument list.

Unlike with L</vcroak>, C<pat> is not permitted to be null.

=over 3

 void       vwarn(      const char *pat, va_list *args)
 void  Perl_vwarn(pTHX_ const char *pat, va_list *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2036

=over 4

=item C<vwarner>
X<vwarner>

This is like C<L</warner>>, but C<args> are an encapsulated argument list.

=over 3

 void       vwarner(      U32 err, const char *pat, va_list *args)
 void  Perl_vwarner(pTHX_ U32 err, const char *pat, va_list *args)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2146

=over 4

=item C<warn>

=item C<warn_nocontext>
X<warn>X<warn_nocontext>

These are XS interfaces to Perl's C<warn> function.

They take a sprintf-style format pattern and argument list, which  are used to
generate a string message.  If the message does not end with a newline, then it
will be extended with some indication of the current location in the code, as
described for C<L</mess_sv>>.

The error message or object will by default be written to standard error,
but this is subject to modification by a C<$SIG{__WARN__}> handler.

Unlike with C<L</croak>>, C<pat> is not permitted to be null.

The two forms differ only in that C<warn_nocontext> does not take a thread
context (C<aTHX>) parameter, so is used in situations where the caller doesn't
already have the thread context.

=over 3

 void  Perl_warn          (pTHX_ const char *pat, ...)
 void       warn_nocontext(      const char *pat, ...)
 void  Perl_warn_nocontext(      const char *pat, ...)

=back

=back

=for hackers
warn declared in embed.fnc; all in group documented at util.c, line 2058
warn_nocontext declared in embed.fnc

=over 4

=item C<warn_sv>
X<warn_sv>

This is an XS interface to Perl's C<warn> function.

C<baseex> is the error message or object.  If it is a reference, it
will be used as-is.  Otherwise it is used as a string, and if it does
not end with a newline then it will be extended with some indication of
the current location in the code, as described for L</mess_sv>.

The error message or object will by default be written to standard error,
but this is subject to modification by a C<$SIG{__WARN__}> handler.

To warn with a simple string message, the L</warn> function may be
more convenient.

=over 3

 void       warn_sv(      SV *baseex)
 void  Perl_warn_sv(pTHX_ SV *baseex)

=back

=back

=for hackers
Declared in embed.fnc; documented at util.c, line 2008

=over 4

=item C<warner>

=item C<warner_nocontext>
X<warner>X<warner_nocontext>

These output a warning of the specified category (or categories) given by
C<err>, using the sprintf-style format pattern C<pat>, and argument list.

C<err> must be one of the C<L</packWARN>>, C<packWARN2>, C<packWARN3>,
C<packWARN4> macros populated with the appropriate number of warning
categories.  If any of the warning categories they specify is fatal, a fatal
exception is thrown.

In any event a message is generated by the pattern and arguments.  If the
message does not end with a newline, then it will be extended with some
indication of the current location in the code, as described for L</mess_sv>.

The error message or object will by default be written to standard error,
but this is subject to modification by a C<$SIG{__WARN__}> handler.

C<pat> is not permitted to be null.

The two forms differ only in that C<warner_nocontext> does not take a thread
context (C<aTHX>) parameter, so is used in situations where the caller doesn't
already have the thread context.

These functions differ from the similarly named C<L</warn>> functions, in that
the latter are for XS code to unconditionally display a warning, whereas these
are for code that may be compiling a perl program, and does extra checking to
see if the warning should be fatal.

=over 3

 void  Perl_warner          (pTHX_ U32 err, const char *pat, ...)
 void       warner_nocontext(      U32 err, const char *pat, ...)
 void  Perl_warner_nocontext(      U32 err, const char *pat, ...)

=back

=back

=for hackers
warner declared in embed.fnc; all in group documented at util.c, line 2104
warner_nocontext declared in embed.fnc

=head1 XS


F<xsubpp> compiles XS code into C.  See L<perlutil/xsubpp>.

=for comment
Some variables below are flagged with 'u' because Devel::PPPort can't currently
readily test them as they spring into existence by compiling with xsubpp.


=over 4

=item C<aMY_CXT>

=item C<aMY_CXT_>

=item C<_aMY_CXT>

Described in L<perlxs>.

=back

=for hackers
aMY_CXT all in group documented at dist/ExtUtils-ParseXS/lib/perlxs.pod, line 2075
aMY_CXT_ 
_aMY_CXT 

=over 4

=item C<ax>
X<ax>

Variable which is setup by C<xsubpp> to indicate the stack base offset,
used by the C<ST>, C<XSprePUSH> and C<XSRETURN> macros.  The C<dMARK> macro
must be called prior to setup the C<MARK> variable.

=over 3

 Stack_off_t  ax

=back

=back

=for hackers
Declared and documented at XSUB.h, line 40

=over 4

=item C<CLASS>
X<CLASS>

Variable which is setup by C<xsubpp> to indicate the
class name for a C++ XS constructor.  This is always a C<char*>.  See
C<L</THIS>>.

=over 3

 char*  CLASS

=back

=back

=for hackers
Declared and documented at XSUB.h, line 25

=over 4

=item C<dAX>
X<dAX>

Sets up the C<ax> variable.
This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.

=over 3

   dAX;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 77

=over 4

=item C<dAXMARK>
X<dAXMARK>

Sets up the C<ax> variable and stack marker variable C<mark>.
This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.

=over 3

   dAXMARK;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 81

=over 4

=item C<dITEMS>
X<dITEMS>

Sets up the C<items> variable.
This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.

=over 3

   dITEMS;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 85

=over 4

=item C<dMY_CXT>

Described in L<perlxs>.

=back

=for hackers
Documented at dist/ExtUtils-ParseXS/lib/perlxs.pod, line 2052

=over 4

=item C<dMY_CXT_SV>
X<dMY_CXT_SV>

Now a placeholder that declares nothing

=over 3

   dMY_CXT_SV;

=back

=back

=for hackers
Declared and documented at perl.h, line 743

=over 4

=item C<dUNDERBAR>
X<dUNDERBAR>

Sets up any variable needed by the C<UNDERBAR> macro.  It used to define
C<padoff_du>, but it is currently a noop.  However, it is strongly advised
to still use it for ensuring past and future compatibility.

=over 3

   dUNDERBAR;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 98

=over 4

=item C<dXSARGS>
X<dXSARGS>

Sets up stack and mark pointers for an XSUB, calling C<dSP> and C<dMARK>.
Sets up the C<ax> and C<items> variables by calling C<dAX> and C<dITEMS>.
This is usually handled automatically by C<xsubpp>.

=over 3

   dXSARGS;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 89

=over 4

=item C<dXSI32>
X<dXSI32>

Sets up the C<ix> variable for an XSUB which has aliases.  This is usually
handled automatically by C<xsubpp>.

=over 3

   dXSI32;

=back

=back

=for hackers
Declared and documented at XSUB.h, line 94

=over 4

=item C<items>
X<items>

Variable which is setup by C<xsubpp> to indicate the number of
items on the stack.  See L<perlxs/"Variable-length Parameter Lists">.

=over 3

 Stack_off_t  items

=back

=back

=for hackers
Declared and documented at XSUB.h, line 45

=over 4

=item C<ix>
X<ix>

Variable which is setup by C<xsubpp> to indicate which of an
XSUB's aliases was used to invoke it.  See L<perlxs/"The ALIAS: Keyword">.

=over 3

 I32  ix

=back

=back

=for hackers
Declared and documented at XSUB.h, line 49

=over 4

=item C<MY_CXT>

=item C<MY_CXT_CLONE>

=item C<MY_CXT_INIT>

=item C<pMY_CXT>

=item C<pMY_CXT_>

=item C<_pMY_CXT>

Described in L<perlxs>.

=back

=for hackers
MY_CXT all in group documented at dist/ExtUtils-ParseXS/lib/perlxs.pod, line 2080
MY_CXT_CLONE 
MY_CXT_INIT 
pMY_CXT 
pMY_CXT_ 
_pMY_CXT 

=over 4

=item C<RETVAL>
X<RETVAL>

Variable which is setup by C<xsubpp> to hold the return value for an
XSUB.  This is always the proper type for the XSUB.  See
L<perlxs/"The RETVAL Variable">.

=over 3

 type  RETVAL

=back

=back

=for hackers
Declared and documented at XSUB.h, line 30

=over 4

=item C<ST>
X<ST>

Used to access elements on the XSUB's stack.

=over 3

 SV*  ST(int ix)

=back

=back

=for hackers
Declared and documented at XSUB.h, line 53

=over 4

=item C<START_MY_CXT>

Described in L<perlxs>.

=back

=for hackers
Documented at dist/ExtUtils-ParseXS/lib/perlxs.pod, line 2034

=over 4

=item C<THIS>
X<THIS>

Variable which is setup by C<xsubpp> to designate the object in a C++
XSUB.  This is always the proper type for the C++ object.  See C<L</CLASS>> and
L<perlxs/"Using XS With C++">.

=over 3

 type  THIS

=back

=back

=for hackers
Declared and documented at XSUB.h, line 35

=over 4

=item C<UNDERBAR>
X<UNDERBAR>

The SV* corresponding to the C<$_> variable.  Works even if there
is a lexical C<$_> in scope.

=back

=for hackers
Declared and documented at XSUB.h, line 103

=over 4

=item C<XS>
X<XS>

Macro to declare an XSUB and its C parameter list.  This is handled by
C<xsubpp>.  It is the same as using the more explicit C<XS_EXTERNAL> macro; the
latter is preferred.

=back

=for hackers
Declared and documented at XSUB.h, line 56

=over 4

=item C<XS_EXTERNAL>
X<XS_EXTERNAL>

Macro to declare an XSUB and its C parameter list explicitly exporting the symbols.

=back

=for hackers
Declared and documented at XSUB.h, line 70

=over 4

=item C<XS_INTERNAL>
X<XS_INTERNAL>

Macro to declare an XSUB and its C parameter list without exporting the symbols.
This is handled by C<xsubpp> and generally preferable over exporting the XSUB
symbols unnecessarily.

=for comment
XS_INTERNAL marked 'u' because declaring a function static within our test
function doesn't work

=back

=for hackers
Declared and documented at XSUB.h, line 61

=over 4

=item C<XSPROTO>
X<XSPROTO>

Macro used by C<L</XS_INTERNAL>> and C<L</XS_EXTERNAL>> to declare a function
prototype.  You probably shouldn't be using this directly yourself.

=back

=for hackers
Declared and documented at XSUB.h, line 73

=head1 Undocumented elements

The following functions have been flagged as part of the public
API, but are currently undocumented.  Use them at your own risk,
as the interfaces are subject to change.  Functions that are not
listed in this document are not intended for public use, and
should NOT be used under any circumstances.

If you feel you need to use one of these functions, first send
email to L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>.
It may be that there is a good reason for the function not being
documented, and it should be removed from this list; or it may
just be that no one has gotten around to documenting it.  In the
latter case, you will be asked to submit a patch to document the
function.  Once your patch is accepted, it will indicate that the
interface is stable (unless it is explicitly marked otherwise) and
usable by you.

X<clone_params_del>X<clone_params_new>X<do_open>X<do_openn>X<sv_dup>
X<sv_dup_inc>

 clone_params_del  clone_params_new  do_open  do_openn  sv_dup  sv_dup_inc

Next are the API-flagged elements that are considered experimental.  Using one
of these is even more risky than plain undocumented ones.  They are listed
here because they should be listed somewhere (so their existence doesn't get
lost) and this is the best place for them.

X<apply_attrs_string>X<gv_fetchmethod_pv_flags>X<gv_fetchmethod_pvn_flags>
X<gv_fetchmethod_sv_flags>X<hv_store_flags>X<leave_adjust_stacks>
X<newXS_flags>X<savetmps>X<thread_locale_init>X<thread_locale_term>

 apply_attrs_string        hv_store_flags       thread_locale_init
 gv_fetchmethod_pv_flags   leave_adjust_stacks  thread_locale_term
 gv_fetchmethod_pvn_flags  newXS_flags          
 gv_fetchmethod_sv_flags   savetmps             

Finally are deprecated undocumented API elements.
Do not use any for new code; remove all occurrences of all of these from
existing code.


There are currently no items of this type

=head1 AUTHORS

Until May 1997, this document was maintained by Jeff Okamoto
<okamoto@corp.hp.com>.  It is now maintained as part of Perl itself.

With lots of help and suggestions from Dean Roehrich, Malcolm Beattie,
Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil
Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer,
Stephen McCamant, and Gurusamy Sarathy.

API Listing originally by Dean Roehrich <roehrich@cray.com>.

Updated to be autogenerated from comments in the source by Benjamin Stuhl.

=head1 SEE ALSO

F<config.h>, L<perlapio>, L<perlcall>, L<perlclib>, L<perlembed>, L<perlfilter>, L<perlguts>, L<perlhacktips>, L<perlintern>, L<perlinterp>, L<perliol>, L<perlmroapi>, L<perlreapi>, L<perlreguts>, L<perlxs>

=cut

ex: set ro ft=pod:
