summaryrefslogtreecommitdiffstats
path: root/include/libiphone
diff options
context:
space:
mode:
Diffstat (limited to 'include/libiphone')
-rw-r--r--include/libiphone/afc.h54
-rw-r--r--include/libiphone/libiphone.h40
2 files changed, 54 insertions, 40 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
5extern "C" {
6#endif
7
8#include <libiphone/libiphone.h>
9
10typedef 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
19typedef enum {
20 AFC_HARDLINK = 1,
21 AFC_SYMLINK = 2
22} afc_link_type_t;
23
24struct afc_client_int;
25typedef struct afc_client_int *afc_client_t;
26
27//afc related functions
28iphone_error_t afc_new_client ( iphone_device_t device, int dst_port, afc_client_t *client );
29iphone_error_t afc_free_client ( afc_client_t client );
30int afc_get_afcerror ( afc_client_t client );
31int afc_get_errno ( afc_client_t client );
32
33iphone_error_t afc_get_devinfo ( afc_client_t client, char ***infos );
34iphone_error_t afc_get_dir_list ( afc_client_t client, const char *dir, char ***list);
35
36iphone_error_t afc_get_file_info ( afc_client_t client, const char *filename, char ***infolist );
37iphone_error_t afc_open_file ( afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle );
38iphone_error_t afc_close_file ( afc_client_t client, uint64_t handle);
39iphone_error_t afc_lock_file ( afc_client_t client, uint64_t handle, int operation);
40iphone_error_t afc_read_file ( afc_client_t client, uint64_t handle, char *data, int length, uint32_t *bytes);
41iphone_error_t afc_write_file ( afc_client_t client, uint64_t handle, const char *data, int length, uint32_t *bytes);
42iphone_error_t afc_seek_file ( afc_client_t client, uint64_t handle, int64_t offset, int whence);
43iphone_error_t afc_truncate_file ( afc_client_t client, uint64_t handle, uint64_t newsize);
44iphone_error_t afc_delete_file ( afc_client_t client, const char *path);
45iphone_error_t afc_rename_file ( afc_client_t client, const char *from, const char *to);
46iphone_error_t afc_mkdir ( afc_client_t client, const char *dir);
47iphone_error_t afc_truncate ( afc_client_t client, const char *path, off_t newsize);
48iphone_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
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index 463efa7..3f5d86c 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -54,29 +54,12 @@ extern "C" {
54 54
55typedef int16_t iphone_error_t; 55typedef int16_t iphone_error_t;
56 56
57typedef enum {
58 AFC_FOPEN_RDONLY = 0x00000001, // r O_RDONLY
59 AFC_FOPEN_RW = 0x00000002, // r+ O_RDWR | O_CREAT
60 AFC_FOPEN_WRONLY = 0x00000003, // w O_WRONLY | O_CREAT | O_TRUNC
61 AFC_FOPEN_WR = 0x00000004, // w+ O_RDWR | O_CREAT | O_TRUNC
62 AFC_FOPEN_APPEND = 0x00000005, // a O_WRONLY | O_APPEND | O_CREAT
63 AFC_FOPEN_RDAPPEND = 0x00000006 // a+ O_RDWR | O_APPEND | O_CREAT
64} iphone_afc_file_mode_t;
65
66typedef enum {
67 IPHONE_AFC_HARDLINK = 1,
68 IPHONE_AFC_SYMLINK = 2
69} iphone_afc_link_type_t;
70
71struct iphone_device_int; 57struct iphone_device_int;
72typedef struct iphone_device_int *iphone_device_t; 58typedef struct iphone_device_int *iphone_device_t;
73 59
74struct iphone_lckd_client_int; 60struct iphone_lckd_client_int;
75typedef struct iphone_lckd_client_int *iphone_lckd_client_t; 61typedef struct iphone_lckd_client_int *iphone_lckd_client_t;
76 62
77struct iphone_afc_client_int;
78typedef struct iphone_afc_client_int *iphone_afc_client_t;
79
80struct iphone_msync_client_int; 63struct iphone_msync_client_int;
81typedef struct iphone_msync_client_int *iphone_msync_client_t; 64typedef struct iphone_msync_client_int *iphone_msync_client_t;
82 65
@@ -111,29 +94,6 @@ iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, plist_t* plist);
111iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, plist_t plist); 94iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, plist_t plist);
112 95
113 96
114//afc related functions
115iphone_error_t iphone_afc_new_client ( iphone_device_t device, int dst_port, iphone_afc_client_t *client );
116iphone_error_t iphone_afc_free_client ( iphone_afc_client_t client );
117int iphone_afc_get_afcerror ( iphone_afc_client_t client );
118int iphone_afc_get_errno ( iphone_afc_client_t client );
119
120iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***infos );
121iphone_error_t iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir, char ***list);
122
123iphone_error_t iphone_afc_get_file_info ( iphone_afc_client_t client, const char *filename, char ***infolist );
124iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, iphone_afc_file_mode_t file_mode, uint64_t *handle );
125iphone_error_t iphone_afc_close_file ( iphone_afc_client_t client, uint64_t handle);
126iphone_error_t iphone_afc_lock_file ( iphone_afc_client_t client, uint64_t handle, int operation);
127iphone_error_t iphone_afc_read_file ( iphone_afc_client_t client, uint64_t handle, char *data, int length, uint32_t *bytes);
128iphone_error_t iphone_afc_write_file ( iphone_afc_client_t client, uint64_t handle, const char *data, int length, uint32_t *bytes);
129iphone_error_t iphone_afc_seek_file ( iphone_afc_client_t client, uint64_t handle, int64_t offset, int whence);
130iphone_error_t iphone_afc_truncate_file ( iphone_afc_client_t client, uint64_t handle, uint64_t newsize);
131iphone_error_t iphone_afc_delete_file ( iphone_afc_client_t client, const char *path);
132iphone_error_t iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to);
133iphone_error_t iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir);
134iphone_error_t iphone_afc_truncate(iphone_afc_client_t client, const char *path, off_t newsize);
135iphone_error_t iphone_afc_make_link ( iphone_afc_client_t client, iphone_afc_link_type_t linktype, const char *target, const char *linkname);
136
137 97
138iphone_error_t iphone_msync_new_client(iphone_device_t device, int dst_port, 98iphone_error_t iphone_msync_new_client(iphone_device_t device, int dst_port,
139 iphone_msync_client_t * client); 99 iphone_msync_client_t * client);