summaryrefslogtreecommitdiffstats
path: root/dev/afccheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'dev/afccheck.c')
-rw-r--r--dev/afccheck.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index b107437..9174e32 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -25,6 +25,7 @@
25#include <glib.h> 25#include <glib.h>
26 26
27#include <libiphone/libiphone.h> 27#include <libiphone/libiphone.h>
28#include <libiphone/lockdown.h>
28#include <libiphone/afc.h> 29#include <libiphone/afc.h>
29 30
30#define BUFFER_SIZE 20000 31#define BUFFER_SIZE 20000
@@ -40,10 +41,10 @@ typedef struct {
40void check_afc(gpointer data) 41void check_afc(gpointer data)
41{ 42{
42 //prepare a buffer 43 //prepare a buffer
43 int buffersize = BUFFER_SIZE * sizeof(int); 44 unsigned int buffersize = BUFFER_SIZE * sizeof(unsigned int);
44 int *buf = (int *) malloc(buffersize); 45 int *buf = (int *) malloc(buffersize);
45 int *buf2 = (int *) malloc(buffersize); 46 int *buf2 = (int *) malloc(buffersize);
46 int bytes = 0; 47 unsigned int bytes = 0;
47 //fill buffer 48 //fill buffer
48 int i = 0; 49 int i = 0;
49 for (i = 0; i < BUFFER_SIZE; i++) { 50 for (i = 0; i < BUFFER_SIZE; i++) {
@@ -84,7 +85,7 @@ void check_afc(gpointer data)
84 85
85int main(int argc, char *argv[]) 86int main(int argc, char *argv[])
86{ 87{
87 iphone_lckd_client_t control = NULL; 88 lockdownd_client_t client = NULL;
88 iphone_device_t phone = NULL; 89 iphone_device_t phone = NULL;
89 GError *err; 90 GError *err;
90 int port = 0; 91 int port = 0;
@@ -95,13 +96,13 @@ int main(int argc, char *argv[])
95 return 1; 96 return 1;
96 } 97 }
97 98
98 if (IPHONE_E_SUCCESS != iphone_lckd_new_client(phone, &control)) { 99 if (IPHONE_E_SUCCESS != lockdownd_new_client(phone, &client)) {
99 iphone_free_device(phone); 100 iphone_free_device(phone);
100 return 1; 101 return 1;
101 } 102 }
102 103
103 if (IPHONE_E_SUCCESS == iphone_lckd_start_service(control, "com.apple.afc", &port) && !port) { 104 if (IPHONE_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) {
104 iphone_lckd_free_client(control); 105 lockdownd_free_client(client);
105 iphone_free_device(phone); 106 iphone_free_device(phone);
106 fprintf(stderr, "Something went wrong when starting AFC."); 107 fprintf(stderr, "Something went wrong when starting AFC.");
107 return 1; 108 return 1;
@@ -128,7 +129,7 @@ int main(int argc, char *argv[])
128 } 129 }
129 130
130 131
131 iphone_lckd_free_client(control); 132 lockdownd_free_client(client);
132 iphone_free_device(phone); 133 iphone_free_device(phone);
133 134
134 return 0; 135 return 0;