aboutsummaryrefslogtreecommitdiffstats
path: root/wlp/C/wlp.c
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-09-08 22:29:44 +0200
committerMatěj Cepl <mcepl@redhat.com>2013-09-08 22:29:44 +0200
commitaa233606dc5358292f26808439bd60836a9b5dfe (patch)
tree097a6fa9a952a8d77161f219c5c8b38da086099e /wlp/C/wlp.c
parentc50ce75f2e06b6b8abe49e34775d343b74f7e8cd (diff)
downloadpygn-aa233606dc5358292f26808439bd60836a9b5dfe.tar.gz
New version from Debian0.9.8
Diffstat (limited to 'wlp/C/wlp.c')
-rw-r--r--wlp/C/wlp.c31
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},