summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-01-28 22:18:41 +0100
committerGravatar Martin Szulecki2010-01-29 02:16:00 +0100
commit96101a1231a4ddfeb40fd738a24e108a3a904048 (patch)
tree65a8f54354d9acbbba93dac2c8602d07e469482c /tools
parent45b88ae3956de089fdc35605910f1359a1d3961c (diff)
downloadlibimobiledevice-96101a1231a4ddfeb40fd738a24e108a3a904048.tar.gz
libimobiledevice-96101a1231a4ddfeb40fd738a24e108a3a904048.tar.bz2
Global renames due to project rename to libimobiledevice
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am34
-rw-r--r--tools/idevice_id.c (renamed from tools/iphone_id.c)20
-rw-r--r--tools/idevicebackup.c (renamed from tools/iphonebackup.c)36
-rw-r--r--tools/ideviceinfo.c (renamed from tools/iphoneinfo.c)28
-rw-r--r--tools/idevicesyslog.c (renamed from tools/iphonesyslog.c)36
5 files changed, 77 insertions, 77 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index d19ef0c..9b6a6e8 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -3,25 +3,25 @@ INCLUDES = -I$(top_srcdir)/include
3AM_CFLAGS = $(GLOBAL_CFLAGS) $(libglib2_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libgthread2_CFLAGS) $(LFS_CFLAGS) 3AM_CFLAGS = $(GLOBAL_CFLAGS) $(libglib2_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libgthread2_CFLAGS) $(LFS_CFLAGS)
4AM_LDFLAGS = $(libglib2_LIBS) $(libgnutls_LIBS) $(libtasn1_LIBS) $(libgthread2_LIBS) 4AM_LDFLAGS = $(libglib2_LIBS) $(libgnutls_LIBS) $(libtasn1_LIBS) $(libgthread2_LIBS)
5 5
6bin_PROGRAMS = iphone_id iphoneinfo iphonesyslog iphonebackup 6bin_PROGRAMS = idevice_id ideviceinfo idevicesyslog idevicebackup
7 7
8iphoneinfo_SOURCES = iphoneinfo.c 8ideviceinfo_SOURCES = ideviceinfo.c
9iphoneinfo_CFLAGS = $(AM_CFLAGS) 9ideviceinfo_CFLAGS = $(AM_CFLAGS)
10iphoneinfo_LDFLAGS = $(AM_LDFLAGS) 10ideviceinfo_LDFLAGS = $(AM_LDFLAGS)
11iphoneinfo_LDADD = ../src/libiphone.la 11ideviceinfo_LDADD = ../src/libimobiledevice.la
12 12
13iphonesyslog_SOURCES = iphonesyslog.c 13idevicesyslog_SOURCES = idevicesyslog.c
14iphonesyslog_CFLAGS = $(AM_CFLAGS) 14idevicesyslog_CFLAGS = $(AM_CFLAGS)
15iphonesyslog_LDFLAGS = $(AM_LDFLAGS) 15idevicesyslog_LDFLAGS = $(AM_LDFLAGS)
16iphonesyslog_LDADD = ../src/libiphone.la 16idevicesyslog_LDADD = ../src/libimobiledevice.la
17 17
18iphone_id_SOURCES = iphone_id.c 18idevice_id_SOURCES = idevice_id.c
19iphone_id_CFLAGS = $(AM_CFLAGS) 19idevice_id_CFLAGS = $(AM_CFLAGS)
20iphone_id_LDFLAGS = $(AM_LDFLAGS) 20idevice_id_LDFLAGS = $(AM_LDFLAGS)
21iphone_id_LDADD = ../src/libiphone.la 21idevice_id_LDADD = ../src/libimobiledevice.la
22 22
23iphonebackup_SOURCES = iphonebackup.c 23idevicebackup_SOURCES = idevicebackup.c
24iphonebackup_CFLAGS = $(AM_CFLAGS) 24idevicebackup_CFLAGS = $(AM_CFLAGS)
25iphonebackup_LDFLAGS = $(AM_LDFLAGS) 25idevicebackup_LDFLAGS = $(AM_LDFLAGS)
26iphonebackup_LDADD = ../src/libiphone.la 26idevicebackup_LDADD = ../src/libimobiledevice.la
27 27
diff --git a/tools/iphone_id.c b/tools/idevice_id.c
index 4a2c3af..1facb60 100644
--- a/tools/iphone_id.c
+++ b/tools/idevice_id.c
@@ -1,8 +1,8 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <string.h> 2#include <string.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#include <libiphone/libiphone.h> 4#include <libimobiledevice/libimobiledevice.h>
5#include <libiphone/lockdown.h> 5#include <libimobiledevice/lockdown.h>
6 6
7#define MODE_NONE 0 7#define MODE_NONE 0
8#define MODE_SHOW_ID 1 8#define MODE_SHOW_ID 1
@@ -25,7 +25,7 @@ static void print_usage(int argc, char **argv)
25 25
26int main(int argc, char **argv) 26int main(int argc, char **argv)
27{ 27{
28 iphone_device_t phone = NULL; 28 idevice_t phone = NULL;
29 lockdownd_client_t client = NULL; 29 lockdownd_client_t client = NULL;
30 char **dev_list = NULL; 30 char **dev_list = NULL;
31 char *devname = NULL; 31 char *devname = NULL;
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
38 /* parse cmdline args */ 38 /* parse cmdline args */
39 for (i = 1; i < argc; i++) { 39 for (i = 1; i < argc; i++) {
40 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { 40 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
41 iphone_set_debug_level(1); 41 idevice_set_debug_level(1);
42 continue; 42 continue;
43 } 43 }
44 else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) { 44 else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) {
@@ -63,14 +63,14 @@ int main(int argc, char **argv)
63 63
64 switch (mode) { 64 switch (mode) {
65 case MODE_SHOW_ID: 65 case MODE_SHOW_ID:
66 iphone_device_new(&phone, uuid); 66 idevice_new(&phone, uuid);
67 if (!phone) { 67 if (!phone) {
68 fprintf(stderr, "ERROR: No device with UUID=%s attached.\n", uuid); 68 fprintf(stderr, "ERROR: No device with UUID=%s attached.\n", uuid);
69 return -2; 69 return -2;
70 } 70 }
71 71
72 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "iphone_id")) { 72 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "idevice_id")) {
73 iphone_device_free(phone); 73 idevice_free(phone);
74 fprintf(stderr, "ERROR: Connecting to device failed!\n"); 74 fprintf(stderr, "ERROR: Connecting to device failed!\n");
75 return -2; 75 return -2;
76 } 76 }
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
81 } 81 }
82 82
83 lockdownd_client_free(client); 83 lockdownd_client_free(client);
84 iphone_device_free(phone); 84 idevice_free(phone);
85 85
86 if (ret == 0) { 86 if (ret == 0) {
87 printf("%s\n", devname); 87 printf("%s\n", devname);
@@ -94,14 +94,14 @@ int main(int argc, char **argv)
94 return ret; 94 return ret;
95 case MODE_LIST_DEVICES: 95 case MODE_LIST_DEVICES:
96 default: 96 default:
97 if (iphone_get_device_list(&dev_list, &i) < 0) { 97 if (idevice_get_device_list(&dev_list, &i) < 0) {
98 fprintf(stderr, "ERROR: Unable to retrieve device list!\n"); 98 fprintf(stderr, "ERROR: Unable to retrieve device list!\n");
99 return -1; 99 return -1;
100 } 100 }
101 for (i = 0; dev_list[i] != NULL; i++) { 101 for (i = 0; dev_list[i] != NULL; i++) {
102 printf("%s\n", dev_list[i]); 102 printf("%s\n", dev_list[i]);
103 } 103 }
104 iphone_device_list_free(dev_list); 104 idevice_device_list_free(dev_list);
105 return 0; 105 return 0;
106 } 106 }
107} 107}
diff --git a/tools/iphonebackup.c b/tools/idevicebackup.c
index bc61347..d3b3ccc 100644
--- a/tools/iphonebackup.c
+++ b/tools/idevicebackup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * iphonebackup.c 2 * idevicebackup.c
3 * Command line interface to use the device's backup and restore service 3 * Command line interface to use the device's backup and restore service
4 * 4 *
5 * Copyright (c) 2009-2010 Martin Szulecki All Rights Reserved. 5 * Copyright (c) 2009-2010 Martin Szulecki All Rights Reserved.
@@ -27,18 +27,18 @@
27#include <signal.h> 27#include <signal.h>
28#include <glib.h> 28#include <glib.h>
29 29
30#include <libiphone/libiphone.h> 30#include <libimobiledevice/libimobiledevice.h>
31#include <libiphone/lockdown.h> 31#include <libimobiledevice/lockdown.h>
32#include <libiphone/mobilebackup.h> 32#include <libimobiledevice/mobilebackup.h>
33#include <libiphone/notification_proxy.h> 33#include <libimobiledevice/notification_proxy.h>
34#include <libiphone/afc.h> 34#include <libimobiledevice/afc.h>
35 35
36#define MOBILEBACKUP_SERVICE_NAME "com.apple.mobilebackup" 36#define MOBILEBACKUP_SERVICE_NAME "com.apple.mobilebackup"
37#define NP_SERVICE_NAME "com.apple.mobile.notification_proxy" 37#define NP_SERVICE_NAME "com.apple.mobile.notification_proxy"
38 38
39static mobilebackup_client_t mobilebackup = NULL; 39static mobilebackup_client_t mobilebackup = NULL;
40static lockdownd_client_t client = NULL; 40static lockdownd_client_t client = NULL;
41static iphone_device_t phone = NULL; 41static idevice_t phone = NULL;
42 42
43static int quit_flag = 0; 43static int quit_flag = 0;
44 44
@@ -111,7 +111,7 @@ static plist_t mobilebackup_factory_info_plist_new()
111 plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); 111 plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node));
112 112
113 value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); 113 value_node = plist_dict_get_item(root_node, "UniqueDeviceID");
114 iphone_device_get_uuid(phone, &uuid); 114 idevice_get_uuid(phone, &uuid);
115 plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); 115 plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid));
116 116
117 /* uppercase */ 117 /* uppercase */
@@ -383,7 +383,7 @@ static void do_post_notification(const char *notification)
383 np_client_t np; 383 np_client_t np;
384 384
385 if (!client) { 385 if (!client) {
386 if (lockdownd_client_new_with_handshake(phone, &client, "iphonebackup") != LOCKDOWN_E_SUCCESS) { 386 if (lockdownd_client_new_with_handshake(phone, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) {
387 return; 387 return;
388 } 388 }
389 } 389 }
@@ -427,7 +427,7 @@ static void print_usage(int argc, char **argv)
427 427
428int main(int argc, char *argv[]) 428int main(int argc, char *argv[])
429{ 429{
430 iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; 430 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
431 int i; 431 int i;
432 char uuid[41]; 432 char uuid[41];
433 uint16_t port = 0; 433 uint16_t port = 0;
@@ -455,7 +455,7 @@ int main(int argc, char *argv[])
455 /* parse cmdline args */ 455 /* parse cmdline args */
456 for (i = 1; i < argc; i++) { 456 for (i = 1; i < argc; i++) {
457 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { 457 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
458 iphone_set_debug_level(1); 458 idevice_set_debug_level(1);
459 continue; 459 continue;
460 } 460 }
461 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { 461 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) {
@@ -518,23 +518,23 @@ int main(int argc, char *argv[])
518 printf("Backup directory is \"%s\"\n", backup_directory); 518 printf("Backup directory is \"%s\"\n", backup_directory);
519 519
520 if (uuid[0] != 0) { 520 if (uuid[0] != 0) {
521 ret = iphone_device_new(&phone, uuid); 521 ret = idevice_new(&phone, uuid);
522 if (ret != IPHONE_E_SUCCESS) { 522 if (ret != IDEVICE_E_SUCCESS) {
523 printf("No device found with uuid %s, is it plugged in?\n", uuid); 523 printf("No device found with uuid %s, is it plugged in?\n", uuid);
524 return -1; 524 return -1;
525 } 525 }
526 } 526 }
527 else 527 else
528 { 528 {
529 ret = iphone_device_new(&phone, NULL); 529 ret = idevice_new(&phone, NULL);
530 if (ret != IPHONE_E_SUCCESS) { 530 if (ret != IDEVICE_E_SUCCESS) {
531 printf("No device found, is it plugged in?\n"); 531 printf("No device found, is it plugged in?\n");
532 return -1; 532 return -1;
533 } 533 }
534 } 534 }
535 535
536 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphonebackup")) { 536 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicebackup")) {
537 iphone_device_free(phone); 537 idevice_free(phone);
538 return -1; 538 return -1;
539 } 539 }
540 540
@@ -946,7 +946,7 @@ int main(int argc, char *argv[])
946 if (mobilebackup) 946 if (mobilebackup)
947 mobilebackup_client_free(mobilebackup); 947 mobilebackup_client_free(mobilebackup);
948 948
949 iphone_device_free(phone); 949 idevice_free(phone);
950 950
951 return 0; 951 return 0;
952} 952}
diff --git a/tools/iphoneinfo.c b/tools/ideviceinfo.c
index 5ee92f5..9183d92 100644
--- a/tools/iphoneinfo.c
+++ b/tools/ideviceinfo.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * iphoneinfo.c 2 * ideviceinfo.c
3 * Simple utility to show information about an attached device 3 * Simple utility to show information about an attached device
4 * 4 *
5 * Copyright (c) 2009 Martin Szulecki All Rights Reserved. 5 * Copyright (c) 2009 Martin Szulecki All Rights Reserved.
@@ -25,8 +25,8 @@
25#include <stdlib.h> 25#include <stdlib.h>
26#include <glib.h> 26#include <glib.h>
27 27
28#include <libiphone/libiphone.h> 28#include <libimobiledevice/libimobiledevice.h>
29#include <libiphone/lockdown.h> 29#include <libimobiledevice/lockdown.h>
30 30
31#define FORMAT_KEY_VALUE 1 31#define FORMAT_KEY_VALUE 1
32#define FORMAT_XML 2 32#define FORMAT_XML 2
@@ -197,7 +197,7 @@ static void print_usage(int argc, char **argv)
197 197
198 name = strrchr(argv[0], '/'); 198 name = strrchr(argv[0], '/');
199 printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); 199 printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0]));
200 printf("Show information about the first connected iPhone/iPod Touch.\n\n"); 200 printf("Show information about a connected iPhone/iPod Touch.\n\n");
201 printf(" -d, --debug\t\tenable communication debugging\n"); 201 printf(" -d, --debug\t\tenable communication debugging\n");
202 printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); 202 printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n");
203 printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); 203 printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n");
@@ -215,8 +215,8 @@ static void print_usage(int argc, char **argv)
215int main(int argc, char *argv[]) 215int main(int argc, char *argv[])
216{ 216{
217 lockdownd_client_t client = NULL; 217 lockdownd_client_t client = NULL;
218 iphone_device_t phone = NULL; 218 idevice_t phone = NULL;
219 iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; 219 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
220 int i; 220 int i;
221 int format = FORMAT_KEY_VALUE; 221 int format = FORMAT_KEY_VALUE;
222 char uuid[41]; 222 char uuid[41];
@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
231 /* parse cmdline args */ 231 /* parse cmdline args */
232 for (i = 1; i < argc; i++) { 232 for (i = 1; i < argc; i++) {
233 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { 233 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
234 iphone_set_debug_level(1); 234 idevice_set_debug_level(1);
235 continue; 235 continue;
236 } 236 }
237 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { 237 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) {
@@ -279,23 +279,23 @@ int main(int argc, char *argv[])
279 } 279 }
280 280
281 if (uuid[0] != 0) { 281 if (uuid[0] != 0) {
282 ret = iphone_device_new(&phone, uuid); 282 ret = idevice_new(&phone, uuid);
283 if (ret != IPHONE_E_SUCCESS) { 283 if (ret != IDEVICE_E_SUCCESS) {
284 printf("No device found with uuid %s, is it plugged in?\n", uuid); 284 printf("No device found with uuid %s, is it plugged in?\n", uuid);
285 return -1; 285 return -1;
286 } 286 }
287 } 287 }
288 else 288 else
289 { 289 {
290 ret = iphone_device_new(&phone, NULL); 290 ret = idevice_new(&phone, NULL);
291 if (ret != IPHONE_E_SUCCESS) { 291 if (ret != IDEVICE_E_SUCCESS) {
292 printf("No device found, is it plugged in?\n"); 292 printf("No device found, is it plugged in?\n");
293 return -1; 293 return -1;
294 } 294 }
295 } 295 }
296 296
297 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphoneinfo")) { 297 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo")) {
298 iphone_device_free(phone); 298 idevice_free(phone);
299 return -1; 299 return -1;
300 } 300 }
301 301
@@ -329,7 +329,7 @@ int main(int argc, char *argv[])
329 if (domain != NULL) 329 if (domain != NULL)
330 free(domain); 330 free(domain);
331 lockdownd_client_free(client); 331 lockdownd_client_free(client);
332 iphone_device_free(phone); 332 idevice_free(phone);
333 333
334 return 0; 334 return 0;
335} 335}
diff --git a/tools/iphonesyslog.c b/tools/idevicesyslog.c
index 41e490f..32b9711 100644
--- a/tools/iphonesyslog.c
+++ b/tools/idevicesyslog.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * syslog_relay.c 2 * idevicesyslog.c
3 * Relay the syslog of a device to stdout 3 * Relay the syslog of a device to stdout
4 * 4 *
5 * Copyright (c) 2009 Martin Szulecki All Rights Reserved. 5 * Copyright (c) 2009 Martin Szulecki All Rights Reserved.
@@ -26,8 +26,8 @@
26#include <signal.h> 26#include <signal.h>
27#include <stdlib.h> 27#include <stdlib.h>
28 28
29#include <libiphone/libiphone.h> 29#include <libimobiledevice/libimobiledevice.h>
30#include <libiphone/lockdown.h> 30#include <libimobiledevice/lockdown.h>
31 31
32static int quit_flag = 0; 32static int quit_flag = 0;
33 33
@@ -45,8 +45,8 @@ static void clean_exit(int sig)
45int main(int argc, char *argv[]) 45int main(int argc, char *argv[])
46{ 46{
47 lockdownd_client_t client = NULL; 47 lockdownd_client_t client = NULL;
48 iphone_device_t phone = NULL; 48 idevice_t phone = NULL;
49 iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; 49 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
50 int i; 50 int i;
51 char uuid[41]; 51 char uuid[41];
52 uint16_t port = 0; 52 uint16_t port = 0;
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
60 /* parse cmdline args */ 60 /* parse cmdline args */
61 for (i = 1; i < argc; i++) { 61 for (i = 1; i < argc; i++) {
62 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { 62 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
63 iphone_set_debug_level(1); 63 idevice_set_debug_level(1);
64 continue; 64 continue;
65 } 65 }
66 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { 66 else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) {
@@ -83,23 +83,23 @@ int main(int argc, char *argv[])
83 } 83 }
84 84
85 if (uuid[0] != 0) { 85 if (uuid[0] != 0) {
86 ret = iphone_device_new(&phone, uuid); 86 ret = idevice_new(&phone, uuid);
87 if (ret != IPHONE_E_SUCCESS) { 87 if (ret != IDEVICE_E_SUCCESS) {
88 printf("No device found with uuid %s, is it plugged in?\n", uuid); 88 printf("No device found with uuid %s, is it plugged in?\n", uuid);
89 return -1; 89 return -1;
90 } 90 }
91 } 91 }
92 else 92 else
93 { 93 {
94 ret = iphone_device_new(&phone, NULL); 94 ret = idevice_new(&phone, NULL);
95 if (ret != IPHONE_E_SUCCESS) { 95 if (ret != IDEVICE_E_SUCCESS) {
96 printf("No device found, is it plugged in?\n"); 96 printf("No device found, is it plugged in?\n");
97 return -1; 97 return -1;
98 } 98 }
99 } 99 }
100 100
101 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphonesyslog")) { 101 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicesyslog")) {
102 iphone_device_free(phone); 102 idevice_free(phone);
103 return -1; 103 return -1;
104 } 104 }
105 105
@@ -109,15 +109,15 @@ int main(int argc, char *argv[])
109 lockdownd_client_free(client); 109 lockdownd_client_free(client);
110 110
111 /* connect to socket relay messages */ 111 /* connect to socket relay messages */
112 iphone_connection_t conn = NULL; 112 idevice_connection_t conn = NULL;
113 if ((iphone_device_connect(phone, port, &conn) != IPHONE_E_SUCCESS) || !conn) { 113 if ((idevice_connect(phone, port, &conn) != IDEVICE_E_SUCCESS) || !conn) {
114 printf("ERROR: Could not open usbmux connection.\n"); 114 printf("ERROR: Could not open usbmux connection.\n");
115 } else { 115 } else {
116 while (!quit_flag) { 116 while (!quit_flag) {
117 char *receive = NULL; 117 char *receive = NULL;
118 uint32_t datalen = 0, bytes = 0, recv_bytes = 0; 118 uint32_t datalen = 0, bytes = 0, recv_bytes = 0;
119 119
120 ret = iphone_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes); 120 ret = idevice_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes);
121 datalen = ntohl(datalen); 121 datalen = ntohl(datalen);
122 122
123 if (datalen == 0) 123 if (datalen == 0)
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
127 receive = (char *) malloc(sizeof(char) * datalen); 127 receive = (char *) malloc(sizeof(char) * datalen);
128 128
129 while (!quit_flag && (recv_bytes <= datalen)) { 129 while (!quit_flag && (recv_bytes <= datalen)) {
130 ret = iphone_connection_receive(conn, receive, datalen, &bytes); 130 ret = idevice_connection_receive(conn, receive, datalen, &bytes);
131 131
132 if (bytes == 0) 132 if (bytes == 0)
133 break; 133 break;
@@ -140,12 +140,12 @@ int main(int argc, char *argv[])
140 free(receive); 140 free(receive);
141 } 141 }
142 } 142 }
143 iphone_device_disconnect(conn); 143 idevice_disconnect(conn);
144 } else { 144 } else {
145 printf("ERROR: Could not start service com.apple.syslog_relay.\n"); 145 printf("ERROR: Could not start service com.apple.syslog_relay.\n");
146 } 146 }
147 147
148 iphone_device_free(phone); 148 idevice_free(phone);
149 149
150 return 0; 150 return 0;
151} 151}