Note that all Perl API global variables must be referenced with the "PL_" prefix. Some macros are provided for compatibility with the older, unadorned names, but this support may be disabled in a future release.
The listing is alphabetical, case insensitive.
        U32     GIMME
        U32     GIMME_V
        int     AvFILL(AV* av)
        void    av_clear(AV* ar)
NOTE: this function is experimental and may change or be removed without notice.
        void    av_create_and_push(AV **const avp, SV *const val)
NOTE: this function is experimental and may change or be removed without notice.
        SV**    av_create_and_unshift_one(AV **const avp, SV *const val)
        SV*     av_delete(AV* ar, I32 key, I32 flags)
This relies on the fact that uninitialized array elements are set to &PL_sv_undef.
        bool    av_exists(AV* ar, I32 key)
        void    av_extend(AV* ar, I32 key)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied arrays.
        SV**    av_fetch(AV* ar, I32 key, I32 lval)
The number of elements in the an array will be "fill + 1" after av_fill() returns. If the array was previously shorter then the additional elements appended are set to "PL_sv_undef". If the array was longer, then the excess elements are freed. "av_fill(av, -1)" is the same as "av_clear(av)".
        void    av_fill(AV* ar, I32 fill)
        I32     av_len(const AV* ar)
        AV*     av_make(I32 size, SV** svp)
        SV*     av_pop(AV* ar)
        void    av_push(AV* ar, SV* val)
        SV*     av_shift(AV* ar)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied arrays.
        SV**    av_store(AV* ar, I32 key, SV* val)
        void    av_undef(AV* ar)
        void    av_unshift(AV* ar, I32 num)
NOTE: the perl_ form of this function is deprecated.
        AV*     get_av(const char* name, I32 create)
        AV*     newAV()
    sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
Currently this always uses mergesort. See sortsv_flags for a more flexible routine.
        void    sortsv(SV** array, size_t num_elts, SVCOMPARE_t cmp)
        void    sortsv_flags(SV** array, size_t num_elts, SVCOMPARE_t cmp, U32 flags)
NOTE: the perl_ form of this function is deprecated.
        I32     call_argv(const char* sub_name, I32 flags, char** argv)
NOTE: the perl_ form of this function is deprecated.
        I32     call_method(const char* methname, I32 flags)
NOTE: the perl_ form of this function is deprecated.
        I32     call_pv(const char* sub_name, I32 flags)
NOTE: the perl_ form of this function is deprecated.
        I32     call_sv(SV* sv, I32 flags)
                ENTER;
NOTE: the perl_ form of this function is deprecated.
        SV*     eval_pv(const char* p, I32 croak_on_error)
NOTE: the perl_ form of this function is deprecated.
        I32     eval_sv(SV* sv, I32 flags)
                FREETMPS;
                LEAVE;
                SAVETMPS;
        bool    isALNUM(char ch)
        bool    isALPHA(char ch)
        bool    isDIGIT(char ch)
        bool    isLOWER(char ch)
        bool    isSPACE(char ch)
        bool    isUPPER(char ch)
        char    toLOWER(char ch)
        char    toUPPER(char ch)
perl_clone takes these flags as parameters:
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 COPY_STACKS while the threads->create doesn't.
CLONEf_KEEP_PTR_TABLE 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 KEEP_PTR_TABLE is not set then perl_clone will kill the ptr_table using the function "ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;", reason to keep it around is if you want to dup some of your own variable who are outside the graph perl scans, example of this code is in threads.xs create
CLONEf_CLONE_HOST This is a win32 thing, it is ignored on unix, it tells perls 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.
        PerlInterpreter*        perl_clone(PerlInterpreter* interp, UV flags)
        HV*     CvSTASH(CV* cv)
NOTE: the perl_ form of this function is deprecated.
        CV*     get_cv(const char* name, I32 flags)
NOTE: the perl_ form of this function is deprecated.
        CV*     get_cvn_flags(const char* name, STRLEN len, I32 flags)
        void    cv_undef(CV* cv)
        void    load_module(U32 flags, SV* name, SV* ver, ...)
        int     nothreadhook()
        PerlInterpreter*        perl_alloc()
        void    perl_construct(PerlInterpreter* interp)
        int     perl_destruct(PerlInterpreter* interp)
        void    perl_free(PerlInterpreter* interp)
        int     perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env)
        int     perl_run(PerlInterpreter* interp)
NOTE: the perl_ form of this function is deprecated.
        void    require_pv(const char* pv)
  char *pv_display(SV *dsv, const char *pv, STRLEN cur, STRLEN len,
                   STRLEN pvlim, U32 flags)
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.
        char*   pv_display(SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
               |const STRLEN count|const STRLEN max
               |STRLEN const *escaped, const U32 flags
Escapes at most the first ``count'' chars of pv and puts the results into dsv such that the size of the escaped string will not exceed ``max'' chars and will not contain any incomplete escape sequences.
If flags contains 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 PERL_PV_ESCAPE_NOCLEAR is set this will not occur.
If PERL_PV_ESCAPE_UNI is set then the input string is treated as Unicode, if PERL_PV_ESCAPE_UNI_DETECT is set then the input string is scanned using "is_utf8_string()" to determine if it is Unicode.
If PERL_PV_ESCAPE_ALL is set then all input chars will be output using "\x01F1" style escapes, otherwise only chars above 255 will be escaped using this style, other non printable chars will use octal or common escaped patterns like "\n". If PERL_PV_ESCAPE_NOBACKSLASH then all chars below 255 will be treated as printable and will be output as literals.
If PERL_PV_ESCAPE_FIRSTCHAR is set then only the first char of the string will be escaped, regardles of max. If the string is utf8 and the chars value is >255 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 "\n" or a 3 or more digit hex value.
If PERL_PV_ESCAPE_RE is set then the escape char used will be a '%' and not a '\\'. This is because regexes very often contain backslashed sequences, whereas '%' is not a particularly common character in patterns.
Returns a pointer to the escaped text as held by dsv.
NOTE: the perl_ form of this function is deprecated.
        char*   pv_escape(SV *dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags)
           |const STRLEN count|const STRLEN max\
           |const char const *start_color| const char const *end_color\
           |const U32 flags
Converts a string into something presentable, handling escaping via pv_escape() and supporting quoting and ellipses.
If the 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 PERL_PV_PRETTY_LTGT flag is set then the result be wrapped in angle brackets.
If the PERL_PV_PRETTY_ELLIPSES flag is set and not all characters in string were output then an ellipsis "..." will be appended to the string. Note that this happens AFTER it has been quoted.
If start_color is non-null then it will be inserted after the opening quote (if there is one) but before the escaped text. If 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 dsv.
NOTE: the perl_ form of this function is deprecated.
        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)
        GV*     gv_fetchmethod(HV* stash, const char* name)
        void    pack_cat(SV *cat, const char *pat, const char *patend, SV **beglist, SV **endlist, SV ***next_in_list, U32 flags)
