Author image Vickenty Fesunov
and 1 contributors

NAME

Ouroboros - Perl XS macros re-exported as C functions

DESCRIPTION

libouroboros is a library of C functions wrapping XS macros. This package provides pointers to these functions, so Perl programs can have access to internal Perl methods (e.g. SvIV) at run-time. In combination with a JIT- compiler it allows Perl programs to build XS-like subroutines completely at run-time, without the need for a C compiler or a build environment.

Thread context

All wrappers accept thread context as a first argument, as defined by pTHX XS macro, even if pTHX is not part of the wrapped macro definition.

Two exceptions to this are ouroboros_sys_init3 and ouroboros_sys_term, since they are called in embedded Perl scenario at times when Perl interpreter object does not exist.

The stack

libouroboros encapsulates local stack state kept by XS inside the stack object: ouroboros_stack_t type and a number of method functions. Storage can be allocated on caller's stack or in heap, and should be initialized first by calling ouroboros_stack_init().

Minimum storage size for ouroboros_stack_t is available as $Ouroboros::SIZE_OF{ouroboros_stack_t}. Exact layout is intentionally unspecified, user program should treat this type as an opaque object and only use provided methods to manipulate it.

Type sizes

Sizes for most primitive data types used by Perl are available via Config and supplemented by %Ouroboros::SIZE_OF hash.

Exception handling

See "ouroboros_xcpt_try" and "ouroboros_xcpt_rethrow".

EXPORTS

Nothing is exported by default.

:all tag exports all methods and constants.

:consts tag exports constants only.

METHODS

Every sub listed here returns a pointer to a C function with a signature as provided.

ouroboros_stack_init_ptr
    OUROBOROS_STATIC void ouroboros_stack_init(pTHX_ ouroboros_stack_t*);

Initialize ouroboros_stack_t object. Must be first thing called by a XS-sub. Equivalent to dXSARGS macro automatically inserted by xsubpp into every XS sub.

ouroboros_stack_items_ptr
    OUROBOROS_STATIC int ouroboros_stack_items(pTHX_ ouroboros_stack_t*);

Returns number of arguments on Perl stack. Equivalent to items local variable in XS.

ouroboros_stack_putback_ptr
    OUROBOROS_STATIC void ouroboros_stack_putback(pTHX_ ouroboros_stack_t*);

Perl macro: PUTBACK

ouroboros_stack_fetch_ptr
    OUROBOROS_STATIC SV* ouroboros_stack_fetch(pTHX_ ouroboros_stack_t*, SSize_t);

Read a value from the stack. Equivalent of:

    return ST(a);

Perl macro: ST(n)

ouroboros_stack_store_ptr
    OUROBOROS_STATIC void ouroboros_stack_store(pTHX_ ouroboros_stack_t*, SSize_t, SV*);

Store a value on the stack. Equivalent of:

    ST(a) = sv;

Perl macro: ST

ouroboros_stack_extend_ptr
    OUROBOROS_STATIC void ouroboros_stack_extend(pTHX_ ouroboros_stack_t*, SSize_t);

Perl macro: EXTEND

ouroboros_stack_pushmark_ptr
    OUROBOROS_STATIC void ouroboros_stack_pushmark(pTHX_ ouroboros_stack_t*);

Perl macro: PUSHMARK

ouroboros_stack_spagain_ptr
    OUROBOROS_STATIC void ouroboros_stack_spagain(pTHX_ ouroboros_stack_t*);

Perl macro: SPAGAIN

ouroboros_stack_xpush_sv_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_sv(pTHX_ ouroboros_stack_t*, SV*);

Perl macro: XPUSHs

ouroboros_stack_xpush_sv_mortal_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_sv_mortal(pTHX_ ouroboros_stack_t*, SV*);

Perl macro: mXPUSHs

ouroboros_stack_xpush_iv_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_iv(pTHX_ ouroboros_stack_t*, IV);

Perl macro: mXPUSHi

ouroboros_stack_xpush_uv_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_uv(pTHX_ ouroboros_stack_t*, UV);

Perl macro: mXPUSHu

ouroboros_stack_xpush_nv_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_nv(pTHX_ ouroboros_stack_t*, NV);

Perl macro: mXPUSHn

ouroboros_stack_xpush_pv_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_pv(pTHX_ ouroboros_stack_t*, const char*, STRLEN);

Perl macro: mXPUSHp

