parrotcode: Parrot extension interface | |
Contents | C |
src/extend.c - Parrot extension interface
These are the functions that parrot extensions (i.e. parrot subroutines written in C, or some other compiled language, rather than in parrot bytecode) may access.
There is a deliberate distancing from the internals here. Don't go peeking inside -- you've as much access as bytecode does, but no more, so we can provide backwards compatibility for as long as we possibly can.
PARROT_API Parrot_String Parrot_PMC_get_string_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL void *Parrot_PMC_get_pointer_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
PARROT_API Parrot_PMC Parrot_PMC_get_pmc_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
PARROT_API Parrot_Int Parrot_PMC_get_intval(PARROT_INTERP, Parrot_PMC pmc)
PARROT_API Parrot_Int Parrot_PMC_get_intval_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
PARROT_API Parrot_Int Parrot_PMC_get_intval_pmckey(PARROT_INTERP, Parrot_PMC pmc, Parrot_PMC key)
PARROT_API Parrot_Float Parrot_PMC_get_numval(PARROT_INTERP, Parrot_PMC pmc)
PARROT_API Parrot_Float Parrot_PMC_get_numval_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
PARROT_API PARROT_MALLOC PARROT_CAN_RETURN_NULL char *Parrot_PMC_get_cstring_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key)
string_cstring_free()
!PARROT_API PARROT_MALLOC PARROT_CAN_RETURN_NULL char *Parrot_PMC_get_cstring(PARROT_INTERP, Parrot_PMC pmc)
string_cstring_free()
!PARROT_API PARROT_MALLOC PARROT_CAN_RETURN_NULL char *Parrot_PMC_get_cstringn(PARROT_INTERP, Parrot_PMC pmc, NOTNULL(Parrot_Int *length))
string_cstring_free()
.PARROT_API PARROT_MALLOC PARROT_CAN_RETURN_NULL char *Parrot_PMC_get_cstringn_intkey(PARROT_INTERP, Parrot_PMC pmc, NOTNULL(Parrot_Int *length), Parrot_Int key)
string_cstring_free()
.PARROT_API void Parrot_PMC_set_string(PARROT_INTERP, Parrot_PMC pmc, Parrot_String value)
PARROT_API void Parrot_PMC_set_string_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, Parrot_String value)
PARROT_API void Parrot_PMC_set_pmc_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, Parrot_PMC value)
PARROT_API void Parrot_PMC_set_pmc_pmckey(PARROT_INTERP, Parrot_PMC pmc, Parrot_PMC key, Parrot_PMC value)
PARROT_API void Parrot_PMC_set_pointer_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, NULLOK(void *value))
PARROT_API void Parrot_PMC_set_intval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int value)
PARROT_API void Parrot_PMC_set_intval_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, Parrot_Int value)
PARROT_API void Parrot_PMC_set_numval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Float value)
PARROT_API void Parrot_PMC_set_numval_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, Parrot_Float value)
PARROT_API void Parrot_PMC_set_cstring(PARROT_INTERP, Parrot_PMC pmc, NULLOK(const char *value))
PARROT_API void Parrot_PMC_set_cstring_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, NULLOK(const char *value))
PARROT_API void Parrot_PMC_set_cstringn(PARROT_INTERP, Parrot_PMC pmc, NULLOK(const char *value), Parrot_Int length)
PARROT_API void Parrot_PMC_push_intval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int value)
PARROT_API void Parrot_PMC_push_numval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Float value)
PARROT_API void Parrot_PMC_delete_pmckey(PARROT_INTERP, Parrot_PMC pmc, Parrot_PMC key)
PARROT_API void Parrot_PMC_set_cstringn_intkey(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int key, NULLOK(const char *value), Parrot_Int length)
PARROT_API Parrot_PMC Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)
PARROT_API Parrot_Int Parrot_PMC_typenum(PARROT_INTERP, NULLOK(const char *_class))
PARROT_API Parrot_PMC Parrot_PMC_null(void)
NULL
PMC.PARROT_API void Parrot_free_cstring(NULLOK(char *string))
PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL void *Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub, NOTNULL(const char *signature), ...)
signature
denotes the return value.
Next chars are arguments. v ... void return
I ... Parrot_Int
N ... Parrot_Float
S ... Parrot_String
P ... Parrot_PMC
PARROT_API Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub, NOTNULL(const char *signature), ...)
Parrot_call_sub
, with Parrot_Int return result.PARROT_API Parrot_Float Parrot_call_sub_ret_float(PARROT_INTERP, Parrot_PMC sub, NOTNULL(const char *signature), ...)
Parrot_call_sub
, with Parrot_Float return result.PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL void *Parrot_call_method(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj, Parrot_String method, NOTNULL(const char *signature), ...)
PARROT_API Parrot_Int Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj, Parrot_String method, NOTNULL(const char *signature), ...)
PARROT_API Parrot_Float Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj, Parrot_String method, NOTNULL(const char *signature), ...)
PARROT_API Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
PARROT_API Parrot_Float Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
PARROT_API Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
PARROT_API Parrot_PMC Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
PARROT_API void Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Int value)
PARROT_API void Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Float value)
PARROT_API void Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum, Parrot_String value)
PARROT_API void Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum, Parrot_PMC value)
PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL Parrot_String Parrot_new_string(PARROT_INTERP, NULLOK(char *buffer), int length, NULLOK(const char *const encoding_name), Parrot_Int flags)
PARROT_API PARROT_WARN_UNUSED_RESULT Parrot_Language Parrot_find_language(PARROT_INTERP, NOTNULL(char *language))
PARROT_API void Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc)
PARROT_API void Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc)
PARROT_API Parrot_PMC Parrot_get_dod_registry(PARROT_INTERP)
PARROT_API void Parrot_PMC_set_vtable(SHIM_INTERP, Parrot_PMC pmc, Parrot_VTABLE vtable)
PARROT_API PARROT_PURE_FUNCTION Parrot_VTABLE Parrot_get_vtable(PARROT_INTERP, Parrot_Int id)
See include/parrot/extend.h and docs/pdds/pdd11_extending.pod.
Initial version by Dan Sugalski.
|