From 2ce660f06cd9399d8aaf3c585130ba6d410b1d17 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 21 Apr 2009 17:20:36 +0200 Subject: AFC cleanup and improved error handling --- src/AFC.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/AFC.h') diff --git a/src/AFC.h b/src/AFC.h index 86a924e..41b4d67 100644 --- a/src/AFC.h +++ b/src/AFC.h @@ -27,14 +27,18 @@ #include #include #include +#include + +#define AFC_MAGIC "CFA6LPAA" +#define AFC_MAGIC_LEN (8) typedef struct { - uint32_t header1, header2; - uint32_t entire_length, unknown1, this_length, unknown2, packet_num, unknown3, operation, unknown4; + char magic[AFC_MAGIC_LEN]; + uint64_t entire_length, this_length, packet_num, operation; } AFCPacket; typedef struct { - uint32_t filehandle, unknown1, size, unknown2; + uint64_t filehandle, size; } AFCFilePacket; typedef struct __AFCToken { @@ -47,11 +51,16 @@ struct iphone_afc_client_int { AFCPacket *afc_packet; int file_handle; int lock; + int afcerror; GMutex *mutex; }; struct iphone_afc_file_int { - uint32_t filehandle, blocks, size, type; + uint32_t filehandle; + uint32_t blocks; + off_t size; + uint32_t mode; + uint32_t nlink; }; @@ -88,3 +97,4 @@ enum { }; uint32_t iphone_afc_get_file_handle(iphone_afc_file_t file); +static int afcerror_to_errno(int afcerror); -- cgit v1.1-32-gdbae