ouroboros_stack_xpush_mortal_ptr
    OUROBOROS_STATIC void ouroboros_stack_xpush_mortal(pTHX_ ouroboros_stack_t*);

Perl macro: XPUSHmortal

ouroboros_stack_push_sv_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_sv(pTHX_ ouroboros_stack_t*, SV*);

Perl macro: PUSHs

ouroboros_stack_push_sv_mortal_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_sv_mortal(pTHX_ ouroboros_stack_t*, SV*);

Perl macro: mPUSHs

ouroboros_stack_push_iv_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_iv(pTHX_ ouroboros_stack_t*, IV);

Perl macro: mPUSHi

ouroboros_stack_push_uv_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_uv(pTHX_ ouroboros_stack_t*, UV);

Perl macro: mPUSHu

ouroboros_stack_push_nv_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_nv(pTHX_ ouroboros_stack_t*, NV);

Perl macro: mPUSHn

ouroboros_stack_push_pv_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_pv(pTHX_ ouroboros_stack_t*, const char*, STRLEN);

Perl macro: mPUSHp

ouroboros_stack_push_mortal_ptr
    OUROBOROS_STATIC void ouroboros_stack_push_mortal(pTHX_ ouroboros_stack_t*);

Perl macro: PUSHmortal

ouroboros_sv_upgrade_ptr
    OUROBOROS_STATIC void ouroboros_sv_upgrade(pTHX_ SV*, svtype);

Perl macro: SvUPGRADE

ouroboros_sv_niok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_niok(pTHX_ SV*);

Perl macro: SvNIOK

ouroboros_sv_niok_priv_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_niok_priv(pTHX_ SV*);

Perl macro: SvNIOKp

ouroboros_sv_niok_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_niok_off(pTHX_ SV*);

Perl macro: SvNIOK_off

ouroboros_sv_ok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_ok(pTHX_ SV*);

Perl macro: SvOK

ouroboros_sv_iok_priv_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_iok_priv(pTHX_ SV*);

Perl macro: SvIOKp

ouroboros_sv_nok_priv_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_nok_priv(pTHX_ SV*);

Perl macro: SvNOKp

ouroboros_sv_pok_priv_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_pok_priv(pTHX_ SV*);

Perl macro: SvPOKp

ouroboros_sv_iok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_iok(pTHX_ SV*);

Perl macro: SvIOK

ouroboros_sv_iok_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_iok_on(pTHX_ SV*);

Perl macro: SvIOK_on

ouroboros_sv_iok_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_iok_off(pTHX_ SV*);

Perl macro: SvIOK_off

ouroboros_sv_iok_only_ptr
    OUROBOROS_STATIC void ouroboros_sv_iok_only(pTHX_ SV*);

Perl macro: SvIOK_only

ouroboros_sv_iok_only_uv_ptr
    OUROBOROS_STATIC void ouroboros_sv_iok_only_uv(pTHX_ SV*);

Perl macro: SvIOK_only_UV

ouroboros_sv_iok_uv_ptr
    OUROBOROS_STATIC bool ouroboros_sv_iok_uv(pTHX_ SV*);

Perl macro: SvIOK_UV

ouroboros_sv_uok_ptr
    OUROBOROS_STATIC bool ouroboros_sv_uok(pTHX_ SV*);

Perl macro: SvUOK

ouroboros_sv_iok_not_uv_ptr
    OUROBOROS_STATIC bool ouroboros_sv_iok_not_uv(pTHX_ SV*);

Perl macro: SvIOK_notUV

ouroboros_sv_nok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_nok(pTHX_ SV*);

Perl macro: SvNOK

ouroboros_sv_nok_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_nok_on(pTHX_ SV*);

Perl macro: SvNOK_on

ouroboros_sv_nok_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_nok_off(pTHX_ SV*);

Perl macro: SvNOK_off

ouroboros_sv_nok_only_ptr
    OUROBOROS_STATIC void ouroboros_sv_nok_only(pTHX_ SV*);

Perl macro: SvNOK_only

ouroboros_sv_pok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_pok(pTHX_ SV*);

Perl macro: SvPOK

ouroboros_sv_pok_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_pok_on(pTHX_ SV*);

Perl macro: SvPOK_on

ouroboros_sv_pok_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_pok_off(pTHX_ SV*);

Perl macro: SvPOK_off

ouroboros_sv_pok_only_ptr
    OUROBOROS_STATIC void ouroboros_sv_pok_only(pTHX_ SV*);