Usually accessed via the "SvPVbyte_nolen" macro.
        char*   sv_2pvbyte_nolen(SV* sv)
Usually accessed via the "SvPVutf8_nolen" macro.
        char*   sv_2pvutf8_nolen(SV* sv)
        void    sv_catpvn_mg(SV *sv, const char *ptr, STRLEN len)
        void    sv_catsv_mg(SV *dstr, SV *sstr)
        void    sv_force_normal(SV *sv)
        IV      sv_iv(SV* sv)
``Superseded'' by sv_nosharing().
        void    sv_nolocking(SV *sv)
``Superseded'' by sv_nosharing().
        void    sv_nounlocking(SV *sv)
        NV      sv_nv(SV* sv)
        char*   sv_pv(SV *sv)
        char*   sv_pvbyte(SV *sv)
        char*   sv_pvbyten(SV *sv, STRLEN *len)
        char*   sv_pvn(SV *sv, STRLEN *len)
        char*   sv_pvutf8(SV *sv)
        char*   sv_pvutf8n(SV *sv, STRLEN *len)
        void    sv_unref(SV* sv)
        void    sv_usepvn(SV* sv, char* ptr, STRLEN len)
        void    sv_usepvn_mg(SV *sv, char *ptr, STRLEN len)
        UV      sv_uv(SV* sv)
        I32     unpack_str(const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags)
        CV*     find_runcv(U32 *db_seqp)
        void    packlist(SV *cat, const char *pat, const char *patend, SV **beglist, SV **endlist)
        I32     unpackstring(const char *pat, const char *patend, const char *s, const char *strend, U32 flags)
        SV*     GvSV(GV* gv)
        SV*     gv_const_sv(GV* gv)
The argument "level" should be either 0 or -1. If "level==0", as a side-effect creates a glob with the given "name" in the given "stash" which in the case of success contains an alias for the subroutine, and sets up caching info for this glob.
This function grants "SUPER" token as a postfix of the stash name. The GV returned from "gv_fetchmeth" may be a method cache entry, which is not visible to Perl code. So when calling "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 "GvCV" macro.
        GV*     gv_fetchmeth(HV* stash, const char* name, STRLEN len, I32 level)
The third parameter of "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 "gv_fetchmethod" is equivalent to calling "gv_fetchmethod_autoload" with a non-zero "autoload" parameter.
These functions grant "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 $AUTOLOAD changing its value. Use the glob created via a side effect to do this.
These functions have the same side-effects and as "gv_fetchmeth" with "level==0". "name" should be writable if contains ':' or ' ''. The warning against passing the GV returned by "gv_fetchmeth" to "call_sv" apply equally to these functions.
        GV*     gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload)
For an autoloaded subroutine without a GV, will create a GV even if "level < 0". For an autoloaded subroutine without a stub, GvCV() of the result may be zero.
        GV*     gv_fetchmeth_autoload(HV* stash, const char* name, STRLEN len, I32 level)
        HV*     gv_stashpv(const char* name, I32 flags)
        HV*     gv_stashpvn(const char* name, U32 namelen, I32 flags)
        HV*     gv_stashpvs(const char* name, I32 create)
        HV*     gv_stashsv(SV* sv, I32 flags)
NOTE: the perl_ form of this function is deprecated.
        HV*     get_hv(const char* name, I32 create)
        U32     HeHASH(HE* he)
        void*   HeKEY(HE* he)
        STRLEN  HeKLEN(HE* he)
        char*   HePV(HE* he, STRLEN len)
        SV*     HeSVKEY(HE* he)
        SV*     HeSVKEY_force(HE* he)
        SV*     HeSVKEY_set(HE* he, SV* sv)
        SV*     HeVAL(HE* he)
        char*   HvNAME(HV* stash)
        void    hv_assert(HV* tb)
        void    hv_clear(HV* tb)
        void    hv_clear_placeholders(HV* hb)
        SV*     hv_delete(HV* tb, const char* key, I32 klen, I32 flags)
        SV*     hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash)
        bool    hv_exists(HV* tb, const char* key, I32 klen)
        bool    hv_exists_ent(HV* tb, SV* key, U32 hash)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied hashes.
        SV**    hv_fetch(HV* tb, const char* key, I32 klen, I32 lval)
        SV**    hv_fetchs(HV* tb, const char* key, I32 lval)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied hashes.
        HE*     hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash)
NOTE: Before version 5.004_65, "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 "HvFILL(tb)".
        I32     hv_iterinit(HV* tb)
        char*   hv_iterkey(HE* entry, I32* retlen)
        SV*     hv_iterkeysv(HE* entry)
You may call "hv_delete" or "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 "hv_iternext", so you must not discard your iterator immediately else the entry will leak - call "hv_iternext" to trigger the resource deallocation.
        HE*     hv_iternext(HV* tb)
        SV*     hv_iternextsv(HV* hv, char** key, I32* retlen)
