diff options
author | 2024-01-31 02:57:11 +0100 | |
---|---|---|
committer | 2024-01-31 02:57:11 +0100 | |
commit | 63bbac545efc400373a7f472fdd78174149119c3 (patch) | |
tree | f95c8d58b7b0fbf33bd188c5becc0401ee7e64ef /src | |
parent | f723a44513eb5ba5797da24bc2b63d9f09600a6e (diff) | |
download | libimobiledevice-63bbac545efc400373a7f472fdd78174149119c3.tar.gz libimobiledevice-63bbac545efc400373a7f472fdd78174149119c3.tar.bz2 |
Move LIBIMOBILEDEVICE_API to public headers
Diffstat (limited to 'src')
55 files changed, 348 insertions, 321 deletions
@@ -29,8 +29,8 @@ | |||
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | #include <string.h> | 30 | #include <string.h> |
31 | 31 | ||
32 | #include "afc.h" | ||
33 | #include "idevice.h" | 32 | #include "idevice.h" |
33 | #include "afc.h" | ||
34 | #include "common/debug.h" | 34 | #include "common/debug.h" |
35 | #include "endianness.h" | 35 | #include "endianness.h" |
36 | 36 | ||
@@ -68,7 +68,7 @@ static void afc_unlock(afc_client_t client) | |||
68 | * invalid, or AFC_E_NO_MEM if there is a memory allocation problem. | 68 | * invalid, or AFC_E_NO_MEM if there is a memory allocation problem. |
69 | */ | 69 | */ |
70 | 70 | ||
71 | LIBIMOBILEDEVICE_API afc_error_t afc_client_new_with_service_client(service_client_t service_client, afc_client_t *client) | 71 | afc_error_t afc_client_new_with_service_client(service_client_t service_client, afc_client_t *client) |
72 | { | 72 | { |
73 | if (!service_client) | 73 | if (!service_client) |
74 | return AFC_E_INVALID_ARG; | 74 | return AFC_E_INVALID_ARG; |
@@ -94,7 +94,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_client_new_with_service_client(service_clie | |||
94 | return AFC_E_SUCCESS; | 94 | return AFC_E_SUCCESS; |
95 | } | 95 | } |
96 | 96 | ||
97 | LIBIMOBILEDEVICE_API afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t * client) | 97 | afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t * client) |
98 | { | 98 | { |
99 | if (!device || !service || service->port == 0) | 99 | if (!device || !service || service->port == 0) |
100 | return AFC_E_INVALID_ARG; | 100 | return AFC_E_INVALID_ARG; |
@@ -113,14 +113,14 @@ LIBIMOBILEDEVICE_API afc_error_t afc_client_new(idevice_t device, lockdownd_serv | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | LIBIMOBILEDEVICE_API afc_error_t afc_client_start_service(idevice_t device, afc_client_t * client, const char* label) | 116 | afc_error_t afc_client_start_service(idevice_t device, afc_client_t * client, const char* label) |
117 | { | 117 | { |
118 | afc_error_t err = AFC_E_UNKNOWN_ERROR; | 118 | afc_error_t err = AFC_E_UNKNOWN_ERROR; |
119 | service_client_factory_start_service(device, AFC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(afc_client_new), &err); | 119 | service_client_factory_start_service(device, AFC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(afc_client_new), &err); |
120 | return err; | 120 | return err; |
121 | } | 121 | } |
122 | 122 | ||
123 | LIBIMOBILEDEVICE_API afc_error_t afc_client_free(afc_client_t client) | 123 | afc_error_t afc_client_free(afc_client_t client) |
124 | { | 124 | { |
125 | if (!client || !client->afc_packet) | 125 | if (!client || !client->afc_packet) |
126 | return AFC_E_INVALID_ARG; | 126 | return AFC_E_INVALID_ARG; |
@@ -414,7 +414,7 @@ static int _afc_check_packet_buffer(afc_client_t client, uint32_t data_len) | |||
414 | 414 | ||
415 | #define AFC_PACKET_DATA_PTR ((char*)client->afc_packet + sizeof(AFCPacket)) | 415 | #define AFC_PACKET_DATA_PTR ((char*)client->afc_packet + sizeof(AFCPacket)) |
416 | 416 | ||
417 | LIBIMOBILEDEVICE_API afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information) | 417 | afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information) |
418 | { | 418 | { |
419 | uint32_t bytes = 0; | 419 | uint32_t bytes = 0; |
420 | char *data = NULL, **list_loc = NULL; | 420 | char *data = NULL, **list_loc = NULL; |
@@ -458,7 +458,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_read_directory(afc_client_t client, const c | |||
458 | return ret; | 458 | return ret; |
459 | } | 459 | } |
460 | 460 | ||
461 | LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info(afc_client_t client, char ***device_information) | 461 | afc_error_t afc_get_device_info(afc_client_t client, char ***device_information) |
462 | { | 462 | { |
463 | uint32_t bytes = 0; | 463 | uint32_t bytes = 0; |
464 | char *data = NULL, **list = NULL; | 464 | char *data = NULL, **list = NULL; |
@@ -495,7 +495,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info(afc_client_t client, char * | |||
495 | return ret; | 495 | return ret; |
496 | } | 496 | } |
497 | 497 | ||
498 | LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value) | 498 | afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value) |
499 | { | 499 | { |
500 | afc_error_t ret = AFC_E_INTERNAL_ERROR; | 500 | afc_error_t ret = AFC_E_INTERNAL_ERROR; |
501 | char **kvps, **ptr; | 501 | char **kvps, **ptr; |
@@ -522,7 +522,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info_key(afc_client_t client, co | |||
522 | return ret; | 522 | return ret; |
523 | } | 523 | } |
524 | 524 | ||
525 | LIBIMOBILEDEVICE_API afc_error_t afc_remove_path(afc_client_t client, const char *path) | 525 | afc_error_t afc_remove_path(afc_client_t client, const char *path) |
526 | { | 526 | { |
527 | uint32_t bytes = 0; | 527 | uint32_t bytes = 0; |
528 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; | 528 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; |
@@ -558,7 +558,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_remove_path(afc_client_t client, const char | |||
558 | return ret; | 558 | return ret; |
559 | } | 559 | } |
560 | 560 | ||
561 | LIBIMOBILEDEVICE_API afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to) | 561 | afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to) |
562 | { | 562 | { |
563 | if (!client || !from || !to || !client->afc_packet || !client->parent) | 563 | if (!client || !from || !to || !client->afc_packet || !client->parent) |
564 | return AFC_E_INVALID_ARG; | 564 | return AFC_E_INVALID_ARG; |
@@ -594,7 +594,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_rename_path(afc_client_t client, const char | |||
594 | return ret; | 594 | return ret; |
595 | } | 595 | } |
596 | 596 | ||
597 | LIBIMOBILEDEVICE_API afc_error_t afc_make_directory(afc_client_t client, const char *path) | 597 | afc_error_t afc_make_directory(afc_client_t client, const char *path) |
598 | { | 598 | { |
599 | uint32_t bytes = 0; | 599 | uint32_t bytes = 0; |
600 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; | 600 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; |
@@ -626,7 +626,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_make_directory(afc_client_t client, const c | |||
626 | return ret; | 626 | return ret; |
627 | } | 627 | } |
628 | 628 | ||
629 | LIBIMOBILEDEVICE_API afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information) | 629 | afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information) |
630 | { | 630 | { |
631 | char *received = NULL; | 631 | char *received = NULL; |
632 | uint32_t bytes = 0; | 632 | uint32_t bytes = 0; |
@@ -666,7 +666,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_get_file_info(afc_client_t client, const ch | |||
666 | return ret; | 666 | return ret; |
667 | } | 667 | } |
668 | 668 | ||
669 | LIBIMOBILEDEVICE_API afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle) | 669 | afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle) |
670 | { | 670 | { |
671 | if (!client || !client->parent || !client->afc_packet) | 671 | if (!client || !client->parent || !client->afc_packet) |
672 | return AFC_E_INVALID_ARG; | 672 | return AFC_E_INVALID_ARG; |
@@ -718,7 +718,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_open(afc_client_t client, const char * | |||
718 | return ret; | 718 | return ret; |
719 | } | 719 | } |
720 | 720 | ||
721 | LIBIMOBILEDEVICE_API afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read) | 721 | afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read) |
722 | { | 722 | { |
723 | char *input = NULL; | 723 | char *input = NULL; |
724 | uint32_t current_count = 0, bytes_loc = 0; | 724 | uint32_t current_count = 0, bytes_loc = 0; |
@@ -774,7 +774,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_read(afc_client_t client, uint64_t han | |||
774 | return ret; | 774 | return ret; |
775 | } | 775 | } |
776 | 776 | ||
777 | LIBIMOBILEDEVICE_API afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written) | 777 | afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written) |
778 | { | 778 | { |
779 | uint32_t current_count = 0; | 779 | uint32_t current_count = 0; |
780 | uint32_t bytes_loc = 0; | 780 | uint32_t bytes_loc = 0; |
@@ -809,7 +809,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_write(afc_client_t client, uint64_t ha | |||
809 | return ret; | 809 | return ret; |
810 | } | 810 | } |
811 | 811 | ||
812 | LIBIMOBILEDEVICE_API afc_error_t afc_file_close(afc_client_t client, uint64_t handle) | 812 | afc_error_t afc_file_close(afc_client_t client, uint64_t handle) |
813 | { | 813 | { |
814 | uint32_t bytes = 0; | 814 | uint32_t bytes = 0; |
815 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; | 815 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; |
@@ -840,7 +840,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_close(afc_client_t client, uint64_t ha | |||
840 | return ret; | 840 | return ret; |
841 | } | 841 | } |
842 | 842 | ||
843 | LIBIMOBILEDEVICE_API afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation) | 843 | afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation) |
844 | { | 844 | { |
845 | uint32_t bytes = 0; | 845 | uint32_t bytes = 0; |
846 | struct lockinfo { | 846 | struct lockinfo { |
@@ -874,7 +874,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_lock(afc_client_t client, uint64_t han | |||
874 | return ret; | 874 | return ret; |
875 | } | 875 | } |
876 | 876 | ||
877 | LIBIMOBILEDEVICE_API afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence) | 877 | afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence) |
878 | { | 878 | { |
879 | uint32_t bytes = 0; | 879 | uint32_t bytes = 0; |
880 | struct seekinfo { | 880 | struct seekinfo { |
@@ -908,7 +908,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_seek(afc_client_t client, uint64_t han | |||
908 | return ret; | 908 | return ret; |
909 | } | 909 | } |
910 | 910 | ||
911 | LIBIMOBILEDEVICE_API afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position) | 911 | afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position) |
912 | { | 912 | { |
913 | char *buffer = NULL; | 913 | char *buffer = NULL; |
914 | uint32_t bytes = 0; | 914 | uint32_t bytes = 0; |
@@ -943,7 +943,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_tell(afc_client_t client, uint64_t han | |||
943 | return ret; | 943 | return ret; |
944 | } | 944 | } |
945 | 945 | ||
946 | LIBIMOBILEDEVICE_API afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize) | 946 | afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize) |
947 | { | 947 | { |
948 | uint32_t bytes = 0; | 948 | uint32_t bytes = 0; |
949 | struct truncinfo { | 949 | struct truncinfo { |
@@ -975,7 +975,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_file_truncate(afc_client_t client, uint64_t | |||
975 | return ret; | 975 | return ret; |
976 | } | 976 | } |
977 | 977 | ||
978 | LIBIMOBILEDEVICE_API afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize) | 978 | afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize) |
979 | { | 979 | { |
980 | if (!client || !path || !client->afc_packet || !client->parent) | 980 | if (!client || !path || !client->afc_packet || !client->parent) |
981 | return AFC_E_INVALID_ARG; | 981 | return AFC_E_INVALID_ARG; |
@@ -1008,7 +1008,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_truncate(afc_client_t client, const char *p | |||
1008 | return ret; | 1008 | return ret; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | LIBIMOBILEDEVICE_API afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname) | 1011 | afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname) |
1012 | { | 1012 | { |
1013 | if (!client || !target || !linkname || !client->afc_packet || !client->parent) | 1013 | if (!client || !target || !linkname || !client->afc_packet || !client->parent) |
1014 | return AFC_E_INVALID_ARG; | 1014 | return AFC_E_INVALID_ARG; |
@@ -1049,7 +1049,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_make_link(afc_client_t client, afc_link_typ | |||
1049 | return ret; | 1049 | return ret; |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | LIBIMOBILEDEVICE_API afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime) | 1052 | afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime) |
1053 | { | 1053 | { |
1054 | if (!client || !path || !client->afc_packet || !client->parent) | 1054 | if (!client || !path || !client->afc_packet || !client->parent) |
1055 | return AFC_E_INVALID_ARG; | 1055 | return AFC_E_INVALID_ARG; |
@@ -1082,7 +1082,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_set_file_time(afc_client_t client, const ch | |||
1082 | return ret; | 1082 | return ret; |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | LIBIMOBILEDEVICE_API afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path) | 1085 | afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path) |
1086 | { | 1086 | { |
1087 | uint32_t bytes = 0; | 1087 | uint32_t bytes = 0; |
1088 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; | 1088 | afc_error_t ret = AFC_E_UNKNOWN_ERROR; |
@@ -1114,7 +1114,7 @@ LIBIMOBILEDEVICE_API afc_error_t afc_remove_path_and_contents(afc_client_t clien | |||
1114 | return ret; | 1114 | return ret; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | LIBIMOBILEDEVICE_API afc_error_t afc_dictionary_free(char **dictionary) | 1117 | afc_error_t afc_dictionary_free(char **dictionary) |
1118 | { | 1118 | { |
1119 | int i = 0; | 1119 | int i = 0; |
1120 | 1120 | ||
diff --git a/src/bt_packet_logger.c b/src/bt_packet_logger.c index 5f7bdeb..937747c 100644 --- a/src/bt_packet_logger.c +++ b/src/bt_packet_logger.c | |||
@@ -69,7 +69,7 @@ static bt_packet_logger_error_t bt_packet_logger_error(service_error_t err) | |||
69 | return BT_PACKET_LOGGER_E_UNKNOWN_ERROR; | 69 | return BT_PACKET_LOGGER_E_UNKNOWN_ERROR; |
70 | } | 70 | } |
71 | 71 | ||
72 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_new(idevice_t device, lockdownd_service_descriptor_t service, bt_packet_logger_client_t * client) | 72 | bt_packet_logger_error_t bt_packet_logger_client_new(idevice_t device, lockdownd_service_descriptor_t service, bt_packet_logger_client_t * client) |
73 | { | 73 | { |
74 | if (!device || !service || service->port == 0 || !client || *client) { | 74 | if (!device || !service || service->port == 0 || !client || *client) { |
75 | debug_info("Incorrect parameter passed to bt_packet_logger_client_new."); | 75 | debug_info("Incorrect parameter passed to bt_packet_logger_client_new."); |
@@ -95,14 +95,14 @@ LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_new(idevic | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_start_service(idevice_t device, bt_packet_logger_client_t * client, const char* label) | 98 | bt_packet_logger_error_t bt_packet_logger_client_start_service(idevice_t device, bt_packet_logger_client_t * client, const char* label) |
99 | { | 99 | { |
100 | bt_packet_logger_error_t err = BT_PACKET_LOGGER_E_UNKNOWN_ERROR; | 100 | bt_packet_logger_error_t err = BT_PACKET_LOGGER_E_UNKNOWN_ERROR; |
101 | service_client_factory_start_service(device, BT_PACKETLOGGER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(bt_packet_logger_client_new), &err); | 101 | service_client_factory_start_service(device, BT_PACKETLOGGER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(bt_packet_logger_client_new), &err); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_free(bt_packet_logger_client_t client) | 105 | bt_packet_logger_error_t bt_packet_logger_client_free(bt_packet_logger_client_t client) |
106 | { | 106 | { |
107 | if (!client) | 107 | if (!client) |
108 | return BT_PACKET_LOGGER_E_INVALID_ARG; | 108 | return BT_PACKET_LOGGER_E_INVALID_ARG; |
@@ -113,7 +113,7 @@ LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_free(bt_pa | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_receive_with_timeout(bt_packet_logger_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 116 | bt_packet_logger_error_t bt_packet_logger_receive_with_timeout(bt_packet_logger_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
117 | { | 117 | { |
118 | bt_packet_logger_error_t res = BT_PACKET_LOGGER_E_UNKNOWN_ERROR; | 118 | bt_packet_logger_error_t res = BT_PACKET_LOGGER_E_UNKNOWN_ERROR; |
119 | int bytes = 0; | 119 | int bytes = 0; |
@@ -186,7 +186,7 @@ void *bt_packet_logger_worker(void *arg) | |||
186 | return NULL; | 186 | return NULL; |
187 | } | 187 | } |
188 | 188 | ||
189 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_start_capture(bt_packet_logger_client_t client, bt_packet_logger_receive_cb_t callback, void* user_data) | 189 | bt_packet_logger_error_t bt_packet_logger_start_capture(bt_packet_logger_client_t client, bt_packet_logger_receive_cb_t callback, void* user_data) |
190 | { | 190 | { |
191 | if (!client || !callback) | 191 | if (!client || !callback) |
192 | return BT_PACKET_LOGGER_E_INVALID_ARG; | 192 | return BT_PACKET_LOGGER_E_INVALID_ARG; |
@@ -214,7 +214,7 @@ LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_start_capture(bt_ | |||
214 | } | 214 | } |
215 | 215 | ||
216 | 216 | ||
217 | LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_stop_capture(bt_packet_logger_client_t client) | 217 | bt_packet_logger_error_t bt_packet_logger_stop_capture(bt_packet_logger_client_t client) |
218 | { | 218 | { |
219 | if (client->worker) { | 219 | if (client->worker) { |
220 | /* notify thread to finish */ | 220 | /* notify thread to finish */ |
diff --git a/src/bt_packet_logger.h b/src/bt_packet_logger.h index 95990d5..620555e 100644 --- a/src/bt_packet_logger.h +++ b/src/bt_packet_logger.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef _BR_PACKET_LOGGER_H | 22 | #ifndef _BR_PACKET_LOGGER_H |
23 | #define _BR_PACKET_LOGGER_H | 23 | #define _BR_PACKET_LOGGER_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/bt_packet_logger.h" | 26 | #include "libimobiledevice/bt_packet_logger.h" |
26 | #include "service.h" | 27 | #include "service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/companion_proxy.c b/src/companion_proxy.c index 5852904..421fa9a 100644 --- a/src/companion_proxy.c +++ b/src/companion_proxy.c | |||
@@ -62,7 +62,7 @@ static companion_proxy_error_t companion_proxy_error(property_list_service_error | |||
62 | return COMPANION_PROXY_E_UNKNOWN_ERROR; | 62 | return COMPANION_PROXY_E_UNKNOWN_ERROR; |
63 | } | 63 | } |
64 | 64 | ||
65 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, companion_proxy_client_t * client) | 65 | companion_proxy_error_t companion_proxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, companion_proxy_client_t * client) |
66 | { | 66 | { |
67 | *client = NULL; | 67 | *client = NULL; |
68 | 68 | ||
@@ -90,14 +90,14 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_new(idevice_ | |||
90 | return COMPANION_PROXY_E_SUCCESS; | 90 | return COMPANION_PROXY_E_SUCCESS; |
91 | } | 91 | } |
92 | 92 | ||
93 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_start_service(idevice_t device, companion_proxy_client_t * client, const char* label) | 93 | companion_proxy_error_t companion_proxy_client_start_service(idevice_t device, companion_proxy_client_t * client, const char* label) |
94 | { | 94 | { |
95 | companion_proxy_error_t err = COMPANION_PROXY_E_UNKNOWN_ERROR; | 95 | companion_proxy_error_t err = COMPANION_PROXY_E_UNKNOWN_ERROR; |
96 | service_client_factory_start_service(device, COMPANION_PROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(companion_proxy_client_new), &err); | 96 | service_client_factory_start_service(device, COMPANION_PROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(companion_proxy_client_new), &err); |
97 | return err; | 97 | return err; |
98 | } | 98 | } |
99 | 99 | ||
100 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_free(companion_proxy_client_t client) | 100 | companion_proxy_error_t companion_proxy_client_free(companion_proxy_client_t client) |
101 | { | 101 | { |
102 | if (!client) | 102 | if (!client) |
103 | return COMPANION_PROXY_E_INVALID_ARG; | 103 | return COMPANION_PROXY_E_INVALID_ARG; |
@@ -116,7 +116,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_free(compani | |||
116 | return err; | 116 | return err; |
117 | } | 117 | } |
118 | 118 | ||
119 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_send(companion_proxy_client_t client, plist_t plist) | 119 | companion_proxy_error_t companion_proxy_send(companion_proxy_client_t client, plist_t plist) |
120 | { | 120 | { |
121 | companion_proxy_error_t res = COMPANION_PROXY_E_UNKNOWN_ERROR; | 121 | companion_proxy_error_t res = COMPANION_PROXY_E_UNKNOWN_ERROR; |
122 | 122 | ||
@@ -129,7 +129,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_send(companion_prox | |||
129 | return res; | 129 | return res; |
130 | } | 130 | } |
131 | 131 | ||
132 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_receive(companion_proxy_client_t client, plist_t * plist) | 132 | companion_proxy_error_t companion_proxy_receive(companion_proxy_client_t client, plist_t * plist) |
133 | { | 133 | { |
134 | companion_proxy_error_t res = COMPANION_PROXY_E_UNKNOWN_ERROR; | 134 | companion_proxy_error_t res = COMPANION_PROXY_E_UNKNOWN_ERROR; |
135 | plist_t outplist = NULL; | 135 | plist_t outplist = NULL; |
@@ -143,7 +143,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_receive(companion_p | |||
143 | return res; | 143 | return res; |
144 | } | 144 | } |
145 | 145 | ||
146 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_get_device_registry(companion_proxy_client_t client, plist_t* paired_devices) | 146 | companion_proxy_error_t companion_proxy_get_device_registry(companion_proxy_client_t client, plist_t* paired_devices) |
147 | { | 147 | { |
148 | if (!client || !paired_devices) { | 148 | if (!client || !paired_devices) { |
149 | return COMPANION_PROXY_E_INVALID_ARG; | 149 | return COMPANION_PROXY_E_INVALID_ARG; |
@@ -226,7 +226,7 @@ static void* companion_proxy_event_thread(void* arg) | |||
226 | return NULL; | 226 | return NULL; |
227 | } | 227 | } |
228 | 228 | ||
229 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_listening_for_devices(companion_proxy_client_t client, companion_proxy_device_event_cb_t callback, void* userdata) | 229 | companion_proxy_error_t companion_proxy_start_listening_for_devices(companion_proxy_client_t client, companion_proxy_device_event_cb_t callback, void* userdata) |
230 | { | 230 | { |
231 | if (!client || !client->parent || !callback) { | 231 | if (!client || !client->parent || !callback) { |
232 | return COMPANION_PROXY_E_INVALID_ARG; | 232 | return COMPANION_PROXY_E_INVALID_ARG; |
@@ -252,7 +252,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_listening_for | |||
252 | return res; | 252 | return res; |
253 | } | 253 | } |
254 | 254 | ||
255 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_stop_listening_for_devices(companion_proxy_client_t client) | 255 | companion_proxy_error_t companion_proxy_stop_listening_for_devices(companion_proxy_client_t client) |
256 | { | 256 | { |
257 | property_list_service_client_t parent = client->parent; | 257 | property_list_service_client_t parent = client->parent; |
258 | client->parent = NULL; | 258 | client->parent = NULL; |
@@ -266,7 +266,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_stop_listening_for_ | |||
266 | return COMPANION_PROXY_E_SUCCESS; | 266 | return COMPANION_PROXY_E_SUCCESS; |
267 | } | 267 | } |
268 | 268 | ||
269 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_get_value_from_registry(companion_proxy_client_t client, const char* companion_udid, const char* key, plist_t* value) | 269 | companion_proxy_error_t companion_proxy_get_value_from_registry(companion_proxy_client_t client, const char* companion_udid, const char* key, plist_t* value) |
270 | { | 270 | { |
271 | if (!client || !companion_udid || !key || !value) { | 271 | if (!client || !companion_udid || !key || !value) { |
272 | return COMPANION_PROXY_E_INVALID_ARG; | 272 | return COMPANION_PROXY_E_INVALID_ARG; |
@@ -310,7 +310,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_get_value_from_regi | |||
310 | return res; | 310 | return res; |
311 | } | 311 | } |
312 | 312 | ||
313 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port, const char* service_name, uint16_t* forward_port, plist_t options) | 313 | companion_proxy_error_t companion_proxy_start_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port, const char* service_name, uint16_t* forward_port, plist_t options) |
314 | { | 314 | { |
315 | if (!client) { | 315 | if (!client) { |
316 | return COMPANION_PROXY_E_INVALID_ARG; | 316 | return COMPANION_PROXY_E_INVALID_ARG; |
@@ -353,7 +353,7 @@ LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_forwarding_se | |||
353 | return res; | 353 | return res; |
354 | } | 354 | } |
355 | 355 | ||
356 | LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_stop_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port) | 356 | companion_proxy_error_t companion_proxy_stop_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port) |
357 | { | 357 | { |
358 | if (!client) { | 358 | if (!client) { |
359 | return COMPANION_PROXY_E_INVALID_ARG; | 359 | return COMPANION_PROXY_E_INVALID_ARG; |
diff --git a/src/companion_proxy.h b/src/companion_proxy.h index 0226640..e36932a 100644 --- a/src/companion_proxy.h +++ b/src/companion_proxy.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __COMPANION_PROXY_H | 22 | #ifndef __COMPANION_PROXY_H |
23 | #define __COMPANION_PROXY_H | 23 | #define __COMPANION_PROXY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/companion_proxy.h" | 26 | #include "libimobiledevice/companion_proxy.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/debugserver.c b/src/debugserver.c index 39c1bdc..74ade8a 100644 --- a/src/debugserver.c +++ b/src/debugserver.c | |||
@@ -64,7 +64,7 @@ static debugserver_error_t debugserver_error(service_error_t err) | |||
64 | return DEBUGSERVER_E_UNKNOWN_ERROR; | 64 | return DEBUGSERVER_E_UNKNOWN_ERROR; |
65 | } | 65 | } |
66 | 66 | ||
67 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_descriptor_t service, debugserver_client_t* client) | 67 | debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_descriptor_t service, debugserver_client_t* client) |
68 | { | 68 | { |
69 | *client = NULL; | 69 | *client = NULL; |
70 | 70 | ||
@@ -98,7 +98,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device | |||
98 | return DEBUGSERVER_E_SUCCESS; | 98 | return DEBUGSERVER_E_SUCCESS; |
99 | } | 99 | } |
100 | 100 | ||
101 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label) | 101 | debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label) |
102 | { | 102 | { |
103 | debugserver_error_t err = DEBUGSERVER_E_UNKNOWN_ERROR; | 103 | debugserver_error_t err = DEBUGSERVER_E_UNKNOWN_ERROR; |
104 | service_client_factory_start_service(device, DEBUGSERVER_SECURE_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err); | 104 | service_client_factory_start_service(device, DEBUGSERVER_SECURE_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err); |
@@ -109,7 +109,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevic | |||
109 | return err; | 109 | return err; |
110 | } | 110 | } |
111 | 111 | ||
112 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_free(debugserver_client_t client) | 112 | debugserver_error_t debugserver_client_free(debugserver_client_t client) |
113 | { | 113 | { |
114 | if (!client) | 114 | if (!client) |
115 | return DEBUGSERVER_E_INVALID_ARG; | 115 | return DEBUGSERVER_E_INVALID_ARG; |
@@ -121,7 +121,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_free(debugserver_cli | |||
121 | return err; | 121 | return err; |
122 | } | 122 | } |
123 | 123 | ||
124 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send(debugserver_client_t client, const char* data, uint32_t size, uint32_t *sent) | 124 | debugserver_error_t debugserver_client_send(debugserver_client_t client, const char* data, uint32_t size, uint32_t *sent) |
125 | { | 125 | { |
126 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; | 126 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; |
127 | int bytes = 0; | 127 | int bytes = 0; |
@@ -142,7 +142,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send(debugserver_cli | |||
142 | return res; | 142 | return res; |
143 | } | 143 | } |
144 | 144 | ||
145 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 145 | debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
146 | { | 146 | { |
147 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; | 147 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; |
148 | int bytes = 0; | 148 | int bytes = 0; |
@@ -162,7 +162,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_with_timeout | |||
162 | return (bytes > 0) ? DEBUGSERVER_E_SUCCESS : res; | 162 | return (bytes > 0) ? DEBUGSERVER_E_SUCCESS : res; |
163 | } | 163 | } |
164 | 164 | ||
165 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive(debugserver_client_t client, char* data, uint32_t size, uint32_t *received) | 165 | debugserver_error_t debugserver_client_receive(debugserver_client_t client, char* data, uint32_t size, uint32_t *received) |
166 | { | 166 | { |
167 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; | 167 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; |
168 | do { | 168 | do { |
@@ -172,7 +172,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive(debugserver_ | |||
172 | return res; | 172 | return res; |
173 | } | 173 | } |
174 | 174 | ||
175 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command) | 175 | debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command) |
176 | { | 176 | { |
177 | int i; | 177 | int i; |
178 | debugserver_command_t tmp = (debugserver_command_t) malloc(sizeof(struct debugserver_command_private)); | 178 | debugserver_command_t tmp = (debugserver_command_t) malloc(sizeof(struct debugserver_command_private)); |
@@ -197,7 +197,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* nam | |||
197 | return DEBUGSERVER_E_SUCCESS; | 197 | return DEBUGSERVER_E_SUCCESS; |
198 | } | 198 | } |
199 | 199 | ||
200 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_free(debugserver_command_t command) | 200 | debugserver_error_t debugserver_command_free(debugserver_command_t command) |
201 | { | 201 | { |
202 | int i; | 202 | int i; |
203 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; | 203 | debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR; |
@@ -275,7 +275,7 @@ static int debugserver_response_is_checksum_valid(const char* response, uint32_t | |||
275 | return 1; | 275 | return 1; |
276 | } | 276 | } |
277 | 277 | ||
278 | LIBIMOBILEDEVICE_API void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32_t* encoded_length) | 278 | void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32_t* encoded_length) |
279 | { | 279 | { |
280 | uint32_t position; | 280 | uint32_t position; |
281 | uint32_t index; | 281 | uint32_t index; |
@@ -291,7 +291,7 @@ LIBIMOBILEDEVICE_API void debugserver_encode_string(const char* buffer, char** e | |||
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | LIBIMOBILEDEVICE_API void debugserver_decode_string(const char *encoded_buffer, size_t encoded_length, char** buffer) | 294 | void debugserver_decode_string(const char *encoded_buffer, size_t encoded_length, char** buffer) |
295 | { | 295 | { |
296 | *buffer = malloc(sizeof(char) * ((encoded_length / 2)+1)); | 296 | *buffer = malloc(sizeof(char) * ((encoded_length / 2)+1)); |
297 | char* t = *buffer; | 297 | char* t = *buffer; |
@@ -350,7 +350,7 @@ static debugserver_error_t debugserver_client_send_noack(debugserver_client_t cl | |||
350 | return debugserver_client_send(client, "-", sizeof(char), NULL); | 350 | return debugserver_client_send(client, "-", sizeof(char), NULL); |
351 | } | 351 | } |
352 | 352 | ||
353 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_ack_mode(debugserver_client_t client, int enabled) | 353 | debugserver_error_t debugserver_client_set_ack_mode(debugserver_client_t client, int enabled) |
354 | { | 354 | { |
355 | if (!client) | 355 | if (!client) |
356 | return DEBUGSERVER_E_INVALID_ARG; | 356 | return DEBUGSERVER_E_INVALID_ARG; |
@@ -362,7 +362,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_ack_mode(debugse | |||
362 | return DEBUGSERVER_E_SUCCESS; | 362 | return DEBUGSERVER_E_SUCCESS; |
363 | } | 363 | } |
364 | 364 | ||
365 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_receive_params(debugserver_client_t client, int (*cancel_receive)(), int receive_loop_timeout) | 365 | debugserver_error_t debugserver_client_set_receive_params(debugserver_client_t client, int (*cancel_receive)(), int receive_loop_timeout) |
366 | { | 366 | { |
367 | if (!client) | 367 | if (!client) |
368 | return DEBUGSERVER_E_INVALID_ARG; | 368 | return DEBUGSERVER_E_INVALID_ARG; |
@@ -392,7 +392,7 @@ static debugserver_error_t debugserver_client_receive_internal_char(debugserver_ | |||
392 | return res; | 392 | return res; |
393 | } | 393 | } |
394 | 394 | ||
395 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_response(debugserver_client_t client, char** response, size_t* response_size) | 395 | debugserver_error_t debugserver_client_receive_response(debugserver_client_t client, char** response, size_t* response_size) |
396 | { | 396 | { |
397 | debugserver_error_t res = DEBUGSERVER_E_SUCCESS; | 397 | debugserver_error_t res = DEBUGSERVER_E_SUCCESS; |
398 | 398 | ||
@@ -503,7 +503,7 @@ cleanup: | |||
503 | return res; | 503 | return res; |
504 | } | 504 | } |
505 | 505 | ||
506 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send_command(debugserver_client_t client, debugserver_command_t command, char** response, size_t* response_size) | 506 | debugserver_error_t debugserver_client_send_command(debugserver_client_t client, debugserver_command_t command, char** response, size_t* response_size) |
507 | { | 507 | { |
508 | debugserver_error_t res = DEBUGSERVER_E_SUCCESS; | 508 | debugserver_error_t res = DEBUGSERVER_E_SUCCESS; |
509 | int i; | 509 | int i; |
@@ -559,7 +559,7 @@ cleanup: | |||
559 | return res; | 559 | return res; |
560 | } | 560 | } |
561 | 561 | ||
562 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_client_t client, const char* env, char** response) | 562 | debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_client_t client, const char* env, char** response) |
563 | { | 563 | { |
564 | if (!client || !env) | 564 | if (!client || !env) |
565 | return DEBUGSERVER_E_INVALID_ARG; | 565 | return DEBUGSERVER_E_INVALID_ARG; |
@@ -578,7 +578,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_environment_hex_ | |||
578 | return result; | 578 | return result; |
579 | } | 579 | } |
580 | 580 | ||
581 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_argv(debugserver_client_t client, int argc, char* argv[], char** response) | 581 | debugserver_error_t debugserver_client_set_argv(debugserver_client_t client, int argc, char* argv[], char** response) |
582 | { | 582 | { |
583 | if (!client || !argc) | 583 | if (!client || !argc) |
584 | return DEBUGSERVER_E_INVALID_ARG; | 584 | return DEBUGSERVER_E_INVALID_ARG; |
diff --git a/src/debugserver.h b/src/debugserver.h index ee3ba62..ce9c255 100644 --- a/src/debugserver.h +++ b/src/debugserver.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef _DEBUGSERVER_H | 22 | #ifndef _DEBUGSERVER_H |
23 | #define _DEBUGSERVER_H | 23 | #define _DEBUGSERVER_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/debugserver.h" | 26 | #include "libimobiledevice/debugserver.h" |
26 | #include "service.h" | 27 | #include "service.h" |
27 | 28 | ||
diff --git a/src/device_link_service.h b/src/device_link_service.h index eae912a..0255b21 100644 --- a/src/device_link_service.h +++ b/src/device_link_service.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __DEVICE_LINK_SERVICE_H | 22 | #ifndef __DEVICE_LINK_SERVICE_H |
23 | #define __DEVICE_LINK_SERVICE_H | 23 | #define __DEVICE_LINK_SERVICE_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "property_list_service.h" | 26 | #include "property_list_service.h" |
26 | 27 | ||
27 | /* Error Codes */ | 28 | /* Error Codes */ |
diff --git a/src/diagnostics_relay.c b/src/diagnostics_relay.c index 5444fcc..6ee3150 100644 --- a/src/diagnostics_relay.c +++ b/src/diagnostics_relay.c | |||
@@ -73,7 +73,7 @@ static int diagnostics_relay_check_result(plist_t dict) | |||
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |
75 | 75 | ||
76 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client) | 76 | diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client) |
77 | { | 77 | { |
78 | if (!device || !service || service->port == 0 || !client || *client) { | 78 | if (!device || !service || service->port == 0 || !client || *client) { |
79 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 79 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -93,14 +93,14 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_new(idev | |||
93 | return DIAGNOSTICS_RELAY_E_SUCCESS; | 93 | return DIAGNOSTICS_RELAY_E_SUCCESS; |
94 | } | 94 | } |
95 | 95 | ||
96 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t * client, const char* label) | 96 | diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t * client, const char* label) |
97 | { | 97 | { |
98 | diagnostics_relay_error_t err = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 98 | diagnostics_relay_error_t err = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
99 | service_client_factory_start_service(device, DIAGNOSTICS_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(diagnostics_relay_client_new), &err); | 99 | service_client_factory_start_service(device, DIAGNOSTICS_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(diagnostics_relay_client_new), &err); |
100 | return err; | 100 | return err; |
101 | } | 101 | } |
102 | 102 | ||
103 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client) | 103 | diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client) |
104 | { | 104 | { |
105 | if (!client) | 105 | if (!client) |
106 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 106 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -167,7 +167,7 @@ static diagnostics_relay_error_t diagnostics_relay_send(diagnostics_relay_client | |||
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | 169 | ||
170 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client) | 170 | diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client) |
171 | { | 171 | { |
172 | if (!client) | 172 | if (!client) |
173 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 173 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -201,7 +201,7 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_goodbye(diagnos | |||
201 | return ret; | 201 | return ret; |
202 | } | 202 | } |
203 | 203 | ||
204 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client) | 204 | diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client) |
205 | { | 205 | { |
206 | if (!client) | 206 | if (!client) |
207 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 207 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -277,17 +277,17 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r | |||
277 | return ret; | 277 | return ret; |
278 | } | 278 | } |
279 | 279 | ||
280 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) | 280 | diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) |
281 | { | 281 | { |
282 | return internal_diagnostics_relay_action(client, "Restart", flags); | 282 | return internal_diagnostics_relay_action(client, "Restart", flags); |
283 | } | 283 | } |
284 | 284 | ||
285 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) | 285 | diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) |
286 | { | 286 | { |
287 | return internal_diagnostics_relay_action(client, "Shutdown", flags); | 287 | return internal_diagnostics_relay_action(client, "Shutdown", flags); |
288 | } | 288 | } |
289 | 289 | ||
290 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics) | 290 | diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics) |
291 | { | 291 | { |
292 | if (!client || diagnostics == NULL) | 292 | if (!client || diagnostics == NULL) |
293 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 293 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -331,7 +331,7 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_request_diagnos | |||
331 | return ret; | 331 | return ret; |
332 | } | 332 | } |
333 | 333 | ||
334 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result) | 334 | diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result) |
335 | { | 335 | { |
336 | if (!client || plist_get_node_type(keys) != PLIST_ARRAY || result == NULL) | 336 | if (!client || plist_get_node_type(keys) != PLIST_ARRAY || result == NULL) |
337 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 337 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -376,7 +376,7 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_mobileges | |||
376 | return ret; | 376 | return ret; |
377 | } | 377 | } |
378 | 378 | ||
379 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* entry_name, const char* entry_class, plist_t* result) | 379 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* entry_name, const char* entry_class, plist_t* result) |
380 | { | 380 | { |
381 | if (!client || (entry_name == NULL && entry_class == NULL) || result == NULL) | 381 | if (!client || (entry_name == NULL && entry_class == NULL) || result == NULL) |
382 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 382 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
@@ -424,7 +424,7 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistr | |||
424 | return ret; | 424 | return ret; |
425 | } | 425 | } |
426 | 426 | ||
427 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result) | 427 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result) |
428 | { | 428 | { |
429 | if (!client || plane == NULL || result == NULL) | 429 | if (!client || plane == NULL || result == NULL) |
430 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 430 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
diff --git a/src/diagnostics_relay.h b/src/diagnostics_relay.h index 6d11ea1..3bb543a 100644 --- a/src/diagnostics_relay.h +++ b/src/diagnostics_relay.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __DIAGNOSTICS_RELAY_H | 22 | #ifndef __DIAGNOSTICS_RELAY_H |
23 | #define __DIAGNOSTICS_RELAY_H | 23 | #define __DIAGNOSTICS_RELAY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/diagnostics_relay.h" | 26 | #include "libimobiledevice/diagnostics_relay.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/file_relay.c b/src/file_relay.c index aa77ae6..fbe7cbf 100644 --- a/src/file_relay.c +++ b/src/file_relay.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "property_list_service.h" | 28 | #include "property_list_service.h" |
29 | #include "common/debug.h" | 29 | #include "common/debug.h" |
30 | 30 | ||
31 | LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client) | 31 | file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client) |
32 | { | 32 | { |
33 | if (!device || !service || service->port == 0 || !client || *client) { | 33 | if (!device || !service || service->port == 0 || !client || *client) { |
34 | return FILE_RELAY_E_INVALID_ARG; | 34 | return FILE_RELAY_E_INVALID_ARG; |
@@ -48,14 +48,14 @@ LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_new(idevice_t device, | |||
48 | return FILE_RELAY_E_SUCCESS; | 48 | return FILE_RELAY_E_SUCCESS; |
49 | } | 49 | } |
50 | 50 | ||
51 | LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label) | 51 | file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label) |
52 | { | 52 | { |
53 | file_relay_error_t err = FILE_RELAY_E_UNKNOWN_ERROR; | 53 | file_relay_error_t err = FILE_RELAY_E_UNKNOWN_ERROR; |
54 | service_client_factory_start_service(device, FILE_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(file_relay_client_new), &err); | 54 | service_client_factory_start_service(device, FILE_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(file_relay_client_new), &err); |
55 | return err; | 55 | return err; |
56 | } | 56 | } |
57 | 57 | ||
58 | LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_free(file_relay_client_t client) | 58 | file_relay_error_t file_relay_client_free(file_relay_client_t client) |
59 | { | 59 | { |
60 | if (!client) | 60 | if (!client) |
61 | return FILE_RELAY_E_INVALID_ARG; | 61 | return FILE_RELAY_E_INVALID_ARG; |
@@ -67,7 +67,7 @@ LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_free(file_relay_client | |||
67 | return FILE_RELAY_E_SUCCESS; | 67 | return FILE_RELAY_E_SUCCESS; |
68 | } | 68 | } |
69 | 69 | ||
70 | LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout) | 70 | file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout) |
71 | { | 71 | { |
72 | if (!client || !client->parent || !sources || !sources[0]) { | 72 | if (!client || !client->parent || !sources || !sources[0]) { |
73 | return FILE_RELAY_E_INVALID_ARG; | 73 | return FILE_RELAY_E_INVALID_ARG; |
@@ -159,7 +159,7 @@ leave: | |||
159 | return err; | 159 | return err; |
160 | } | 160 | } |
161 | 161 | ||
162 | LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection) | 162 | file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection) |
163 | { | 163 | { |
164 | return file_relay_request_sources_timeout(client, sources, connection, 60000); | 164 | return file_relay_request_sources_timeout(client, sources, connection, 60000); |
165 | } | 165 | } |
diff --git a/src/file_relay.h b/src/file_relay.h index 626fab8..65bf460 100644 --- a/src/file_relay.h +++ b/src/file_relay.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __FILE_RELAY_H | 22 | #ifndef __FILE_RELAY_H |
23 | #define __FILE_RELAY_H | 23 | #define __FILE_RELAY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/file_relay.h" | 26 | #include "libimobiledevice/file_relay.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/heartbeat.c b/src/heartbeat.c index 9a527cc..3945d73 100644 --- a/src/heartbeat.c +++ b/src/heartbeat.c | |||
@@ -62,7 +62,7 @@ static heartbeat_error_t heartbeat_error(property_list_service_error_t err) | |||
62 | return HEARTBEAT_E_UNKNOWN_ERROR; | 62 | return HEARTBEAT_E_UNKNOWN_ERROR; |
63 | } | 63 | } |
64 | 64 | ||
65 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client) | 65 | heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client) |
66 | { | 66 | { |
67 | *client = NULL; | 67 | *client = NULL; |
68 | 68 | ||
@@ -89,14 +89,14 @@ LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_new(idevice_t device, lo | |||
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
91 | 91 | ||
92 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label) | 92 | heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label) |
93 | { | 93 | { |
94 | heartbeat_error_t err = HEARTBEAT_E_UNKNOWN_ERROR; | 94 | heartbeat_error_t err = HEARTBEAT_E_UNKNOWN_ERROR; |
95 | service_client_factory_start_service(device, HEARTBEAT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(heartbeat_client_new), &err); | 95 | service_client_factory_start_service(device, HEARTBEAT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(heartbeat_client_new), &err); |
96 | return err; | 96 | return err; |
97 | } | 97 | } |
98 | 98 | ||
99 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_free(heartbeat_client_t client) | 99 | heartbeat_error_t heartbeat_client_free(heartbeat_client_t client) |
100 | { | 100 | { |
101 | if (!client) | 101 | if (!client) |
102 | return HEARTBEAT_E_INVALID_ARG; | 102 | return HEARTBEAT_E_INVALID_ARG; |
@@ -107,7 +107,7 @@ LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_free(heartbeat_client_t | |||
107 | return err; | 107 | return err; |
108 | } | 108 | } |
109 | 109 | ||
110 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist) | 110 | heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist) |
111 | { | 111 | { |
112 | heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR; | 112 | heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR; |
113 | 113 | ||
@@ -122,12 +122,12 @@ LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_send(heartbeat_client_t client, | |||
122 | return res; | 122 | return res; |
123 | } | 123 | } |
124 | 124 | ||
125 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist) | 125 | heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist) |
126 | { | 126 | { |
127 | return heartbeat_receive_with_timeout(client, plist, 1000); | 127 | return heartbeat_receive_with_timeout(client, plist, 1000); |
128 | } | 128 | } |
129 | 129 | ||
130 | LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms) | 130 | heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms) |
131 | { | 131 | { |
132 | heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR; | 132 | heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR; |
133 | plist_t outplist = NULL; | 133 | plist_t outplist = NULL; |
diff --git a/src/heartbeat.h b/src/heartbeat.h index f648681..379ecc1 100644 --- a/src/heartbeat.h +++ b/src/heartbeat.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __HEARTBEAT_H | 22 | #ifndef __HEARTBEAT_H |
23 | #define __HEARTBEAT_H | 23 | #define __HEARTBEAT_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/heartbeat.h" | 26 | #include "libimobiledevice/heartbeat.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/house_arrest.c b/src/house_arrest.c index ac92130..caad731 100644 --- a/src/house_arrest.c +++ b/src/house_arrest.c | |||
@@ -58,7 +58,7 @@ static house_arrest_error_t house_arrest_error(property_list_service_error_t err | |||
58 | return HOUSE_ARREST_E_UNKNOWN_ERROR; | 58 | return HOUSE_ARREST_E_UNKNOWN_ERROR; |
59 | } | 59 | } |
60 | 60 | ||
61 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service_descriptor_t service, house_arrest_client_t *client) | 61 | house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service_descriptor_t service, house_arrest_client_t *client) |
62 | { | 62 | { |
63 | property_list_service_client_t plistclient = NULL; | 63 | property_list_service_client_t plistclient = NULL; |
64 | house_arrest_error_t err = house_arrest_error(property_list_service_client_new(device, service, &plistclient)); | 64 | house_arrest_error_t err = house_arrest_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -74,14 +74,14 @@ LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_new(idevice_t devi | |||
74 | return HOUSE_ARREST_E_SUCCESS; | 74 | return HOUSE_ARREST_E_SUCCESS; |
75 | } | 75 | } |
76 | 76 | ||
77 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_start_service(idevice_t device, house_arrest_client_t * client, const char* label) | 77 | house_arrest_error_t house_arrest_client_start_service(idevice_t device, house_arrest_client_t * client, const char* label) |
78 | { | 78 | { |
79 | house_arrest_error_t err = HOUSE_ARREST_E_UNKNOWN_ERROR; | 79 | house_arrest_error_t err = HOUSE_ARREST_E_UNKNOWN_ERROR; |
80 | service_client_factory_start_service(device, HOUSE_ARREST_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(house_arrest_client_new), &err); | 80 | service_client_factory_start_service(device, HOUSE_ARREST_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(house_arrest_client_new), &err); |
81 | return err; | 81 | return err; |
82 | } | 82 | } |
83 | 83 | ||
84 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_free(house_arrest_client_t client) | 84 | house_arrest_error_t house_arrest_client_free(house_arrest_client_t client) |
85 | { | 85 | { |
86 | if (!client) | 86 | if (!client) |
87 | return HOUSE_ARREST_E_INVALID_ARG; | 87 | return HOUSE_ARREST_E_INVALID_ARG; |
@@ -96,7 +96,7 @@ LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_free(house_arrest_ | |||
96 | return err; | 96 | return err; |
97 | } | 97 | } |
98 | 98 | ||
99 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, plist_t dict) | 99 | house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, plist_t dict) |
100 | { | 100 | { |
101 | if (!client || !client->parent || !dict) | 101 | if (!client || !client->parent || !dict) |
102 | return HOUSE_ARREST_E_INVALID_ARG; | 102 | return HOUSE_ARREST_E_INVALID_ARG; |
@@ -112,7 +112,7 @@ LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_request(house_arrest | |||
112 | return res; | 112 | return res; |
113 | } | 113 | } |
114 | 114 | ||
115 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, const char *command, const char *appid) | 115 | house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, const char *command, const char *appid) |
116 | { | 116 | { |
117 | if (!client || !client->parent || !command || !appid) | 117 | if (!client || !client->parent || !command || !appid) |
118 | return HOUSE_ARREST_E_INVALID_ARG; | 118 | return HOUSE_ARREST_E_INVALID_ARG; |
@@ -132,7 +132,7 @@ LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_command(house_arrest | |||
132 | return res; | 132 | return res; |
133 | } | 133 | } |
134 | 134 | ||
135 | LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist_t *dict) | 135 | house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist_t *dict) |
136 | { | 136 | { |
137 | if (!client || !client->parent) | 137 | if (!client || !client->parent) |
138 | return HOUSE_ARREST_E_INVALID_ARG; | 138 | return HOUSE_ARREST_E_INVALID_ARG; |
@@ -150,7 +150,7 @@ LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_get_result(house_arrest_c | |||
150 | return res; | 150 | return res; |
151 | } | 151 | } |
152 | 152 | ||
153 | LIBIMOBILEDEVICE_API afc_error_t afc_client_new_from_house_arrest_client(house_arrest_client_t client, afc_client_t *afc_client) | 153 | afc_error_t afc_client_new_from_house_arrest_client(house_arrest_client_t client, afc_client_t *afc_client) |
154 | { | 154 | { |
155 | if (!client || !client->parent || (client->mode == HOUSE_ARREST_CLIENT_MODE_AFC)) { | 155 | if (!client || !client->parent || (client->mode == HOUSE_ARREST_CLIENT_MODE_AFC)) { |
156 | return AFC_E_INVALID_ARG; | 156 | return AFC_E_INVALID_ARG; |
diff --git a/src/house_arrest.h b/src/house_arrest.h index 387594f..5612a29 100644 --- a/src/house_arrest.h +++ b/src/house_arrest.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __HOUSE_ARREST_H | 22 | #ifndef __HOUSE_ARREST_H |
23 | #define __HOUSE_ARREST_H | 23 | #define __HOUSE_ARREST_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/house_arrest.h" | 26 | #include "libimobiledevice/house_arrest.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/idevice.c b/src/idevice.c index 19b171c..ed1cf3c 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
@@ -248,7 +248,7 @@ static void usbmux_event_cb(const usbmuxd_event_t *event, void *user_data) | |||
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | LIBIMOBILEDEVICE_API idevice_error_t idevice_events_subscribe(idevice_subscription_context_t *context, idevice_event_cb_t callback, void *user_data) | 251 | idevice_error_t idevice_events_subscribe(idevice_subscription_context_t *context, idevice_event_cb_t callback, void *user_data) |
252 | { | 252 | { |
253 | if (!context || !callback) { | 253 | if (!context || !callback) { |
254 | return IDEVICE_E_INVALID_ARG; | 254 | return IDEVICE_E_INVALID_ARG; |
@@ -270,7 +270,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_events_subscribe(idevice_subscripti | |||
270 | return IDEVICE_E_SUCCESS; | 270 | return IDEVICE_E_SUCCESS; |
271 | } | 271 | } |
272 | 272 | ||
273 | LIBIMOBILEDEVICE_API idevice_error_t idevice_events_unsubscribe(idevice_subscription_context_t context) | 273 | idevice_error_t idevice_events_unsubscribe(idevice_subscription_context_t context) |
274 | { | 274 | { |
275 | if (!context) { | 275 | if (!context) { |
276 | return IDEVICE_E_INVALID_ARG; | 276 | return IDEVICE_E_INVALID_ARG; |
@@ -287,7 +287,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_events_unsubscribe(idevice_subscrip | |||
287 | return IDEVICE_E_SUCCESS; | 287 | return IDEVICE_E_SUCCESS; |
288 | } | 288 | } |
289 | 289 | ||
290 | LIBIMOBILEDEVICE_API idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data) | 290 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data) |
291 | { | 291 | { |
292 | if (event_ctx) { | 292 | if (event_ctx) { |
293 | idevice_events_unsubscribe(event_ctx); | 293 | idevice_events_unsubscribe(event_ctx); |
@@ -295,7 +295,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_event_subscribe(idevice_event_cb_t | |||
295 | return idevice_events_subscribe(&event_ctx, callback, user_data); | 295 | return idevice_events_subscribe(&event_ctx, callback, user_data); |
296 | } | 296 | } |
297 | 297 | ||
298 | LIBIMOBILEDEVICE_API idevice_error_t idevice_event_unsubscribe(void) | 298 | idevice_error_t idevice_event_unsubscribe(void) |
299 | { | 299 | { |
300 | if (!event_ctx) { | 300 | if (!event_ctx) { |
301 | return IDEVICE_E_SUCCESS; | 301 | return IDEVICE_E_SUCCESS; |
@@ -304,7 +304,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_event_unsubscribe(void) | |||
304 | return idevice_events_unsubscribe(event_ctx); | 304 | return idevice_events_unsubscribe(event_ctx); |
305 | } | 305 | } |
306 | 306 | ||
307 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list_extended(idevice_info_t **devices, int *count) | 307 | idevice_error_t idevice_get_device_list_extended(idevice_info_t **devices, int *count) |
308 | { | 308 | { |
309 | usbmuxd_device_info_t *dev_list; | 309 | usbmuxd_device_info_t *dev_list; |
310 | 310 | ||
@@ -359,7 +359,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list_extended(idevice_in | |||
359 | return IDEVICE_E_SUCCESS; | 359 | return IDEVICE_E_SUCCESS; |
360 | } | 360 | } |
361 | 361 | ||
362 | LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_extended_free(idevice_info_t *devices) | 362 | idevice_error_t idevice_device_list_extended_free(idevice_info_t *devices) |
363 | { | 363 | { |
364 | if (devices) { | 364 | if (devices) { |
365 | int i = 0; | 365 | int i = 0; |
@@ -374,7 +374,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_extended_free(idevice_i | |||
374 | return IDEVICE_E_SUCCESS; | 374 | return IDEVICE_E_SUCCESS; |
375 | } | 375 | } |
376 | 376 | ||
377 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list(char ***devices, int *count) | 377 | idevice_error_t idevice_get_device_list(char ***devices, int *count) |
378 | { | 378 | { |
379 | usbmuxd_device_info_t *dev_list; | 379 | usbmuxd_device_info_t *dev_list; |
380 | 380 | ||
@@ -406,7 +406,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list(char ***devices, in | |||
406 | return IDEVICE_E_SUCCESS; | 406 | return IDEVICE_E_SUCCESS; |
407 | } | 407 | } |
408 | 408 | ||
409 | LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_free(char **devices) | 409 | idevice_error_t idevice_device_list_free(char **devices) |
410 | { | 410 | { |
411 | if (devices) { | 411 | if (devices) { |
412 | int i = 0; | 412 | int i = 0; |
@@ -419,7 +419,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_free(char **devices) | |||
419 | return IDEVICE_E_SUCCESS; | 419 | return IDEVICE_E_SUCCESS; |
420 | } | 420 | } |
421 | 421 | ||
422 | LIBIMOBILEDEVICE_API void idevice_set_debug_level(int level) | 422 | void idevice_set_debug_level(int level) |
423 | { | 423 | { |
424 | internal_set_debug_level(level); | 424 | internal_set_debug_level(level); |
425 | } | 425 | } |
@@ -472,7 +472,7 @@ static idevice_t idevice_from_mux_device(usbmuxd_device_info_t *muxdev) | |||
472 | return device; | 472 | return device; |
473 | } | 473 | } |
474 | 474 | ||
475 | LIBIMOBILEDEVICE_API idevice_error_t idevice_new_with_options(idevice_t * device, const char *udid, enum idevice_options options) | 475 | idevice_error_t idevice_new_with_options(idevice_t * device, const char *udid, enum idevice_options options) |
476 | { | 476 | { |
477 | usbmuxd_device_info_t muxdev; | 477 | usbmuxd_device_info_t muxdev; |
478 | int usbmux_options = 0; | 478 | int usbmux_options = 0; |
@@ -496,12 +496,12 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_new_with_options(idevice_t * device | |||
496 | return IDEVICE_E_NO_DEVICE; | 496 | return IDEVICE_E_NO_DEVICE; |
497 | } | 497 | } |
498 | 498 | ||
499 | LIBIMOBILEDEVICE_API idevice_error_t idevice_new(idevice_t * device, const char *udid) | 499 | idevice_error_t idevice_new(idevice_t * device, const char *udid) |
500 | { | 500 | { |
501 | return idevice_new_with_options(device, udid, 0); | 501 | return idevice_new_with_options(device, udid, 0); |
502 | } | 502 | } |
503 | 503 | ||
504 | LIBIMOBILEDEVICE_API idevice_error_t idevice_free(idevice_t device) | 504 | idevice_error_t idevice_free(idevice_t device) |
505 | { | 505 | { |
506 | if (!device) | 506 | if (!device) |
507 | return IDEVICE_E_INVALID_ARG; | 507 | return IDEVICE_E_INVALID_ARG; |
@@ -518,7 +518,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_free(idevice_t device) | |||
518 | return ret; | 518 | return ret; |
519 | } | 519 | } |
520 | 520 | ||
521 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) | 521 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) |
522 | { | 522 | { |
523 | if (!device) { | 523 | if (!device) { |
524 | return IDEVICE_E_INVALID_ARG; | 524 | return IDEVICE_E_INVALID_ARG; |
@@ -599,7 +599,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t | |||
599 | return IDEVICE_E_UNKNOWN_ERROR; | 599 | return IDEVICE_E_UNKNOWN_ERROR; |
600 | } | 600 | } |
601 | 601 | ||
602 | LIBIMOBILEDEVICE_API idevice_error_t idevice_disconnect(idevice_connection_t connection) | 602 | idevice_error_t idevice_disconnect(idevice_connection_t connection) |
603 | { | 603 | { |
604 | if (!connection) { | 604 | if (!connection) { |
605 | return IDEVICE_E_INVALID_ARG; | 605 | return IDEVICE_E_INVALID_ARG; |
@@ -662,7 +662,7 @@ static idevice_error_t internal_connection_send(idevice_connection_t connection, | |||
662 | 662 | ||
663 | } | 663 | } |
664 | 664 | ||
665 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes) | 665 | idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes) |
666 | { | 666 | { |
667 | if (!connection || !data | 667 | if (!connection || !data |
668 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) | 668 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) |
@@ -777,7 +777,7 @@ static idevice_error_t internal_connection_receive_timeout(idevice_connection_t | |||
777 | return IDEVICE_E_UNKNOWN_ERROR; | 777 | return IDEVICE_E_UNKNOWN_ERROR; |
778 | } | 778 | } |
779 | 779 | ||
780 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout) | 780 | idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout) |
781 | { | 781 | { |
782 | if (!connection | 782 | if (!connection |
783 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) | 783 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) |
@@ -876,7 +876,7 @@ static idevice_error_t internal_connection_receive(idevice_connection_t connecti | |||
876 | return IDEVICE_E_UNKNOWN_ERROR; | 876 | return IDEVICE_E_UNKNOWN_ERROR; |
877 | } | 877 | } |
878 | 878 | ||
879 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes) | 879 | idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes) |
880 | { | 880 | { |
881 | if (!connection | 881 | if (!connection |
882 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) | 882 | #if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) |
@@ -909,7 +909,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive(idevice_connecti | |||
909 | return internal_connection_receive(connection, data, len, recv_bytes); | 909 | return internal_connection_receive(connection, data, len, recv_bytes); |
910 | } | 910 | } |
911 | 911 | ||
912 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_get_fd(idevice_connection_t connection, int *fd) | 912 | idevice_error_t idevice_connection_get_fd(idevice_connection_t connection, int *fd) |
913 | { | 913 | { |
914 | if (!connection || !fd) { | 914 | if (!connection || !fd) { |
915 | return IDEVICE_E_INVALID_ARG; | 915 | return IDEVICE_E_INVALID_ARG; |
@@ -928,7 +928,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_get_fd(idevice_connectio | |||
928 | return IDEVICE_E_UNKNOWN_ERROR; | 928 | return IDEVICE_E_UNKNOWN_ERROR; |
929 | } | 929 | } |
930 | 930 | ||
931 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) | 931 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) |
932 | { | 932 | { |
933 | if (!device || !handle) | 933 | if (!device || !handle) |
934 | return IDEVICE_E_INVALID_ARG; | 934 | return IDEVICE_E_INVALID_ARG; |
@@ -937,7 +937,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_get_handle(idevice_t device, uint32 | |||
937 | return IDEVICE_E_SUCCESS; | 937 | return IDEVICE_E_SUCCESS; |
938 | } | 938 | } |
939 | 939 | ||
940 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_udid(idevice_t device, char **udid) | 940 | idevice_error_t idevice_get_udid(idevice_t device, char **udid) |
941 | { | 941 | { |
942 | if (!device || !udid) | 942 | if (!device || !udid) |
943 | return IDEVICE_E_INVALID_ARG; | 943 | return IDEVICE_E_INVALID_ARG; |
@@ -1186,7 +1186,7 @@ static int _mbedtls_f_rng(void* p_rng, unsigned char* buf, size_t len) | |||
1186 | } | 1186 | } |
1187 | #endif | 1187 | #endif |
1188 | 1188 | ||
1189 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) | 1189 | idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) |
1190 | { | 1190 | { |
1191 | if (!connection || connection->ssl_data) | 1191 | if (!connection || connection->ssl_data) |
1192 | return IDEVICE_E_INVALID_ARG; | 1192 | return IDEVICE_E_INVALID_ARG; |
@@ -1489,12 +1489,12 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_conne | |||
1489 | return ret; | 1489 | return ret; |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection) | 1492 | idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection) |
1493 | { | 1493 | { |
1494 | return idevice_connection_disable_bypass_ssl(connection, 0); | 1494 | return idevice_connection_disable_bypass_ssl(connection, 0); |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_bypass_ssl(idevice_connection_t connection, uint8_t sslBypass) | 1497 | idevice_error_t idevice_connection_disable_bypass_ssl(idevice_connection_t connection, uint8_t sslBypass) |
1498 | { | 1498 | { |
1499 | if (!connection) | 1499 | if (!connection) |
1500 | return IDEVICE_E_INVALID_ARG; | 1500 | return IDEVICE_E_INVALID_ARG; |
diff --git a/src/idevice.h b/src/idevice.h index 2509e48..dd72f9d 100644 --- a/src/idevice.h +++ b/src/idevice.h | |||
@@ -37,14 +37,16 @@ | |||
37 | #include <mbedtls/ctr_drbg.h> | 37 | #include <mbedtls/ctr_drbg.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #ifdef WIN32 | 40 | #ifdef LIBIMOBILEDEVICE_STATIC |
41 | #define LIBIMOBILEDEVICE_API __declspec( dllexport ) | 41 | #define LIBIMOBILEDEVICE_API |
42 | #elif defined(_WIN32) | ||
43 | #define LIBIMOBILEDEVICE_API __declspec( dllexport ) | ||
42 | #else | 44 | #else |
43 | #ifdef HAVE_FVISIBILITY | 45 | #if __GNUC__ >= 4 |
44 | #define LIBIMOBILEDEVICE_API __attribute__((visibility("default"))) | 46 | #define LIBIMOBILEDEVICE_API __attribute__((visibility("default"))) |
45 | #else | 47 | #else |
46 | #define LIBIMOBILEDEVICE_API | 48 | #define LIBIMOBILEDEVICE_API |
47 | #endif | 49 | #endif |
48 | #endif | 50 | #endif |
49 | 51 | ||
50 | #include "common/userpref.h" | 52 | #include "common/userpref.h" |
diff --git a/src/installation_proxy.c b/src/installation_proxy.c index 9602876..ec19da0 100644 --- a/src/installation_proxy.c +++ b/src/installation_proxy.c | |||
@@ -232,7 +232,7 @@ static instproxy_error_t instproxy_error(property_list_service_error_t err) | |||
232 | return INSTPROXY_E_UNKNOWN_ERROR; | 232 | return INSTPROXY_E_UNKNOWN_ERROR; |
233 | } | 233 | } |
234 | 234 | ||
235 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, instproxy_client_t *client) | 235 | instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, instproxy_client_t *client) |
236 | { | 236 | { |
237 | property_list_service_client_t plistclient = NULL; | 237 | property_list_service_client_t plistclient = NULL; |
238 | instproxy_error_t err = instproxy_error(property_list_service_client_new(device, service, &plistclient)); | 238 | instproxy_error_t err = instproxy_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -249,14 +249,14 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_new(idevice_t device, lo | |||
249 | return INSTPROXY_E_SUCCESS; | 249 | return INSTPROXY_E_SUCCESS; |
250 | } | 250 | } |
251 | 251 | ||
252 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_start_service(idevice_t device, instproxy_client_t * client, const char* label) | 252 | instproxy_error_t instproxy_client_start_service(idevice_t device, instproxy_client_t * client, const char* label) |
253 | { | 253 | { |
254 | instproxy_error_t err = INSTPROXY_E_UNKNOWN_ERROR; | 254 | instproxy_error_t err = INSTPROXY_E_UNKNOWN_ERROR; |
255 | service_client_factory_start_service(device, INSTPROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(instproxy_client_new), &err); | 255 | service_client_factory_start_service(device, INSTPROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(instproxy_client_new), &err); |
256 | return err; | 256 | return err; |
257 | } | 257 | } |
258 | 258 | ||
259 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_free(instproxy_client_t client) | 259 | instproxy_error_t instproxy_client_free(instproxy_client_t client) |
260 | { | 260 | { |
261 | if (!client) | 261 | if (!client) |
262 | return INSTPROXY_E_INVALID_ARG; | 262 | return INSTPROXY_E_INVALID_ARG; |
@@ -525,7 +525,7 @@ static instproxy_error_t instproxy_perform_command(instproxy_client_t client, pl | |||
525 | return res; | 525 | return res; |
526 | } | 526 | } |
527 | 527 | ||
528 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_browse_with_callback(instproxy_client_t client, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 528 | instproxy_error_t instproxy_browse_with_callback(instproxy_client_t client, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
529 | { | 529 | { |
530 | if (!client || !client->parent || !status_cb) | 530 | if (!client || !client->parent || !status_cb) |
531 | return INSTPROXY_E_INVALID_ARG; | 531 | return INSTPROXY_E_INVALID_ARG; |
@@ -566,7 +566,7 @@ static void instproxy_append_current_list_to_result_cb(plist_t command, plist_t | |||
566 | plist_free(current_list); | 566 | plist_free(current_list); |
567 | } | 567 | } |
568 | 568 | ||
569 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result) | 569 | instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result) |
570 | { | 570 | { |
571 | if (!client || !client->parent || !result) | 571 | if (!client || !client->parent || !result) |
572 | return INSTPROXY_E_INVALID_ARG; | 572 | return INSTPROXY_E_INVALID_ARG; |
@@ -603,7 +603,7 @@ static void instproxy_copy_lookup_result_cb(plist_t command, plist_t status, voi | |||
603 | } | 603 | } |
604 | } | 604 | } |
605 | 605 | ||
606 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_lookup(instproxy_client_t client, const char** appids, plist_t client_options, plist_t *result) | 606 | instproxy_error_t instproxy_lookup(instproxy_client_t client, const char** appids, plist_t client_options, plist_t *result) |
607 | { | 607 | { |
608 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 608 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
609 | int i = 0; | 609 | int i = 0; |
@@ -650,7 +650,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_lookup(instproxy_client_t clien | |||
650 | return res; | 650 | return res; |
651 | } | 651 | } |
652 | 652 | ||
653 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_install(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 653 | instproxy_error_t instproxy_install(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
654 | { | 654 | { |
655 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 655 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
656 | 656 | ||
@@ -667,7 +667,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_install(instproxy_client_t clie | |||
667 | return res; | 667 | return res; |
668 | } | 668 | } |
669 | 669 | ||
670 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_upgrade(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 670 | instproxy_error_t instproxy_upgrade(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
671 | { | 671 | { |
672 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 672 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
673 | 673 | ||
@@ -684,7 +684,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_upgrade(instproxy_client_t clie | |||
684 | return res; | 684 | return res; |
685 | } | 685 | } |
686 | 686 | ||
687 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_uninstall(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 687 | instproxy_error_t instproxy_uninstall(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
688 | { | 688 | { |
689 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 689 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
690 | 690 | ||
@@ -701,7 +701,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_uninstall(instproxy_client_t cl | |||
701 | return res; | 701 | return res; |
702 | } | 702 | } |
703 | 703 | ||
704 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_lookup_archives(instproxy_client_t client, plist_t client_options, plist_t *result) | 704 | instproxy_error_t instproxy_lookup_archives(instproxy_client_t client, plist_t client_options, plist_t *result) |
705 | { | 705 | { |
706 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 706 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
707 | 707 | ||
@@ -717,7 +717,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_lookup_archives(instproxy_clien | |||
717 | return res; | 717 | return res; |
718 | } | 718 | } |
719 | 719 | ||
720 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 720 | instproxy_error_t instproxy_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
721 | { | 721 | { |
722 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 722 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
723 | 723 | ||
@@ -734,7 +734,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_archive(instproxy_client_t clie | |||
734 | return res; | 734 | return res; |
735 | } | 735 | } |
736 | 736 | ||
737 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 737 | instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
738 | { | 738 | { |
739 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 739 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
740 | 740 | ||
@@ -751,7 +751,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_restore(instproxy_client_t clie | |||
751 | return res; | 751 | return res; |
752 | } | 752 | } |
753 | 753 | ||
754 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) | 754 | instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) |
755 | { | 755 | { |
756 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 756 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
757 | 757 | ||
@@ -768,7 +768,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_remove_archive(instproxy_client | |||
768 | return res; | 768 | return res; |
769 | } | 769 | } |
770 | 770 | ||
771 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result) | 771 | instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result) |
772 | { | 772 | { |
773 | if (!client || !capabilities || !result) | 773 | if (!client || !capabilities || !result) |
774 | return INSTPROXY_E_INVALID_ARG; | 774 | return INSTPROXY_E_INVALID_ARG; |
@@ -805,7 +805,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instpr | |||
805 | return res; | 805 | return res; |
806 | } | 806 | } |
807 | 807 | ||
808 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_status_get_error(plist_t status, char **name, char** description, uint64_t* code) | 808 | instproxy_error_t instproxy_status_get_error(plist_t status, char **name, char** description, uint64_t* code) |
809 | { | 809 | { |
810 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; | 810 | instproxy_error_t res = INSTPROXY_E_UNKNOWN_ERROR; |
811 | 811 | ||
@@ -843,7 +843,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_status_get_error(plist_t status | |||
843 | return res; | 843 | return res; |
844 | } | 844 | } |
845 | 845 | ||
846 | LIBIMOBILEDEVICE_API void instproxy_status_get_name(plist_t status, char **name) | 846 | void instproxy_status_get_name(plist_t status, char **name) |
847 | { | 847 | { |
848 | if (name) { | 848 | if (name) { |
849 | plist_t node = plist_dict_get_item(status, "Status"); | 849 | plist_t node = plist_dict_get_item(status, "Status"); |
@@ -855,7 +855,7 @@ LIBIMOBILEDEVICE_API void instproxy_status_get_name(plist_t status, char **name) | |||
855 | } | 855 | } |
856 | } | 856 | } |
857 | 857 | ||
858 | LIBIMOBILEDEVICE_API void instproxy_status_get_percent_complete(plist_t status, int *percent) | 858 | void instproxy_status_get_percent_complete(plist_t status, int *percent) |
859 | { | 859 | { |
860 | uint64_t val = 0; | 860 | uint64_t val = 0; |
861 | if (percent) { | 861 | if (percent) { |
@@ -867,7 +867,7 @@ LIBIMOBILEDEVICE_API void instproxy_status_get_percent_complete(plist_t status, | |||
867 | } | 867 | } |
868 | } | 868 | } |
869 | 869 | ||
870 | LIBIMOBILEDEVICE_API void instproxy_status_get_current_list(plist_t status, uint64_t* total, uint64_t* current_index, uint64_t* current_amount, plist_t* list) | 870 | void instproxy_status_get_current_list(plist_t status, uint64_t* total, uint64_t* current_index, uint64_t* current_amount, plist_t* list) |
871 | { | 871 | { |
872 | plist_t node = NULL; | 872 | plist_t node = NULL; |
873 | 873 | ||
@@ -904,7 +904,7 @@ LIBIMOBILEDEVICE_API void instproxy_status_get_current_list(plist_t status, uint | |||
904 | } | 904 | } |
905 | } | 905 | } |
906 | 906 | ||
907 | LIBIMOBILEDEVICE_API void instproxy_command_get_name(plist_t command, char** name) | 907 | void instproxy_command_get_name(plist_t command, char** name) |
908 | { | 908 | { |
909 | if (name) { | 909 | if (name) { |
910 | plist_t node = plist_dict_get_item(command, "Command"); | 910 | plist_t node = plist_dict_get_item(command, "Command"); |
@@ -916,12 +916,12 @@ LIBIMOBILEDEVICE_API void instproxy_command_get_name(plist_t command, char** nam | |||
916 | } | 916 | } |
917 | } | 917 | } |
918 | 918 | ||
919 | LIBIMOBILEDEVICE_API plist_t instproxy_client_options_new(void) | 919 | plist_t instproxy_client_options_new(void) |
920 | { | 920 | { |
921 | return plist_new_dict(); | 921 | return plist_new_dict(); |
922 | } | 922 | } |
923 | 923 | ||
924 | LIBIMOBILEDEVICE_API void instproxy_client_options_add(plist_t client_options, ...) | 924 | void instproxy_client_options_add(plist_t client_options, ...) |
925 | { | 925 | { |
926 | if (!client_options) | 926 | if (!client_options) |
927 | return; | 927 | return; |
@@ -955,7 +955,7 @@ LIBIMOBILEDEVICE_API void instproxy_client_options_add(plist_t client_options, . | |||
955 | va_end(args); | 955 | va_end(args); |
956 | } | 956 | } |
957 | 957 | ||
958 | LIBIMOBILEDEVICE_API void instproxy_client_options_set_return_attributes(plist_t client_options, ...) | 958 | void instproxy_client_options_set_return_attributes(plist_t client_options, ...) |
959 | { | 959 | { |
960 | if (!client_options) | 960 | if (!client_options) |
961 | return; | 961 | return; |
@@ -976,14 +976,14 @@ LIBIMOBILEDEVICE_API void instproxy_client_options_set_return_attributes(plist_t | |||
976 | plist_dict_set_item(client_options, "ReturnAttributes", return_attributes); | 976 | plist_dict_set_item(client_options, "ReturnAttributes", return_attributes); |
977 | } | 977 | } |
978 | 978 | ||
979 | LIBIMOBILEDEVICE_API void instproxy_client_options_free(plist_t client_options) | 979 | void instproxy_client_options_free(plist_t client_options) |
980 | { | 980 | { |
981 | if (client_options) { | 981 | if (client_options) { |
982 | plist_free(client_options); | 982 | plist_free(client_options); |
983 | } | 983 | } |
984 | } | 984 | } |
985 | 985 | ||
986 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* bundle_id, char** path) | 986 | instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* bundle_id, char** path) |
987 | { | 987 | { |
988 | if (!client || !client->parent || !bundle_id) | 988 | if (!client || !client->parent || !bundle_id) |
989 | return INSTPROXY_E_INVALID_ARG; | 989 | return INSTPROXY_E_INVALID_ARG; |
diff --git a/src/installation_proxy.h b/src/installation_proxy.h index 033bdef..5bdbb71 100644 --- a/src/installation_proxy.h +++ b/src/installation_proxy.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #ifndef __INSTALLATION_PROXY_H | 23 | #ifndef __INSTALLATION_PROXY_H |
24 | #define __INSTALLATION_PROXY_H | 24 | #define __INSTALLATION_PROXY_H |
25 | 25 | ||
26 | #include "idevice.h" | ||
26 | #include "libimobiledevice/installation_proxy.h" | 27 | #include "libimobiledevice/installation_proxy.h" |
27 | #include "property_list_service.h" | 28 | #include "property_list_service.h" |
28 | #include <libimobiledevice-glue/thread.h> | 29 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c index e527652..1afc2c5 100644 --- a/src/lockdown-cu.c +++ b/src/lockdown-cu.c | |||
@@ -490,7 +490,7 @@ static void chacha20_poly1305_decrypt_64(unsigned char* key, unsigned char* nonc | |||
490 | 490 | ||
491 | #endif /* HAVE_WIRELESS_PAIRING */ | 491 | #endif /* HAVE_WIRELESS_PAIRING */ |
492 | 492 | ||
493 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_client_t client, lockdownd_cu_pairing_cb_t pairing_callback, void* cb_user_data, plist_t host_info, plist_t acl) | 493 | lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_client_t client, lockdownd_cu_pairing_cb_t pairing_callback, void* cb_user_data, plist_t host_info, plist_t acl) |
494 | { | 494 | { |
495 | #ifdef HAVE_WIRELESS_PAIRING | 495 | #ifdef HAVE_WIRELESS_PAIRING |
496 | if (!client || !pairing_callback || (host_info && plist_get_node_type(host_info) != PLIST_DICT) || (acl && plist_get_node_type(acl) != PLIST_DICT)) | 496 | if (!client || !pairing_callback || (host_info && plist_get_node_type(host_info) != PLIST_DICT) || (acl && plist_get_node_type(acl) != PLIST_DICT)) |
@@ -932,7 +932,7 @@ debug_buffer(data, data_len); | |||
932 | #endif | 932 | #endif |
933 | } | 933 | } |
934 | 934 | ||
935 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t client, const char* request, plist_t request_payload, plist_t* reply) | 935 | lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t client, const char* request, plist_t request_payload, plist_t* reply) |
936 | { | 936 | { |
937 | #ifdef HAVE_WIRELESS_PAIRING | 937 | #ifdef HAVE_WIRELESS_PAIRING |
938 | if (!client || !request) | 938 | if (!client || !request) |
@@ -1057,7 +1057,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_send_request_and_get_reply(l | |||
1057 | #endif | 1057 | #endif |
1058 | } | 1058 | } |
1059 | 1059 | ||
1060 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t client, const char* domain, const char* key, plist_t* value) | 1060 | lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t client, const char* domain, const char* key, plist_t* value) |
1061 | { | 1061 | { |
1062 | #ifdef HAVE_WIRELESS_PAIRING | 1062 | #ifdef HAVE_WIRELESS_PAIRING |
1063 | if (!client) | 1063 | if (!client) |
@@ -1097,7 +1097,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t | |||
1097 | #endif | 1097 | #endif |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair_cu(lockdownd_client_t client) | 1100 | lockdownd_error_t lockdownd_pair_cu(lockdownd_client_t client) |
1101 | { | 1101 | { |
1102 | #ifdef HAVE_WIRELESS_PAIRING | 1102 | #ifdef HAVE_WIRELESS_PAIRING |
1103 | if (!client) | 1103 | if (!client) |
diff --git a/src/lockdown.c b/src/lockdown.c index 92af186..256bff0 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
@@ -226,7 +226,7 @@ static void plist_dict_add_label(plist_t plist, const char *label) | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
229 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id) | 229 | lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id) |
230 | { | 230 | { |
231 | if (!client) | 231 | if (!client) |
232 | return LOCKDOWN_E_INVALID_ARG; | 232 | return LOCKDOWN_E_INVALID_ARG; |
@@ -309,7 +309,7 @@ static lockdownd_error_t lockdownd_client_free_simple(lockdownd_client_t client) | |||
309 | return ret; | 309 | return ret; |
310 | } | 310 | } |
311 | 311 | ||
312 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_free(lockdownd_client_t client) | 312 | lockdownd_error_t lockdownd_client_free(lockdownd_client_t client) |
313 | { | 313 | { |
314 | if (!client) | 314 | if (!client) |
315 | return LOCKDOWN_E_INVALID_ARG; | 315 | return LOCKDOWN_E_INVALID_ARG; |
@@ -325,7 +325,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_free(lockdownd_client_t | |||
325 | return ret; | 325 | return ret; |
326 | } | 326 | } |
327 | 327 | ||
328 | LIBIMOBILEDEVICE_API void lockdownd_client_set_label(lockdownd_client_t client, const char *label) | 328 | void lockdownd_client_set_label(lockdownd_client_t client, const char *label) |
329 | { | 329 | { |
330 | if (client) { | 330 | if (client) { |
331 | if (client->label) | 331 | if (client->label) |
@@ -335,7 +335,7 @@ LIBIMOBILEDEVICE_API void lockdownd_client_set_label(lockdownd_client_t client, | |||
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
338 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist) | 338 | lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist) |
339 | { | 339 | { |
340 | if (!client || !plist || (plist && *plist)) | 340 | if (!client || !plist || (plist && *plist)) |
341 | return LOCKDOWN_E_INVALID_ARG; | 341 | return LOCKDOWN_E_INVALID_ARG; |
@@ -343,7 +343,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_receive(lockdownd_client_t clie | |||
343 | return lockdownd_error(property_list_service_receive_plist(client->parent, plist)); | 343 | return lockdownd_error(property_list_service_receive_plist(client->parent, plist)); |
344 | } | 344 | } |
345 | 345 | ||
346 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist) | 346 | lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist) |
347 | { | 347 | { |
348 | if (!client || !plist) | 348 | if (!client || !plist) |
349 | return LOCKDOWN_E_INVALID_ARG; | 349 | return LOCKDOWN_E_INVALID_ARG; |
@@ -351,7 +351,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_send(lockdownd_client_t client, | |||
351 | return lockdownd_error(property_list_service_send_xml_plist(client->parent, plist)); | 351 | return lockdownd_error(property_list_service_send_xml_plist(client->parent, plist)); |
352 | } | 352 | } |
353 | 353 | ||
354 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type) | 354 | lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type) |
355 | { | 355 | { |
356 | if (!client) | 356 | if (!client) |
357 | return LOCKDOWN_E_INVALID_ARG; | 357 | return LOCKDOWN_E_INVALID_ARG; |
@@ -396,7 +396,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_query_type(lockdownd_client_t c | |||
396 | return ret; | 396 | return ret; |
397 | } | 397 | } |
398 | 398 | ||
399 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value) | 399 | lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value) |
400 | { | 400 | { |
401 | if (!client) | 401 | if (!client) |
402 | return LOCKDOWN_E_INVALID_ARG; | 402 | return LOCKDOWN_E_INVALID_ARG; |
@@ -450,7 +450,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value(lockdownd_client_t cl | |||
450 | return ret; | 450 | return ret; |
451 | } | 451 | } |
452 | 452 | ||
453 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value) | 453 | lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value) |
454 | { | 454 | { |
455 | if (!client || !value) | 455 | if (!client || !value) |
456 | return LOCKDOWN_E_INVALID_ARG; | 456 | return LOCKDOWN_E_INVALID_ARG; |
@@ -498,7 +498,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_set_value(lockdownd_client_t cl | |||
498 | return ret; | 498 | return ret; |
499 | } | 499 | } |
500 | 500 | ||
501 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key) | 501 | lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key) |
502 | { | 502 | { |
503 | if (!client) | 503 | if (!client) |
504 | return LOCKDOWN_E_INVALID_ARG; | 504 | return LOCKDOWN_E_INVALID_ARG; |
@@ -545,7 +545,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_remove_value(lockdownd_client_t | |||
545 | return ret; | 545 | return ret; |
546 | } | 546 | } |
547 | 547 | ||
548 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t client, char **udid) | 548 | lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t client, char **udid) |
549 | { | 549 | { |
550 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; | 550 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; |
551 | plist_t value = NULL; | 551 | plist_t value = NULL; |
@@ -591,7 +591,7 @@ static lockdownd_error_t lockdownd_get_device_public_key_as_key_data(lockdownd_c | |||
591 | return ret; | 591 | return ret; |
592 | } | 592 | } |
593 | 593 | ||
594 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name) | 594 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name) |
595 | { | 595 | { |
596 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; | 596 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; |
597 | plist_t value = NULL; | 597 | plist_t value = NULL; |
@@ -608,7 +608,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_device_name(lockdownd_clien | |||
608 | return ret; | 608 | return ret; |
609 | } | 609 | } |
610 | 610 | ||
611 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label) | 611 | lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label) |
612 | { | 612 | { |
613 | if (!device || !client) | 613 | if (!device || !client) |
614 | return LOCKDOWN_E_INVALID_ARG; | 614 | return LOCKDOWN_E_INVALID_ARG; |
@@ -643,7 +643,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new(idevice_t device, lo | |||
643 | return LOCKDOWN_E_SUCCESS; | 643 | return LOCKDOWN_E_SUCCESS; |
644 | } | 644 | } |
645 | 645 | ||
646 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label) | 646 | lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label) |
647 | { | 647 | { |
648 | if (!client) | 648 | if (!client) |
649 | return LOCKDOWN_E_INVALID_ARG; | 649 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1056,7 +1056,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
1056 | return ret; | 1056 | return ret; |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | 1059 | lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
1060 | { | 1060 | { |
1061 | 1061 | ||
1062 | plist_t options = plist_new_dict(); | 1062 | plist_t options = plist_new_dict(); |
@@ -1069,22 +1069,22 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair(lockdownd_client_t client, | |||
1069 | return ret; | 1069 | return ret; |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair_with_options(lockdownd_client_t client, lockdownd_pair_record_t pair_record, plist_t options, plist_t *response) | 1072 | lockdownd_error_t lockdownd_pair_with_options(lockdownd_client_t client, lockdownd_pair_record_t pair_record, plist_t options, plist_t *response) |
1073 | { | 1073 | { |
1074 | return lockdownd_do_pair(client, pair_record, "Pair", options, response); | 1074 | return lockdownd_do_pair(client, pair_record, "Pair", options, response); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | 1077 | lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
1078 | { | 1078 | { |
1079 | return lockdownd_do_pair(client, pair_record, "ValidatePair", NULL, NULL); | 1079 | return lockdownd_do_pair(client, pair_record, "ValidatePair", NULL, NULL); |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | 1082 | lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
1083 | { | 1083 | { |
1084 | return lockdownd_do_pair(client, pair_record, "Unpair", NULL, NULL); | 1084 | return lockdownd_do_pair(client, pair_record, "Unpair", NULL, NULL); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) | 1087 | lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) |
1088 | { | 1088 | { |
1089 | if (!client) | 1089 | if (!client) |
1090 | return LOCKDOWN_E_INVALID_ARG; | 1090 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1114,7 +1114,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_enter_recovery(lockdownd_client | |||
1114 | return ret; | 1114 | return ret; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) | 1117 | lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) |
1118 | { | 1118 | { |
1119 | if (!client) | 1119 | if (!client) |
1120 | return LOCKDOWN_E_INVALID_ARG; | 1120 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1148,7 +1148,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_goodbye(lockdownd_client_t clie | |||
1148 | return ret; | 1148 | return ret; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled) | 1151 | lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled) |
1152 | { | 1152 | { |
1153 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; | 1153 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; |
1154 | plist_t dict = NULL; | 1154 | plist_t dict = NULL; |
@@ -1392,17 +1392,17 @@ static lockdownd_error_t lockdownd_do_start_service(lockdownd_client_t client, c | |||
1392 | return ret; | 1392 | return ret; |
1393 | } | 1393 | } |
1394 | 1394 | ||
1395 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service) | 1395 | lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service) |
1396 | { | 1396 | { |
1397 | return lockdownd_do_start_service(client, identifier, 0, service); | 1397 | return lockdownd_do_start_service(client, identifier, 0, service); |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_service_with_escrow_bag(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service) | 1400 | lockdownd_error_t lockdownd_start_service_with_escrow_bag(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service) |
1401 | { | 1401 | { |
1402 | return lockdownd_do_start_service(client, identifier, 1, service); | 1402 | return lockdownd_do_start_service(client, identifier, 1, service); |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record) | 1405 | lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record) |
1406 | { | 1406 | { |
1407 | if (!client) | 1407 | if (!client) |
1408 | return LOCKDOWN_E_INVALID_ARG; | 1408 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1441,7 +1441,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_activate(lockdownd_client_t cli | |||
1441 | return ret; | 1441 | return ret; |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) | 1444 | lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) |
1445 | { | 1445 | { |
1446 | if (!client) | 1446 | if (!client) |
1447 | return LOCKDOWN_E_INVALID_ARG; | 1447 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1488,7 +1488,7 @@ static void str_remove_spaces(char *source) | |||
1488 | *dest = 0; | 1488 | *dest = 0; |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count) | 1491 | lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count) |
1492 | { | 1492 | { |
1493 | if (!client) | 1493 | if (!client) |
1494 | return LOCKDOWN_E_INVALID_ARG; | 1494 | return LOCKDOWN_E_INVALID_ARG; |
@@ -1543,7 +1543,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd | |||
1543 | return LOCKDOWN_E_SUCCESS; | 1543 | return LOCKDOWN_E_SUCCESS; |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_data_classes_free(char **classes) | 1546 | lockdownd_error_t lockdownd_data_classes_free(char **classes) |
1547 | { | 1547 | { |
1548 | if (classes) { | 1548 | if (classes) { |
1549 | int i = 0; | 1549 | int i = 0; |
@@ -1555,7 +1555,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_data_classes_free(char **classe | |||
1555 | return LOCKDOWN_E_SUCCESS; | 1555 | return LOCKDOWN_E_SUCCESS; |
1556 | } | 1556 | } |
1557 | 1557 | ||
1558 | LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service) | 1558 | lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service) |
1559 | { | 1559 | { |
1560 | if (service) { | 1560 | if (service) { |
1561 | free(service->identifier); | 1561 | free(service->identifier); |
@@ -1565,7 +1565,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_service_descriptor_free(lockdow | |||
1565 | return LOCKDOWN_E_SUCCESS; | 1565 | return LOCKDOWN_E_SUCCESS; |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | LIBIMOBILEDEVICE_API const char* lockdownd_strerror(lockdownd_error_t err) | 1568 | const char* lockdownd_strerror(lockdownd_error_t err) |
1569 | { | 1569 | { |
1570 | switch (err) { | 1570 | switch (err) { |
1571 | case LOCKDOWN_E_SUCCESS: | 1571 | case LOCKDOWN_E_SUCCESS: |
diff --git a/src/lockdown.h b/src/lockdown.h index bcd4717..ba291ec 100644 --- a/src/lockdown.h +++ b/src/lockdown.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #ifndef __LOCKDOWND_H | 23 | #ifndef __LOCKDOWND_H |
24 | #define __LOCKDOWND_H | 24 | #define __LOCKDOWND_H |
25 | 25 | ||
26 | #include "idevice.h" | ||
26 | #include "libimobiledevice/lockdown.h" | 27 | #include "libimobiledevice/lockdown.h" |
27 | #include "property_list_service.h" | 28 | #include "property_list_service.h" |
28 | 29 | ||
diff --git a/src/misagent.c b/src/misagent.c index af925f9..e3da997 100644 --- a/src/misagent.c +++ b/src/misagent.c | |||
@@ -89,7 +89,7 @@ static misagent_error_t misagent_check_result(plist_t response, int* status_code | |||
89 | return MISAGENT_E_REQUEST_FAILED; | 89 | return MISAGENT_E_REQUEST_FAILED; |
90 | } | 90 | } |
91 | 91 | ||
92 | LIBIMOBILEDEVICE_API misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client) | 92 | misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client) |
93 | { | 93 | { |
94 | property_list_service_client_t plistclient = NULL; | 94 | property_list_service_client_t plistclient = NULL; |
95 | misagent_error_t err = misagent_error(property_list_service_client_new(device, service, &plistclient)); | 95 | misagent_error_t err = misagent_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -105,14 +105,14 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_client_new(idevice_t device, lock | |||
105 | return MISAGENT_E_SUCCESS; | 105 | return MISAGENT_E_SUCCESS; |
106 | } | 106 | } |
107 | 107 | ||
108 | LIBIMOBILEDEVICE_API misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t * client, const char* label) | 108 | misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t * client, const char* label) |
109 | { | 109 | { |
110 | misagent_error_t err = MISAGENT_E_UNKNOWN_ERROR; | 110 | misagent_error_t err = MISAGENT_E_UNKNOWN_ERROR; |
111 | service_client_factory_start_service(device, MISAGENT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(misagent_client_new), &err); | 111 | service_client_factory_start_service(device, MISAGENT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(misagent_client_new), &err); |
112 | return err; | 112 | return err; |
113 | } | 113 | } |
114 | 114 | ||
115 | LIBIMOBILEDEVICE_API misagent_error_t misagent_client_free(misagent_client_t client) | 115 | misagent_error_t misagent_client_free(misagent_client_t client) |
116 | { | 116 | { |
117 | if (!client) | 117 | if (!client) |
118 | return MISAGENT_E_INVALID_ARG; | 118 | return MISAGENT_E_INVALID_ARG; |
@@ -127,7 +127,7 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_client_free(misagent_client_t cli | |||
127 | return err; | 127 | return err; |
128 | } | 128 | } |
129 | 129 | ||
130 | LIBIMOBILEDEVICE_API misagent_error_t misagent_install(misagent_client_t client, plist_t profile) | 130 | misagent_error_t misagent_install(misagent_client_t client, plist_t profile) |
131 | { | 131 | { |
132 | if (!client || !client->parent || !profile || (plist_get_node_type(profile) != PLIST_DATA)) | 132 | if (!client || !client->parent || !profile || (plist_get_node_type(profile) != PLIST_DATA)) |
133 | return MISAGENT_E_INVALID_ARG; | 133 | return MISAGENT_E_INVALID_ARG; |
@@ -164,7 +164,7 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_install(misagent_client_t client, | |||
164 | return res; | 164 | return res; |
165 | } | 165 | } |
166 | 166 | ||
167 | LIBIMOBILEDEVICE_API misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles) | 167 | misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles) |
168 | { | 168 | { |
169 | if (!client || !client->parent || !profiles) | 169 | if (!client || !client->parent || !profiles) |
170 | return MISAGENT_E_INVALID_ARG; | 170 | return MISAGENT_E_INVALID_ARG; |
@@ -204,7 +204,7 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_copy(misagent_client_t client, pl | |||
204 | 204 | ||
205 | } | 205 | } |
206 | 206 | ||
207 | LIBIMOBILEDEVICE_API misagent_error_t misagent_copy_all(misagent_client_t client, plist_t* profiles) | 207 | misagent_error_t misagent_copy_all(misagent_client_t client, plist_t* profiles) |
208 | { | 208 | { |
209 | if (!client || !client->parent || !profiles) | 209 | if (!client || !client->parent || !profiles) |
210 | return MISAGENT_E_INVALID_ARG; | 210 | return MISAGENT_E_INVALID_ARG; |
@@ -244,7 +244,7 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_copy_all(misagent_client_t client | |||
244 | 244 | ||
245 | } | 245 | } |
246 | 246 | ||
247 | LIBIMOBILEDEVICE_API misagent_error_t misagent_remove(misagent_client_t client, const char* profileID) | 247 | misagent_error_t misagent_remove(misagent_client_t client, const char* profileID) |
248 | { | 248 | { |
249 | if (!client || !client->parent || !profileID) | 249 | if (!client || !client->parent || !profileID) |
250 | return MISAGENT_E_INVALID_ARG; | 250 | return MISAGENT_E_INVALID_ARG; |
@@ -281,7 +281,7 @@ LIBIMOBILEDEVICE_API misagent_error_t misagent_remove(misagent_client_t client, | |||
281 | return res; | 281 | return res; |
282 | } | 282 | } |
283 | 283 | ||
284 | LIBIMOBILEDEVICE_API int misagent_get_status_code(misagent_client_t client) | 284 | int misagent_get_status_code(misagent_client_t client) |
285 | { | 285 | { |
286 | if (!client) { | 286 | if (!client) { |
287 | return -1; | 287 | return -1; |
diff --git a/src/misagent.h b/src/misagent.h index 08ad063..e394087 100644 --- a/src/misagent.h +++ b/src/misagent.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __MISAGENT_H | 22 | #ifndef __MISAGENT_H |
23 | #define __MISAGENT_H | 23 | #define __MISAGENT_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/misagent.h" | 26 | #include "libimobiledevice/misagent.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c index 9ccfd85..5df8e86 100644 --- a/src/mobile_image_mounter.c +++ b/src/mobile_image_mounter.c | |||
@@ -78,7 +78,7 @@ static mobile_image_mounter_error_t mobile_image_mounter_error(property_list_ser | |||
78 | return MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR; | 78 | return MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR; |
79 | } | 79 | } |
80 | 80 | ||
81 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdownd_service_descriptor_t service, mobile_image_mounter_client_t *client) | 81 | mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdownd_service_descriptor_t service, mobile_image_mounter_client_t *client) |
82 | { | 82 | { |
83 | property_list_service_client_t plistclient = NULL; | 83 | property_list_service_client_t plistclient = NULL; |
84 | mobile_image_mounter_error_t err = mobile_image_mounter_error(property_list_service_client_new(device, service, &plistclient)); | 84 | mobile_image_mounter_error_t err = mobile_image_mounter_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -95,14 +95,14 @@ LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_new(idevi | |||
95 | return MOBILE_IMAGE_MOUNTER_E_SUCCESS; | 95 | return MOBILE_IMAGE_MOUNTER_E_SUCCESS; |
96 | } | 96 | } |
97 | 97 | ||
98 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_start_service(idevice_t device, mobile_image_mounter_client_t * client, const char* label) | 98 | mobile_image_mounter_error_t mobile_image_mounter_start_service(idevice_t device, mobile_image_mounter_client_t * client, const char* label) |
99 | { | 99 | { |
100 | mobile_image_mounter_error_t err = MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR; | 100 | mobile_image_mounter_error_t err = MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR; |
101 | service_client_factory_start_service(device, MOBILE_IMAGE_MOUNTER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobile_image_mounter_new), &err); | 101 | service_client_factory_start_service(device, MOBILE_IMAGE_MOUNTER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobile_image_mounter_new), &err); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client) | 105 | mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client) |
106 | { | 106 | { |
107 | if (!client) | 107 | if (!client) |
108 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 108 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
@@ -115,7 +115,7 @@ LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_free(mobi | |||
115 | return MOBILE_IMAGE_MOUNTER_E_SUCCESS; | 115 | return MOBILE_IMAGE_MOUNTER_E_SUCCESS; |
116 | } | 116 | } |
117 | 117 | ||
118 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_lookup_image(mobile_image_mounter_client_t client, const char *image_type, plist_t *result) | 118 | mobile_image_mounter_error_t mobile_image_mounter_lookup_image(mobile_image_mounter_client_t client, const char *image_type, plist_t *result) |
119 | { | 119 | { |
120 | if (!client || !image_type || !result) { | 120 | if (!client || !image_type || !result) { |
121 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 121 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
@@ -181,7 +181,7 @@ static mobile_image_mounter_error_t process_result(plist_t result, const char *e | |||
181 | return res; | 181 | return res; |
182 | } | 182 | } |
183 | 183 | ||
184 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata) | 184 | mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata) |
185 | { | 185 | { |
186 | if (!client || !image_type || (image_size == 0) || !upload_cb) { | 186 | if (!client || !image_type || (image_size == 0) || !upload_cb) { |
187 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 187 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
@@ -260,7 +260,7 @@ leave_unlock: | |||
260 | 260 | ||
261 | } | 261 | } |
262 | 262 | ||
263 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result) | 263 | mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result) |
264 | { | 264 | { |
265 | if (!client || !image_path || !image_type || !result) { | 265 | if (!client || !image_path || !image_type || !result) { |
266 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 266 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
@@ -292,7 +292,7 @@ leave_unlock: | |||
292 | return res; | 292 | return res; |
293 | } | 293 | } |
294 | 294 | ||
295 | LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client) | 295 | mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client) |
296 | { | 296 | { |
297 | if (!client) { | 297 | if (!client) { |
298 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 298 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
diff --git a/src/mobile_image_mounter.h b/src/mobile_image_mounter.h index 55c9cf2..9a8fcdd 100644 --- a/src/mobile_image_mounter.h +++ b/src/mobile_image_mounter.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __MOBILE_IMAGE_MOUNTER_H | 22 | #ifndef __MOBILE_IMAGE_MOUNTER_H |
23 | #define __MOBILE_IMAGE_MOUNTER_H | 23 | #define __MOBILE_IMAGE_MOUNTER_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/mobile_image_mounter.h" | 26 | #include "libimobiledevice/mobile_image_mounter.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/mobileactivation.c b/src/mobileactivation.c index 79c7003..fce5f16 100644 --- a/src/mobileactivation.c +++ b/src/mobileactivation.c | |||
@@ -54,7 +54,7 @@ static mobileactivation_error_t mobileactivation_error(property_list_service_err | |||
54 | return MOBILEACTIVATION_E_UNKNOWN_ERROR; | 54 | return MOBILEACTIVATION_E_UNKNOWN_ERROR; |
55 | } | 55 | } |
56 | 56 | ||
57 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobileactivation_client_t *client) | 57 | mobileactivation_error_t mobileactivation_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobileactivation_client_t *client) |
58 | { | 58 | { |
59 | if (!device || !service || service->port == 0 || !client || *client) { | 59 | if (!device || !service || service->port == 0 || !client || *client) { |
60 | return MOBILEACTIVATION_E_INVALID_ARG; | 60 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -74,14 +74,14 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_client_new(idevic | |||
74 | return MOBILEACTIVATION_E_SUCCESS; | 74 | return MOBILEACTIVATION_E_SUCCESS; |
75 | } | 75 | } |
76 | 76 | ||
77 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_client_start_service(idevice_t device, mobileactivation_client_t * client, const char* label) | 77 | mobileactivation_error_t mobileactivation_client_start_service(idevice_t device, mobileactivation_client_t * client, const char* label) |
78 | { | 78 | { |
79 | mobileactivation_error_t err = MOBILEACTIVATION_E_UNKNOWN_ERROR; | 79 | mobileactivation_error_t err = MOBILEACTIVATION_E_UNKNOWN_ERROR; |
80 | service_client_factory_start_service(device, MOBILEACTIVATION_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobileactivation_client_new), &err); | 80 | service_client_factory_start_service(device, MOBILEACTIVATION_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobileactivation_client_new), &err); |
81 | return err; | 81 | return err; |
82 | } | 82 | } |
83 | 83 | ||
84 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_client_free(mobileactivation_client_t client) | 84 | mobileactivation_error_t mobileactivation_client_free(mobileactivation_client_t client) |
85 | { | 85 | { |
86 | if (!client) | 86 | if (!client) |
87 | return MOBILEACTIVATION_E_INVALID_ARG; | 87 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -176,7 +176,7 @@ static mobileactivation_error_t mobileactivation_send_command(mobileactivation_c | |||
176 | return ret; | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||
179 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_get_activation_state(mobileactivation_client_t client, plist_t *state) | 179 | mobileactivation_error_t mobileactivation_get_activation_state(mobileactivation_client_t client, plist_t *state) |
180 | { | 180 | { |
181 | if (!client || !state) | 181 | if (!client || !state) |
182 | return MOBILEACTIVATION_E_INVALID_ARG; | 182 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -198,7 +198,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_get_activation_st | |||
198 | return ret; | 198 | return ret; |
199 | } | 199 | } |
200 | 200 | ||
201 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation_session_info(mobileactivation_client_t client, plist_t *blob) | 201 | mobileactivation_error_t mobileactivation_create_activation_session_info(mobileactivation_client_t client, plist_t *blob) |
202 | { | 202 | { |
203 | if (!client || !blob) | 203 | if (!client || !blob) |
204 | return MOBILEACTIVATION_E_INVALID_ARG; | 204 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -218,7 +218,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation | |||
218 | return ret; | 218 | return ret; |
219 | } | 219 | } |
220 | 220 | ||
221 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation_info(mobileactivation_client_t client, plist_t *info) | 221 | mobileactivation_error_t mobileactivation_create_activation_info(mobileactivation_client_t client, plist_t *info) |
222 | { | 222 | { |
223 | if (!client || !info) | 223 | if (!client || !info) |
224 | return MOBILEACTIVATION_E_INVALID_ARG; | 224 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -240,7 +240,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation | |||
240 | return ret; | 240 | return ret; |
241 | } | 241 | } |
242 | 242 | ||
243 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation_info_with_session(mobileactivation_client_t client, plist_t handshake_response, plist_t *info) | 243 | mobileactivation_error_t mobileactivation_create_activation_info_with_session(mobileactivation_client_t client, plist_t handshake_response, plist_t *info) |
244 | { | 244 | { |
245 | if (!client || !info) | 245 | if (!client || !info) |
246 | return MOBILEACTIVATION_E_INVALID_ARG; | 246 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -264,7 +264,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation | |||
264 | return ret; | 264 | return ret; |
265 | } | 265 | } |
266 | 266 | ||
267 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_activate(mobileactivation_client_t client, plist_t activation_record) | 267 | mobileactivation_error_t mobileactivation_activate(mobileactivation_client_t client, plist_t activation_record) |
268 | { | 268 | { |
269 | if (!client || !activation_record) | 269 | if (!client || !activation_record) |
270 | return MOBILEACTIVATION_E_INVALID_ARG; | 270 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -277,7 +277,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_activate(mobileac | |||
277 | return ret; | 277 | return ret; |
278 | } | 278 | } |
279 | 279 | ||
280 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_activate_with_session(mobileactivation_client_t client, plist_t activation_record, plist_t headers) | 280 | mobileactivation_error_t mobileactivation_activate_with_session(mobileactivation_client_t client, plist_t activation_record, plist_t headers) |
281 | { | 281 | { |
282 | if (!client || !activation_record) | 282 | if (!client || !activation_record) |
283 | return MOBILEACTIVATION_E_INVALID_ARG; | 283 | return MOBILEACTIVATION_E_INVALID_ARG; |
@@ -300,7 +300,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_activate_with_ses | |||
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_deactivate(mobileactivation_client_t client) | 303 | mobileactivation_error_t mobileactivation_deactivate(mobileactivation_client_t client) |
304 | { | 304 | { |
305 | if (!client) | 305 | if (!client) |
306 | return MOBILEACTIVATION_E_INVALID_ARG; | 306 | return MOBILEACTIVATION_E_INVALID_ARG; |
diff --git a/src/mobileactivation.h b/src/mobileactivation.h index 49b9ebc..a8dff5d 100644 --- a/src/mobileactivation.h +++ b/src/mobileactivation.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __MOBILEACTIVATION_H | 22 | #ifndef __MOBILEACTIVATION_H |
23 | #define __MOBILEACTIVATION_H | 23 | #define __MOBILEACTIVATION_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/mobileactivation.h" | 26 | #include "libimobiledevice/mobileactivation.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||
diff --git a/src/mobilebackup.c b/src/mobilebackup.c index f48f42a..36986a4 100644 --- a/src/mobilebackup.c +++ b/src/mobilebackup.c | |||
@@ -69,7 +69,7 @@ static mobilebackup_error_t mobilebackup_error(device_link_service_error_t err) | |||
69 | return MOBILEBACKUP_E_UNKNOWN_ERROR; | 69 | return MOBILEBACKUP_E_UNKNOWN_ERROR; |
70 | } | 70 | } |
71 | 71 | ||
72 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilebackup_client_t * client) | 72 | mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilebackup_client_t * client) |
73 | { | 73 | { |
74 | if (!device || !service || service->port == 0 || !client || *client) | 74 | if (!device || !service || service->port == 0 || !client || *client) |
75 | return MOBILEBACKUP_E_INVALID_ARG; | 75 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -96,14 +96,14 @@ LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_new(idevice_t devi | |||
96 | return ret; | 96 | return ret; |
97 | } | 97 | } |
98 | 98 | ||
99 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_start_service(idevice_t device, mobilebackup_client_t * client, const char* label) | 99 | mobilebackup_error_t mobilebackup_client_start_service(idevice_t device, mobilebackup_client_t * client, const char* label) |
100 | { | 100 | { |
101 | mobilebackup_error_t err = MOBILEBACKUP_E_UNKNOWN_ERROR; | 101 | mobilebackup_error_t err = MOBILEBACKUP_E_UNKNOWN_ERROR; |
102 | service_client_factory_start_service(device, MOBILEBACKUP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup_client_new), &err); | 102 | service_client_factory_start_service(device, MOBILEBACKUP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup_client_new), &err); |
103 | return err; | 103 | return err; |
104 | } | 104 | } |
105 | 105 | ||
106 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client) | 106 | mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client) |
107 | { | 107 | { |
108 | if (!client) | 108 | if (!client) |
109 | return MOBILEBACKUP_E_INVALID_ARG; | 109 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -116,7 +116,7 @@ LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_free(mobilebackup_ | |||
116 | return err; | 116 | return err; |
117 | } | 117 | } |
118 | 118 | ||
119 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t * plist) | 119 | mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t * plist) |
120 | { | 120 | { |
121 | if (!client) | 121 | if (!client) |
122 | return MOBILEBACKUP_E_INVALID_ARG; | 122 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -124,7 +124,7 @@ LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive(mobilebackup_clie | |||
124 | return ret; | 124 | return ret; |
125 | } | 125 | } |
126 | 126 | ||
127 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send(mobilebackup_client_t client, plist_t plist) | 127 | mobilebackup_error_t mobilebackup_send(mobilebackup_client_t client, plist_t plist) |
128 | { | 128 | { |
129 | if (!client || !plist) | 129 | if (!client || !plist) |
130 | return MOBILEBACKUP_E_INVALID_ARG; | 130 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -241,7 +241,7 @@ leave: | |||
241 | return err; | 241 | return err; |
242 | } | 242 | } |
243 | 243 | ||
244 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_request_backup(mobilebackup_client_t client, plist_t backup_manifest, const char *base_path, const char *proto_version) | 244 | mobilebackup_error_t mobilebackup_request_backup(mobilebackup_client_t client, plist_t backup_manifest, const char *base_path, const char *proto_version) |
245 | { | 245 | { |
246 | if (!client || !client->parent || !base_path || !proto_version) | 246 | if (!client || !client->parent || !base_path || !proto_version) |
247 | return MOBILEBACKUP_E_INVALID_ARG; | 247 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -309,12 +309,12 @@ leave: | |||
309 | return err; | 309 | return err; |
310 | } | 310 | } |
311 | 311 | ||
312 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_backup_file_received(mobilebackup_client_t client) | 312 | mobilebackup_error_t mobilebackup_send_backup_file_received(mobilebackup_client_t client) |
313 | { | 313 | { |
314 | return mobilebackup_send_message(client, "kBackupMessageBackupFileReceived", NULL); | 314 | return mobilebackup_send_message(client, "kBackupMessageBackupFileReceived", NULL); |
315 | } | 315 | } |
316 | 316 | ||
317 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, plist_t backup_manifest, mobilebackup_flags_t flags, const char *proto_version) | 317 | mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, plist_t backup_manifest, mobilebackup_flags_t flags, const char *proto_version) |
318 | { | 318 | { |
319 | if (!client || !client->parent || !backup_manifest || !proto_version) | 319 | if (!client || !client->parent || !backup_manifest || !proto_version) |
320 | return MOBILEBACKUP_E_INVALID_ARG; | 320 | return MOBILEBACKUP_E_INVALID_ARG; |
@@ -376,17 +376,17 @@ leave: | |||
376 | return err; | 376 | return err; |
377 | } | 377 | } |
378 | 378 | ||
379 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive_restore_file_received(mobilebackup_client_t client, plist_t *result) | 379 | mobilebackup_error_t mobilebackup_receive_restore_file_received(mobilebackup_client_t client, plist_t *result) |
380 | { | 380 | { |
381 | return mobilebackup_receive_message(client, "BackupMessageRestoreFileReceived", result); | 381 | return mobilebackup_receive_message(client, "BackupMessageRestoreFileReceived", result); |
382 | } | 382 | } |
383 | 383 | ||
384 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive_restore_application_received(mobilebackup_client_t client, plist_t *result) | 384 | mobilebackup_error_t mobilebackup_receive_restore_application_received(mobilebackup_client_t client, plist_t *result) |
385 | { | 385 | { |
386 | return mobilebackup_receive_message(client, "BackupMessageRestoreApplicationReceived", result); | 386 | return mobilebackup_receive_message(client, "BackupMessageRestoreApplicationReceived", result); |
387 | } | 387 | } |
388 | 388 | ||
389 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_restore_complete(mobilebackup_client_t client) | 389 | mobilebackup_error_t mobilebackup_send_restore_complete(mobilebackup_client_t client) |
390 | { | 390 | { |
391 | mobilebackup_error_t err = mobilebackup_send_message(client, "BackupMessageRestoreComplete", NULL); | 391 | mobilebackup_error_t err = mobilebackup_send_message(client, "BackupMessageRestoreComplete", NULL); |
392 | if (err != MOBILEBACKUP_E_SUCCESS) { | 392 | if (err != MOBILEBACKUP_E_SUCCESS) { |
@@ -431,7 +431,7 @@ LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_restore_complete(mob | |||
431 | return err; | 431 | return err; |
432 | } | 432 | } |
433 | 433 | ||
434 | LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const char *reason) | 434 | mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const char *reason) |
435 | { | 435 | { |
436 | if (!client || !client->parent || !reason) | 436 | if (!client || !client->parent || !reason) |
437 | return MOBILEBACKUP_E_INVALID_ARG; | 437 | return MOBILEBACKUP_E_INVALID_ARG; |
diff --git a/src/mobilebackup.h b/src/mobilebackup.h index edda70f..04ec479 100644 --- a/src/mobilebackup.h +++ b/src/mobilebackup.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #ifndef __MOBILEBACKUP_H | 23 | #ifndef __MOBILEBACKUP_H |
24 | #define __MOBILEBACKUP_H | 24 | #define __MOBILEBACKUP_H |
25 | 25 | ||
26 | #include "idevice.h" | ||
26 | #include "libimobiledevice/mobilebackup.h" | 27 | #include "libimobiledevice/mobilebackup.h" |
27 | #include "device_link_service.h" | 28 | #include "device_link_service.h" |
28 | 29 | ||
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index 3726065..a8d673f 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
@@ -68,7 +68,7 @@ static mobilebackup2_error_t mobilebackup2_error(device_link_service_error_t err | |||
68 | return MOBILEBACKUP2_E_UNKNOWN_ERROR; | 68 | return MOBILEBACKUP2_E_UNKNOWN_ERROR; |
69 | } | 69 | } |
70 | 70 | ||
71 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_service_descriptor_t service, | 71 | mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_service_descriptor_t service, |
72 | mobilebackup2_client_t * client) | 72 | mobilebackup2_client_t * client) |
73 | { | 73 | { |
74 | if (!device || !service || service->port == 0 || !client || *client) | 74 | if (!device || !service || service->port == 0 || !client || *client) |
@@ -96,14 +96,14 @@ LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_new(idevice_t de | |||
96 | return ret; | 96 | return ret; |
97 | } | 97 | } |
98 | 98 | ||
99 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_start_service(idevice_t device, mobilebackup2_client_t * client, const char* label) | 99 | mobilebackup2_error_t mobilebackup2_client_start_service(idevice_t device, mobilebackup2_client_t * client, const char* label) |
100 | { | 100 | { |
101 | mobilebackup2_error_t err = MOBILEBACKUP2_E_UNKNOWN_ERROR; | 101 | mobilebackup2_error_t err = MOBILEBACKUP2_E_UNKNOWN_ERROR; |
102 | service_client_factory_start_service(device, MOBILEBACKUP2_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup2_client_new), &err); | 102 | service_client_factory_start_service(device, MOBILEBACKUP2_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup2_client_new), &err); |
103 | return err; | 103 | return err; |
104 | } | 104 | } |
105 | 105 | ||
106 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client) | 106 | mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client) |
107 | { | 107 | { |
108 | if (!client) | 108 | if (!client) |
109 | return MOBILEBACKUP2_E_INVALID_ARG; | 109 | return MOBILEBACKUP2_E_INVALID_ARG; |
@@ -116,7 +116,7 @@ LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_free(mobilebacku | |||
116 | return err; | 116 | return err; |
117 | } | 117 | } |
118 | 118 | ||
119 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options) | 119 | mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options) |
120 | { | 120 | { |
121 | if (!client || !client->parent || (!message && !options)) | 121 | if (!client || !client->parent || (!message && !options)) |
122 | return MOBILEBACKUP2_E_INVALID_ARG; | 122 | return MOBILEBACKUP2_E_INVALID_ARG; |
@@ -214,12 +214,12 @@ leave: | |||
214 | return err; | 214 | return err; |
215 | } | 215 | } |
216 | 216 | ||
217 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage) | 217 | mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage) |
218 | { | 218 | { |
219 | return mobilebackup2_error(device_link_service_receive_message(client->parent, msg_plist, dlmessage)); | 219 | return mobilebackup2_error(device_link_service_receive_message(client->parent, msg_plist, dlmessage)); |
220 | } | 220 | } |
221 | 221 | ||
222 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes) | 222 | mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes) |
223 | { | 223 | { |
224 | if (!client || !client->parent || !data || (length == 0) || !bytes) | 224 | if (!client || !client->parent || !data || (length == 0) || !bytes) |
225 | return MOBILEBACKUP2_E_INVALID_ARG; | 225 | return MOBILEBACKUP2_E_INVALID_ARG; |
@@ -244,7 +244,7 @@ LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_ | |||
244 | return MOBILEBACKUP2_E_MUX_ERROR; | 244 | return MOBILEBACKUP2_E_MUX_ERROR; |
245 | } | 245 | } |
246 | 246 | ||
247 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes) | 247 | mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes) |
248 | { | 248 | { |
249 | if (!client || !client->parent || !data || (length == 0) || !bytes) | 249 | if (!client || !client->parent || !data || (length == 0) || !bytes) |
250 | return MOBILEBACKUP2_E_INVALID_ARG; | 250 | return MOBILEBACKUP2_E_INVALID_ARG; |
@@ -271,7 +271,7 @@ LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_receive_raw(mobilebacku | |||
271 | return MOBILEBACKUP2_E_MUX_ERROR; | 271 | return MOBILEBACKUP2_E_MUX_ERROR; |
272 | } | 272 | } |
273 | 273 | ||
274 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t client, double local_versions[], char count, double *remote_version) | 274 | mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t client, double local_versions[], char count, double *remote_version) |
275 | { | 275 | { |
276 | int i; | 276 | int i; |
277 | 277 | ||
@@ -329,7 +329,7 @@ leave: | |||
329 | return err; | 329 | return err; |
330 | } | 330 | } |
331 | 331 | ||
332 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options) | 332 | mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options) |
333 | { | 333 | { |
334 | if (!client || !client->parent || !request || !target_identifier) | 334 | if (!client || !client->parent || !request || !target_identifier) |
335 | return MOBILEBACKUP2_E_INVALID_ARG; | 335 | return MOBILEBACKUP2_E_INVALID_ARG; |
@@ -360,7 +360,7 @@ LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_request(mobileback | |||
360 | return err; | 360 | return err; |
361 | } | 361 | } |
362 | 362 | ||
363 | LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_status_response(mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2) | 363 | mobilebackup2_error_t mobilebackup2_send_status_response(mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2) |
364 | { | 364 | { |
365 | if (!client || !client->parent) | 365 | if (!client || !client->parent) |
366 | return MOBILEBACKUP2_E_INVALID_ARG; | 366 | return MOBILEBACKUP2_E_INVALID_ARG; |
diff --git a/src/mobilebackup2.h b/src/mobilebackup2.h index 025b6bf..e232b97 100644 --- a/src/mobilebackup2.h +++ b/src/mobilebackup2.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __MOBILEBACKUP2_H | 22 | #ifndef __MOBILEBACKUP2_H |
23 | #define __MOBILEBACKUP2_H | 23 | #define __MOBILEBACKUP2_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/mobilebackup2.h" | 26 | #include "libimobiledevice/mobilebackup2.h" |
26 | #include "device_link_service.h" | 27 | #include "device_link_service.h" |
27 | 28 | ||
diff --git a/src/mobilesync.c b/src/mobilesync.c index e50226c..9b81a49 100644 --- a/src/mobilesync.c +++ b/src/mobilesync.c | |||
@@ -71,7 +71,7 @@ static mobilesync_error_t mobilesync_error(device_link_service_error_t err) | |||
71 | return MOBILESYNC_E_UNKNOWN_ERROR; | 71 | return MOBILESYNC_E_UNKNOWN_ERROR; |
72 | } | 72 | } |
73 | 73 | ||
74 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, | 74 | mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, |
75 | mobilesync_client_t * client) | 75 | mobilesync_client_t * client) |
76 | { | 76 | { |
77 | if (!device || !service || service->port == 0 || !client || *client) | 77 | if (!device || !service || service->port == 0 || !client || *client) |
@@ -101,14 +101,14 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, | |||
101 | return ret; | 101 | return ret; |
102 | } | 102 | } |
103 | 103 | ||
104 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label) | 104 | mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label) |
105 | { | 105 | { |
106 | mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR; | 106 | mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR; |
107 | service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err); | 107 | service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err); |
108 | return err; | 108 | return err; |
109 | } | 109 | } |
110 | 110 | ||
111 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) | 111 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) |
112 | { | 112 | { |
113 | if (!client) | 113 | if (!client) |
114 | return MOBILESYNC_E_INVALID_ARG; | 114 | return MOBILESYNC_E_INVALID_ARG; |
@@ -118,7 +118,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client | |||
118 | return err; | 118 | return err; |
119 | } | 119 | } |
120 | 120 | ||
121 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist) | 121 | mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist) |
122 | { | 122 | { |
123 | if (!client) | 123 | if (!client) |
124 | return MOBILESYNC_E_INVALID_ARG; | 124 | return MOBILESYNC_E_INVALID_ARG; |
@@ -126,14 +126,14 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t c | |||
126 | return ret; | 126 | return ret; |
127 | } | 127 | } |
128 | 128 | ||
129 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist) | 129 | mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist) |
130 | { | 130 | { |
131 | if (!client || !plist) | 131 | if (!client || !plist) |
132 | return MOBILESYNC_E_INVALID_ARG; | 132 | return MOBILESYNC_E_INVALID_ARG; |
133 | return mobilesync_error(device_link_service_send(client->parent, plist)); | 133 | return mobilesync_error(device_link_service_send(client->parent, plist)); |
134 | } | 134 | } |
135 | 135 | ||
136 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description) | 136 | mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description) |
137 | { | 137 | { |
138 | if (!client || client->data_class || !data_class || | 138 | if (!client || client->data_class || !data_class || |
139 | !anchors || !anchors->computer_anchor) { | 139 | !anchors || !anchors->computer_anchor) { |
@@ -259,7 +259,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_start(mobilesync_client_t cli | |||
259 | return err; | 259 | return err; |
260 | } | 260 | } |
261 | 261 | ||
262 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_finish(mobilesync_client_t client) | 262 | mobilesync_error_t mobilesync_finish(mobilesync_client_t client) |
263 | { | 263 | { |
264 | if (!client || !client->data_class) { | 264 | if (!client || !client->data_class) { |
265 | return MOBILESYNC_E_INVALID_ARG; | 265 | return MOBILESYNC_E_INVALID_ARG; |
@@ -344,17 +344,17 @@ static mobilesync_error_t mobilesync_get_records(mobilesync_client_t client, con | |||
344 | return err; | 344 | return err; |
345 | } | 345 | } |
346 | 346 | ||
347 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client) | 347 | mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client) |
348 | { | 348 | { |
349 | return mobilesync_get_records(client, "SDMessageGetAllRecordsFromDevice"); | 349 | return mobilesync_get_records(client, "SDMessageGetAllRecordsFromDevice"); |
350 | } | 350 | } |
351 | 351 | ||
352 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client) | 352 | mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client) |
353 | { | 353 | { |
354 | return mobilesync_get_records(client, "SDMessageGetChangesFromDevice"); | 354 | return mobilesync_get_records(client, "SDMessageGetChangesFromDevice"); |
355 | } | 355 | } |
356 | 356 | ||
357 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions) | 357 | mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions) |
358 | { | 358 | { |
359 | if (!client || !client->data_class) { | 359 | if (!client || !client->data_class) { |
360 | return MOBILESYNC_E_INVALID_ARG; | 360 | return MOBILESYNC_E_INVALID_ARG; |
@@ -421,7 +421,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_cl | |||
421 | return err; | 421 | return err; |
422 | } | 422 | } |
423 | 423 | ||
424 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client) | 424 | mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client) |
425 | { | 425 | { |
426 | if (!client || !client->data_class) { | 426 | if (!client || !client->data_class) { |
427 | return MOBILESYNC_E_INVALID_ARG; | 427 | return MOBILESYNC_E_INVALID_ARG; |
@@ -490,7 +490,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(m | |||
490 | return err; | 490 | return err; |
491 | } | 491 | } |
492 | 492 | ||
493 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client) | 493 | mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client) |
494 | { | 494 | { |
495 | if (!client || !client->data_class) { | 495 | if (!client || !client->data_class) { |
496 | return MOBILESYNC_E_INVALID_ARG; | 496 | return MOBILESYNC_E_INVALID_ARG; |
@@ -524,7 +524,7 @@ static plist_t create_process_changes_message(const char *data_class, plist_t en | |||
524 | return msg; | 524 | return msg; |
525 | } | 525 | } |
526 | 526 | ||
527 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client) | 527 | mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client) |
528 | { | 528 | { |
529 | if (!client || !client->data_class) { | 529 | if (!client || !client->data_class) { |
530 | return MOBILESYNC_E_INVALID_ARG; | 530 | return MOBILESYNC_E_INVALID_ARG; |
@@ -591,7 +591,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_co | |||
591 | return err; | 591 | return err; |
592 | } | 592 | } |
593 | 593 | ||
594 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions) | 594 | mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions) |
595 | { | 595 | { |
596 | if (!client || !client->data_class || !entities) { | 596 | if (!client || !client->data_class || !entities) { |
597 | return MOBILESYNC_E_INVALID_ARG; | 597 | return MOBILESYNC_E_INVALID_ARG; |
@@ -619,7 +619,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_clien | |||
619 | return err; | 619 | return err; |
620 | } | 620 | } |
621 | 621 | ||
622 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping) | 622 | mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping) |
623 | { | 623 | { |
624 | if (!client || !client->data_class) { | 624 | if (!client || !client->data_class) { |
625 | return MOBILESYNC_E_INVALID_ARG; | 625 | return MOBILESYNC_E_INVALID_ARG; |
@@ -688,7 +688,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_ | |||
688 | return err; | 688 | return err; |
689 | } | 689 | } |
690 | 690 | ||
691 | LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason) | 691 | mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason) |
692 | { | 692 | { |
693 | if (!client || !client->data_class || !reason) { | 693 | if (!client || !client->data_class || !reason) { |
694 | return MOBILESYNC_E_INVALID_ARG; | 694 | return MOBILESYNC_E_INVALID_ARG; |
@@ -714,7 +714,7 @@ LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t cl | |||
714 | return err; | 714 | return err; |
715 | } | 715 | } |
716 | 716 | ||
717 | LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor) | 717 | mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor) |
718 | { | 718 | { |
719 | mobilesync_anchors_t anchors = (mobilesync_anchors_t) malloc(sizeof(mobilesync_anchors)); | 719 | mobilesync_anchors_t anchors = (mobilesync_anchors_t) malloc(sizeof(mobilesync_anchors)); |
720 | if (device_anchor != NULL) { | 720 | if (device_anchor != NULL) { |
@@ -731,7 +731,7 @@ LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *dev | |||
731 | return anchors; | 731 | return anchors; |
732 | } | 732 | } |
733 | 733 | ||
734 | LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors) | 734 | void mobilesync_anchors_free(mobilesync_anchors_t anchors) |
735 | { | 735 | { |
736 | if (anchors->device_anchor != NULL) { | 736 | if (anchors->device_anchor != NULL) { |
737 | free(anchors->device_anchor); | 737 | free(anchors->device_anchor); |
@@ -745,12 +745,12 @@ LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors) | |||
745 | anchors = NULL; | 745 | anchors = NULL; |
746 | } | 746 | } |
747 | 747 | ||
748 | LIBIMOBILEDEVICE_API plist_t mobilesync_actions_new(void) | 748 | plist_t mobilesync_actions_new(void) |
749 | { | 749 | { |
750 | return plist_new_dict(); | 750 | return plist_new_dict(); |
751 | } | 751 | } |
752 | 752 | ||
753 | LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...) | 753 | void mobilesync_actions_add(plist_t actions, ...) |
754 | { | 754 | { |
755 | if (!actions) | 755 | if (!actions) |
756 | return; | 756 | return; |
@@ -782,7 +782,7 @@ LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...) | |||
782 | va_end(args); | 782 | va_end(args); |
783 | } | 783 | } |
784 | 784 | ||
785 | LIBIMOBILEDEVICE_API void mobilesync_actions_free(plist_t actions) | 785 | void mobilesync_actions_free(plist_t actions) |
786 | { | 786 | { |
787 | if (actions) { | 787 | if (actions) { |
788 | plist_free(actions); | 788 | plist_free(actions); |
diff --git a/src/mobilesync.h b/src/mobilesync.h index f672252..3b5ece9 100644 --- a/src/mobilesync.h +++ b/src/mobilesync.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #ifndef __MOBILESYNC_H | 23 | #ifndef __MOBILESYNC_H |
24 | #define __MOBILESYNC_H | 24 | #define __MOBILESYNC_H |
25 | 25 | ||
26 | #include "idevice.h" | ||
26 | #include "libimobiledevice/mobilesync.h" | 27 | #include "libimobiledevice/mobilesync.h" |
27 | #include "device_link_service.h" | 28 | #include "device_link_service.h" |
28 | 29 | ||
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index e17e2fe..60b2e03 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c | |||
@@ -89,7 +89,7 @@ static np_error_t np_error(property_list_service_error_t err) | |||
89 | return NP_E_UNKNOWN_ERROR; | 89 | return NP_E_UNKNOWN_ERROR; |
90 | } | 90 | } |
91 | 91 | ||
92 | LIBIMOBILEDEVICE_API np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client) | 92 | np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client) |
93 | { | 93 | { |
94 | property_list_service_client_t plistclient = NULL; | 94 | property_list_service_client_t plistclient = NULL; |
95 | np_error_t err = np_error(property_list_service_client_new(device, service, &plistclient)); | 95 | np_error_t err = np_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -107,14 +107,14 @@ LIBIMOBILEDEVICE_API np_error_t np_client_new(idevice_t device, lockdownd_servic | |||
107 | return NP_E_SUCCESS; | 107 | return NP_E_SUCCESS; |
108 | } | 108 | } |
109 | 109 | ||
110 | LIBIMOBILEDEVICE_API np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label) | 110 | np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label) |
111 | { | 111 | { |
112 | np_error_t err = NP_E_UNKNOWN_ERROR; | 112 | np_error_t err = NP_E_UNKNOWN_ERROR; |
113 | service_client_factory_start_service(device, NP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(np_client_new), &err); | 113 | service_client_factory_start_service(device, NP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(np_client_new), &err); |
114 | return err; | 114 | return err; |
115 | } | 115 | } |
116 | 116 | ||
117 | LIBIMOBILEDEVICE_API np_error_t np_client_free(np_client_t client) | 117 | np_error_t np_client_free(np_client_t client) |
118 | { | 118 | { |
119 | plist_t dict; | 119 | plist_t dict; |
120 | property_list_service_client_t parent; | 120 | property_list_service_client_t parent; |
@@ -168,7 +168,7 @@ LIBIMOBILEDEVICE_API np_error_t np_client_free(np_client_t client) | |||
168 | return NP_E_SUCCESS; | 168 | return NP_E_SUCCESS; |
169 | } | 169 | } |
170 | 170 | ||
171 | LIBIMOBILEDEVICE_API np_error_t np_post_notification(np_client_t client, const char *notification) | 171 | np_error_t np_post_notification(np_client_t client, const char *notification) |
172 | { | 172 | { |
173 | if (!client || !notification) { | 173 | if (!client || !notification) { |
174 | return NP_E_INVALID_ARG; | 174 | return NP_E_INVALID_ARG; |
@@ -204,7 +204,7 @@ static np_error_t internal_np_observe_notification(np_client_t client, const cha | |||
204 | return res; | 204 | return res; |
205 | } | 205 | } |
206 | 206 | ||
207 | LIBIMOBILEDEVICE_API np_error_t np_observe_notification( np_client_t client, const char *notification ) | 207 | np_error_t np_observe_notification( np_client_t client, const char *notification ) |
208 | { | 208 | { |
209 | if (!client || !notification) { | 209 | if (!client || !notification) { |
210 | return NP_E_INVALID_ARG; | 210 | return NP_E_INVALID_ARG; |
@@ -215,7 +215,7 @@ LIBIMOBILEDEVICE_API np_error_t np_observe_notification( np_client_t client, con | |||
215 | return res; | 215 | return res; |
216 | } | 216 | } |
217 | 217 | ||
218 | LIBIMOBILEDEVICE_API np_error_t np_observe_notifications(np_client_t client, const char **notification_spec) | 218 | np_error_t np_observe_notifications(np_client_t client, const char **notification_spec) |
219 | { | 219 | { |
220 | int i = 0; | 220 | int i = 0; |
221 | np_error_t res = NP_E_UNKNOWN_ERROR; | 221 | np_error_t res = NP_E_UNKNOWN_ERROR; |
@@ -346,7 +346,7 @@ void* np_notifier( void* arg ) | |||
346 | return NULL; | 346 | return NULL; |
347 | } | 347 | } |
348 | 348 | ||
349 | LIBIMOBILEDEVICE_API np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb, void *user_data ) | 349 | np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb, void *user_data ) |
350 | { | 350 | { |
351 | if (!client) | 351 | if (!client) |
352 | return NP_E_INVALID_ARG; | 352 | return NP_E_INVALID_ARG; |
diff --git a/src/notification_proxy.h b/src/notification_proxy.h index ea85149..595cb01 100644 --- a/src/notification_proxy.h +++ b/src/notification_proxy.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __NOTIFICATION_PROXY_H | 22 | #ifndef __NOTIFICATION_PROXY_H |
23 | #define __NOTIFICATION_PROXY_H | 23 | #define __NOTIFICATION_PROXY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/notification_proxy.h" | 26 | #include "libimobiledevice/notification_proxy.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/preboard.c b/src/preboard.c index 4b3b444..c3eff02 100644 --- a/src/preboard.c +++ b/src/preboard.c | |||
@@ -62,7 +62,7 @@ static preboard_error_t preboard_error(property_list_service_error_t err) | |||
62 | return PREBOARD_E_UNKNOWN_ERROR; | 62 | return PREBOARD_E_UNKNOWN_ERROR; |
63 | } | 63 | } |
64 | 64 | ||
65 | LIBIMOBILEDEVICE_API preboard_error_t preboard_client_new(idevice_t device, lockdownd_service_descriptor_t service, preboard_client_t * client) | 65 | preboard_error_t preboard_client_new(idevice_t device, lockdownd_service_descriptor_t service, preboard_client_t * client) |
66 | { | 66 | { |
67 | *client = NULL; | 67 | *client = NULL; |
68 | 68 | ||
@@ -90,14 +90,14 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_client_new(idevice_t device, lock | |||
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | LIBIMOBILEDEVICE_API preboard_error_t preboard_client_start_service(idevice_t device, preboard_client_t * client, const char* label) | 93 | preboard_error_t preboard_client_start_service(idevice_t device, preboard_client_t * client, const char* label) |
94 | { | 94 | { |
95 | preboard_error_t err = PREBOARD_E_UNKNOWN_ERROR; | 95 | preboard_error_t err = PREBOARD_E_UNKNOWN_ERROR; |
96 | service_client_factory_start_service(device, PREBOARD_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(preboard_client_new), &err); | 96 | service_client_factory_start_service(device, PREBOARD_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(preboard_client_new), &err); |
97 | return err; | 97 | return err; |
98 | } | 98 | } |
99 | 99 | ||
100 | LIBIMOBILEDEVICE_API preboard_error_t preboard_client_free(preboard_client_t client) | 100 | preboard_error_t preboard_client_free(preboard_client_t client) |
101 | { | 101 | { |
102 | if (!client) | 102 | if (!client) |
103 | return PREBOARD_E_INVALID_ARG; | 103 | return PREBOARD_E_INVALID_ARG; |
@@ -116,7 +116,7 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_client_free(preboard_client_t cli | |||
116 | return err; | 116 | return err; |
117 | } | 117 | } |
118 | 118 | ||
119 | LIBIMOBILEDEVICE_API preboard_error_t preboard_send(preboard_client_t client, plist_t plist) | 119 | preboard_error_t preboard_send(preboard_client_t client, plist_t plist) |
120 | { | 120 | { |
121 | preboard_error_t res = PREBOARD_E_UNKNOWN_ERROR; | 121 | preboard_error_t res = PREBOARD_E_UNKNOWN_ERROR; |
122 | res = preboard_error(property_list_service_send_binary_plist(client->parent, plist)); | 122 | res = preboard_error(property_list_service_send_binary_plist(client->parent, plist)); |
@@ -127,7 +127,7 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_send(preboard_client_t client, pl | |||
127 | return res; | 127 | return res; |
128 | } | 128 | } |
129 | 129 | ||
130 | LIBIMOBILEDEVICE_API preboard_error_t preboard_receive_with_timeout(preboard_client_t client, plist_t * plist, uint32_t timeout_ms) | 130 | preboard_error_t preboard_receive_with_timeout(preboard_client_t client, plist_t * plist, uint32_t timeout_ms) |
131 | { | 131 | { |
132 | preboard_error_t res = PREBOARD_E_UNKNOWN_ERROR; | 132 | preboard_error_t res = PREBOARD_E_UNKNOWN_ERROR; |
133 | plist_t outplist = NULL; | 133 | plist_t outplist = NULL; |
@@ -141,7 +141,7 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_receive_with_timeout(preboard_cli | |||
141 | return res; | 141 | return res; |
142 | } | 142 | } |
143 | 143 | ||
144 | LIBIMOBILEDEVICE_API preboard_error_t preboard_receive(preboard_client_t client, plist_t * plist) | 144 | preboard_error_t preboard_receive(preboard_client_t client, plist_t * plist) |
145 | { | 145 | { |
146 | return preboard_receive_with_timeout(client, plist, 5000); | 146 | return preboard_receive_with_timeout(client, plist, 5000); |
147 | } | 147 | } |
@@ -209,7 +209,7 @@ static preboard_error_t preboard_receive_status_loop_with_callback(preboard_clie | |||
209 | return res; | 209 | return res; |
210 | } | 210 | } |
211 | 211 | ||
212 | LIBIMOBILEDEVICE_API preboard_error_t preboard_create_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data) | 212 | preboard_error_t preboard_create_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data) |
213 | { | 213 | { |
214 | if (!client) { | 214 | if (!client) { |
215 | return PREBOARD_E_INVALID_ARG; | 215 | return PREBOARD_E_INVALID_ARG; |
@@ -232,7 +232,7 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_create_stashbag(preboard_client_t | |||
232 | return preboard_receive_status_loop_with_callback(client, status_cb, user_data); | 232 | return preboard_receive_status_loop_with_callback(client, status_cb, user_data); |
233 | } | 233 | } |
234 | 234 | ||
235 | LIBIMOBILEDEVICE_API preboard_error_t preboard_commit_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data) | 235 | preboard_error_t preboard_commit_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data) |
236 | { | 236 | { |
237 | if (!client) { | 237 | if (!client) { |
238 | return PREBOARD_E_INVALID_ARG; | 238 | return PREBOARD_E_INVALID_ARG; |
diff --git a/src/preboard.h b/src/preboard.h index 61263fc..f8164eb 100644 --- a/src/preboard.h +++ b/src/preboard.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __PREBOARD_H | 22 | #ifndef __PREBOARD_H |
23 | #define __PREBOARD_H | 23 | #define __PREBOARD_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/preboard.h" | 26 | #include "libimobiledevice/preboard.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/property_list_service.c b/src/property_list_service.c index 4654b6e..2fca4e7 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c | |||
@@ -58,7 +58,7 @@ static property_list_service_error_t service_to_property_list_service_error(serv | |||
58 | return PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR; | 58 | return PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR; |
59 | } | 59 | } |
60 | 60 | ||
61 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client) | 61 | property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client) |
62 | { | 62 | { |
63 | if (!device || !service || service->port == 0 || !client || *client) | 63 | if (!device || !service || service->port == 0 || !client || *client) |
64 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 64 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
@@ -78,7 +78,7 @@ LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_client_ | |||
78 | return PROPERTY_LIST_SERVICE_E_SUCCESS; | 78 | return PROPERTY_LIST_SERVICE_E_SUCCESS; |
79 | } | 79 | } |
80 | 80 | ||
81 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_client_free(property_list_service_client_t client) | 81 | property_list_service_error_t property_list_service_client_free(property_list_service_client_t client) |
82 | { | 82 | { |
83 | if (!client) | 83 | if (!client) |
84 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 84 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
@@ -152,12 +152,12 @@ static property_list_service_error_t internal_plist_send(property_list_service_c | |||
152 | return res; | 152 | return res; |
153 | } | 153 | } |
154 | 154 | ||
155 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist) | 155 | property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist) |
156 | { | 156 | { |
157 | return internal_plist_send(client, plist, 0); | 157 | return internal_plist_send(client, plist, 0); |
158 | } | 158 | } |
159 | 159 | ||
160 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist) | 160 | property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist) |
161 | { | 161 | { |
162 | return internal_plist_send(client, plist, 1); | 162 | return internal_plist_send(client, plist, 1); |
163 | } | 163 | } |
@@ -262,31 +262,31 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis | |||
262 | return res; | 262 | return res; |
263 | } | 263 | } |
264 | 264 | ||
265 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout) | 265 | property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout) |
266 | { | 266 | { |
267 | return internal_plist_receive_timeout(client, plist, timeout); | 267 | return internal_plist_receive_timeout(client, plist, timeout); |
268 | } | 268 | } |
269 | 269 | ||
270 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist) | 270 | property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist) |
271 | { | 271 | { |
272 | return internal_plist_receive_timeout(client, plist, 30000); | 272 | return internal_plist_receive_timeout(client, plist, 30000); |
273 | } | 273 | } |
274 | 274 | ||
275 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client) | 275 | property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client) |
276 | { | 276 | { |
277 | if (!client || !client->parent) | 277 | if (!client || !client->parent) |
278 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 278 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
279 | return service_to_property_list_service_error(service_enable_ssl(client->parent)); | 279 | return service_to_property_list_service_error(service_enable_ssl(client->parent)); |
280 | } | 280 | } |
281 | 281 | ||
282 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client) | 282 | property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client) |
283 | { | 283 | { |
284 | if (!client || !client->parent) | 284 | if (!client || !client->parent) |
285 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 285 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
286 | return service_to_property_list_service_error(service_disable_ssl(client->parent)); | 286 | return service_to_property_list_service_error(service_disable_ssl(client->parent)); |
287 | } | 287 | } |
288 | 288 | ||
289 | LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_get_service_client(property_list_service_client_t client, service_client_t *service_client) | 289 | property_list_service_error_t property_list_service_get_service_client(property_list_service_client_t client, service_client_t *service_client) |
290 | { | 290 | { |
291 | if (!client || !client->parent || !service_client) | 291 | if (!client || !client->parent || !service_client) |
292 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 292 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
diff --git a/src/property_list_service.h b/src/property_list_service.h index 3c9e14d..0e9e948 100644 --- a/src/property_list_service.h +++ b/src/property_list_service.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __PROPERTY_LIST_SERVICE_H | 22 | #ifndef __PROPERTY_LIST_SERVICE_H |
23 | #define __PROPERTY_LIST_SERVICE_H | 23 | #define __PROPERTY_LIST_SERVICE_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/property_list_service.h" | 26 | #include "libimobiledevice/property_list_service.h" |
26 | #include "service.h" | 27 | #include "service.h" |
27 | 28 | ||
diff --git a/src/restore.c b/src/restore.c index 41bfb9d..d13a28a 100644 --- a/src/restore.c +++ b/src/restore.c | |||
@@ -111,7 +111,7 @@ static restored_error_t restored_error(property_list_service_error_t err) | |||
111 | return RESTORE_E_UNKNOWN_ERROR; | 111 | return RESTORE_E_UNKNOWN_ERROR; |
112 | } | 112 | } |
113 | 113 | ||
114 | LIBIMOBILEDEVICE_API restored_error_t restored_client_free(restored_client_t client) | 114 | restored_error_t restored_client_free(restored_client_t client) |
115 | { | 115 | { |
116 | if (!client) | 116 | if (!client) |
117 | return RESTORE_E_INVALID_ARG; | 117 | return RESTORE_E_INVALID_ARG; |
@@ -139,7 +139,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_client_free(restored_client_t cli | |||
139 | return ret; | 139 | return ret; |
140 | } | 140 | } |
141 | 141 | ||
142 | LIBIMOBILEDEVICE_API void restored_client_set_label(restored_client_t client, const char *label) | 142 | void restored_client_set_label(restored_client_t client, const char *label) |
143 | { | 143 | { |
144 | if (client) { | 144 | if (client) { |
145 | if (client->label) | 145 | if (client->label) |
@@ -149,7 +149,7 @@ LIBIMOBILEDEVICE_API void restored_client_set_label(restored_client_t client, co | |||
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | LIBIMOBILEDEVICE_API restored_error_t restored_receive(restored_client_t client, plist_t *plist) | 152 | restored_error_t restored_receive(restored_client_t client, plist_t *plist) |
153 | { | 153 | { |
154 | if (!client || !plist || (plist && *plist)) | 154 | if (!client || !plist || (plist && *plist)) |
155 | return RESTORE_E_INVALID_ARG; | 155 | return RESTORE_E_INVALID_ARG; |
@@ -157,7 +157,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_receive(restored_client_t client, | |||
157 | return restored_error(property_list_service_receive_plist(client->parent, plist)); | 157 | return restored_error(property_list_service_receive_plist(client->parent, plist)); |
158 | } | 158 | } |
159 | 159 | ||
160 | LIBIMOBILEDEVICE_API restored_error_t restored_send(restored_client_t client, plist_t plist) | 160 | restored_error_t restored_send(restored_client_t client, plist_t plist) |
161 | { | 161 | { |
162 | if (!client || !plist) | 162 | if (!client || !plist) |
163 | return RESTORE_E_INVALID_ARG; | 163 | return RESTORE_E_INVALID_ARG; |
@@ -165,7 +165,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_send(restored_client_t client, pl | |||
165 | return restored_error(property_list_service_send_xml_plist(client->parent, plist)); | 165 | return restored_error(property_list_service_send_xml_plist(client->parent, plist)); |
166 | } | 166 | } |
167 | 167 | ||
168 | LIBIMOBILEDEVICE_API restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version) | 168 | restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version) |
169 | { | 169 | { |
170 | if (!client) | 170 | if (!client) |
171 | return RESTORE_E_INVALID_ARG; | 171 | return RESTORE_E_INVALID_ARG; |
@@ -224,7 +224,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_query_type(restored_client_t clie | |||
224 | return ret; | 224 | return ret; |
225 | } | 225 | } |
226 | 226 | ||
227 | LIBIMOBILEDEVICE_API restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value) | 227 | restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value) |
228 | { | 228 | { |
229 | if (!client || !key) | 229 | if (!client || !key) |
230 | return RESTORE_E_INVALID_ARG; | 230 | return RESTORE_E_INVALID_ARG; |
@@ -266,7 +266,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_query_value(restored_client_t cli | |||
266 | return ret; | 266 | return ret; |
267 | } | 267 | } |
268 | 268 | ||
269 | LIBIMOBILEDEVICE_API restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value) | 269 | restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value) |
270 | { | 270 | { |
271 | plist_t item; | 271 | plist_t item; |
272 | 272 | ||
@@ -291,7 +291,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_get_value(restored_client_t clien | |||
291 | return RESTORE_E_SUCCESS; | 291 | return RESTORE_E_SUCCESS; |
292 | } | 292 | } |
293 | 293 | ||
294 | LIBIMOBILEDEVICE_API restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label) | 294 | restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label) |
295 | { | 295 | { |
296 | if (!client) | 296 | if (!client) |
297 | return RESTORE_E_INVALID_ARG; | 297 | return RESTORE_E_INVALID_ARG; |
@@ -335,7 +335,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_client_new(idevice_t device, rest | |||
335 | return ret; | 335 | return ret; |
336 | } | 336 | } |
337 | 337 | ||
338 | LIBIMOBILEDEVICE_API restored_error_t restored_goodbye(restored_client_t client) | 338 | restored_error_t restored_goodbye(restored_client_t client) |
339 | { | 339 | { |
340 | if (!client) | 340 | if (!client) |
341 | return RESTORE_E_INVALID_ARG; | 341 | return RESTORE_E_INVALID_ARG; |
@@ -367,7 +367,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_goodbye(restored_client_t client) | |||
367 | return ret; | 367 | return ret; |
368 | } | 368 | } |
369 | 369 | ||
370 | LIBIMOBILEDEVICE_API restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version) | 370 | restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version) |
371 | { | 371 | { |
372 | if (!client) | 372 | if (!client) |
373 | return RESTORE_E_INVALID_ARG; | 373 | return RESTORE_E_INVALID_ARG; |
@@ -391,7 +391,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_start_restore(restored_client_t c | |||
391 | return ret; | 391 | return ret; |
392 | } | 392 | } |
393 | 393 | ||
394 | LIBIMOBILEDEVICE_API restored_error_t restored_reboot(restored_client_t client) | 394 | restored_error_t restored_reboot(restored_client_t client) |
395 | { | 395 | { |
396 | if (!client) | 396 | if (!client) |
397 | return RESTORE_E_INVALID_ARG; | 397 | return RESTORE_E_INVALID_ARG; |
diff --git a/src/restore.h b/src/restore.h index 646d1d1..ec6fa04 100644 --- a/src/restore.h +++ b/src/restore.h | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <string.h> | 25 | #include <string.h> |
26 | 26 | ||
27 | #include "idevice.h" | ||
27 | #include "libimobiledevice/restore.h" | 28 | #include "libimobiledevice/restore.h" |
28 | #include "property_list_service.h" | 29 | #include "property_list_service.h" |
29 | 30 | ||
diff --git a/src/reverse_proxy.c b/src/reverse_proxy.c index bca0a13..2fcfdd1 100644 --- a/src/reverse_proxy.c +++ b/src/reverse_proxy.c | |||
@@ -528,7 +528,7 @@ static void* _reverse_proxy_control_thread(void *cdata) | |||
528 | return NULL; | 528 | return NULL; |
529 | } | 529 | } |
530 | 530 | ||
531 | LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_start_proxy(reverse_proxy_client_t client, int control_protocol_version) | 531 | reverse_proxy_error_t reverse_proxy_client_start_proxy(reverse_proxy_client_t client, int control_protocol_version) |
532 | { | 532 | { |
533 | char buf[16] = {0, }; | 533 | char buf[16] = {0, }; |
534 | uint32_t bytes = 0; | 534 | uint32_t bytes = 0; |
@@ -607,7 +607,7 @@ LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_start_proxy(reve | |||
607 | return err; | 607 | return err; |
608 | } | 608 | } |
609 | 609 | ||
610 | LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_create_with_service(idevice_t device, reverse_proxy_client_t* client, const char* label) | 610 | reverse_proxy_error_t reverse_proxy_client_create_with_service(idevice_t device, reverse_proxy_client_t* client, const char* label) |
611 | { | 611 | { |
612 | reverse_proxy_error_t err = REVERSE_PROXY_E_UNKNOWN_ERROR; | 612 | reverse_proxy_error_t err = REVERSE_PROXY_E_UNKNOWN_ERROR; |
613 | service_client_factory_start_service(device, "com.apple.PurpleReverseProxy.Ctrl", (void**)client, label, SERVICE_CONSTRUCTOR(reverse_proxy_client_new), &err); | 613 | service_client_factory_start_service(device, "com.apple.PurpleReverseProxy.Ctrl", (void**)client, label, SERVICE_CONSTRUCTOR(reverse_proxy_client_new), &err); |
@@ -620,7 +620,7 @@ LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_create_with_serv | |||
620 | return REVERSE_PROXY_E_SUCCESS; | 620 | return REVERSE_PROXY_E_SUCCESS; |
621 | } | 621 | } |
622 | 622 | ||
623 | LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_create_with_port(idevice_t device, reverse_proxy_client_t* client, uint16_t device_port) | 623 | reverse_proxy_error_t reverse_proxy_client_create_with_port(idevice_t device, reverse_proxy_client_t* client, uint16_t device_port) |
624 | { | 624 | { |
625 | reverse_proxy_client_t client_loc = NULL; | 625 | reverse_proxy_client_t client_loc = NULL; |
626 | reverse_proxy_error_t err; | 626 | reverse_proxy_error_t err; |
@@ -641,7 +641,7 @@ LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_create_with_port | |||
641 | return REVERSE_PROXY_E_SUCCESS; | 641 | return REVERSE_PROXY_E_SUCCESS; |
642 | } | 642 | } |
643 | 643 | ||
644 | LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_free(reverse_proxy_client_t client) | 644 | reverse_proxy_error_t reverse_proxy_client_free(reverse_proxy_client_t client) |
645 | { | 645 | { |
646 | if (!client) | 646 | if (!client) |
647 | return REVERSE_PROXY_E_INVALID_ARG; | 647 | return REVERSE_PROXY_E_INVALID_ARG; |
@@ -660,14 +660,14 @@ LIBIMOBILEDEVICE_API reverse_proxy_error_t reverse_proxy_client_free(reverse_pro | |||
660 | return err; | 660 | return err; |
661 | } | 661 | } |
662 | 662 | ||
663 | LIBIMOBILEDEVICE_API reverse_proxy_client_type_t reverse_proxy_get_type(reverse_proxy_client_t client) | 663 | reverse_proxy_client_type_t reverse_proxy_get_type(reverse_proxy_client_t client) |
664 | { | 664 | { |
665 | if (!client) | 665 | if (!client) |
666 | return 0; | 666 | return 0; |
667 | return client->type; | 667 | return client->type; |
668 | } | 668 | } |
669 | 669 | ||
670 | LIBIMOBILEDEVICE_API void reverse_proxy_client_set_status_callback(reverse_proxy_client_t client, reverse_proxy_status_cb_t status_callback, void* user_data) | 670 | void reverse_proxy_client_set_status_callback(reverse_proxy_client_t client, reverse_proxy_status_cb_t status_callback, void* user_data) |
671 | { | 671 | { |
672 | if (!client) { | 672 | if (!client) { |
673 | return; | 673 | return; |
@@ -676,7 +676,7 @@ LIBIMOBILEDEVICE_API void reverse_proxy_client_set_status_callback(reverse_proxy | |||
676 | client->status_cb_user_data = user_data; | 676 | client->status_cb_user_data = user_data; |
677 | } | 677 | } |
678 | 678 | ||
679 | LIBIMOBILEDEVICE_API void reverse_proxy_client_set_log_callback(reverse_proxy_client_t client, reverse_proxy_log_cb_t log_callback, void* user_data) | 679 | void reverse_proxy_client_set_log_callback(reverse_proxy_client_t client, reverse_proxy_log_cb_t log_callback, void* user_data) |
680 | { | 680 | { |
681 | if (!client) { | 681 | if (!client) { |
682 | return; | 682 | return; |
@@ -685,7 +685,7 @@ LIBIMOBILEDEVICE_API void reverse_proxy_client_set_log_callback(reverse_proxy_cl | |||
685 | client->log_cb_user_data = user_data; | 685 | client->log_cb_user_data = user_data; |
686 | } | 686 | } |
687 | 687 | ||
688 | LIBIMOBILEDEVICE_API void reverse_proxy_client_set_data_callback(reverse_proxy_client_t client, reverse_proxy_data_cb_t data_callback, void* user_data) | 688 | void reverse_proxy_client_set_data_callback(reverse_proxy_client_t client, reverse_proxy_data_cb_t data_callback, void* user_data) |
689 | { | 689 | { |
690 | if (!client) { | 690 | if (!client) { |
691 | return; | 691 | return; |
diff --git a/src/reverse_proxy.h b/src/reverse_proxy.h index 17eabac..7f441bd 100644 --- a/src/reverse_proxy.h +++ b/src/reverse_proxy.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __REVERSE_PROXY_H | 22 | #ifndef __REVERSE_PROXY_H |
23 | #define __REVERSE_PROXY_H | 23 | #define __REVERSE_PROXY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/reverse_proxy.h" | 26 | #include "libimobiledevice/reverse_proxy.h" |
26 | #include "service.h" | 27 | #include "service.h" |
27 | 28 | ||
diff --git a/src/sbservices.c b/src/sbservices.c index c7ee911..365e130 100644 --- a/src/sbservices.c +++ b/src/sbservices.c | |||
@@ -79,7 +79,7 @@ static sbservices_error_t sbservices_error(property_list_service_error_t err) | |||
79 | return SBSERVICES_E_UNKNOWN_ERROR; | 79 | return SBSERVICES_E_UNKNOWN_ERROR; |
80 | } | 80 | } |
81 | 81 | ||
82 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client) | 82 | sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client) |
83 | { | 83 | { |
84 | property_list_service_client_t plistclient = NULL; | 84 | property_list_service_client_t plistclient = NULL; |
85 | sbservices_error_t err = sbservices_error(property_list_service_client_new(device, service, &plistclient)); | 85 | sbservices_error_t err = sbservices_error(property_list_service_client_new(device, service, &plistclient)); |
@@ -95,14 +95,14 @@ LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_new(idevice_t device, | |||
95 | return SBSERVICES_E_SUCCESS; | 95 | return SBSERVICES_E_SUCCESS; |
96 | } | 96 | } |
97 | 97 | ||
98 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t * client, const char* label) | 98 | sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t * client, const char* label) |
99 | { | 99 | { |
100 | sbservices_error_t err = SBSERVICES_E_UNKNOWN_ERROR; | 100 | sbservices_error_t err = SBSERVICES_E_UNKNOWN_ERROR; |
101 | service_client_factory_start_service(device, SBSERVICES_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(sbservices_client_new), &err); | 101 | service_client_factory_start_service(device, SBSERVICES_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(sbservices_client_new), &err); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_free(sbservices_client_t client) | 105 | sbservices_error_t sbservices_client_free(sbservices_client_t client) |
106 | { | 106 | { |
107 | if (!client) | 107 | if (!client) |
108 | return SBSERVICES_E_INVALID_ARG; | 108 | return SBSERVICES_E_INVALID_ARG; |
@@ -115,7 +115,7 @@ LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_free(sbservices_client | |||
115 | return err; | 115 | return err; |
116 | } | 116 | } |
117 | 117 | ||
118 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version) | 118 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version) |
119 | { | 119 | { |
120 | if (!client || !client->parent || !state) | 120 | if (!client || !client->parent || !state) |
121 | return SBSERVICES_E_INVALID_ARG; | 121 | return SBSERVICES_E_INVALID_ARG; |
@@ -155,7 +155,7 @@ leave_unlock: | |||
155 | return res; | 155 | return res; |
156 | } | 156 | } |
157 | 157 | ||
158 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate) | 158 | sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate) |
159 | { | 159 | { |
160 | if (!client || !client->parent || !newstate) | 160 | if (!client || !client->parent || !newstate) |
161 | return SBSERVICES_E_INVALID_ARG; | 161 | return SBSERVICES_E_INVALID_ARG; |
@@ -184,7 +184,7 @@ LIBIMOBILEDEVICE_API sbservices_error_t sbservices_set_icon_state(sbservices_cli | |||
184 | return res; | 184 | return res; |
185 | } | 185 | } |
186 | 186 | ||
187 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize) | 187 | sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize) |
188 | { | 188 | { |
189 | if (!client || !client->parent || !bundleId || !pngdata) | 189 | if (!client || !client->parent || !bundleId || !pngdata) |
190 | return SBSERVICES_E_INVALID_ARG; | 190 | return SBSERVICES_E_INVALID_ARG; |
@@ -221,7 +221,7 @@ leave_unlock: | |||
221 | return res; | 221 | return res; |
222 | } | 222 | } |
223 | 223 | ||
224 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation) | 224 | sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation) |
225 | { | 225 | { |
226 | if (!client || !client->parent || !interface_orientation) | 226 | if (!client || !client->parent || !interface_orientation) |
227 | return SBSERVICES_E_INVALID_ARG; | 227 | return SBSERVICES_E_INVALID_ARG; |
@@ -259,7 +259,7 @@ leave_unlock: | |||
259 | return res; | 259 | return res; |
260 | } | 260 | } |
261 | 261 | ||
262 | LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize) | 262 | sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize) |
263 | { | 263 | { |
264 | if (!client || !client->parent || !pngdata) | 264 | if (!client || !client->parent || !pngdata) |
265 | return SBSERVICES_E_INVALID_ARG; | 265 | return SBSERVICES_E_INVALID_ARG; |
diff --git a/src/sbservices.h b/src/sbservices.h index 39d822c..b67281e 100644 --- a/src/sbservices.h +++ b/src/sbservices.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __SBSERVICES_H | 22 | #ifndef __SBSERVICES_H |
23 | #define __SBSERVICES_H | 23 | #define __SBSERVICES_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/sbservices.h" | 26 | #include "libimobiledevice/sbservices.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/screenshotr.c b/src/screenshotr.c index 77835da..c3cc9ba 100644 --- a/src/screenshotr.c +++ b/src/screenshotr.c | |||
@@ -65,7 +65,7 @@ static screenshotr_error_t screenshotr_error(device_link_service_error_t err) | |||
65 | return SCREENSHOTR_E_UNKNOWN_ERROR; | 65 | return SCREENSHOTR_E_UNKNOWN_ERROR; |
66 | } | 66 | } |
67 | 67 | ||
68 | LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_new(idevice_t device, lockdownd_service_descriptor_t service, | 68 | screenshotr_error_t screenshotr_client_new(idevice_t device, lockdownd_service_descriptor_t service, |
69 | screenshotr_client_t * client) | 69 | screenshotr_client_t * client) |
70 | { | 70 | { |
71 | if (!device || !service || service->port == 0 || !client || *client) | 71 | if (!device || !service || service->port == 0 || !client || *client) |
@@ -93,14 +93,14 @@ LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_new(idevice_t device | |||
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
96 | LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_start_service(idevice_t device, screenshotr_client_t * client, const char* label) | 96 | screenshotr_error_t screenshotr_client_start_service(idevice_t device, screenshotr_client_t * client, const char* label) |
97 | { | 97 | { |
98 | screenshotr_error_t err = SCREENSHOTR_E_UNKNOWN_ERROR; | 98 | screenshotr_error_t err = SCREENSHOTR_E_UNKNOWN_ERROR; |
99 | service_client_factory_start_service(device, SCREENSHOTR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(screenshotr_client_new), &err); | 99 | service_client_factory_start_service(device, SCREENSHOTR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(screenshotr_client_new), &err); |
100 | return err; | 100 | return err; |
101 | } | 101 | } |
102 | 102 | ||
103 | LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_free(screenshotr_client_t client) | 103 | screenshotr_error_t screenshotr_client_free(screenshotr_client_t client) |
104 | { | 104 | { |
105 | if (!client) | 105 | if (!client) |
106 | return SCREENSHOTR_E_INVALID_ARG; | 106 | return SCREENSHOTR_E_INVALID_ARG; |
@@ -110,7 +110,7 @@ LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_free(screenshotr_cli | |||
110 | return err; | 110 | return err; |
111 | } | 111 | } |
112 | 112 | ||
113 | LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_take_screenshot(screenshotr_client_t client, char **imgdata, uint64_t *imgsize) | 113 | screenshotr_error_t screenshotr_take_screenshot(screenshotr_client_t client, char **imgdata, uint64_t *imgsize) |
114 | { | 114 | { |
115 | if (!client || !client->parent || !imgdata) | 115 | if (!client || !client->parent || !imgdata) |
116 | return SCREENSHOTR_E_INVALID_ARG; | 116 | return SCREENSHOTR_E_INVALID_ARG; |
diff --git a/src/screenshotr.h b/src/screenshotr.h index 47d4e42..1319ec0 100644 --- a/src/screenshotr.h +++ b/src/screenshotr.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __SCREENSHOTR_H | 22 | #ifndef __SCREENSHOTR_H |
23 | #define __SCREENSHOTR_H | 23 | #define __SCREENSHOTR_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/screenshotr.h" | 26 | #include "libimobiledevice/screenshotr.h" |
26 | #include "device_link_service.h" | 27 | #include "device_link_service.h" |
27 | 28 | ||
diff --git a/src/service.c b/src/service.c index 6c9d109..9474021 100644 --- a/src/service.c +++ b/src/service.c | |||
@@ -56,7 +56,7 @@ static service_error_t idevice_to_service_error(idevice_error_t err) | |||
56 | return SERVICE_E_UNKNOWN_ERROR; | 56 | return SERVICE_E_UNKNOWN_ERROR; |
57 | } | 57 | } |
58 | 58 | ||
59 | LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) | 59 | service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) |
60 | { | 60 | { |
61 | if (!device || !service || service->port == 0 || !client || *client) | 61 | if (!device || !service || service->port == 0 || !client || *client) |
62 | return SERVICE_E_INVALID_ARG; | 62 | return SERVICE_E_INVALID_ARG; |
@@ -80,7 +80,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdo | |||
80 | return SERVICE_E_SUCCESS; | 80 | return SERVICE_E_SUCCESS; |
81 | } | 81 | } |
82 | 82 | ||
83 | LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int32_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int32_t *error_code) | 83 | service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int32_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int32_t *error_code) |
84 | { | 84 | { |
85 | *client = NULL; | 85 | *client = NULL; |
86 | 86 | ||
@@ -119,7 +119,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevic | |||
119 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; | 119 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; |
120 | } | 120 | } |
121 | 121 | ||
122 | LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client) | 122 | service_error_t service_client_free(service_client_t client) |
123 | { | 123 | { |
124 | if (!client) | 124 | if (!client) |
125 | return SERVICE_E_INVALID_ARG; | 125 | return SERVICE_E_INVALID_ARG; |
@@ -132,7 +132,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client | |||
132 | return err; | 132 | return err; |
133 | } | 133 | } |
134 | 134 | ||
135 | LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) | 135 | service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) |
136 | { | 136 | { |
137 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 137 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
138 | uint32_t bytes = 0; | 138 | uint32_t bytes = 0; |
@@ -153,7 +153,7 @@ LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const | |||
153 | return res; | 153 | return res; |
154 | } | 154 | } |
155 | 155 | ||
156 | LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 156 | service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
157 | { | 157 | { |
158 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 158 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
159 | uint32_t bytes = 0; | 159 | uint32_t bytes = 0; |
@@ -174,31 +174,31 @@ LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client | |||
174 | return res; | 174 | return res; |
175 | } | 175 | } |
176 | 176 | ||
177 | LIBIMOBILEDEVICE_API service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) | 177 | service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) |
178 | { | 178 | { |
179 | return service_receive_with_timeout(client, data, size, received, 30000); | 179 | return service_receive_with_timeout(client, data, size, received, 30000); |
180 | } | 180 | } |
181 | 181 | ||
182 | LIBIMOBILEDEVICE_API service_error_t service_enable_ssl(service_client_t client) | 182 | service_error_t service_enable_ssl(service_client_t client) |
183 | { | 183 | { |
184 | if (!client || !client->connection) | 184 | if (!client || !client->connection) |
185 | return SERVICE_E_INVALID_ARG; | 185 | return SERVICE_E_INVALID_ARG; |
186 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); | 186 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); |
187 | } | 187 | } |
188 | 188 | ||
189 | LIBIMOBILEDEVICE_API service_error_t service_disable_ssl(service_client_t client) | 189 | service_error_t service_disable_ssl(service_client_t client) |
190 | { | 190 | { |
191 | return service_disable_bypass_ssl(client, 0); | 191 | return service_disable_bypass_ssl(client, 0); |
192 | } | 192 | } |
193 | 193 | ||
194 | LIBIMOBILEDEVICE_API service_error_t service_disable_bypass_ssl(service_client_t client, uint8_t sslBypass) | 194 | service_error_t service_disable_bypass_ssl(service_client_t client, uint8_t sslBypass) |
195 | { | 195 | { |
196 | if (!client || !client->connection) | 196 | if (!client || !client->connection) |
197 | return SERVICE_E_INVALID_ARG; | 197 | return SERVICE_E_INVALID_ARG; |
198 | return idevice_to_service_error(idevice_connection_disable_bypass_ssl(client->connection, sslBypass)); | 198 | return idevice_to_service_error(idevice_connection_disable_bypass_ssl(client->connection, sslBypass)); |
199 | } | 199 | } |
200 | 200 | ||
201 | LIBIMOBILEDEVICE_API service_error_t service_get_connection(service_client_t client, idevice_connection_t *connection) | 201 | service_error_t service_get_connection(service_client_t client, idevice_connection_t *connection) |
202 | { | 202 | { |
203 | if (!client || !client->connection || !connection) | 203 | if (!client || !client->connection || !connection) |
204 | return SERVICE_E_INVALID_ARG; | 204 | return SERVICE_E_INVALID_ARG; |
diff --git a/src/service.h b/src/service.h index 3fc3077..071fe3f 100644 --- a/src/service.h +++ b/src/service.h | |||
@@ -21,9 +21,9 @@ | |||
21 | #ifndef SERVICE_H | 21 | #ifndef SERVICE_H |
22 | #define SERVICE_H | 22 | #define SERVICE_H |
23 | 23 | ||
24 | #include "idevice.h" | ||
24 | #include "libimobiledevice/service.h" | 25 | #include "libimobiledevice/service.h" |
25 | #include "libimobiledevice/lockdown.h" | 26 | #include "libimobiledevice/lockdown.h" |
26 | #include "idevice.h" | ||
27 | 27 | ||
28 | struct service_client_private { | 28 | struct service_client_private { |
29 | idevice_connection_t connection; | 29 | idevice_connection_t connection; |
diff --git a/src/syslog_relay.c b/src/syslog_relay.c index ec9eca5..9f4296e 100644 --- a/src/syslog_relay.c +++ b/src/syslog_relay.c | |||
@@ -67,7 +67,7 @@ static syslog_relay_error_t syslog_relay_error(service_error_t err) | |||
67 | return SYSLOG_RELAY_E_UNKNOWN_ERROR; | 67 | return SYSLOG_RELAY_E_UNKNOWN_ERROR; |
68 | } | 68 | } |
69 | 69 | ||
70 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client) | 70 | syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client) |
71 | { | 71 | { |
72 | *client = NULL; | 72 | *client = NULL; |
73 | 73 | ||
@@ -95,14 +95,14 @@ LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_new(idevice_t devi | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label) | 98 | syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label) |
99 | { | 99 | { |
100 | syslog_relay_error_t err = SYSLOG_RELAY_E_UNKNOWN_ERROR; | 100 | syslog_relay_error_t err = SYSLOG_RELAY_E_UNKNOWN_ERROR; |
101 | service_client_factory_start_service(device, SYSLOG_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(syslog_relay_client_new), &err); | 101 | service_client_factory_start_service(device, SYSLOG_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(syslog_relay_client_new), &err); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client) | 105 | syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client) |
106 | { | 106 | { |
107 | if (!client) | 107 | if (!client) |
108 | return SYSLOG_RELAY_E_INVALID_ARG; | 108 | return SYSLOG_RELAY_E_INVALID_ARG; |
@@ -113,12 +113,12 @@ LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_free(syslog_relay_ | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_receive(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received) | 116 | syslog_relay_error_t syslog_relay_receive(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received) |
117 | { | 117 | { |
118 | return syslog_relay_receive_with_timeout(client, data, size, received, 1000); | 118 | return syslog_relay_receive_with_timeout(client, data, size, received, 1000); |
119 | } | 119 | } |
120 | 120 | ||
121 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 121 | syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
122 | { | 122 | { |
123 | syslog_relay_error_t res = SYSLOG_RELAY_E_UNKNOWN_ERROR; | 123 | syslog_relay_error_t res = SYSLOG_RELAY_E_UNKNOWN_ERROR; |
124 | int bytes = 0; | 124 | int bytes = 0; |
@@ -175,7 +175,7 @@ void *syslog_relay_worker(void *arg) | |||
175 | return NULL; | 175 | return NULL; |
176 | } | 176 | } |
177 | 177 | ||
178 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data) | 178 | syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data) |
179 | { | 179 | { |
180 | if (!client || !callback) | 180 | if (!client || !callback) |
181 | return SYSLOG_RELAY_E_INVALID_ARG; | 181 | return SYSLOG_RELAY_E_INVALID_ARG; |
@@ -203,7 +203,7 @@ LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_start_capture(syslog_rela | |||
203 | return res; | 203 | return res; |
204 | } | 204 | } |
205 | 205 | ||
206 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_start_capture_raw(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data) | 206 | syslog_relay_error_t syslog_relay_start_capture_raw(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data) |
207 | { | 207 | { |
208 | if (!client || !callback) | 208 | if (!client || !callback) |
209 | return SYSLOG_RELAY_E_INVALID_ARG; | 209 | return SYSLOG_RELAY_E_INVALID_ARG; |
@@ -231,7 +231,7 @@ LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_start_capture_raw(syslog_ | |||
231 | return res; | 231 | return res; |
232 | } | 232 | } |
233 | 233 | ||
234 | LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client) | 234 | syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client) |
235 | { | 235 | { |
236 | if (client->worker) { | 236 | if (client->worker) { |
237 | /* notify thread to finish */ | 237 | /* notify thread to finish */ |
diff --git a/src/syslog_relay.h b/src/syslog_relay.h index 86d798e..d5263e2 100644 --- a/src/syslog_relay.h +++ b/src/syslog_relay.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef _SYSLOG_RELAY_H | 22 | #ifndef _SYSLOG_RELAY_H |
23 | #define _SYSLOG_RELAY_H | 23 | #define _SYSLOG_RELAY_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/syslog_relay.h" | 26 | #include "libimobiledevice/syslog_relay.h" |
26 | #include "service.h" | 27 | #include "service.h" |
27 | #include <libimobiledevice-glue/thread.h> | 28 | #include <libimobiledevice-glue/thread.h> |
diff --git a/src/webinspector.c b/src/webinspector.c index 3360597..f960fcc 100644 --- a/src/webinspector.c +++ b/src/webinspector.c | |||
@@ -62,7 +62,7 @@ static webinspector_error_t webinspector_error(property_list_service_error_t err | |||
62 | return WEBINSPECTOR_E_UNKNOWN_ERROR; | 62 | return WEBINSPECTOR_E_UNKNOWN_ERROR; |
63 | } | 63 | } |
64 | 64 | ||
65 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client) | 65 | webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client) |
66 | { | 66 | { |
67 | *client = NULL; | 67 | *client = NULL; |
68 | 68 | ||
@@ -89,14 +89,14 @@ LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_new(idevice_t devi | |||
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
91 | 91 | ||
92 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label) | 92 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label) |
93 | { | 93 | { |
94 | webinspector_error_t err = WEBINSPECTOR_E_UNKNOWN_ERROR; | 94 | webinspector_error_t err = WEBINSPECTOR_E_UNKNOWN_ERROR; |
95 | service_client_factory_start_service(device, WEBINSPECTOR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(webinspector_client_new), &err); | 95 | service_client_factory_start_service(device, WEBINSPECTOR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(webinspector_client_new), &err); |
96 | return err; | 96 | return err; |
97 | } | 97 | } |
98 | 98 | ||
99 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_free(webinspector_client_t client) | 99 | webinspector_error_t webinspector_client_free(webinspector_client_t client) |
100 | { | 100 | { |
101 | if (!client) | 101 | if (!client) |
102 | return WEBINSPECTOR_E_INVALID_ARG; | 102 | return WEBINSPECTOR_E_INVALID_ARG; |
@@ -107,7 +107,7 @@ LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_free(webinspector_ | |||
107 | return err; | 107 | return err; |
108 | } | 108 | } |
109 | 109 | ||
110 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist) | 110 | webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist) |
111 | { | 111 | { |
112 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; | 112 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; |
113 | 113 | ||
@@ -164,12 +164,12 @@ LIBIMOBILEDEVICE_API webinspector_error_t webinspector_send(webinspector_client_ | |||
164 | return res; | 164 | return res; |
165 | } | 165 | } |
166 | 166 | ||
167 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist) | 167 | webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist) |
168 | { | 168 | { |
169 | return webinspector_receive_with_timeout(client, plist, 5000); | 169 | return webinspector_receive_with_timeout(client, plist, 5000); |
170 | } | 170 | } |
171 | 171 | ||
172 | LIBIMOBILEDEVICE_API webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms) | 172 | webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms) |
173 | { | 173 | { |
174 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; | 174 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; |
175 | plist_t message = NULL; | 175 | plist_t message = NULL; |
diff --git a/src/webinspector.h b/src/webinspector.h index 67421bc..d249c58 100644 --- a/src/webinspector.h +++ b/src/webinspector.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef __WEBINSPECTOR_H | 22 | #ifndef __WEBINSPECTOR_H |
23 | #define __WEBINSPECTOR_H | 23 | #define __WEBINSPECTOR_H |
24 | 24 | ||
25 | #include "idevice.h" | ||
25 | #include "libimobiledevice/webinspector.h" | 26 | #include "libimobiledevice/webinspector.h" |
26 | #include "property_list_service.h" | 27 | #include "property_list_service.h" |
27 | 28 | ||