Perl macro: SvPOK_only

ouroboros_sv_pok_only_utf8_ptr
    OUROBOROS_STATIC void ouroboros_sv_pok_only_utf8(pTHX_ SV*);

Perl macro: SvPOK_only_UTF8

ouroboros_sv_vok_ptr
    OUROBOROS_STATIC bool ouroboros_sv_vok(pTHX_ SV*);

Perl macro: SvVOK

ouroboros_sv_ook_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_ook(pTHX_ SV*);

Perl macro: SvOOK

ouroboros_sv_ook_offset_ptr
    OUROBOROS_STATIC void ouroboros_sv_ook_offset(pTHX_ SV*, STRLEN*);

Perl macro: SvOOK_offset

ouroboros_sv_rok_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_rok(pTHX_ SV*);

Perl macro: SvROK

ouroboros_sv_rok_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_rok_on(pTHX_ SV*);

Perl macro: SvROK_on

ouroboros_sv_rok_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_rok_off(pTHX_ SV*);

Perl macro: SvROK_off

ouroboros_sv_iv_ptr
    OUROBOROS_STATIC IV ouroboros_sv_iv(pTHX_ SV*);

Perl macro: SvIV

ouroboros_sv_iv_nomg_ptr
    OUROBOROS_STATIC IV ouroboros_sv_iv_nomg(pTHX_ SV*);

Perl macro: SvIV_nomg

ouroboros_sv_iv_raw_ptr
    OUROBOROS_STATIC IV ouroboros_sv_iv_raw(pTHX_ SV*);

Perl macro: SvIVX

ouroboros_sv_iv_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_iv_set(pTHX_ SV*, IV);

Perl macro: SvIV_set

ouroboros_sv_uv_ptr
    OUROBOROS_STATIC UV ouroboros_sv_uv(pTHX_ SV*);

Perl macro: SvUV

ouroboros_sv_uv_nomg_ptr
    OUROBOROS_STATIC UV ouroboros_sv_uv_nomg(pTHX_ SV*);

Perl macro: SvUV_nomg

ouroboros_sv_uv_raw_ptr
    OUROBOROS_STATIC UV ouroboros_sv_uv_raw(pTHX_ SV*);

Perl macro: SvUVX

ouroboros_sv_uv_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_uv_set(pTHX_ SV*, UV);

Perl macro: SvUV_set

ouroboros_sv_nv_ptr
    OUROBOROS_STATIC NV ouroboros_sv_nv(pTHX_ SV*);

Perl macro: SvNV

ouroboros_sv_nv_nomg_ptr
    OUROBOROS_STATIC NV ouroboros_sv_nv_nomg(pTHX_ SV*);

Perl macro: SvNV_nomg

ouroboros_sv_nv_raw_ptr
    OUROBOROS_STATIC NV ouroboros_sv_nv_raw(pTHX_ SV*);

Perl macro: SvNVX

ouroboros_sv_nv_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_nv_set(pTHX_ SV*, NV);

Perl macro: SvNV_set

ouroboros_sv_pv_ptr
    OUROBOROS_STATIC const char* ouroboros_sv_pv(pTHX_ SV*, STRLEN*);

Perl macro: SvPV

ouroboros_sv_pv_nomg_ptr
    OUROBOROS_STATIC const char* ouroboros_sv_pv_nomg(pTHX_ SV*, STRLEN*);

Perl macro: SvPV_nomg

ouroboros_sv_pv_nolen_ptr
    OUROBOROS_STATIC const char* ouroboros_sv_pv_nolen(pTHX_ SV*);

Perl macro: SvPV_nolen

ouroboros_sv_pv_nomg_nolen_ptr
    OUROBOROS_STATIC const char* ouroboros_sv_pv_nomg_nolen(pTHX_ SV*);

Perl macro: SvPV_nomg_nolen

ouroboros_sv_pv_raw_ptr
    OUROBOROS_STATIC char* ouroboros_sv_pv_raw(pTHX_ SV*);

Perl macro: SvPVX

ouroboros_sv_pv_cur_ptr
    OUROBOROS_STATIC STRLEN ouroboros_sv_pv_cur(pTHX_ SV*);

Perl macro: SvCUR

ouroboros_sv_pv_cur_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_pv_cur_set(pTHX_ SV*, STRLEN);

Perl macro: SvCUR_set

