diff options
Diffstat (limited to 'lib/command_py.c')
| -rw-r--r-- | lib/command_py.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/command_py.c b/lib/command_py.c index 411caa52d6..99438d4f5a 100644 --- a/lib/command_py.c +++ b/lib/command_py.c @@ -138,22 +138,40 @@ static PyObject *graph_node_prev(PyObject *self, PyObject *args) static PyObject *graph_node_join(PyObject *self, PyObject *args) { struct wrap_graph_node *wrap = (struct wrap_graph_node *)self; + struct cmd_token *tok; if (!wrap->node->data || ((struct cmd_token *)wrap->node->data)->type == END_TKN) Py_RETURN_NONE; - struct cmd_token *tok = wrap->node->data; + tok = wrap->node->data; if (tok->type != FORK_TKN) Py_RETURN_NONE; return graph_to_pyobj(wrap->wgraph, tok->forkjoin); }; +static PyObject *graph_node_fork(PyObject *self, PyObject *args) +{ + struct wrap_graph_node *wrap = (struct wrap_graph_node *)self; + struct cmd_token *tok; + + if (!wrap->node->data || + ((struct cmd_token *)wrap->node->data)->type == END_TKN) + Py_RETURN_NONE; + + tok = wrap->node->data; + if (tok->type != JOIN_TKN) + Py_RETURN_NONE; + + return graph_to_pyobj(wrap->wgraph, tok->forkjoin); +}; + static PyMethodDef methods_graph_node[] = { { "next", graph_node_next, METH_NOARGS, "outbound graph edge list" }, { "prev", graph_node_prev, METH_NOARGS, "inbound graph edge list" }, { "join", graph_node_join, METH_NOARGS, "outbound join node" }, + { "fork", graph_node_fork, METH_NOARGS, "inbound fork node" }, {} }; |
