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):
10 cdef dict _lookup_table 10 cdef dict _lookup_table
11 cdef int16_t _c_errcode 11 cdef int16_t _c_errcode
12 12
13cdef class Base:
14 cdef inline int handle_error(self, int16_t ret) except -1
15 cdef inline BaseError _error(self, int16_t ret)
16
13cdef class iDeviceError(BaseError): pass 17cdef class iDeviceError(BaseError): pass
14 18
15cdef extern from "libimobiledevice/libimobiledevice.h": 19cdef extern from "libimobiledevice/libimobiledevice.h":
@@ -29,7 +33,7 @@ cdef extern from "libimobiledevice/libimobiledevice.h":
29cdef class iDeviceEvent: 33cdef class iDeviceEvent:
30 cdef const_idevice_event_t _c_event 34 cdef const_idevice_event_t _c_event
31 35
32cdef class iDevice: 36cdef class iDevice(Base):
33 cdef idevice_t _c_dev 37 cdef idevice_t _c_dev
34 38
35cdef class LockdownError(BaseError): pass 39cdef class LockdownError(BaseError): pass
@@ -39,7 +43,7 @@ cdef extern from "libimobiledevice/lockdown.h":
39 pass 43 pass
40 ctypedef lockdownd_client_int *lockdownd_client_t 44 ctypedef lockdownd_client_int *lockdownd_client_t
41 45
42cdef class LockdownClient: 46cdef class LockdownClient(Base):
43 cdef lockdownd_client_t _c_client 47 cdef lockdownd_client_t _c_client
44 cpdef int start_service(self, service) 48 cpdef int start_service(self, service)
45 cpdef goodbye(self) 49 cpdef goodbye(self)