diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-12-18 20:33:56 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-12-18 20:33:56 +0000 |
commit | e6eb7b5307da2a446e1c8c6b0cb6b11fc6705b00 (patch) | |
tree | 3315ae510245c0a0b4d791b7c1d73f1bc01afdce /include | |
parent | 73457d0e435f4a9be9a9980fb06dd004b87c6647 (diff) |
Switch to autotools and test with Python 2.5 as well as 2.4.
In the process:
HACKING.txt: update
include/dbus-python.h: add some typedefs to make it saner
bus.c, conn.c, conn-methods.c: further alter docstrings to keep epydoc happy
exceptions.c: create exceptions in a more longwinded way for Python 2.5 compatibility
message-get-args.c, bus/__init__.py: tweak docstrings
dbus/introspect_parser.py: make docstring valid reStructuredText
run-test.sh: simplify, since configure now does some of the work
test/*.py: use paths from run-test.sh, cope with out-of-tree builds
test-standalone.py: carry out additional sanity checks
Diffstat (limited to 'include')
-rw-r--r-- | include/dbus-python.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/include/dbus-python.h b/include/dbus-python.h index 9d6d581..e1fe288 100644 --- a/include/dbus-python.h +++ b/include/dbus-python.h @@ -1,4 +1,5 @@ /* C API for _dbus_bindings, used by _dbus_glib_bindings. + * This file is currently Python-version-independent. * * Copyright (C) 2006 Collabora Ltd. * @@ -31,30 +32,32 @@ DBUS_BEGIN_DECLS +typedef void (*_dbus_py_func_ptr)(void); + +typedef dbus_bool_t (*_dbus_py_conn_setup_func)(DBusConnection *, void *); +typedef dbus_bool_t (*_dbus_py_srv_setup_func)(DBusServer *, void *); +typedef void (*_dbus_py_free_func)(void *); + #define DBUS_BINDINGS_API_COUNT 3 #ifdef INSIDE_DBUS_PYTHON_BINDINGS -#define Connection_BorrowDBusConnection DBusPyConnection_BorrowDBusConnection -#define NativeMainLoop_New4 DBusPyNativeMainLoop_New4 extern DBusConnection *DBusPyConnection_BorrowDBusConnection(PyObject *); -extern PyObject *DBusPyNativeMainLoop_New4(dbus_bool_t (*)(DBusConnection *, void *), - dbus_bool_t (*)(DBusServer *, void *), - void (*)(void *), - void *); +extern PyObject *DBusPyNativeMainLoop_New4(_dbus_py_conn_setup_func, + _dbus_py_srv_setup_func, + _dbus_py_free_func, + void *); #else static PyObject *_dbus_bindings_module = NULL; -static void **dbus_bindings_API; +static _dbus_py_func_ptr *dbus_bindings_API; #define DBusPyConnection_BorrowDBusConnection \ (*(DBusConnection *(*)(PyObject *))dbus_bindings_API[1]) #define DBusPyNativeMainLoop_New4 \ - ((PyObject *(*)(dbus_bool_t (*)(DBusConnection *, void *),\ - dbus_bool_t (*)(DBusServer *, void *),\ - void (*)(void *),\ - void *))dbus_bindings_API[2]) + ((PyObject *(*)(_dbus_py_conn_setup_func, _dbus_py_srv_setup_func, \ + _dbus_py_free_func, void *))dbus_bindings_API[2]) static int import_dbus_bindings(const char *this_module_name) @@ -69,7 +72,7 @@ import_dbus_bindings(const char *this_module_name) c_api = PyObject_GetAttrString(_dbus_bindings_module, "_C_API"); if (c_api == NULL) return -1; if (PyCObject_Check(c_api)) { - dbus_bindings_API = (void **)PyCObject_AsVoidPtr(c_api); + dbus_bindings_API = (_dbus_py_func_ptr *)PyCObject_AsVoidPtr(c_api); } else { Py_DECREF(c_api); |