diff options
| author | 2008-08-31 11:47:18 +0200 | |
|---|---|---|
| committer | 2008-08-31 19:33:19 +0200 | |
| commit | 86f61988990daa30c8564e2b26666dd442bd6e65 (patch) | |
| tree | 985400ee8848585dabf8efbe2acbfc37d9b3f2f8 /include | |
| parent | dc89741f00bd6919c0eedbd882c05f66d72fdbee (diff) | |
| download | libimobiledevice-86f61988990daa30c8564e2b26666dd442bd6e65.tar.gz libimobiledevice-86f61988990daa30c8564e2b26666dd442bd6e65.tar.bz2 | |
make all functions return an error code.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libiphone/libiphone.h | 56 |
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 | ||
| 49 | typedef short iphone_error_t; | ||
| 50 | |||
| 49 | enum { | 51 | enum { |
| 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; | |||
| 73 | typedef struct iphone_afc_file_int *iphone_afc_file_t; | 75 | typedef struct iphone_afc_file_int *iphone_afc_file_t; |
| 74 | 76 | ||
| 75 | //device related functions | 77 | //device related functions |
| 76 | int iphone_get_device ( iphone_device_t *device ); | 78 | iphone_error_t iphone_get_device ( iphone_device_t *device ); |
| 77 | void iphone_free_device ( iphone_device_t device ); | 79 | iphone_error_t iphone_free_device ( iphone_device_t device ); |
| 78 | 80 | ||
| 79 | 81 | ||
| 80 | //lockdownd related functions | 82 | //lockdownd related functions |
| 81 | int iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client ); | 83 | iphone_error_t iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client ); |
| 82 | void iphone_lckd_free_client( iphone_lckd_client_t client ); | 84 | iphone_error_t iphone_lckd_free_client( iphone_lckd_client_t client ); |
| 83 | 85 | ||
| 84 | int iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service ); | 86 | iphone_error_t iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service, int *port ); |
| 85 | int iphone_lckd_recv ( iphone_lckd_client_t client, char **dump_data ); | 87 | iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, char **dump_data, uint32_t *recv_bytes ); |
| 86 | int iphone_lckd_send ( iphone_lckd_client_t client, char *raw_data, uint32_t length ); | 88 | iphone_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 |
| 90 | int iphone_mux_new_client ( iphone_device_t device, uint16_t src_port, uint16_t dst_port, iphone_umux_client_t *client ); | 92 | iphone_error_t iphone_mux_new_client ( iphone_device_t device, uint16_t src_port, uint16_t dst_port, iphone_umux_client_t *client ); |
| 91 | void iphone_mux_free_client ( iphone_umux_client_t client ); | 93 | iphone_error_t iphone_mux_free_client ( iphone_umux_client_t client ); |
| 92 | 94 | ||
| 93 | int iphone_mux_send ( iphone_umux_client_t client, const char *data, uint32_t datalen ); | 95 | iphone_error_t iphone_mux_send ( iphone_umux_client_t client, const char *data, uint32_t datalen, uint32_t *sent_bytes ); |
| 94 | int iphone_mux_recv ( iphone_umux_client_t client, char *data, uint32_t datalen ); | 96 | iphone_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 |
| 98 | int iphone_afc_new_client ( iphone_device_t device, int src_port, int dst_port, iphone_afc_client_t *client ); | 100 | iphone_error_t iphone_afc_new_client ( iphone_device_t device, int src_port, int dst_port, iphone_afc_client_t *client ); |
| 99 | void iphone_afc_free_client ( iphone_afc_client_t client ); | 101 | iphone_error_t iphone_afc_free_client ( iphone_afc_client_t client ); |
| 100 | 102 | ||
| 101 | char **iphone_afc_get_devinfo ( iphone_afc_client_t client ); | 103 | iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***infos ); |
| 102 | char **iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir); | 104 | iphone_error_t iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir, char ***list); |
| 103 | 105 | ||
| 104 | int iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf ); | 106 | iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf ); |
| 105 | int iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, uint32_t file_mode, iphone_afc_file_t *file ); | 107 | iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, uint32_t file_mode, iphone_afc_file_t *file ); |
| 106 | void iphone_afc_close_file ( iphone_afc_client_t client, iphone_afc_file_t file); | 108 | iphone_error_t iphone_afc_close_file ( iphone_afc_client_t client, iphone_afc_file_t file); |
| 107 | int iphone_afc_read_file ( iphone_afc_client_t client, iphone_afc_file_t file, char *data, int length); | 109 | iphone_error_t iphone_afc_read_file ( iphone_afc_client_t client, iphone_afc_file_t file, char *data, int length, uint32_t *bytes); |
| 108 | int iphone_afc_write_file ( iphone_afc_client_t client, iphone_afc_file_t file, const char *data, int length); | 110 | iphone_error_t iphone_afc_write_file ( iphone_afc_client_t client, iphone_afc_file_t file, const char *data, int length, uint32_t *bytes); |
| 109 | int iphone_afc_seek_file ( iphone_afc_client_t client, iphone_afc_file_t file, int seekpos); | 111 | iphone_error_t iphone_afc_seek_file ( iphone_afc_client_t client, iphone_afc_file_t file, int seekpos); |
| 110 | int iphone_afc_truncate_file ( iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize); | 112 | iphone_error_t iphone_afc_truncate_file ( iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize); |
| 111 | int iphone_afc_delete_file ( iphone_afc_client_t client, const char *path); | 113 | iphone_error_t iphone_afc_delete_file ( iphone_afc_client_t client, const char *path); |
| 112 | int iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to); | 114 | iphone_error_t iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to); |
| 113 | int iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir); | 115 | iphone_error_t iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir); |
| 114 | 116 | ||
| 115 | 117 | ||
| 116 | #ifdef __cplusplus | 118 | #ifdef __cplusplus |
