From abb74bcae219c25cffb7e30db6a34c69dcd92f0a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 6 Jul 2009 19:38:00 +0200 Subject: API cleanup for AFC Signed-off-by: Martin Szulecki --- src/AFC.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/AFC.h') diff --git a/src/AFC.h b/src/AFC.h index a9c33c3..5d337e5 100644 --- a/src/AFC.h +++ b/src/AFC.h @@ -19,9 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libiphone/libiphone.h" -#include "iphone.h" - #include #include #include @@ -46,7 +43,7 @@ typedef struct __AFCToken { char *token; } AFCToken; -struct iphone_afc_client_int { +struct afc_client_int { int sfd; AFCPacket *afc_packet; int file_handle; -- cgit v1.1-32-gdbae From c3d9e80985ef52eebb25bb07512cabc52786c130 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 00:19:47 +0200 Subject: Define remaining unknown AFC operations; SUCCESS is actually a DATA operation --- src/AFC.h | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'src/AFC.h') diff --git a/src/AFC.h b/src/AFC.h index 5d337e5..a0ce0ef 100644 --- a/src/AFC.h +++ b/src/AFC.h @@ -52,35 +52,36 @@ struct afc_client_int { GMutex *mutex; }; +/* AFC Operations */ enum { - AFC_ERROR = 0x00000001, - AFC_SUCCESS_RESPONSE = 0x00000002, - AFC_LIST_DIR = 0x00000003, // ReadDir - // 0x00000004 // ReadFile - // 0x00000005 // WriteFile - // 0x00000006 // WritePart - AFC_TRUNCATE = 0x00000007, // Truncate - AFC_DELETE = 0x00000008, // RemovePath - AFC_MAKE_DIR = 0x00000009, // MakeDir - AFC_GET_INFO = 0x0000000a, // GetFileInfo - AFC_GET_DEVINFO = 0x0000000b, // GetDeviceInfo - // 0x0000000c // same as 5, but writes to temp file, then renames it. - AFC_FILE_OPEN = 0x0000000d, // FileRefOpen - AFC_FILE_HANDLE = 0x0000000e, // _unknownPacket - AFC_READ = 0x0000000f, // FileRefRead - AFC_WRITE = 0x00000010, // FileRefWrite - AFC_FILE_SEEK = 0x00000011, // FileRefSeek - AFC_FILE_TELL = 0x00000012, // FileRefTell - // 0x00000013 // _unknownPacket - AFC_FILE_CLOSE = 0x00000014, // FileRefClose - AFC_FILE_TRUNCATE = 0x00000015, // FileRefSetFileSize (ftruncate) - // 0x00000016 // SetFatalError - // 0x00000017 // SetConnectionOptions - AFC_RENAME = 0x00000018, // RenamePath - // 0x00000019 // SetFSBlockSize (0x800000) - // 0x0000001A // SetBlockSize (0x800000) - AFC_FILE_LOCK = 0x0000001B, // FileRefLock - AFC_MAKE_LINK = 0x0000001C // MakeLink + AFC_OP_STATUS = 0x00000001, // Status + AFC_OP_DATA = 0x00000002, // Data + AFC_OP_READ_DIR = 0x00000003, // ReadDir + AFC_OP_READ_FILE = 0x00000004, // ReadFile + AFC_OP_WRITE_FILE = 0x00000005, // WriteFile + AFC_OP_WRITE_PART = 0x00000006, // WritePart + AFC_OP_TRUNCATE = 0x00000007, // TruncateFile + AFC_OP_REMOVE_PATH = 0x00000008, // RemovePath + AFC_OP_MAKE_DIR = 0x00000009, // MakeDir + AFC_OP_GET_FILE_INFO = 0x0000000a, // GetFileInfo + AFC_OP_GET_DEVINFO = 0x0000000b, // GetDeviceInfo + AFC_OP_WRITE_FILE_ATOM = 0x0000000c, // WriteFileAtomic (tmp file+rename) + AFC_OP_FILE_OPEN = 0x0000000d, // FileRefOpen + AFC_OP_FILE_OPEN_RES = 0x0000000e, // FileRefOpenResult + AFC_OP_READ = 0x0000000f, // FileRefRead + AFC_OP_WRITE = 0x00000010, // FileRefWrite + AFC_OP_FILE_SEEK = 0x00000011, // FileRefSeek + AFC_OP_FILE_TELL = 0x00000012, // FileRefTell + AFC_OP_FILE_TELL_RES = 0x00000013, // FileRefTellResult + AFC_OP_FILE_CLOSE = 0x00000014, // FileRefClose + AFC_OP_FILE_SET_SIZE = 0x00000015, // FileRefSetFileSize (ftruncate) + AFC_OP_GET_CON_INFO = 0x00000016, // GetConnectionInfo + AFC_OP_SET_CON_OPTIONS = 0x00000017, // SetConnectionOptions + AFC_OP_RENAME_PATH = 0x00000018, // RenamePath + AFC_OP_SET_FS_BS = 0x00000019, // SetFSBlockSize (0x800000) + AFC_OP_SET_SOCKET_BS = 0x0000001A, // SetSocketBlockSize (0x800000) + AFC_OP_FILE_LOCK = 0x0000001B, // FileRefLock + AFC_OP_MAKE_LINK = 0x0000001C // MakeLink }; static int afcerror_to_errno(int afcerror); -- cgit v1.1-32-gdbae From 50be30047dbb0d38fd8d61763c13ec75d2b52543 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 03:26:39 +0200 Subject: Update AFC API and use error codes from the STATUS operation response --- src/AFC.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/AFC.h') diff --git a/src/AFC.h b/src/AFC.h index a0ce0ef..909e8c3 100644 --- a/src/AFC.h +++ b/src/AFC.h @@ -26,6 +26,8 @@ #include #include +#include "libiphone/afc.h" + #define AFC_MAGIC "CFA6LPAA" #define AFC_MAGIC_LEN (8) -- cgit v1.1-32-gdbae From 8415e1f13dfc8c31fe4d1ff695af26189297795b Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 03:46:13 +0200 Subject: Remove AFC to errno conversion and make afc_receive_data() return AFC errors --- src/AFC.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/AFC.h') diff --git a/src/AFC.h b/src/AFC.h index 909e8c3..7ed6bd8 100644 --- a/src/AFC.h +++ b/src/AFC.h @@ -50,7 +50,6 @@ struct afc_client_int { AFCPacket *afc_packet; int file_handle; int lock; - int afcerror; GMutex *mutex; }; @@ -86,4 +85,3 @@ enum { AFC_OP_MAKE_LINK = 0x0000001C // MakeLink }; -static int afcerror_to_errno(int afcerror); -- cgit v1.1-32-gdbae