summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-25 02:40:25 +0200
committerGravatar Martin Szulecki2009-07-25 02:40:25 +0200
commitf5e9d76ebd74999512ab73f44fabba86879b1c1f (patch)
tree9e01e1b8bda52c04c31c5334805a530403713e08 /include
parentd11abfb48218a37d9c66831ebec8b0a736d5385f (diff)
downloadlibimobiledevice-f5e9d76ebd74999512ab73f44fabba86879b1c1f.tar.gz
libimobiledevice-f5e9d76ebd74999512ab73f44fabba86879b1c1f.tar.bz2
Update lockdown API and introduce new error codes
Diffstat (limited to 'include')
-rw-r--r--include/libiphone/libiphone.h10
-rw-r--r--include/libiphone/lockdown.h51
2 files changed, 36 insertions, 25 deletions
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index 9764a7e..895e809 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -32,7 +32,7 @@ extern "C" {
#include <plist/plist.h>
#include <usbmuxd.h>
-//general errors
+/* Error Codes */
#define IPHONE_E_SUCCESS 0
#define IPHONE_E_INVALID_ARG -1
#define IPHONE_E_UNKNOWN_ERROR -2
@@ -41,14 +41,6 @@ extern "C" {
#define IPHONE_E_NOT_ENOUGH_DATA -5
#define IPHONE_E_BAD_HEADER -6
-//lockdownd specific error
-#define IPHONE_E_INVALID_CONF -7
-#define IPHONE_E_PAIRING_FAILED -8
-#define IPHONE_E_SSL_ERROR -9
-#define IPHONE_E_PLIST_ERROR -10
-#define IPHONE_E_DICT_ERROR -11
-#define IPHONE_E_START_SERVICE_FAILED -12
-
//afc specific error
#define IPHONE_E_AFC_ERROR -13
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h
index 20ccf77..55c0cb7 100644
--- a/include/libiphone/lockdown.h
+++ b/include/libiphone/lockdown.h
@@ -27,25 +27,44 @@ extern "C" {
#include <libiphone/libiphone.h>
+/* Error Codes */
+#define LOCKDOWN_E_SUCCESS 0
+#define LOCKDOWN_E_INVALID_ARG -1
+#define LOCKDOWN_E_INVALID_CONF -2
+#define LOCKDOWN_E_PLIST_ERROR -3
+#define LOCKDOWN_E_PAIRING_FAILED -4
+#define LOCKDOWN_E_SSL_ERROR -5
+#define LOCKDOWN_E_DICT_ERROR -6
+#define LOCKDOWN_E_START_SERVICE_FAILED -7
+#define LOCKDOWN_E_NOT_ENOUGH_DATA -8
+#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9
+#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10
+#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11
+#define LOCKDOWN_E_MUX_ERROR -12
+
+#define LOCKDOWN_E_UNKNOWN_ERROR -256
+
+typedef int16_t lockdownd_error_t;
+
struct lockdownd_client_int;
typedef struct lockdownd_client_int *lockdownd_client_t;
-//lockdownd related functions
-iphone_error_t lockdownd_new_client (iphone_device_t device, lockdownd_client_t *client);
-iphone_error_t lockdownd_free_client(lockdownd_client_t client);
-iphone_error_t lockdownd_query_type(lockdownd_client_t client);
-iphone_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value);
-iphone_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value);
-iphone_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key);
-iphone_error_t lockdownd_start_service (lockdownd_client_t client, const char *service, int *port);
-iphone_error_t lockdownd_stop_session(lockdownd_client_t client);
-iphone_error_t lockdownd_send (lockdownd_client_t client, plist_t plist);
-iphone_error_t lockdownd_recv (lockdownd_client_t client, plist_t *plist);
-iphone_error_t lockdownd_pair(lockdownd_client_t client, char *uid, char *host_id);
-iphone_error_t lockdownd_get_device_uid (lockdownd_client_t control, char **uid);
-iphone_error_t lockdownd_get_device_name (lockdownd_client_t client, char **device_name);
-iphone_error_t lockdownd_enter_recovery(lockdownd_client_t client);
-iphone_error_t lockdownd_goodbye(lockdownd_client_t client);
+/* Interface */
+lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client);
+lockdownd_error_t lockdownd_client_free(lockdownd_client_t client);
+lockdownd_error_t lockdownd_query_type(lockdownd_client_t client);
+lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value);
+lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value);
+lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key);
+lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port);
+lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client);
+lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist);
+lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist);
+lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *host_id);
+lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid);
+lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name);
+lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client);
+lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client);
#ifdef __cplusplus
}