summaryrefslogtreecommitdiffstats
path: root/cython/imobiledevice.pxd
diff options
context:
space:
mode:
authorGravatar Bryan Forbes2010-03-17 10:27:44 -0500
committerGravatar Martin Szulecki2012-03-20 23:25:54 +0100
commit68c63cc1382326e7f0cb4e6bd863427f9069ca05 (patch)
treed4094cb7f98cdb081e614c519f6cf8d0f9080c18 /cython/imobiledevice.pxd
parentcfe6244f8954efce4ef12b9b4338cc0d41a9ff40 (diff)
downloadlibimobiledevice-68c63cc1382326e7f0cb4e6bd863427f9069ca05.tar.gz
libimobiledevice-68c63cc1382326e7f0cb4e6bd863427f9069ca05.tar.bz2
Added base class for more efficient error handling.
Diffstat (limited to 'cython/imobiledevice.pxd')
-rw-r--r--cython/imobiledevice.pxd8
1 files changed, 6 insertions, 2 deletions
diff --git a/cython/imobiledevice.pxd b/cython/imobiledevice.pxd
index bdebe33..0557d37 100644
--- a/cython/imobiledevice.pxd
+++ b/cython/imobiledevice.pxd
@@ -10,6 +10,10 @@ cdef class BaseError(Exception):
cdef dict _lookup_table
cdef int16_t _c_errcode
+cdef class Base:
+ cdef inline int handle_error(self, int16_t ret) except -1
+ cdef inline BaseError _error(self, int16_t ret)
+
cdef class iDeviceError(BaseError): pass
cdef extern from "libimobiledevice/libimobiledevice.h":
@@ -29,7 +33,7 @@ cdef extern from "libimobiledevice/libimobiledevice.h":
cdef class iDeviceEvent:
cdef const_idevice_event_t _c_event
-cdef class iDevice:
+cdef class iDevice(Base):
cdef idevice_t _c_dev
cdef class LockdownError(BaseError): pass
@@ -39,7 +43,7 @@ cdef extern from "libimobiledevice/lockdown.h":
pass
ctypedef lockdownd_client_int *lockdownd_client_t
-cdef class LockdownClient:
+cdef class LockdownClient(Base):
cdef lockdownd_client_t _c_client
cpdef int start_service(self, service)
cpdef goodbye(self)