ouroboros_sv_pv_len_ptr
    OUROBOROS_STATIC STRLEN ouroboros_sv_pv_len(pTHX_ SV*);

Perl macro: SvLEN

ouroboros_sv_pv_len_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_pv_len_set(pTHX_ SV*, STRLEN);

Perl macro: SvLEN_set

ouroboros_sv_pv_end_ptr
    OUROBOROS_STATIC char* ouroboros_sv_pv_end(pTHX_ SV*);

Perl macro: SvEND

ouroboros_sv_rv_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_rv(pTHX_ SV*);

Perl macro: SvRV

ouroboros_sv_rv_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_rv_set(pTHX_ SV*, SV*);

Perl macro: SvRV_set

ouroboros_sv_true_ptr
    OUROBOROS_STATIC bool ouroboros_sv_true(pTHX_ SV*);

Perl macro: SvTRUE

ouroboros_sv_true_nomg_ptr
    OUROBOROS_STATIC bool ouroboros_sv_true_nomg(pTHX_ SV*);

Perl macro: SvTRUE_nomg

ouroboros_sv_type_ptr
    OUROBOROS_STATIC svtype ouroboros_sv_type(pTHX_ SV*);

Perl macro: SvTYPE

ouroboros_sv_flags_ptr
    OUROBOROS_STATIC UV ouroboros_sv_flags(pTHX_ SV*);

Perl macro: SvFLAGS

ouroboros_sv_utf8_ptr
    OUROBOROS_STATIC bool ouroboros_sv_utf8(pTHX_ SV*);

Perl macro: SvUTF8

ouroboros_sv_utf8_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_utf8_on(pTHX_ SV*);

Perl macro: SvUTF8_on

ouroboros_sv_utf8_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_utf8_off(pTHX_ SV*);

Perl macro: SvUTF8_off

ouroboros_sv_is_cow_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_is_cow(pTHX_ SV*);

Perl macro: SvIsCOW

ouroboros_sv_is_cow_shared_hash_ptr
    OUROBOROS_STATIC bool ouroboros_sv_is_cow_shared_hash(pTHX_ SV*);

Perl macro: SvIsCOW_shared_hash

ouroboros_sv_tainted_ptr
    OUROBOROS_STATIC bool ouroboros_sv_tainted(pTHX_ SV*);

Perl macro: SvTAINTED

ouroboros_sv_tainted_on_ptr
    OUROBOROS_STATIC void ouroboros_sv_tainted_on(pTHX_ SV*);

Perl macro: SvTAINTED_on

ouroboros_sv_tainted_off_ptr
    OUROBOROS_STATIC void ouroboros_sv_tainted_off(pTHX_ SV*);

Perl macro: SvTAINTED_off

ouroboros_sv_taint_ptr
    OUROBOROS_STATIC void ouroboros_sv_taint(pTHX_ SV*);

Perl macro: SvTAINT

ouroboros_sv_share_ptr
    OUROBOROS_STATIC void ouroboros_sv_share(pTHX_ SV*);

Perl macro: SvSHARE

ouroboros_sv_lock_ptr
    OUROBOROS_STATIC void ouroboros_sv_lock(pTHX_ SV*);

Perl macro: SvLOCK

ouroboros_sv_unlock_ptr
    OUROBOROS_STATIC void ouroboros_sv_unlock(pTHX_ SV*);

Perl macro: SvUNLOCK

ouroboros_sv_get_a_magic_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_get_a_magic(pTHX_ SV*);

Perl macro: SvGAMAGIC

ouroboros_sv_magic_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_magic_set(pTHX_ SV*, MAGIC*);

Perl macro: SvMAGIC_set

ouroboros_sv_get_magic_ptr
    OUROBOROS_STATIC void ouroboros_sv_get_magic(pTHX_ SV*);

Perl macro: SvGETMAGIC

ouroboros_sv_set_magic_ptr
    OUROBOROS_STATIC void ouroboros_sv_set_magic(pTHX_ SV*);

Perl macro: SvSETMAGIC

ouroboros_gv_sv_ptr
    OUROBOROS_STATIC SV* ouroboros_gv_sv(pTHX_ GV*);

Perl macro: GvSV

ouroboros_gv_av_ptr
    OUROBOROS_STATIC AV* ouroboros_gv_av(pTHX_ GV*);

Perl macro: GvAV

ouroboros_gv_hv_ptr
    OUROBOROS_STATIC HV* ouroboros_gv_hv(pTHX_ GV*);

