summaryrefslogtreecommitdiffstats
path: root/include/libiphone/libiphone.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libiphone/libiphone.h')
-rw-r--r--include/libiphone/libiphone.h56
1 files changed, 29 insertions, 27 deletions
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index 768ff21..26d35ab 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -46,6 +46,8 @@ extern "C" {
46//afc specific error 46//afc specific error
47#define IPHONE_E_NO_SUCH_FILE -10 47#define IPHONE_E_NO_SUCH_FILE -10
48 48
49typedef short iphone_error_t;
50
49enum { 51enum {
50 AFC_FILE_READ = 0x00000002, // seems to be able to read and write files 52 AFC_FILE_READ = 0x00000002, // seems to be able to read and write files
51 AFC_FILE_WRITE = 0x00000003, // writes and creates a file, blanks it out, etc. 53 AFC_FILE_WRITE = 0x00000003, // writes and creates a file, blanks it out, etc.
@@ -73,44 +75,44 @@ struct iphone_afc_file_int;
73typedef struct iphone_afc_file_int *iphone_afc_file_t; 75typedef struct iphone_afc_file_int *iphone_afc_file_t;
74 76
75//device related functions 77//device related functions
76int iphone_get_device ( iphone_device_t *device ); 78iphone_error_t iphone_get_device ( iphone_device_t *device );
77void iphone_free_device ( iphone_device_t device ); 79iphone_error_t iphone_free_device ( iphone_device_t device );
78 80
79 81
80//lockdownd related functions 82//lockdownd related functions
81int iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client ); 83iphone_error_t iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client );
82void iphone_lckd_free_client( iphone_lckd_client_t client ); 84iphone_error_t iphone_lckd_free_client( iphone_lckd_client_t client );
83 85
84int iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service ); 86iphone_error_t iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service, int *port );
85int iphone_lckd_recv ( iphone_lckd_client_t client, char **dump_data ); 87iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, char **dump_data, uint32_t *recv_bytes );
86int iphone_lckd_send ( iphone_lckd_client_t client, char *raw_data, uint32_t length ); 88iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, char *raw_data, uint32_t length, uint32_t *recv_bytes );
87 89
88 90
89//usbmux related functions 91//usbmux related functions
90int iphone_mux_new_client ( iphone_device_t device, uint16_t src_port, uint16_t dst_port, iphone_umux_client_t *client ); 92iphone_error_t iphone_mux_new_client ( iphone_device_t device, uint16_t src_port, uint16_t dst_port, iphone_umux_client_t *client );
91void iphone_mux_free_client ( iphone_umux_client_t client ); 93iphone_error_t iphone_mux_free_client ( iphone_umux_client_t client );
92 94
93int iphone_mux_send ( iphone_umux_client_t client, const char *data, uint32_t datalen ); 95iphone_error_t iphone_mux_send ( iphone_umux_client_t client, const char *data, uint32_t datalen, uint32_t *sent_bytes );
94int iphone_mux_recv ( iphone_umux_client_t client, char *data, uint32_t datalen ); 96iphone_error_t iphone_mux_recv ( iphone_umux_client_t client, char *data, uint32_t datalen, uint32_t *recv_bytes );
95 97
96 98
97//afc related functions 99//afc related functions
98int iphone_afc_new_client ( iphone_device_t device, int src_port, int dst_port, iphone_afc_client_t *client ); 100iphone_error_t iphone_afc_new_client ( iphone_device_t device, int src_port, int dst_port, iphone_afc_client_t *client );
99void iphone_afc_free_client ( iphone_afc_client_t client ); 101iphone_error_t iphone_afc_free_client ( iphone_afc_client_t client );
100 102
101char **iphone_afc_get_devinfo ( iphone_afc_client_t client ); 103iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***infos );
102char **iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir); 104iphone_error_t iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir, char ***list);
103 105
104int iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf ); 106iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf );
105int iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, uint32_t file_mode, iphone_afc_file_t *file ); 107iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, uint32_t file_mode, iphone_afc_file_t *file );
106void iphone_afc_close_file ( iphone_afc_client_t client, iphone_afc_file_t file); 108iphone_error_t iphone_afc_close_file ( iphone_afc_client_t client, iphone_afc_file_t file);
107int iphone_afc_read_file ( iphone_afc_client_t client, iphone_afc_file_t file, char *data, int length); 109iphone_error_t iphone_afc_read_file ( iphone_afc_client_t client, iphone_afc_file_t file, char *data, int length, uint32_t *bytes);
108int iphone_afc_write_file ( iphone_afc_client_t client, iphone_afc_file_t file, const char *data, int length); 110iphone_error_t iphone_afc_write_file ( iphone_afc_client_t client, iphone_afc_file_t file, const char *data, int length, uint32_t *bytes);
109int iphone_afc_seek_file ( iphone_afc_client_t client, iphone_afc_file_t file, int seekpos); 111iphone_error_t iphone_afc_seek_file ( iphone_afc_client_t client, iphone_afc_file_t file, int seekpos);
110int iphone_afc_truncate_file ( iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize); 112iphone_error_t iphone_afc_truncate_file ( iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize);
111int iphone_afc_delete_file ( iphone_afc_client_t client, const char *path); 113iphone_error_t iphone_afc_delete_file ( iphone_afc_client_t client, const char *path);
112int iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to); 114iphone_error_t iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to);
113int iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir); 115iphone_error_t iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir);
114 116
115 117
116#ifdef __cplusplus 118#ifdef __cplusplus