summaryrefslogtreecommitdiff
path: root/c_src/permdbpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'c_src/permdbpy.c')
-rw-r--r--c_src/permdbpy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/c_src/permdbpy.c b/c_src/permdbpy.c
index 9bd2e8a..491f759 100644
--- a/c_src/permdbpy.c
+++ b/c_src/permdbpy.c
@@ -43,11 +43,11 @@ PyTypeObject permdb_type = {
};
permdb_object_py *
-permdb_alloc_py(const char *dbpath)
+permdb_alloc_py(const char *dbpath, int write_enable)
{
struct permdb_object *permdb;
- permdb = permdb_alloc(dbpath);
+ permdb = permdb_alloc(dbpath, write_enable);
if (permdb == NULL) {
PyErr_SetString(PyExc_RuntimeError, "Cannot allocate permdb object");
@@ -84,12 +84,13 @@ static PyObject *
permdb_alloc_wrapper(PyObject *self, PyObject *args)
{
const char *dbpath = NULL;
+ int write_enable = 1;
- if (!PyArg_ParseTuple(args, "s", &dbpath)) {
+ if (!PyArg_ParseTuple(args, "s|i", &dbpath, &write_enable)) {
return NULL;
}
- return (PyObject*)permdb_alloc_py(dbpath);
+ return (PyObject*)permdb_alloc_py(dbpath, write_enable);
}
static PyObject *