diff options
Diffstat (limited to 'src/AFC.h')
| -rw-r--r-- | src/AFC.h | 36 |
1 files changed, 10 insertions, 26 deletions
| @@ -33,25 +33,24 @@ typedef struct { | |||
| 33 | } AFCPacket; | 33 | } AFCPacket; |
| 34 | 34 | ||
| 35 | typedef struct { | 35 | typedef struct { |
| 36 | usbmux_connection *connection; | ||
| 37 | AFCPacket *afc_packet; | ||
| 38 | int file_handle; | ||
| 39 | int lock; | ||
| 40 | } AFClient; | ||
| 41 | |||
| 42 | typedef struct { | ||
| 43 | uint32 filehandle, unknown1, size, unknown2; | 36 | uint32 filehandle, unknown1, size, unknown2; |
| 44 | } AFCFilePacket; | 37 | } AFCFilePacket; |
| 45 | 38 | ||
| 46 | typedef struct { | ||
| 47 | uint32 filehandle, blocks, size, type; | ||
| 48 | } AFCFile; | ||
| 49 | |||
| 50 | typedef struct __AFCToken { | 39 | typedef struct __AFCToken { |
| 51 | struct __AFCToken *last, *next; | 40 | struct __AFCToken *last, *next; |
| 52 | char *token; | 41 | char *token; |
| 53 | } AFCToken; | 42 | } AFCToken; |
| 54 | 43 | ||
| 44 | struct iphone_afc_client_int { | ||
| 45 | iphone_umux_client_t connection; | ||
| 46 | AFCPacket *afc_packet; | ||
| 47 | int file_handle; | ||
| 48 | int lock; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct iphone_afc_file_int { | ||
| 52 | uint32 filehandle, blocks, size, type; | ||
| 53 | }; | ||
| 55 | 54 | ||
| 56 | enum { | 55 | enum { |
| 57 | AFC_FILE_READ = 0x00000002, // seems to be able to read and write files | 56 | AFC_FILE_READ = 0x00000002, // seems to be able to read and write files |
| @@ -82,18 +81,3 @@ enum { | |||
| 82 | AFC_WRITE = 0x00000010 | 81 | AFC_WRITE = 0x00000010 |
| 83 | }; | 82 | }; |
| 84 | 83 | ||
| 85 | AFClient *afc_connect(iPhone *phone, int s_port, int d_port); | ||
| 86 | void afc_disconnect(AFClient *client); | ||
| 87 | |||
| 88 | char **afc_get_devinfo(AFClient *client); | ||
| 89 | char **afc_get_dir_list(AFClient *client, const char *dir); | ||
| 90 | AFCFile *afc_get_file_info(AFClient *client, const char *path); | ||
| 91 | AFCFile *afc_open_file(AFClient *client, const char *filename, uint32 file_mode); | ||
| 92 | void afc_close_file(AFClient *client, AFCFile *file); | ||
| 93 | int afc_read_file(AFClient *client, AFCFile *file, char *data, int length); | ||
| 94 | int afc_write_file(AFClient *client, AFCFile *file, const char *data, int length); | ||
| 95 | int afc_seek_file(AFClient *client, AFCFile *file, int seekpos); | ||
| 96 | int afc_truncate_file(AFClient *client, AFCFile *file, uint32 newsize); | ||
| 97 | int afc_delete_file(AFClient *client, const char *path); | ||
| 98 | int afc_rename_file(AFClient *client, const char *from, const char *to); | ||
| 99 | int afc_mkdir(AFClient *client, const char *dir); | ||
