tdb: update tdb ABI to use hide_symbols=True
[sahlberg/ctdb.git] / lib / tdb / pytdb.c
index 88f6f4ef73d3051638a3bf103d7ad20d381917c6..7a9205b815cbaf8c580fcb3fb1d679bf600ce11e 100644 (file)
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
 
-   Swig interface to tdb.
+   Python interface to tdb.
 
    Copyright (C) 2004-2006 Tim Potter <tpot@samba.org>
    Copyright (C) 2007-2008 Jelmer Vernooij <jelmer@samba.org>
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "replace.h"
+#include "system/filesys.h"
+
 #include <Python.h>
-#ifdef HAVE_FSTAT
-#undef HAVE_FSTAT
+#ifndef Py_RETURN_NONE
+#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
 #endif
 
 /* Include tdb headers */
-#include <stdint.h>
-#include <signal.h>
 #include <tdb.h>
-#include <fcntl.h>
-#include <stdbool.h>
 
 typedef struct {
        PyObject_HEAD
@@ -113,13 +112,6 @@ static PyObject *obj_transaction_commit(PyTdbObject *self)
        Py_RETURN_NONE;
 }
 
-static PyObject *obj_transaction_recover(PyTdbObject *self)
-{
-       int ret = tdb_transaction_recover(self->ctx);
-       PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       Py_RETURN_NONE;
-}
-
 static PyObject *obj_transaction_start(PyTdbObject *self)
 {
        int ret = tdb_transaction_start(self->ctx);
@@ -326,9 +318,6 @@ static PyMethodDef tdb_object_methods[] = {
        { "transaction_commit", (PyCFunction)obj_transaction_commit, METH_NOARGS,
                "S.transaction_commit() -> None\n"
                "Commit the currently active transaction." },
-       { "transaction_recover", (PyCFunction)obj_transaction_recover, METH_NOARGS,
-               "S.transaction_recover() -> None\n"
-               "Recover the currently active transaction." },
        { "transaction_start", (PyCFunction)obj_transaction_start, METH_NOARGS,
                "S.transaction_start() -> None\n"
                "Start a new transaction." },
@@ -338,7 +327,7 @@ static PyMethodDef tdb_object_methods[] = {
        { "read_lock_all", (PyCFunction)obj_lockall_read, METH_NOARGS, NULL },
        { "read_unlock_all", (PyCFunction)obj_unlockall_read, METH_NOARGS, NULL },
        { "close", (PyCFunction)obj_close, METH_NOARGS, NULL },
-       { "get", (PyCFunction)obj_get, METH_VARARGS, "S.fetch(key) -> value\n"
+       { "get", (PyCFunction)obj_get, METH_VARARGS, "S.get(key) -> value\n"
                "Fetch a value." },
        { "append", (PyCFunction)obj_append, METH_VARARGS, "S.append(key, value) -> None\n"
                "Append data to an existing key." },