return graph_to_pyobj(gwrap, gn);
};
+static PyObject *graph_merge(PyObject *self, PyObject *args);
+
static PyMethodDef methods_graph[] = {
- {"first", graph_first, METH_NOARGS, "first graph node"},
- {}};
+ { "first", graph_first, METH_NOARGS, "first graph node" },
+ { "merge", graph_merge, METH_VARARGS, "merge graphs" },
+ {}
+};
static PyObject *graph_parse(PyTypeObject *type, PyObject *args,
PyObject *kwds);
.tp_methods = methods_graph,
};
+static PyObject *graph_merge(PyObject *self, PyObject *args)
+{
+ PyObject *py_other;
+ struct wrap_graph *gwrap = (struct wrap_graph *)self;
+ struct wrap_graph *gother;
+
+ if (!PyArg_ParseTuple(args, "O!", &typeobj_graph, &py_other))
+ return NULL;
+
+ gother = (struct wrap_graph *)py_other;
+ cmd_graph_merge(gwrap->graph, gother->graph, +1);
+ Py_RETURN_NONE;
+}
+
/* top call / entrypoint for python code */
static PyObject *graph_parse(PyTypeObject *type, PyObject *args, PyObject *kwds)
{