summaryrefslogtreecommitdiff
path: root/c_src/permdbpy.c
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-02-18 13:56:07 +0100
committerLinus Nordberg <linus@nordu.net>2016-04-25 13:14:12 +0200
commit93df8702113728341d8ad6d86ce847ea52b79c08 (patch)
tree8ebcbe3ad49edcdfbd1ad6f3150589db59ea9a46 /c_src/permdbpy.c
parent110a39cd613b83cc9df27645e6472785c238bcbc (diff)
Use pascal strings for keys
Diffstat (limited to 'c_src/permdbpy.c')
-rw-r--r--c_src/permdbpy.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/c_src/permdbpy.c b/c_src/permdbpy.c
index a98c83a..1e8c2f7 100644
--- a/c_src/permdbpy.c
+++ b/c_src/permdbpy.c
@@ -45,67 +45,6 @@ permdb_alloc_py(const char *dbpath)
return state;
}
-typedef struct node_object_py {
- PyObject_HEAD
- node_object nodeobj;
-} node_object_py;
-
-static void
-pynode_dealloc(node_object_py *node)
-{
-
-}
-
-static PyObject*
-node_getitem(PyObject *o, PyObject *key)
-{
- unsigned int n = PyLong_AsUnsignedLong(key);
- node_object_py *node = (node_object_py *)o;
-
- return PyLong_FromUnsignedLongLong(get_entry_in_node(node->nodeobj, n));
-}
-
-static PyMappingMethods node_as_mapping = {
- 0, /* mp_length */
- node_getitem, /* mp_subscript */
- 0, /* mp_ass_subscript */
-};
-
-static PyTypeObject node_type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "permdb.node", /*tp_name*/
- sizeof(node_object_py), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)pynode_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- &node_as_mapping, /*tp_as_mapping*/
- 0, /*tp_hash */
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT, /*tp_flags*/
- "PermDB node", /*tp_doc*/
-};
-
-
-static node_object_py *
-node_alloc(node_object data)
-{
- node_object_py *node = PyObject_New(node_object_py, &node_type);
- node->nodeobj = data;
- return node;
-}
-
-
static PyObject *
data_pread(PyObject *self, PyObject *args)
{
@@ -140,20 +79,6 @@ permdb_alloc_wrapper(PyObject *self, PyObject *args)
}
static PyObject *
-readnode_wrapper(PyObject *self, PyObject *args)
-{
- permdb_object_py *state;
- unsigned long long offset;
- const char *key = NULL;
-
- if (!PyArg_ParseTuple(args, "O!K|s", &permdb_type, &state, &offset, &key)) {
- return NULL;
- }
-
- return (PyObject *)node_alloc(readnode(state->permdb, offset, key));
-}
-
-static PyObject *
datasize_wrapper(PyObject *self, PyObject *args)
{
permdb_object_py *state;
@@ -255,7 +180,6 @@ committree_wrapper(PyObject *self, PyObject *args)
static PyMethodDef UtilMethods[] = {
{"data_pread", data_pread, METH_VARARGS},
{"alloc", permdb_alloc_wrapper, METH_VARARGS},
- {"readnode", readnode_wrapper, METH_VARARGS},
{"datasize", datasize_wrapper, METH_VARARGS},
{"addvalue", addvalue_wrapper, METH_VARARGS},
{"getvalue", getvalue_wrapper, METH_VARARGS},