| 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_STRING Parrot_PMC_get_string(Parrot_INTERP interp, Parrot_PMC pmc)Parrot_STRING Parrot_PMC_get_string_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)void *Parrot_PMC_get_pointer(Parrot_INTERP interp, Parrot_PMC pmc)void *Parrot_PMC_get_pointer_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)Parrot_PMC Parrot_PMC_get_pmc_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)Parrot_Int Parrot_PMC_get_intval(Parrot_INTERP interp, Parrot_PMC pmc)Parrot_Int Parrot_PMC_get_intval_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)Parrot_Int Parrot_PMC_get_intval_pmckey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_PMC key)Parrot_Float Parrot_PMC_get_numval(Parrot_INTERP interp, Parrot_PMC pmc)Parrot_Float Parrot_PMC_get_numval_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)char *Parrot_PMC_get_cstring_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key)char *Parrot_PMC_get_cstring(Parrot_INTERP interp, Parrot_PMC pmc)char *Parrot_PMC_get_cstringn(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int *length)char *Parrot_PMC_get_cstringn_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int *length, Parrot_Int key)void Parrot_PMC_set_string(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_STRING value)void Parrot_PMC_set_string_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, Parrot_STRING value)void Parrot_PMC_set_pmc_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, Parrot_PMC value)void Parrot_PMC_set_pmc_pmckey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_PMC key, Parrot_PMC value)void Parrot_PMC_set_pointer(Parrot_INTERP interp, Parrot_PMC pmc, void *value)void Parrot_PMC_set_pointer_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, void *value)void Parrot_PMC_set_intval(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int value)void Parrot_PMC_set_intval_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, Parrot_Int value)void Parrot_PMC_set_numval(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Float value)void Parrot_PMC_set_numval_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, Parrot_Float value)void Parrot_PMC_set_cstring(Parrot_INTERP interp, Parrot_PMC pmc, const char *value)void Parrot_PMC_set_cstring_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, const char *value)void Parrot_PMC_set_cstringn(Parrot_INTERP interp, Parrot_PMC pmc, const char *value, Parrot_Int length)void Parrot_PMC_push_intval(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int value)void Parrot_PMC_push_numval(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Float value)void Parrot_PMC_push_string(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int value)void Parrot_PMC_push_pmc(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_PMC value)void Parrot_PMC_delete_pmckey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_PMC key)void Parrot_PMC_set_cstringn_intkey(Parrot_INTERP interp, Parrot_PMC pmc, Parrot_Int key, const char *value, Parrot_Int length)Parrot_PMC Parrot_PMC_new(Parrot_INTERP interp, Parrot_Int type)Parrot_Int Parrot_PMC_typenum(Parrot_INTERP interp, const char *class)Parrot_PMC Parrot_PMC_null()NULL PMC.void Parrot_free_cstring(char *string)void *Parrot_call_sub(Parrot_INTERP interpreter, Parrot_PMC sub, 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_Int Parrot_call_sub_ret_int(Parrot_INTERP interpreter, Parrot_PMC sub, const char *signature, ...)>Parrot_Float Parrot_call_sub_ret_float(Parrot_INTERP interpreter, Parrot_PMC sub, const char *signature, ...)>void *Parrot_call_method(Parrot_INTERP interp, Parrot_PMC sub, Parrot_PMC object, Parrot_STRING method, const char *signature, ...)Parrot_Int Parrot_call_method_ret_int(Parrot_INTERP interp, Parrot_PMC sub, Parrot_PMC object, Parrot_STRING method, const char *signature, ...)Parrot_Float Parrot_call_method_ret_float(Parrot_INTERP interp, Parrot_PMC sub, Parrot_PMC object, Parrot_STRING method, const char *signature, ...)Parrot_Int Parrot_get_intreg(Parrot_INTERP interpreter, Parrot_Int regnum)Parrot_Float Parrot_get_numreg(Parrot_INTERP interpreter, Parrot_Int regnum)Parrot_STRING Parrot_get_strreg(Parrot_INTERP interpreter, Parrot_Int regnum)Parrot_PMC Parrot_get_pmcreg(Parrot_INTERP interpreter, Parrot_Int regnum)void Parrot_set_intreg(Parrot_INTERP interpreter, Parrot_Int regnum, Parrot_Int value)void Parrot_set_numreg(Parrot_INTERP interpreter, Parrot_Int regnum, Parrot_Float value)void Parrot_set_strreg(Parrot_INTERP interpreter, Parrot_Int regnum, Parrot_STRING value)void Parrot_set_pmcreg(Parrot_INTERP interpreter, Parrot_Int regnum, Parrot_PMC value) Parrot_STRING Parrot_new_string(Parrot_INTERP interpreter, char *buffer, int length, const char *const encoding_name, Parrot_Int flags)Parrot_Const_Encoding Parrot_find_encoding(Parrot_INTERP interpreter, char *encoding_name)Parrot_Language Parrot_find_language(Parrot_INTERP interpreter, char *language)void Parrot_register_pmc(Parrot_INTERP interpreter, Parrot_PMC pmc)void Parrot_unregister_pmc(Parrot_INTERP interpreter, Parrot_PMC pmc)void Parrot_pmc_set_vtable(Parrot_INTERP interpreter, Parrot_PMC pmc, Parrot_VTABLE vtable)Parrot_VTABLE Parrot_get_vtable(Parrot_INTERP interpreter, Parrot_Int id)
See include/parrot/extend.h and docs/pdds/pdd11_extending.pod.

Initial version by Dan Sugalski.

Hey! The above document had some coding errors, which are explained below:
|
|
|