NOTE: this function is experimental and may change or be removed without notice.
        HE*     hv_iternext_flags(HV* tb, I32 flags)
        SV*     hv_iterval(HV* tb, HE* entry)
        void    hv_magic(HV* hv, GV* gv, int how)
        SV*     hv_scalar(HV* hv)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied hashes.
        SV**    hv_store(HV* tb, const char* key, I32 klen, SV* val, U32 hash)
        SV**    hv_stores(HV* tb, const char* key, NULLOK SV* val)
See ``Understanding the Magic of Tied Hashes and Arrays'' in perlguts for more information on how to use this function on tied hashes.
        HE*     hv_store_ent(HV* tb, SV* key, SV* val, U32 hash)
        void    hv_undef(HV* tb)
        HV*     newHV()
        int     mg_clear(SV* sv)
        int     mg_copy(SV* sv, SV* nsv, const char* key, I32 klen)
        MAGIC*  mg_find(const SV* sv, int type)
        int     mg_free(SV* sv)
        int     mg_get(SV* sv)
        U32     mg_length(SV* sv)
        void    mg_magical(SV* sv)
        int     mg_set(SV* sv)
        void    SvGETMAGIC(SV* sv)
        void    SvLOCK(SV* sv)
        void    SvSETMAGIC(SV* sv)
        void    SvSetMagicSV(SV* dsb, SV* ssv)
        void    SvSetMagicSV_nosteal(SV* dsv, SV* ssv)
        void    SvSetSV(SV* dsb, SV* ssv)
        void    SvSetSV_nosteal(SV* dsv, SV* ssv)
        void    SvSHARE(SV* sv)
        void    SvUNLOCK(SV* sv)
        void    Copy(void* src, void* dest, int nitems, type)
        void *  CopyD(void* src, void* dest, int nitems, type)
        void    Move(void* src, void* dest, int nitems, type)
        void *  MoveD(void* src, void* dest, int nitems, type)
In 5.9.3, Newx() and friends replace the older New() API, and drops the first parameter, x, a debug aid which allowed callers to identify themselves. This aid has been superseded by a new build option, PERL_MEM_LOG (see ``PERL_MEM_LOG'' in perlhack). The older API is still there for use in XS modules supporting older perls.
        void    Newx(void* ptr, int nitems, type)
        void    Newxc(void* ptr, int nitems, type, cast)
        void    Newxz(void* ptr, int nitems, type)
        void    Poison(void* dest, int nitems, type)
        void    PoisonFree(void* dest, int nitems, type)
        void    PoisonNew(void* dest, int nitems, type)
        void    PoisonWith(void* dest, int nitems, type, U8 byte)
        void    Renew(void* ptr, int nitems, type)
        void    Renewc(void* ptr, int nitems, type, cast)
        void    Safefree(void* ptr)
        char*   savepv(const char* pv)
        char*   savepvn(const char* pv, I32 len)
        char*   savepvs(const char* s)
        char*   savesharedpv(const char* pv)
        char*   savesharedpvn(const char *const pv, const STRLEN len)
        char*   savesvpv(SV* sv)
        void    StructCopy(type src, type dest, type)
        void    Zero(void* dest, int nitems, type)
        void *  ZeroD(void* dest, int nitems, type)
        void    fbm_compile(SV* sv, U32 flags)
        char*   fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags)
    (char *) Perl_form(pTHX_ const char* pat, ...)
can be used any place a string (char *) is required:
    char * s = Perl_form("%d.%d",major,minor);
Uses a single private buffer so if you want to format several strings you must explicitly copy the earlier strings away (and free the copies when you are done).
        char*   form(const char* pat, ...)
        int     getcwd_sv(SV* sv)
        int     my_snprintf(char *buffer, const Size_t len, const char *format, ...)
        int     my_sprintf(char *buffer, const char *pat, ...)
        int     my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap)
    SV *sv = new_version(SV *ver);
Does not alter the passed in ver SV. See ``upg_version'' if you want to upgrade the SV.
        SV*     new_version(SV *ver)
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.
        const char*     scan_version(const char *vstr, SV *sv, bool qv)
        bool    strEQ(char* s1, char* s2)
        bool    strGE(char* s1, char* s2)
        bool    strGT(char* s1, char* s2)
        bool    strLE(char* s1, char* s2)
        bool    strLT(char* s1, char* s2)
        bool    strNE(char* s1, char* s2)
        bool    strnEQ(char* s1, char* s2, STRLEN len)
        bool    strnNE(char* s1, char* s2, STRLEN len)
        bool    sv_destroyable(SV *sv)
        void    sv_nosharing(SV *sv)
    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.
        SV*     upg_version(SV *ver, bool qv)
        int     vcmp(SV *lvs, SV *rvs)
    sv = vnormal(rv);
NOTE: you can pass either the object directly or the SV contained within the RV.
        SV*     vnormal(SV *vs)
    sv = vnumify(rv);
NOTE: you can pass either the object directly or the SV contained within the RV.
        SV*     vnumify(SV *vs)
        SV*     vstringify(SV *vs)
    bool vverify(SV *vobj);
Note that it only confirms the bare minimum structure (so as not to get confused by derived classes which may contain additional hash entries):
        bool    vverify(SV *vs)
You are responsible for "SvREFCNT_inc()" on the return value if you plan to store it anywhere semi-permanently (otherwise it might be deleted out from under you the next time the cache is invalidated).
        AV*     mro_get_linear_isa(HV* stash)
Ideally, all instances of "PL_sub_generation++" in perl source outside of "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 constant.pm does).
This same method is available from pure perl via, "mro::method_changed_in(classname)".
        void    mro_method_changed_in(HV* stash)
                dMULTICALL;
                MULTICALL;
                POP_MULTICALL;
                PUSH_MULTICALL;
