Exemplo n.º 1
0
PARROT_API
Parrot_Int
Parrot_api_pmc_deserialize(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String fpmc),
        ARGOUT(Parrot_PMC * pmc))
{
    ASSERT_ARGS(Parrot_api_pmc_deserialize)
    EMBED_API_CALLIN(interp_pmc, interp)
    Parrot_pf_verify_image_string(interp, fpmc);
    *pmc = Parrot_thaw(interp, fpmc);
    EMBED_API_CALLOUT(interp_pmc, interp);
}
Exemplo n.º 2
0
static void
parrot_set_config_hash_interpreter(PARROT_INTERP)
{
    ASSERT_ARGS(parrot_set_config_hash_interpreter)
    PMC *iglobals = interp->iglobals;

    PMC *config_hash = NULL;

    if (parrot_config_size_stored > 1) {
        STRING * const config_string =
            Parrot_str_new_init(interp,
                               (const char *)parrot_config_stored, parrot_config_size_stored,
                               Parrot_default_encoding_ptr,
                               PObj_external_FLAG|PObj_constant_FLAG);

        config_hash = Parrot_thaw(interp, config_string);
    }
    else {
        config_hash = Parrot_pmc_new(interp, enum_class_Hash);
    }

    VTABLE_set_pmc_keyed_int(interp, iglobals,
                             (INTVAL) IGLOBALS_CONFIG_HASH, config_hash);
}
Exemplo n.º 3
0
value otherwise.

=cut

*/

PARROT_API
Parrot_Int
Parrot_api_pmc_deserialize_bytes(ARGIN(Parrot_PMC interp_pmc), ARGIN(const unsigned char *fpmc),
        Parrot_Int length, ARGOUT(Parrot_PMC *pmc))
{
    ASSERT_ARGS(Parrot_api_pmc_deserialize_bytes)
    EMBED_API_CALLIN(interp_pmc, interp)
    STRING * const fpmc_str = Parrot_str_new_init(interp, (const char *)fpmc,
        length, Parrot_binary_encoding_ptr, PObj_external_FLAG);
    *pmc = Parrot_thaw(interp, fpmc_str);
    EMBED_API_CALLOUT(interp_pmc, interp);
}

/*

=item C<Parrot_Int Parrot_api_pmc_null(Parrot_PMC interp_pmc, Parrot_PMC
*pmctonull)>

Nullify C<pmctonull> PMC. This function returns a true value if this call is
successful and false value otherwise.

=cut

*/