Perl macro: GvHV

ouroboros_gv_cv_ptr
    OUROBOROS_STATIC CV* ouroboros_gv_cv(pTHX_ CV*);

Perl macro: GvCV

ouroboros_sv_stash_ptr
    OUROBOROS_STATIC HV* ouroboros_sv_stash(pTHX_ SV*);

Perl macro: SvSTASH

ouroboros_sv_stash_set_ptr
    OUROBOROS_STATIC void ouroboros_sv_stash_set(pTHX_ SV*, HV*);

Perl macro: SvSTASH_set

ouroboros_cv_stash_ptr
    OUROBOROS_STATIC HV* ouroboros_cv_stash(pTHX_ CV*);

Perl macro: CvSTASH

ouroboros_hv_name_ptr
    OUROBOROS_STATIC const char* ouroboros_hv_name(pTHX_ HV*);

Perl macro: HvNAME

ouroboros_hv_name_len_ptr
    OUROBOROS_STATIC STRLEN ouroboros_hv_name_len(pTHX_ HV*);

Perl macro: HvNAMELEN

ouroboros_hv_name_utf8_ptr
    OUROBOROS_STATIC unsigned char ouroboros_hv_name_utf8(pTHX_ HV*);

Perl macro: HvNAMEUTF8

ouroboros_hv_ename_ptr
    OUROBOROS_STATIC const char* ouroboros_hv_ename(pTHX_ HV*);

Perl macro: HvENAME

ouroboros_hv_ename_len_ptr
    OUROBOROS_STATIC STRLEN ouroboros_hv_ename_len(pTHX_ HV*);

Perl macro: HvENAMELEN

ouroboros_hv_ename_utf8_ptr
    OUROBOROS_STATIC unsigned char ouroboros_hv_ename_utf8(pTHX_ HV*);

Perl macro: HvENAMEUTF8

ouroboros_he_pv_ptr
    OUROBOROS_STATIC const char* ouroboros_he_pv(pTHX_ HE*, STRLEN*);

Perl macro: HePV

ouroboros_he_val_ptr
    OUROBOROS_STATIC SV* ouroboros_he_val(pTHX_ HE*);

Perl macro: HeVAL

ouroboros_he_hash_ptr
    OUROBOROS_STATIC U32 ouroboros_he_hash(pTHX_ HE*);

Perl macro: HeHASH

ouroboros_he_svkey_ptr
    OUROBOROS_STATIC SV* ouroboros_he_svkey(pTHX_ HE*);

Perl macro: HeSVKEY

ouroboros_he_svkey_force_ptr
    OUROBOROS_STATIC SV* ouroboros_he_svkey_force(pTHX_ HE*);

Perl macro: HeSVKEY_force

ouroboros_he_svkey_set_ptr
    OUROBOROS_STATIC SV* ouroboros_he_svkey_set(pTHX_ HE*, SV*);

Perl macro: HeSVKEY_set

ouroboros_perl_hash_ptr
    OUROBOROS_STATIC U32 ouroboros_perl_hash(pTHX_ U8*, STRLEN);

Unlike macro, returns hash value instead of assigning it to an argument.

Perl macro: PERL_HASH

ouroboros_sv_refcnt_ptr
    OUROBOROS_STATIC U32 ouroboros_sv_refcnt(pTHX_ SV*);

Perl macro: SvREFCNT

ouroboros_sv_refcnt_inc_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_refcnt_inc(pTHX_ SV*);

Perl macro: SvREFCNT_inc_simple

ouroboros_sv_refcnt_inc_nn_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_refcnt_inc_nn(pTHX_ SV*);

Perl macro: SvREFCNT_inc_simple_NN

ouroboros_sv_refcnt_inc_void_ptr
    OUROBOROS_STATIC void ouroboros_sv_refcnt_inc_void(pTHX_ SV*);

Perl macro: SvREFCNT_inc_simple_void

ouroboros_sv_refcnt_inc_void_nn_ptr
    OUROBOROS_STATIC void ouroboros_sv_refcnt_inc_void_nn(pTHX_ SV*);

Perl macro: SvREFCNT_inc_simple_void_NN

ouroboros_sv_refcnt_dec_ptr
    OUROBOROS_STATIC void ouroboros_sv_refcnt_dec(pTHX_ SV*);

Perl macro: SvREFCNT_dec