On entry start and *len give the string to scan, *flags gives conversion flags, and result should be NULL or a pointer to an NV. The scan stops at the end of the string, or the first invalid character. Unless "PERL_SCAN_SILENT_ILLDIGIT" is set in *flags, encountering an invalid character will also trigger a warning. On return *len is set to the length of the scanned string, and *flags gives output flags.
If the value is <= "UV_MAX" it is returned as a UV, the output flags are clear, and nothing is written to *result. If the value is > UV_MAX "grok_bin" returns UV_MAX, sets "PERL_SCAN_GREATER_THAN_UV_MAX" in the output flags, and writes the value to *result (or the value is discarded if result is NULL).
The binary number may optionally be prefixed with ``0b'' or ``b'' unless "PERL_SCAN_DISALLOW_PREFIX" is set in *flags on entry. If "PERL_SCAN_ALLOW_UNDERSCORES" is set in *flags then the binary number may use '_' characters to separate digits.
        UV      grok_bin(const char* start, STRLEN* len_p, I32* flags, NV *result)
On entry start and *len give the string to scan, *flags gives conversion flags, and result should be NULL or a pointer to an NV. The scan stops at the end of the string, or the first invalid character. Unless "PERL_SCAN_SILENT_ILLDIGIT" is set in *flags, encountering an invalid character will also trigger a warning. On return *len is set to the length of the scanned string, and *flags gives output flags.
If the value is <= UV_MAX it is returned as a UV, the output flags are clear, and nothing is written to *result. If the value is > UV_MAX "grok_hex" returns UV_MAX, sets "PERL_SCAN_GREATER_THAN_UV_MAX" in the output flags, and writes the value to *result (or the value is discarded if result is NULL).
The hex number may optionally be prefixed with ``0x'' or ``x'' unless "PERL_SCAN_DISALLOW_PREFIX" is set in *flags on entry. If "PERL_SCAN_ALLOW_UNDERSCORES" is set in *flags then the hex number may use '_' characters to separate digits.
        UV      grok_hex(const char* start, STRLEN* len_p, I32* flags, NV *result)
If the value of the number can fit an in UV, it is returned in the *valuep IS_NUMBER_IN_UV will be set to indicate that *valuep is valid, IS_NUMBER_IN_UV will never be set unless *valuep is valid, but *valuep may have been assigned to during processing even though IS_NUMBER_IN_UV is not set on return. If valuep is NULL, IS_NUMBER_IN_UV will be set for the same cases as when valuep is non-NULL, but no actual assignment (or SEGV) will occur.
IS_NUMBER_NOT_INT will be set with IS_NUMBER_IN_UV if trailing decimals were seen (in which case *valuep gives the true value truncated to an integer), and IS_NUMBER_NEG if the number is negative (in which case *valuep holds the absolute value). IS_NUMBER_IN_UV is not set if e notation was used or the number is larger than a UV.
        int     grok_number(const char *pv, STRLEN len, UV *valuep)
        bool    grok_numeric_radix(const char **sp, const char *send)
On entry start and *len give the string to scan, *flags gives conversion flags, and result should be NULL or a pointer to an NV. The scan stops at the end of the string, or the first invalid character. Unless "PERL_SCAN_SILENT_ILLDIGIT" is set in *flags, encountering an invalid character will also trigger a warning. On return *len is set to the length of the scanned string, and *flags gives output flags.
If the value is <= UV_MAX it is returned as a UV, the output flags are clear, and nothing is written to *result. If the value is > UV_MAX "grok_oct" returns UV_MAX, sets "PERL_SCAN_GREATER_THAN_UV_MAX" in the output flags, and writes the value to *result (or the value is discarded if result is NULL).
If "PERL_SCAN_ALLOW_UNDERSCORES" is set in *flags then the octal number may use '_' characters to separate digits.
        UV      grok_oct(const char* start, STRLEN* len_p, I32* flags, NV *result)
If Configure detects this system has a signbit() that will work with our NVs, then we just use it via the #define in perl.h. Otherwise, fall back on this implementation. As a first pass, this gets everything right except -0.0. Alas, catching -0.0 is the main use for this function, so this is not too helpful yet. Still, at least we have the scaffolding in place to support other systems, should that prove useful.
Configure notes: This function is called 'Perl_signbit' instead of a plain 'signbit' because it is easy to imagine a system having a signbit() function or macro that doesn't happen to work with our particular choice of NVs. We shouldn't just re-#define signbit as Perl_signbit and expect the standard system headers to be happy. Also, this is a no-context function (no pTHX_) because Perl_signbit() is usually re-#defined in perl.h as a simple macro call to the system's signbit(). Users should just always call Perl_signbit().
NOTE: this function is experimental and may change or be removed without notice.
        int     Perl_signbit(NV f)
        NV      scan_bin(const char* start, STRLEN len, STRLEN* retlen)
        NV      scan_hex(const char* start, STRLEN len, STRLEN* retlen)
        NV      scan_oct(const char* start, STRLEN len, STRLEN* retlen)
Constant subs can be created with "newCONSTSUB" or as described in ``Constant Functions'' in perlsub.
        SV*     cv_const_sv(CV* cv)
        CV*     newCONSTSUB(HV* stash, const char* name, SV* sv)
        SV*     pad_sv(PADOFFSET po)
        HV*     PL_modglobal
        STRLEN  PL_na
        SV      PL_sv_no
        SV      PL_sv_undef
        SV      PL_sv_yes
    if (SvMAGICAL(sv))
        mg_get(sv);
    if (SvROK(sv) &&
        (tmpsv = (SV*)SvRV(sv)) &&
        SvTYPE(tmpsv) == SVt_PVMG &&
        (tmpmg = mg_find(tmpsv, PERL_MAGIC_qr)))
    {
        return (REGEXP *)tmpmg->mg_obj;
    }
NULL will be returned if a REGEXP* is not found.
        REGEXP *        SvRX(SV *sv)
