diff options
| author | 2009-07-06 19:38:00 +0200 | |
|---|---|---|
| committer | 2009-07-18 10:39:41 -0700 | |
| commit | 4105af17e9f2df5405afa6a74a02a304ed6bacff (patch) | |
| tree | daf79b623def5a66810466842197f3bc696c8c28 /include/libiphone/afc.h | |
| parent | 6de08b1e12946b85a595f82c1c04391d70d8b828 (diff) | |
| download | libimobiledevice-4105af17e9f2df5405afa6a74a02a304ed6bacff.tar.gz libimobiledevice-4105af17e9f2df5405afa6a74a02a304ed6bacff.tar.bz2 | |
API cleanup for AFC
Diffstat (limited to 'include/libiphone/afc.h')
| -rw-r--r-- | include/libiphone/afc.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/libiphone/afc.h b/include/libiphone/afc.h new file mode 100644 index 0000000..2a0bbad --- /dev/null +++ b/include/libiphone/afc.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #ifndef AFC_H | ||
| 2 | #define AFC_H | ||
| 3 | |||
| 4 | #ifdef __cplusplus | ||
| 5 | extern "C" { | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #include <libiphone/libiphone.h> | ||
| 9 | |||
| 10 | typedef enum { | ||
| 11 | AFC_FOPEN_RDONLY = 0x00000001, // r O_RDONLY | ||
| 12 | AFC_FOPEN_RW = 0x00000002, // r+ O_RDWR | O_CREAT | ||
| 13 | AFC_FOPEN_WRONLY = 0x00000003, // w O_WRONLY | O_CREAT | O_TRUNC | ||
| 14 | AFC_FOPEN_WR = 0x00000004, // w+ O_RDWR | O_CREAT | O_TRUNC | ||
| 15 | AFC_FOPEN_APPEND = 0x00000005, // a O_WRONLY | O_APPEND | O_CREAT | ||
| 16 | AFC_FOPEN_RDAPPEND = 0x00000006 // a+ O_RDWR | O_APPEND | O_CREAT | ||
| 17 | } afc_file_mode_t; | ||
| 18 | |||
| 19 | typedef enum { | ||
| 20 | AFC_HARDLINK = 1, | ||
| 21 | AFC_SYMLINK = 2 | ||
| 22 | } afc_link_type_t; | ||
| 23 | |||
| 24 | struct afc_client_int; | ||
| 25 | typedef struct afc_client_int *afc_client_t; | ||
| 26 | |||
| 27 | //afc related functions | ||
| 28 | iphone_error_t afc_new_client ( iphone_device_t device, int dst_port, afc_client_t *client ); | ||
| 29 | iphone_error_t afc_free_client ( afc_client_t client ); | ||
| 30 | int afc_get_afcerror ( afc_client_t client ); | ||
| 31 | int afc_get_errno ( afc_client_t client ); | ||
| 32 | |||
| 33 | iphone_error_t afc_get_devinfo ( afc_client_t client, char ***infos ); | ||
| 34 | iphone_error_t afc_get_dir_list ( afc_client_t client, const char *dir, char ***list); | ||
| 35 | |||
| 36 | iphone_error_t afc_get_file_info ( afc_client_t client, const char *filename, char ***infolist ); | ||
| 37 | iphone_error_t afc_open_file ( afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle ); | ||
| 38 | iphone_error_t afc_close_file ( afc_client_t client, uint64_t handle); | ||
| 39 | iphone_error_t afc_lock_file ( afc_client_t client, uint64_t handle, int operation); | ||
| 40 | iphone_error_t afc_read_file ( afc_client_t client, uint64_t handle, char *data, int length, uint32_t *bytes); | ||
| 41 | iphone_error_t afc_write_file ( afc_client_t client, uint64_t handle, const char *data, int length, uint32_t *bytes); | ||
| 42 | iphone_error_t afc_seek_file ( afc_client_t client, uint64_t handle, int64_t offset, int whence); | ||
| 43 | iphone_error_t afc_truncate_file ( afc_client_t client, uint64_t handle, uint64_t newsize); | ||
| 44 | iphone_error_t afc_delete_file ( afc_client_t client, const char *path); | ||
| 45 | iphone_error_t afc_rename_file ( afc_client_t client, const char *from, const char *to); | ||
| 46 | iphone_error_t afc_mkdir ( afc_client_t client, const char *dir); | ||
| 47 | iphone_error_t afc_truncate ( afc_client_t client, const char *path, off_t newsize); | ||
| 48 | iphone_error_t afc_make_link ( afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname); | ||
| 49 | |||
| 50 | #ifdef __cplusplus | ||
| 51 | } | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #endif | ||
