diff options
Diffstat (limited to 'cython/imobiledevice.pxd')
| -rw-r--r-- | cython/imobiledevice.pxd | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/cython/imobiledevice.pxd b/cython/imobiledevice.pxd new file mode 100644 index 0000000..238df68 --- /dev/null +++ b/cython/imobiledevice.pxd | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | #!python | ||
| 2 | #cython: language_level=3str | ||
| 3 | |||
| 4 | cimport plist | ||
| 5 | |||
| 6 | from libc.stdint cimport * | ||
| 7 | |||
| 8 | cdef extern from "pyerrors.h": | ||
| 9 | ctypedef class __builtin__.Exception [object PyBaseExceptionObject]: | ||
| 10 | pass | ||
| 11 | |||
| 12 | cdef class BaseError(Exception): | ||
| 13 | cdef dict _lookup_table | ||
| 14 | cdef int16_t _c_errcode | ||
| 15 | |||
| 16 | cdef class Base: | ||
| 17 | cdef inline int handle_error(self, int16_t ret) except -1 | ||
| 18 | cdef BaseError _error(self, int16_t ret) | ||
| 19 | |||
| 20 | cdef class iDeviceError(BaseError): pass | ||
| 21 | |||
| 22 | cdef extern from "libimobiledevice/libimobiledevice.h": | ||
| 23 | cdef struct idevice_private: | ||
| 24 | pass | ||
| 25 | ctypedef idevice_private* idevice_t | ||
| 26 | cdef struct idevice_connection_private: | ||
| 27 | pass | ||
| 28 | ctypedef idevice_connection_private* idevice_connection_t | ||
| 29 | cdef enum idevice_connection_type: | ||
| 30 | CONNECTION_USBMUXD = 1 | ||
| 31 | CONNECTION_NETWORK | ||
| 32 | cdef enum idevice_event_type: | ||
| 33 | IDEVICE_DEVICE_ADD = 1 | ||
| 34 | IDEVICE_DEVICE_REMOVE | ||
| 35 | IDEVICE_DEVICE_PAIRED | ||
| 36 | ctypedef struct idevice_event_t: | ||
| 37 | idevice_event_type event | ||
| 38 | char *udid | ||
| 39 | idevice_connection_type conn_type | ||
| 40 | ctypedef idevice_event_t* const_idevice_event_t "const idevice_event_t*" | ||
| 41 | |||
| 42 | cdef class iDeviceEvent: | ||
| 43 | cdef const_idevice_event_t _c_event | ||
| 44 | |||
| 45 | cdef class iDeviceConnection(Base): | ||
| 46 | cdef idevice_connection_t _c_connection | ||
| 47 | |||
| 48 | cpdef bytes receive_timeout(self, uint32_t max_len, unsigned int timeout) | ||
| 49 | cpdef bytes receive(self, max_len) | ||
| 50 | cpdef disconnect(self) | ||
| 51 | |||
| 52 | cdef class iDevice(Base): | ||
| 53 | cdef idevice_t _c_dev | ||
| 54 | |||
| 55 | cpdef iDeviceConnection connect(self, uint16_t port) | ||
| 56 | |||
| 57 | cdef class BaseService(Base): | ||
| 58 | pass | ||
| 59 | |||
| 60 | cdef class PropertyListService(BaseService): | ||
| 61 | cpdef send(self, plist.Node node) | ||
| 62 | cpdef object receive(self) | ||
| 63 | cpdef object receive_with_timeout(self, int timeout_ms) | ||
| 64 | cdef int16_t _send(self, plist.plist_t node) | ||
| 65 | cdef int16_t _receive(self, plist.plist_t* c_node) | ||
| 66 | cdef int16_t _receive_with_timeout(self, plist.plist_t* c_node, int timeout_ms) | ||
| 67 | |||
| 68 | cdef extern from "libimobiledevice/lockdown.h": | ||
| 69 | cdef struct lockdownd_client_private: | ||
| 70 | pass | ||
| 71 | ctypedef lockdownd_client_private *lockdownd_client_t | ||
| 72 | cdef struct lockdownd_pair_record: | ||
| 73 | char *device_certificate | ||
| 74 | char *host_certificate | ||
| 75 | char *host_id | ||
| 76 | char *root_certificate | ||
| 77 | ctypedef lockdownd_pair_record *lockdownd_pair_record_t | ||
| 78 | cdef struct lockdownd_service_descriptor: | ||
| 79 | uint16_t port | ||
| 80 | uint8_t ssl_enabled | ||
| 81 | ctypedef lockdownd_service_descriptor *lockdownd_service_descriptor_t | ||
| 82 | |||
| 83 | cdef class LockdownError(BaseError): pass | ||
| 84 | |||
| 85 | cdef class LockdownPairRecord: | ||
| 86 | cdef lockdownd_pair_record_t _c_record | ||
| 87 | |||
| 88 | cdef class LockdownServiceDescriptor(Base): | ||
| 89 | cdef lockdownd_service_descriptor_t _c_service_descriptor | ||
| 90 | |||
| 91 | cdef class LockdownClient(PropertyListService): | ||
| 92 | cdef lockdownd_client_t _c_client | ||
| 93 | cdef readonly iDevice device | ||
| 94 | |||
| 95 | cpdef bytes query_type(self) | ||
| 96 | cpdef plist.Node get_value(self, bytes domain=*, bytes key=*) | ||
| 97 | cpdef set_value(self, bytes domain, bytes key, object value) | ||
| 98 | cpdef remove_value(self, bytes domain, bytes key) | ||
| 99 | cpdef object start_service(self, object service) | ||
| 100 | cpdef object get_service_client(self, object service_class) | ||
| 101 | cpdef tuple start_session(self, bytes host_id) | ||
| 102 | cpdef stop_session(self, bytes session_id) | ||
| 103 | cpdef pair(self, object pair_record=*) | ||
| 104 | cpdef validate_pair(self, object pair_record=*) | ||
| 105 | cpdef unpair(self, object pair_record=*) | ||
| 106 | cpdef activate(self, plist.Node activation_record) | ||
| 107 | cpdef deactivate(self) | ||
| 108 | cpdef enter_recovery(self) | ||
| 109 | cpdef goodbye(self) | ||
| 110 | cpdef list get_sync_data_classes(self) | ||