If you want to do something with the REGEXP* later use SvRX instead and check for NULL.
        bool    SvRXOK(SV* sv)
                dXCPT;
                XCPT_RETHROW;
                dMARK;
                dORIGMARK;
                dSP;
        void    EXTEND(SP, int nitems)
        void    mPUSHi(IV iv)
        void    mPUSHn(NV nv)
        void    mPUSHp(char* str, STRLEN len)
        void    mPUSHu(UV uv)
        void    mXPUSHi(IV iv)
        void    mXPUSHn(NV nv)
        void    mXPUSHp(char* str, STRLEN len)
        void    mXPUSHu(UV uv)
        IV      POPi
        long    POPl
        NV      POPn
        char*   POPp
        char*   POPpbytex
        char*   POPpx
        SV*     POPs
        void    PUSHi(IV iv)
        void    PUSHMARK(SP)
        void    PUSHmortal()
        void    PUSHn(NV nv)
        void    PUSHp(char* str, STRLEN len)
        void    PUSHs(SV* sv)
        void    PUSHu(UV uv)
                PUTBACK;
                SPAGAIN;
        void    XPUSHi(IV iv)
        void    XPUSHmortal()
        void    XPUSHn(NV nv)
        void    XPUSHp(char* str, STRLEN len)
        void    XPUSHs(SV* sv)
        void    XPUSHu(UV uv)
        void    XSRETURN(int nitems)
                XSRETURN_EMPTY;
        void    XSRETURN_IV(IV iv)
                XSRETURN_NO;
        void    XSRETURN_NV(NV nv)
        void    XSRETURN_PV(char* str)
                XSRETURN_UNDEF;
        void    XSRETURN_UV(IV uv)
                XSRETURN_YES;
        void    XST_mIV(int pos, IV iv)
        void    XST_mNO(int pos)
        void    XST_mNV(int pos, NV nv)
        void    XST_mPV(int pos, char* str)
        void    XST_mUNDEF(int pos)
        void    XST_mYES(int pos)
NOTE: the perl_ form of this function is deprecated.
        SV*     get_sv(const char* name, I32 create)
        SV*     newRV_inc(SV* sv)
        STRLEN  SvCUR(SV* sv)
        void    SvCUR_set(SV* sv, STRLEN len)
        char*   SvEND(SV* sv)
        char*   SvGAMAGIC(SV* sv)
        char *  SvGROW(SV* sv, STRLEN len)
        U32     SvIOK(SV* sv)
        U32     SvIOKp(SV* sv)
        bool    SvIOK_notUV(SV* sv)
        void    SvIOK_off(SV* sv)
        void    SvIOK_on(SV* sv)
        void    SvIOK_only(SV* sv)
        void    SvIOK_only_UV(SV* sv)
        bool    SvIOK_UV(SV* sv)
        bool    SvIsCOW(SV* sv)
        bool    SvIsCOW_shared_hash(SV* sv)
        IV      SvIV(SV* sv)
        IV      SvIVX(SV* sv)
        IV      SvIVx(SV* sv)
        IV      SvIV_nomg(SV* sv)
        void    SvIV_set(SV* sv, IV val)
        STRLEN  SvLEN(SV* sv)
        void    SvLEN_set(SV* sv, STRLEN len)
        void    SvMAGIC_set(SV* sv, MAGIC* val)
        U32     SvNIOK(SV* sv)
        U32     SvNIOKp(SV* sv)
        void    SvNIOK_off(SV* sv)
        U32     SvNOK(SV* sv)
        U32     SvNOKp(SV* sv)
        void    SvNOK_off(SV* sv)
        void    SvNOK_on(SV* sv)
        void    SvNOK_only(SV* sv)
        NV      SvNV(SV* sv)
        NV      SvNVX(SV* sv)
        NV      SvNVx(SV* sv)
        void    SvNV_set(SV* sv, NV val)
        U32     SvOK(SV* sv)
        U32     SvOOK(SV* sv)
        U32     SvPOK(SV* sv)
        U32     SvPOKp(SV* sv)
        void    SvPOK_off(SV* sv)
        void    SvPOK_on(SV* sv)
        void    SvPOK_only(SV* sv)
        void    SvPOK_only_UTF8(SV* sv)
        char*   SvPV(SV* sv, STRLEN len)
        char*   SvPVbyte(SV* sv, STRLEN len)
        char*   SvPVbytex(SV* sv, STRLEN len)
        char*   SvPVbytex_force(SV* sv, STRLEN len)
        char*   SvPVbyte_force(SV* sv, STRLEN len)
        char*   SvPVbyte_nolen(SV* sv)
        char*   SvPVutf8(SV* sv, STRLEN len)
        char*   SvPVutf8x(SV* sv, STRLEN len)
        char*   SvPVutf8x_force(SV* sv, STRLEN len)
        char*   SvPVutf8_force(SV* sv, STRLEN len)
        char*   SvPVutf8_nolen(SV* sv)
        char*   SvPVX(SV* sv)
        char*   SvPVx(SV* sv, STRLEN len)
        char*   SvPV_force(SV* sv, STRLEN len)
        char*   SvPV_force_nomg(SV* sv, STRLEN len)
        char*   SvPV_nolen(SV* sv)
        char*   SvPV_nomg(SV* sv, STRLEN len)
        void    SvPV_set(SV* sv, char* val)
        U32     SvREFCNT(SV* sv)
        void    SvREFCNT_dec(SV* sv)
All of the following SvREFCNT_inc* macros are optimized versions of SvREFCNT_inc, and can be replaced with SvREFCNT_inc.
        SV*     SvREFCNT_inc(SV* sv)
        SV*     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    SvREFCNT_inc_void_NN(SV* sv)
        U32     SvROK(SV* sv)
        void    SvROK_off(SV* sv)
        void    SvROK_on(SV* sv)
        SV*     SvRV(SV* sv)
        void    SvRV_set(SV* sv, SV* val)
        HV*     SvSTASH(SV* sv)
        void    SvSTASH_set(SV* sv, HV* val)
        void    SvTAINT(SV* sv)
        bool    SvTAINTED(SV* sv)
        void    SvTAINTED_off(SV* sv)
        void    SvTAINTED_on(SV* sv)
        bool    SvTRUE(SV* sv)
        svtype  SvTYPE(SV* sv)
        bool    SvUOK(SV* sv)
        void    SvUPGRADE(SV* sv, svtype type)
        U32     SvUTF8(SV* sv)
        void    SvUTF8_off(SV *sv)
        void    SvUTF8_on(SV *sv)
        UV      SvUV(SV* sv)
        UV      SvUVX(SV* sv)
        UV      SvUVx(SV* sv)
        UV      SvUV_nomg(SV* sv)
        void    SvUV_set(SV* sv, UV val)
        bool    SvVOK(SV* sv)
        void    sv_catpvn_nomg(SV* sv, const char* ptr, STRLEN len)
        void    sv_catsv_nomg(SV* dsv, SV* ssv)
        bool    sv_derived_from(SV* sv, const char* name)
        bool    sv_does(SV* sv, const char* name)
        void    sv_report_used()
        void    sv_setsv_nomg(SV* dsv, SV* ssv)
        I32     looks_like_number(SV* sv)
        SV*     newRV_noinc(SV* sv)
