Example #1
0
mpdm_t mpsl_build_funcs(void)
/* build all functions */
{
    mpdm_t c;
    int n;

    /* creates all the symbols in the CORE library */
    c = MPDM_O();

    for (n = 0; mpsl_funcs[n].name != NULL; n++) {
        mpdm_t f = MPDM_S(mpsl_funcs[n].name);
        mpdm_t x = MPDM_X(mpsl_funcs[n].func);

        mpdm_set(mpdm_root(), x, f);
        mpdm_set(c, x, f);
    }

    return c;
}
Example #2
0
/** o = new(c1 [, c2, ...cn]); */
static mpdm_t F_new(F_ARGS)
{
    int n;
    mpdm_t r = MPDM_O();

    for (n = 0; n < mpdm_size(a); n++) {
        mpdm_t w, v, i;
        int m = 0;

        w = mpdm_ref(A(n));

        if (mpdm_type(w) == MPDM_TYPE_OBJECT) {
            while (mpdm_iterator(w, &m, &v, &i))
                mpdm_set(r, mpdm_clone(v), i);
        }

        mpdm_unref(w);
    }

    return r;
}
Example #3
0
/**
 * mpsl_trap - Install a trapping function.
 * @trap_func: The trapping MPSL code
 *
 * Installs a trapping function. The function is an MPSL
 * executable value receiving 3 arguments: the code stream,
 * the arguments and the return value of the executed code.
 *
 * Returns NULL (previous versions returned the previous
 * trapping function).
 */
mpdm_t mpsl_trap(mpdm_t trap_func)
{
    mpdm_set(&mpsl_trap_func, trap_func);

    return NULL;
}
Example #4
0
static mpdm_t F_set(F_ARGS)
{
    return mpdm_set(A0, A1, A2);
}