ouroboros_sv_refcnt_dec_nn_ptr
    OUROBOROS_STATIC void ouroboros_sv_refcnt_dec_nn(pTHX_ SV*);

Perl macro: SvREFCNT_dec_NN

ouroboros_enter_ptr
    OUROBOROS_STATIC void ouroboros_enter(pTHX);

Perl macro: ENTER

ouroboros_leave_ptr
    OUROBOROS_STATIC void ouroboros_leave(pTHX);

Perl macro: LEAVE

ouroboros_savetmps_ptr
    OUROBOROS_STATIC void ouroboros_savetmps(pTHX);

Perl macro: SAVETMPS

ouroboros_freetmps_ptr
    OUROBOROS_STATIC void ouroboros_freetmps(pTHX);

Perl macro: FREETMPS

ouroboros_sys_init3_ptr
    OUROBOROS_STATIC void ouroboros_sys_init3(int*, char***, char***);

Perl macro: PERL_SYS_INIT3

ouroboros_sys_term_ptr
    OUROBOROS_STATIC void ouroboros_sys_term();

Perl macro: PERL_SYS_TERM

ouroboros_sv_undef_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_undef(pTHX);

Return address of PL_sv_undef global.

ouroboros_sv_no_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_no(pTHX);

Return address of PL_sv_no global.

ouroboros_sv_yes_ptr
    OUROBOROS_STATIC SV* ouroboros_sv_yes(pTHX);

Return address of PL_sv_yes global.

ouroboros_gimme_ptr
    OUROBOROS_STATIC U32 ouroboros_gimme(pTHX);

Perl macro: GIMME_V

ouroboros_xcpt_try_ptr
    OUROBOROS_STATIC int ouroboros_xcpt_try(pTHX_ ouroboros_xcpt_callback_t, void*);

Execute callback once while capturing Perl exceptions. Second argument is passed to the callback as is and can be NULL.

This is equivalent of XCPT_TRY_START and XCPT_TRY_END macros, see "Exception Handling" in perlguts.

Returns zero if callback was executed successfully and no Perl exceptions were thrown.

Returns non-zero if Perl exception was thrown while executing callback. After doing cleanups, this value must be passed to "ouroboros_xcpt_rethrow".

Perl macro: XCPT_TRY_START and XCPT_TRY_END

ouroboros_xcpt_rethrow_ptr
    OUROBOROS_STATIC void ouroboros_xcpt_rethrow(pTHX_ int);

Continue exception unwinding after unsuccessful call to "ouroboros_xcpt_try".

Perl macro: XCPT_RETHROW

CONSTANTS

This package also provides a number of consants from XS API. Some constants may not be available, depending on the Perl version used.

@Ouroboros::CONSTS contains names of all constants provided by this package.

SVt_NULL
SVt_IV
SVt_NV
SVt_PV
SVt_PVIV
SVt_PVNV
SVt_PVMG
SVt_REGEXP
SVt_PVGV
SVt_PVLV
SVt_PVAV
SVt_PVHV
SVt_PVCV
SVt_PVFM
SVt_PVIO
SVt_LAST
SV_CATBYTES
SV_CATUTF8
SV_CONST_RETURN
SV_COW_DROP_PV
SV_FORCE_UTF8_UPGRADE
SV_GMAGIC
SV_HAS_TRAILING_NUL
SV_IMMEDIATE_UNREF
SV_NOSTEAL
SV_SMAGIC
GV_ADD
GV_ADDMG
GV_ADDMULTI
GV_NOADD_NOINIT
GV_NOEXPAND
GV_NOINIT
GV_SUPER
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_env
PERL_MAGIC_envelem
PERL_MAGIC_ext
PERL_MAGIC_fm
PERL_MAGIC_foo
PERL_MAGIC_hints
PERL_MAGIC_hintselem
PERL_MAGIC_isa
PERL_MAGIC_isaelem
PERL_MAGIC_lvref
PERL_MAGIC_nkeys
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

THE REST

Most of the XS API consists of normal functions and their addresses can be discovered via DynaLoader at run-time with little effort. See "Internal Functions" in perlguts for more information.

SEE MORE

Perl extensive XS documentation: perlxs, perlapi, perlguts.

JIT-compiler libraries for Perl: LibJIT, GCCJIT.

AUTHOR

Vickenty Fesunov, <cpan-ouroboros@setattr.net>

COPYRIGHT AND LICENSE

Copyright (c) 2016 Vickenty Fesunov. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.