In 5.9.3, newSV() replaces the older NEWSV() API, and drops the first parameter, x, a debug aid which allowed callers to identify themselves. This aid has been superseded by a new build option, PERL_MEM_LOG (see ``PERL_MEM_LOG'' in perlhack). The older API is still there for use in XS modules supporting older perls.
        SV*     newSV(STRLEN len)
        SV*     newSVhek(const HEK *hek)
        SV*     newSViv(IV i)
        SV*     newSVnv(NV n)
        SV*     newSVpv(const char* s, STRLEN len)
        SV*     newSVpvf(const char* pat, ...)
        SV*     newSVpvn(const char* s, STRLEN len)
        SV*     newSVpvn_share(const char* s, I32 len, U32 hash)
        SV*     newSVpvs(const char* s)
        SV*     newSVpvs_share(const char* s)
        SV*     newSVrv(SV* rv, const char* classname)
        SV*     newSVsv(SV* old)
        SV*     newSVuv(UV u)
        SV*     newSV_type(svtype type)
        bool    sv_2bool(SV* sv)
        CV*     sv_2cv(SV* sv, HV** st, GV** gvp, I32 lref)
        IO*     sv_2io(SV* sv)
        IV      sv_2iv_flags(SV* sv, I32 flags)
        SV*     sv_2mortal(SV* sv)
        NV      sv_2nv(SV* sv)
Usually accessed via the "SvPVbyte" macro.
        char*   sv_2pvbyte(SV* sv, STRLEN* lp)
Usually accessed via the "SvPVutf8" macro.
        char*   sv_2pvutf8(SV* sv, STRLEN* lp)
        char*   sv_2pv_flags(SV* sv, STRLEN* lp, I32 flags)
        UV      sv_2uv_flags(SV* sv, I32 flags)
        int     sv_backoff(SV* sv)
        SV*     sv_bless(SV* sv, HV* stash)
        void    sv_catpv(SV* sv, const char* ptr)
        void    sv_catpvf(SV* sv, const char* pat, ...)
        void    sv_catpvf_mg(SV *sv, const char* pat, ...)
        void    sv_catpvn(SV* sv, const char* ptr, STRLEN len)
        void    sv_catpvn_flags(SV* sv, const char* ptr, STRLEN len, I32 flags)
        void    sv_catpvs(SV* sv, const char* s)
        void    sv_catpv_mg(SV *sv, const char *ptr)
        void    sv_catsv(SV* dsv, SV* ssv)
        void    sv_catsv_flags(SV* dsv, SV* ssv, I32 flags)
        void    sv_chop(SV* sv, const char* ptr)
        void    sv_clear(SV* sv)
        I32     sv_cmp(SV* sv1, SV* sv2)
        I32     sv_cmp_locale(SV* sv1, SV* sv2)
Any scalar variable may carry 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.
        char*   sv_collxfrm(SV* sv, STRLEN* nxp)
        void    sv_copypv(SV* dsv, SV* ssv)
        void    sv_dec(SV* sv)
        I32     sv_eq(SV* sv1, SV* sv2)
        void    sv_force_normal_flags(SV *sv, U32 flags)
        void    sv_free(SV* sv)
        char*   sv_gets(SV* sv, PerlIO* fp, I32 append)
        char*   sv_grow(SV* sv, STRLEN newlen)
        void    sv_inc(SV* sv)
        void    sv_insert(SV* bigsv, STRLEN offset, STRLEN len, const char* little, STRLEN littlelen)
        int     sv_isa(SV* sv, const char* name)
        int     sv_isobject(SV* sv)
        STRLEN  sv_len(SV* sv)
        STRLEN  sv_len_utf8(SV* sv)
See "sv_magicext" (which "sv_magic" now calls) for a description of the handling of the "name" and "namlen" arguments.
You need to use "sv_magicext" to add magic to SvREADONLY SVs and also to add more than one instance of the same 'how'.
        void    sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen)
