4. Word

The ftlget word (by the same name), is loaded into runt with load_ftlget.

<<loader>>=
int load_ftlget(runt_vm *vm, runt_ptr pw)
{
    runt_cell *c;
    runt_keyword_define(vm, "ftlget", 6, rproc_ftlget, &c);
    runt_cell_data(vm, c, pw);
    return runt_is_alive(vm);
}
<<word>>=
int node_ftlget(gf_node *node, sp_ftlist *ftl);
static runt_int rproc_ftlget(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    sp_ftlist *ftl;
    rgf_param in;
    runt_stacklet *out;
    gf_patch *patch;
    gf_node *node;

    rc = rgf_get_ftlist(vm, &ftl);
    RUNT_ERROR_CHECK(rc);

    rc = rgf_get_param(vm, &in);
    RUNT_ERROR_CHECK(rc);

    rc = runt_ppush(vm, &out);
    RUNT_ERROR_CHECK(rc);

    patch = rgf_get_patch(p);

    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);

    rc = node_ftlget(node, ftl);
    GF_RUNT_ERROR_CHECK(rc);

    rgf_set_param(vm, node, &in, 0);
    rgf_push_output(vm, node, out, 1);

    return RUNT_OK;
}



prev | home | next