diff options
author | Nikias Bassen | 2009-04-21 17:20:36 +0200 |
---|---|---|
committer | Matt Colyer | 2009-05-08 07:57:09 -0700 |
commit | 2ce660f06cd9399d8aaf3c585130ba6d410b1d17 (patch) | |
tree | c1f4301c00b6e1e761d6a7726248b049ea37b40c /src/AFC.h | |
parent | 7a93c3469de1063e48c8b946fa9ed9019de6934c (diff) | |
download | libimobiledevice-2ce660f06cd9399d8aaf3c585130ba6d410b1d17.tar.gz libimobiledevice-2ce660f06cd9399d8aaf3c585130ba6d410b1d17.tar.bz2 |
AFC cleanup and improved error handling
Diffstat (limited to 'src/AFC.h')
-rw-r--r-- | src/AFC.h | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -27,14 +27,18 @@ #include <stdlib.h> #include <sys/stat.h> #include <glib.h> +#include <stdint.h> + +#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); |