Note that "sv_magicext" will allow things that "sv_magic" will not. In particular, you can add magic to SvREADONLY SVs, and add more than one instance of the same 'how'.
If "namlen" is greater than zero then a "savepvn" copy of "name" is stored, if "namlen" is zero then "name" is stored as-is and - as another special case - if "(name && namlen == HEf_SVKEY)" then "name" is assumed to contain an "SV*" and is stored as-is with its REFCNT incremented.
(This is now used as a subroutine by "sv_magic".)
        MAGIC * sv_magicext(SV* sv, SV* obj, int how, const MGVTBL *vtbl, const char* name, I32 namlen)
        SV*     sv_mortalcopy(SV* oldsv)
        SV*     sv_newmortal()
        SV*     sv_newref(SV* sv)
        void    sv_pos_b2u(SV* sv, I32* offsetp)
        void    sv_pos_u2b(SV* sv, I32* offsetp, I32* lenp)
        char*   sv_pvbyten_force(SV* sv, STRLEN* lp)
        char*   sv_pvn_force(SV* sv, STRLEN* lp)
        char*   sv_pvn_force_flags(SV* sv, STRLEN* lp, I32 flags)
        char*   sv_pvutf8n_force(SV* sv, STRLEN* lp)
        const char*     sv_reftype(const SV* sv, int ob)
        void    sv_replace(SV* sv, SV* nsv)
        void    sv_reset(const char* s, HV* stash)
        SV*     sv_rvweaken(SV *sv)
        void    sv_setiv(SV* sv, IV num)
        void    sv_setiv_mg(SV *sv, IV i)
        void    sv_setnv(SV* sv, NV num)
        void    sv_setnv_mg(SV *sv, NV num)
        void    sv_setpv(SV* sv, const char* ptr)
        void    sv_setpvf(SV* sv, const char* pat, ...)
        void    sv_setpvf_mg(SV *sv, const char* pat, ...)
        void    sv_setpviv(SV* sv, IV num)
        void    sv_setpviv_mg(SV *sv, IV iv)
        void    sv_setpvn(SV* sv, const char* ptr, STRLEN len)
        void    sv_setpvn_mg(SV *sv, const char *ptr, STRLEN len)
        void    sv_setpvs(SV* sv, const char* s)
        void    sv_setpv_mg(SV *sv, const char *ptr)
        SV*     sv_setref_iv(SV* rv, const char* classname, IV iv)
        SV*     sv_setref_nv(SV* rv, const char* classname, NV nv)
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 "sv_setref_pvn" copies the string while this copies the pointer.
        SV*     sv_setref_pv(SV* rv, const char* classname, void* pv)
Note that "sv_setref_pv" copies the pointer while this copies the string.
        SV*     sv_setref_pvn(SV* rv, const char* classname, const char* pv, STRLEN n)
        SV*     sv_setref_uv(SV* rv, const char* classname, UV uv)
You probably want to use one of the assortment of wrappers, such as "SvSetSV", "SvSetSV_nosteal", "SvSetMagicSV" and "SvSetMagicSV_nosteal".
        void    sv_setsv(SV* dsv, SV* ssv)
You probably want to use one of the assortment of wrappers, such as "SvSetSV", "SvSetSV_nosteal", "SvSetMagicSV" and "SvSetMagicSV_nosteal".
This is the primary function for copying scalars, and most other copy-ish functions and macros use this underneath.
        void    sv_setsv_flags(SV* dsv, SV* ssv, I32 flags)
        void    sv_setsv_mg(SV *dstr, SV *sstr)
        void    sv_setuv(SV* sv, UV num)
        void    sv_setuv_mg(SV *sv, UV u)
        I32     sv_true(SV *sv)
        int     sv_unmagic(SV* sv, int type)
        void    sv_unref_flags(SV* sv, U32 flags)
        void    sv_upgrade(SV* sv, svtype new_type)
If "flags" & SV_SMAGIC is true, will call SvSETMAGIC. If "flags" & SV_HAS_TRAILING_NUL is true, then "ptr[len]" must be NUL, and the realloc will be skipped. (i.e. the buffer is actually at least 1 byte longer than "len", and already meets the requirements for storing in "SvPVX")
        void    sv_usepvn_flags(SV* sv, char* ptr, STRLEN len, U32 flags)
NOTE: this function is experimental and may change or be removed without notice.
        bool    sv_utf8_decode(SV *sv)
This is not as a general purpose Unicode to byte encoding interface: use the Encode extension for that.
NOTE: this function is experimental and may change or be removed without notice.
        bool    sv_utf8_downgrade(SV *sv, bool fail_ok)
        void    sv_utf8_encode(SV *sv)
This is not as a general purpose byte encoding to Unicode interface: use the Encode extension for that.
        STRLEN  sv_utf8_upgrade(SV *sv)
This is not as a general purpose byte encoding to Unicode interface: use the Encode extension for that.
        STRLEN  sv_utf8_upgrade_flags(SV *sv, I32 flags)
Usually used via its frontend "sv_catpvf".
        void    sv_vcatpvf(SV* sv, const char* pat, va_list* args)
Usually used via one of its frontends "sv_vcatpvf" and "sv_vcatpvf_mg".
        void    sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
Usually used via its frontend "sv_catpvf_mg".
        void    sv_vcatpvf_mg(SV* sv, const char* pat, va_list* args)
Usually used via its frontend "sv_setpvf".
        void    sv_vsetpvf(SV* sv, const char* pat, va_list* args)
Usually used via one of its frontends "sv_vsetpvf" and "sv_vsetpvf_mg".
        void    sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
Usually used via its frontend "sv_setpvf_mg".
        void    sv_vsetpvf_mg(SV* sv, const char* pat, va_list* args)
NOTE: this function is experimental and may change or be removed without notice.
        U8*     bytes_from_utf8(const U8 *s, STRLEN *len, bool *is_utf8)
If you want to convert to UTF-8 from other encodings than ASCII, see sv_recode_to_utf8().
NOTE: this function is experimental and may change or be removed without notice.
        U8*     bytes_to_utf8(const U8 *s, STRLEN *len)
If the pe1 and pe2 are non-NULL, the scanning pointers will be copied in there (they will point at the beginning of the next character). If the pointers behind pe1 or pe2 are non-NULL, they are the end pointers beyond which scanning will not continue under any circumstances. If the byte lengths l1 and l2 are non-zero, s1+l1 and s2+l2 will be used as goal end pointers that will also stop the scan, and which qualify towards defining a successful match: all the scans that define an explicit length must reach their goal pointers for a match to succeed).
For case-insensitiveness, the ``casefolding'' of Unicode is used instead of upper/lowercasing both the characters, see http://www.unicode.org/unicode/reports/tr21/ (Case Mappings).
        I32     ibcmp_utf8(const char* a, char **pe1, UV l1, bool u1, const char* b, char **pe2, UV l2, bool u2)
        STRLEN  is_utf8_char(const U8 *p)
See also is_utf8_string_loclen() and is_utf8_string_loc().
        bool    is_utf8_string(const U8 *s, STRLEN len)
See also is_utf8_string_loclen() and is_utf8_string().
        bool    is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **p)
