9. Seq16 Runt Words

9.1. Runt Loader

All runt words are loaded with the function seq16_runt_loader. It is loaded at init time.

<<seq16_function_declarations>>=
static int seq16_runt_loader(monolith_d *m);
<<seq16_functions>>=
<<seq16_runt_functions>>
static int seq16_runt_loader(monolith_d *m)
{
<<seq16_runt_keywords>>
    monolith_runt_mark_set(m);
    return RUNT_OK;
}
<<seq16_runtime_init>>=
seq16_runt_loader(m);

9.2. Seq16clk

<<seq16_runt_keywords>>=
monolith_runt_keyword(m, "seq16clk", 8, rproc_seq16clk, m);
<<seq16_runt_functions>>=
static runt_int rproc_seq16clk(runt_vm *vm, runt_ptr p)
{
    monolith_d *m;
    runt_int rc;
    rgf_param clk;
    gf_patch *patch;
    gf_node *node;
    const char *name;
    runt_stacklet *s;
    monolith_page *pg;
    page_seq16_d *seq16;

    m = runt_to_cptr(p);
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    name = runt_to_string(s->p);

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

    rc = runt_monolith_lookup_page(vm, m, name, "seq16", is_seq16, &pg);
    RUNT_ERROR_CHECK(rc);

    seq16 = monolith_page_data_get(pg);

    patch = monolith_graforge_get(m);
    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);
    node_seq16clk(node, seq16);
    rgf_set_param(vm, node, &clk, 0);
    return RUNT_OK;
}

9.3. Seq16val

<<seq16_runt_keywords>>=
monolith_runt_keyword(m, "seq16val", 8, rproc_seq16val, m);
<<seq16_runt_functions>>=
static runt_int rproc_seq16val(runt_vm *vm, runt_ptr p)
{
    monolith_d *m;
    runt_int rc;
    gf_patch *patch;
    gf_node *node;
    const char *name;
    runt_stacklet *s;
    runt_stacklet *out;
    monolith_page *pg;
    page_seq16_d *seq16;

    m = runt_to_cptr(p);
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    name = runt_to_string(s->p);

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

    rc = runt_monolith_lookup_page(vm, m, name, "seq16", is_seq16, &pg);
    RUNT_ERROR_CHECK(rc);

    seq16 = monolith_page_data_get(pg);

    patch = monolith_graforge_get(m);
    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);
    node_seq16val(node, seq16);
    rgf_push_output(vm, node, out, 0);
    return RUNT_OK;
}

9.4. Seq16gt

<<seq16_runt_keywords>>=
monolith_runt_keyword(m, "seq16gt", 7, rproc_seq16gt, m);
<<seq16_runt_functions>>=
static runt_int rproc_seq16gt(runt_vm *vm, runt_ptr p)
{
    monolith_d *m;
    runt_int rc;
    gf_patch *patch;
    gf_node *node;
    const char *name;
    runt_stacklet *s;
    runt_stacklet *out;
    monolith_page *pg;
    page_seq16_d *seq16;

    m = runt_to_cptr(p);
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    name = runt_to_string(s->p);

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

    rc = runt_monolith_lookup_page(vm, m, name, "seq16", is_seq16, &pg);
    RUNT_ERROR_CHECK(rc);

    seq16 = monolith_page_data_get(pg);

    patch = monolith_graforge_get(m);
    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);
    node_seq16gt(node, seq16);
    rgf_push_output(vm, node, out, 0);
    return RUNT_OK;
}

9.5. Seq16clkget

<<seq16_runt_keywords>>=
monolith_runt_keyword(m, "seq16clkget", 11, rproc_seq16clkget, m);
<<seq16_runt_functions>>=
static runt_int rproc_seq16clkget(runt_vm *vm, runt_ptr p)
{
    monolith_d *m;
    runt_int rc;
    gf_patch *patch;
    gf_node *node;
    const char *name;
    runt_stacklet *s;
    runt_stacklet *out;
    monolith_page *pg;
    page_seq16_d *seq16;

    m = runt_to_cptr(p);
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    name = runt_to_string(s->p);

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

    rc = runt_monolith_lookup_page(vm, m, name, "seq16", is_seq16, &pg);
    RUNT_ERROR_CHECK(rc);

    seq16 = monolith_page_data_get(pg);

    patch = monolith_graforge_get(m);
    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);
    node_seq16clkget(node, seq16);
    rgf_push_output(vm, node, out, 0);
    return RUNT_OK;
}

9.6. Seq16col

<<seq16_runt_keywords>>=
monolith_runt_keyword(m, "seq16col", 8, rproc_seq16col, m);
<<seq16_runt_functions>>=
static runt_int rproc_seq16col(runt_vm *vm, runt_ptr p)
{
    monolith_d *m;
    runt_int rc;
    gf_patch *patch;
    gf_node *node;
    const char *name;
    runt_stacklet *s;
    runt_stacklet *out;
    monolith_page *pg;
    page_seq16_d *seq16;
    rgf_param col;

    m = runt_to_cptr(p);

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    name = runt_to_string(s->p);

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

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

    rc = runt_monolith_lookup_page(vm, m, name, "seq16", is_seq16, &pg);
    RUNT_ERROR_CHECK(rc);

    seq16 = monolith_page_data_get(pg);

    patch = monolith_graforge_get(m);
    rc = gf_patch_new_node(patch, &node);
    GF_RUNT_ERROR_CHECK(rc);
    node_seq16col(node, seq16);

    rgf_set_param(vm, node, &col, 0);
    rgf_push_output(vm, node, out, 1);
    return RUNT_OK;
}



prev | home | next