@@ -66,6 +66,7 @@ typedef unsigned int mach_error_t;
66
66
typedef unsigned int afc_error_t ;
67
67
typedef unsigned int usbmux_error_t ;
68
68
typedef unsigned int service_conn_t ;
69
+ typedef service_conn_t * ServiceConnRef ;
69
70
70
71
struct am_recovery_device ;
71
72
@@ -142,6 +143,8 @@ typedef struct afc_connection {
142
143
unsigned int context ; /* 40 */
143
144
} __attribute__ ((packed )) afc_connection ;
144
145
146
+ typedef struct afc_connection * AFCConnectionRef ;
147
+
145
148
typedef struct afc_directory {
146
149
unsigned char unknown [0 ]; /* size unknown */
147
150
} __attribute__ ((packed )) afc_directory ;
@@ -258,10 +261,10 @@ mach_error_t AMDeviceStartSession(struct am_device *device);
258
261
*/
259
262
260
263
mach_error_t AMDeviceStartService (struct am_device * device , CFStringRef
261
- service_name , service_conn_t * handle , unsigned int *
264
+ service_name , ServiceConnRef handle , unsigned int *
262
265
unknown );
263
266
264
- mach_error_t AMDeviceStartHouseArrestService (struct am_device * device , CFStringRef identifier , void * unknown , service_conn_t * handle , unsigned int * what );
267
+ mach_error_t AMDeviceStartHouseArrestService (struct am_device * device , CFStringRef identifier , void * unknown , ServiceConnRef handle , unsigned int * what );
265
268
266
269
/* Stops a session. You should do this before accessing services.
267
270
*
@@ -281,10 +284,10 @@ mach_error_t AMDeviceStopSession(struct am_device *device);
281
284
*/
282
285
283
286
afc_error_t AFCConnectionOpen (service_conn_t handle , unsigned int io_timeout ,
284
- struct afc_connection * * conn );
287
+ AFCConnectionRef * conn );
285
288
286
289
/* Pass in a pointer to an afc_device_info structure. It will be filled. */
287
- afc_error_t AFCDeviceInfoOpen (afc_connection * conn , struct
290
+ afc_error_t AFCDeviceInfoOpen (AFCConnectionRef conn , struct
288
291
afc_dictionary * * info );
289
292
290
293
/* Turns debug mode on if the environment variable AFCDEBUG is set to a numeric
@@ -300,7 +303,7 @@ afc_error_t AFCDeviceInfoOpen(afc_connection *conn, struct
300
303
* MDERR_OK if successful
301
304
*/
302
305
303
- afc_error_t AFCDirectoryOpen (afc_connection * conn , const char * path ,
306
+ afc_error_t AFCDirectoryOpen (AFCConnectionRef conn , const char * path ,
304
307
struct afc_directory * * dir );
305
308
306
309
/* Acquires the next entry in a directory previously opened with
@@ -313,30 +316,30 @@ afc_error_t AFCDirectoryOpen(afc_connection *conn, const char *path,
313
316
* MDERR_OK if successful, even if no entries remain
314
317
*/
315
318
316
- afc_error_t AFCDirectoryRead (afc_connection * conn /*unsigned int unused*/ , struct afc_directory * dir ,
319
+ afc_error_t AFCDirectoryRead (AFCConnectionRef conn /*unsigned int unused*/ , struct afc_directory * dir ,
317
320
char * * dirent );
318
321
319
- afc_error_t AFCDirectoryClose (afc_connection * conn , struct afc_directory * dir );
320
- afc_error_t AFCDirectoryCreate (afc_connection * conn , const char * dirname );
321
- afc_error_t AFCRemovePath (afc_connection * conn , const char * dirname );
322
- afc_error_t AFCRenamePath (afc_connection * conn , const char * from , const char * to );
323
- afc_error_t AFCLinkPath (afc_connection * conn , long long int linktype , const char * target , const char * linkname );
322
+ afc_error_t AFCDirectoryClose (AFCConnectionRef conn , struct afc_directory * dir );
323
+ afc_error_t AFCDirectoryCreate (AFCConnectionRef conn , const char * dirname );
324
+ afc_error_t AFCRemovePath (AFCConnectionRef conn , const char * dirname );
325
+ afc_error_t AFCRenamePath (AFCConnectionRef conn , const char * from , const char * to );
326
+ afc_error_t AFCLinkPath (AFCConnectionRef conn , long long int linktype , const char * target , const char * linkname );
324
327
325
328
/* Returns the context field of the given AFC connection. */
326
- unsigned int AFCConnectionGetContext (afc_connection * conn );
329
+ unsigned int AFCConnectionGetContext (AFCConnectionRef conn );
327
330
328
331
/* Returns the fs_block_size field of the given AFC connection. */
329
- unsigned int AFCConnectionGetFSBlockSize (afc_connection * conn );
332
+ unsigned int AFCConnectionGetFSBlockSize (AFCConnectionRef conn );
330
333
331
334
/* Returns the io_timeout field of the given AFC connection. In iTunes this is
332
335
* 0. */
333
- unsigned int AFCConnectionGetIOTimeout (afc_connection * conn );
336
+ unsigned int AFCConnectionGetIOTimeout (AFCConnectionRef conn );
334
337
335
338
/* Returns the sock_block_size field of the given AFC connection. */
336
- unsigned int AFCConnectionGetSocketBlockSize (afc_connection * conn );
339
+ unsigned int AFCConnectionGetSocketBlockSize (AFCConnectionRef conn );
337
340
338
341
/* Closes the given AFC connection. */
339
- afc_error_t AFCConnectionClose (afc_connection * conn );
342
+ afc_error_t AFCConnectionClose (AFCConnectionRef conn );
340
343
341
344
/* Registers for device notifications related to the restore process. unknown0
342
345
* is zero when iTunes calls this. In iTunes,
@@ -392,19 +395,19 @@ CFMutableDictionaryRef AMRestoreCreateDefaultOptions(CFAllocatorRef allocator);
392
395
* ------------------------------------------------------------------------- */
393
396
394
397
/* mode 2 = read, mode 3 = write */
395
- afc_error_t AFCFileRefOpen (afc_connection * conn , const char * path ,
398
+ afc_error_t AFCFileRefOpen (AFCConnectionRef conn , const char * path ,
396
399
unsigned long long mode , afc_file_ref * ref );
397
- afc_error_t AFCFileRefSeek (afc_connection * conn , afc_file_ref ref ,
400
+ afc_error_t AFCFileRefSeek (AFCConnectionRef conn , afc_file_ref ref ,
398
401
unsigned long long offset1 , unsigned long long offset2 );
399
- afc_error_t AFCFileRefRead (afc_connection * conn , afc_file_ref ref ,
402
+ afc_error_t AFCFileRefRead (AFCConnectionRef conn , afc_file_ref ref ,
400
403
void * buf , size_t * len );
401
- afc_error_t AFCFileRefSetFileSize (afc_connection * conn , afc_file_ref ref ,
404
+ afc_error_t AFCFileRefSetFileSize (AFCConnectionRef conn , afc_file_ref ref ,
402
405
unsigned long long offset );
403
- afc_error_t AFCFileRefWrite (afc_connection * conn , afc_file_ref ref ,
406
+ afc_error_t AFCFileRefWrite (AFCConnectionRef conn , afc_file_ref ref ,
404
407
const void * buf , size_t len );
405
- afc_error_t AFCFileRefClose (afc_connection * conn , afc_file_ref ref );
408
+ afc_error_t AFCFileRefClose (AFCConnectionRef conn , afc_file_ref ref );
406
409
407
- afc_error_t AFCFileInfoOpen (afc_connection * conn , const char * path , struct
410
+ afc_error_t AFCFileInfoOpen (AFCConnectionRef conn , const char * path , struct
408
411
afc_dictionary * * info );
409
412
afc_error_t AFCKeyValueRead (struct afc_dictionary * dict , char * * key , char * *
410
413
val );
0 commit comments