summaryrefslogtreecommitdiffstats
path: root/dev/msyncclient.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-25 02:08:12 +0200
committerGravatar Martin Szulecki2009-07-25 02:08:12 +0200
commit40a0abaa1c7f2196d40276b0689b18a04e468acd (patch)
treeaee97118e637ccc7b8ab638a77a154b6bbed4f4b /dev/msyncclient.c
parent66695e6b7db9457d5ecfe6f4f6624dc195e5274d (diff)
downloadlibimobiledevice-40a0abaa1c7f2196d40276b0689b18a04e468acd.tar.gz
libimobiledevice-40a0abaa1c7f2196d40276b0689b18a04e468acd.tar.bz2
Update MobileSync API and introduce mobilesync error codes
Diffstat (limited to 'dev/msyncclient.c')
-rw-r--r--dev/msyncclient.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/dev/msyncclient.c b/dev/msyncclient.c
index 5eb105d..7651002 100644
--- a/dev/msyncclient.c
+++ b/dev/msyncclient.c
@@ -28,12 +28,12 @@
28#include <libiphone/lockdown.h> 28#include <libiphone/lockdown.h>
29#include <libiphone/mobilesync.h> 29#include <libiphone/mobilesync.h>
30 30
31static iphone_error_t mobilesync_get_all_contacts(mobilesync_client_t client) 31static mobilesync_error_t mobilesync_get_all_contacts(mobilesync_client_t client)
32{ 32{
33 if (!client) 33 if (!client)
34 return IPHONE_E_INVALID_ARG; 34 return MOBILESYNC_E_INVALID_ARG;
35 35
36 iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; 36 mobilesync_error_t ret = MOBILESYNC_E_UNKNOWN_ERROR;
37 plist_t array = NULL; 37 plist_t array = NULL;
38 38
39 array = plist_new_array(); 39 array = plist_new_array();
@@ -124,7 +124,6 @@ static iphone_error_t mobilesync_get_all_contacts(mobilesync_client_t client)
124 plist_free(array); 124 plist_free(array);
125 array = NULL; 125 array = NULL;
126 126
127
128 return ret; 127 return ret;
129} 128}
130 129
@@ -137,7 +136,6 @@ int main(int argc, char *argv[])
137 if (argc > 1 && !strcasecmp(argv[1], "--debug")) 136 if (argc > 1 && !strcasecmp(argv[1], "--debug"))
138 iphone_set_debug_mask(DBGMASK_MOBILESYNC); 137 iphone_set_debug_mask(DBGMASK_MOBILESYNC);
139 138
140
141 if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { 139 if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) {
142 printf("No iPhone found, is it plugged in?\n"); 140 printf("No iPhone found, is it plugged in?\n");
143 return -1; 141 return -1;
@@ -152,10 +150,10 @@ int main(int argc, char *argv[])
152 150
153 if (port) { 151 if (port) {
154 mobilesync_client_t msync = NULL; 152 mobilesync_client_t msync = NULL;
155 mobilesync_new_client(phone, port, &msync); 153 mobilesync_client_new(phone, port, &msync);
156 if (msync) { 154 if (msync) {
157 mobilesync_get_all_contacts(msync); 155 mobilesync_get_all_contacts(msync);
158 mobilesync_free_client(msync); 156 mobilesync_client_free(msync);
159 } 157 }
160 } else { 158 } else {
161 printf("Start service failure.\n"); 159 printf("Start service failure.\n");