Пример #1
0
static void
startup(void)
{
    /*
     * Since these symbols will be relocated in runtime, we can't
     * initialize them in the vector initialization, we must assign
     * them in runtime.
     */
    nodes[0 /* reader */].type = _CUSTOM_NODE_TYPES_READER;
    nodes[1 /* logic */].type = _CUSTOM_NODE_TYPES_LOGIC;
    nodes[2 /* writer */].type = _CUSTOM_NODE_TYPES_WRITER;
#ifdef SOL_FLOW_NODE_TYPE_CONSOLE_DEFINED
    nodes[3 /* console */].type = SOL_FLOW_NODE_TYPE_CONSOLE;
#endif

    flow = sol_flow_static_new(NULL, nodes, conns);
}
Пример #2
0
static void
startup(void)
{
    const struct sol_flow_node_type **console_type;

    if (sol_flow_get_node_type("console", SOL_FLOW_NODE_TYPE_CONSOLE, &console_type) < 0)
        return;

    /*
     * Since these symbols will be relocated in runtime, we can't
     * initialize them in the vector initialization, we must assign
     * them in runtime.
     */
    nodes[0 /* reader */].type = SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_READER;
    nodes[1 /* logic */].type = SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_LOGIC;
    nodes[2 /* writer */].type = SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_WRITER;
    nodes[3 /* console */].type = *console_type;

    flow = sol_flow_static_new(NULL, nodes, conns);
}