summaryrefslogtreecommitdiffstats
path: root/cython/lockdown.pxi
diff options
context:
space:
mode:
Diffstat (limited to 'cython/lockdown.pxi')
-rw-r--r--cython/lockdown.pxi23
1 files changed, 23 insertions, 0 deletions
diff --git a/cython/lockdown.pxi b/cython/lockdown.pxi
index a904d12..8463738 100644
--- a/cython/lockdown.pxi
+++ b/cython/lockdown.pxi
@@ -41,6 +41,8 @@ cdef extern from "libimobiledevice/lockdown.h":
lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
+ lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count)
+ lockdownd_error_t lockdownd_data_classes_free(char **classes)
cdef class LockdownError(BaseError):
def __init__(self, *args, **kwargs):
@@ -245,6 +247,27 @@ cdef class LockdownClient(PropertyListService):
cpdef goodbye(self):
self.handle_error(lockdownd_goodbye(self._c_client))
+ cpdef list get_sync_data_classes(self):
+ cdef:
+ char **classes = NULL
+ int count = 0
+ list result = []
+ bytes data_class
+
+ try:
+ self.handle_error(lockdownd_get_sync_data_classes(self._c_client, &classes, &count))
+
+ for i from 0 <= i < count:
+ data_class = classes[i]
+ result.append(data_class)
+
+ return result
+ except Exception, e:
+ raise
+ finally:
+ if classes != NULL:
+ lockdownd_data_classes_free(classes)
+
cdef inline int16_t _send(self, plist.plist_t node):
return lockdownd_send(self._c_client, node)