diff options
Diffstat (limited to 'wlp/C/wlp.c')
-rw-r--r-- | wlp/C/wlp.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/wlp/C/wlp.c b/wlp/C/wlp.c index 8c0779d..6a36617 100644 --- a/wlp/C/wlp.c +++ b/wlp/C/wlp.c @@ -6,7 +6,6 @@ * Thanks to md for this useful formula. Beer is beer. */ -//#include <python/Python.h> #include <Python.h> #include <stdio.h> #include <unistd.h> @@ -20,8 +19,6 @@ static FILE *fd = NULL; struct wlp_list_t *list; static PyObject *node2dict(struct wlp_node_t *node); -static PyObject *node2dict2(struct wlp_node_t *node); - @@ -37,7 +34,7 @@ static PyObject *wlp_setfilebyname(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "s", &file)) return NULL; - if(fd = fopen(file,"r")) { + if((fd = fopen(file,"r"))) { return Py_None; } else { PyErr_SetFromErrno(PyExc_Exception); @@ -144,32 +141,6 @@ static PyObject *node2dict(struct wlp_node_t *node) { } - -/* - * node2dict2(): transoform a wlp_node_t node in a python dictionary of the form - * { 'owner': ownername, var: val} - * it's currently unused (obsoleted) - */ - -static PyObject *node2dict2(struct wlp_node_t *node) { - PyObject *dict = PyDict_New(); - - if(!dict) - dict = Py_None; - else { - PyDict_SetItem(dict, - Py_BuildValue("s","owner"), - Py_BuildValue("s",node->owner)); - - PyDict_SetItem(dict, - Py_BuildValue("s",node->left), - Py_BuildValue("s",node->right)); - } - - return dict; - -} - static PyMethodDef wlp_methods[] = { {"mkdict", wlp_mkdict, METH_VARARGS}, {"setfilebyname", wlp_setfilebyname, METH_VARARGS}, |