See also is_utf8_string_loc() and is_utf8_string().
        bool    is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
The flags argument can have UNI_DISPLAY_ISPRINT set to display isPRINT()able characters as themselves, UNI_DISPLAY_BACKSLASH to display the \\[nrfta\\] as the backslashed versions (like '\n') (UNI_DISPLAY_BACKSLASH is preferred over UNI_DISPLAY_ISPRINT for \\). UNI_DISPLAY_QQ (and its alias UNI_DISPLAY_REGEX) have both UNI_DISPLAY_BACKSLASH and UNI_DISPLAY_ISPRINT turned on.
The pointer to the PV of the dsv is returned.
        char*   pv_uni_display(SV *dsv, const U8 *spv, STRLEN len, STRLEN pvlim, UV flags)
Returns TRUE if the terminator was found, else returns FALSE.
        bool    sv_cat_decode(SV* dsv, SV *encoding, SV *ssv, int *offset, char* tstr, int tlen)
If the sv already is UTF-8 (or if it is not POK), or if the encoding is not a reference, nothing is done to the sv. If the encoding is not an "Encode::XS" Encoding object, bad things will happen. (See lib/encoding.pm and Encode).
The PV of the sv is returned.
        char*   sv_recode_to_utf8(SV* sv, SV *encoding)
The flags argument is as in pv_uni_display().
The pointer to the PV of the dsv is returned.
        char*   sv_uni_display(SV *dsv, SV *ssv, STRLEN pvlim, UV flags)
The ``ustrp'' is a pointer to the character buffer to put the conversion result to. The ``lenp'' is a pointer to the length of the result.
The ``swashp'' is a pointer to the swash to use.
Both the special and normal mappings are stored lib/unicore/To/Foo.pl, and loaded by SWASHNEW, using lib/utf8_heavy.pl. The special (usually, but not always, a multicharacter mapping), is tried first.
The ``special'' is a string like ``utf8::ToSpecLower'', which means the hash %utf8::ToSpecLower. The access to the hash is through Perl_to_utf8_case().
The ``normal'' is a string like ``ToLower'' which means the swash %utf8::ToLower.
        UV      to_utf8_case(const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special)
The first character of the foldcased version is returned (but note, as explained above, that there may be more.)
        UV      to_utf8_fold(const U8 *p, U8* ustrp, STRLEN *lenp)
The first character of the lowercased version is returned (but note, as explained above, that there may be more.)
        UV      to_utf8_lower(const U8 *p, U8* ustrp, STRLEN *lenp)
The first character of the titlecased version is returned (but note, as explained above, that there may be more.)
        UV      to_utf8_title(const U8 *p, U8* ustrp, STRLEN *lenp)
The first character of the uppercased version is returned (but note, as explained above, that there may be more.)
        UV      to_utf8_upper(const U8 *p, U8* ustrp, STRLEN *lenp)
Returns the native character value of the first character in the string "s" which is assumed to be in UTF-8 encoding; "retlen" will be set to the length, in bytes, of that character.
Allows length and flags to be passed to low level routine.
        UV      utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
If "s" does not point to a well-formed UTF-8 character, the behaviour is dependent on the value of "flags": if it contains UTF8_CHECK_ONLY, it is assumed that the caller will raise a warning, and this function will silently just set "retlen" to "-1" and return zero. If the "flags" does not contain UTF8_CHECK_ONLY, warnings about malformations will be given, "retlen" will be set to the expected length of the UTF-8 character in bytes, and zero will be returned.
The "flags" can also contain various flags to allow deviations from the strict UTF-8 encoding (see utf8.h).
Most code should use utf8_to_uvchr() rather than call this directly.
        UV      utf8n_to_uvuni(const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
WARNING: use only if you *know* that the pointers point inside the same UTF-8 buffer.
        IV      utf8_distance(const U8 *a, const U8 *b)
WARNING: do not use the following unless you *know* "off" is within the UTF-8 data pointed to by "s" *and* that on entry "s" is aligned on the first byte of character or just after the last byte of a character.
        U8*     utf8_hop(const U8 *s, I32 off)
        STRLEN  utf8_length(const U8* s, const U8 *e)
If you need a copy of the string, see "bytes_from_utf8".
NOTE: this function is experimental and may change or be removed without notice.
        U8*     utf8_to_bytes(U8 *s, STRLEN *len)
If "s" does not point to a well-formed UTF-8 character, zero is returned and retlen is set, if possible, to -1.
        UV      utf8_to_uvchr(const U8 *s, STRLEN *retlen)
This function should only be used when returned UV is considered an index into the Unicode semantic tables (e.g. swashes).
If "s" does not point to a well-formed UTF-8 character, zero is returned and retlen is set, if possible, to -1.
        UV      utf8_to_uvuni(const U8 *s, STRLEN *retlen)
    d = uvchr_to_utf8(d, uv);
is the recommended wide native character-aware way of saying
    *(d++) = uv;
        U8*     uvchr_to_utf8(U8 *d, UV uv)
    d = uvuni_to_utf8_flags(d, uv, flags);
or, in most cases,
    d = uvuni_to_utf8(d, uv);
(which is equivalent to)
    d = uvuni_to_utf8_flags(d, uv, 0);
is the recommended Unicode-aware way of saying
    *(d++) = uv;
        U8*     uvuni_to_utf8_flags(U8 *d, UV uv, UV flags)
        I32     ax
        char*   CLASS
                dAX;
                dAXMARK;
                dITEMS;
                dUNDERBAR;
                dXSARGS;
                dXSI32;
        I32     items
        I32     ix
        (whatever)      RETVAL
        SV*     ST(int ix)
        (whatever)      THIS
                XS_VERSION_BOOTCHECK;
If you want to throw an exception object, assign the object to $@ and then pass "NULL" to croak():
   errsv = get_sv("@", TRUE);
   sv_setsv(errsv, exception_object);
   croak(NULL);
        void    croak(const char* pat, ...)
        void    warn(const char* pat, ...)
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.