diff options
Diffstat (limited to 'include/libimobiledevice')
| -rw-r--r-- | include/libimobiledevice/afc.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/include/libimobiledevice/afc.h b/include/libimobiledevice/afc.h index a3cde32..4b92fa0 100644 --- a/include/libimobiledevice/afc.h +++ b/include/libimobiledevice/afc.h | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * @file libimobiledevice/afc.h | 2 | * @file libimobiledevice/afc.h |
| 3 | * @brief Access the filesystem. | 3 | * @brief Access the filesystem on the device. |
| 4 | * \internal | 4 | * \internal |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2014 Martin Szulecki All Rights Reserved. | ||
| 6 | * Copyright (c) 2009 Nikias Bassen All Rights Reserved. | 7 | * Copyright (c) 2009 Nikias Bassen All Rights Reserved. |
| 7 | * | 8 | * |
| 8 | * This library is free software; you can redistribute it and/or | 9 | * This library is free software; you can redistribute it and/or |
| @@ -102,11 +103,11 @@ typedef afc_client_private *afc_client_t; /**< The client handle. */ | |||
| 102 | * @param device The device to connect to. | 103 | * @param device The device to connect to. |
| 103 | * @param service The service descriptor returned by lockdownd_start_service. | 104 | * @param service The service descriptor returned by lockdownd_start_service. |
| 104 | * @param client Pointer that will be set to a newly allocated afc_client_t | 105 | * @param client Pointer that will be set to a newly allocated afc_client_t |
| 105 | * upon successful return. | 106 | * upon successful return. |
| 106 | * | 107 | * |
| 107 | * @return AFC_E_SUCCESS on success, AFC_E_INVALID_ARG if device or service is | 108 | * @return AFC_E_SUCCESS on success, AFC_E_INVALID_ARG if device or service is |
| 108 | * invalid, AFC_E_MUX_ERROR if the connection cannot be established, | 109 | * invalid, AFC_E_MUX_ERROR if the connection cannot be established, |
| 109 | * or AFC_E_NO_MEM if there is a memory allocation problem. | 110 | * or AFC_E_NO_MEM if there is a memory allocation problem. |
| 110 | */ | 111 | */ |
| 111 | afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t *client); | 112 | afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t *client); |
| 112 | 113 | ||
| @@ -114,20 +115,18 @@ afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t serv | |||
| 114 | * Starts a new AFC service on the specified device and connects to it. | 115 | * Starts a new AFC service on the specified device and connects to it. |
| 115 | * | 116 | * |
| 116 | * @param device The device to connect to. | 117 | * @param device The device to connect to. |
| 117 | * @param client Pointer that will point to a newly allocated | 118 | * @param client Pointer that will point to a newly allocated afc_client_t upon |
| 118 | * afc_client_t upon successful return. Must be freed using | 119 | * successful return. Must be freed using afc_client_free() after use. |
| 119 | * afc_client_free() after use. | ||
| 120 | * @param label The label to use for communication. Usually the program name. | 120 | * @param label The label to use for communication. Usually the program name. |
| 121 | * Pass NULL to disable sending the label in requests to lockdownd. | 121 | * Pass NULL to disable sending the label in requests to lockdownd. |
| 122 | * | 122 | * |
| 123 | * @return AFC_E_SUCCESS on success, or an AFC_E_* error | 123 | * @return AFC_E_SUCCESS on success, or an AFC_E_* error code otherwise. |
| 124 | * code otherwise. | ||
| 125 | */ | 124 | */ |
| 126 | afc_error_t afc_client_start_service(idevice_t device, afc_client_t* client, const char* label); | 125 | afc_error_t afc_client_start_service(idevice_t device, afc_client_t* client, const char* label); |
| 127 | 126 | ||
| 128 | /** | 127 | /** |
| 129 | * Frees up an AFC client. If the connection was created by the | 128 | * Frees up an AFC client. If the connection was created by the client itself, |
| 130 | * client itself, the connection will be closed. | 129 | * the connection will be closed. |
| 131 | * | 130 | * |
| 132 | * @param client The client to free. | 131 | * @param client The client to free. |
| 133 | */ | 132 | */ |
| @@ -179,9 +178,9 @@ afc_error_t afc_get_file_info(afc_client_t client, const char *filename, char ** | |||
| 179 | * @param client The client to use to open the file. | 178 | * @param client The client to use to open the file. |
| 180 | * @param filename The file to open. (must be a fully-qualified path) | 179 | * @param filename The file to open. (must be a fully-qualified path) |
| 181 | * @param file_mode The mode to use to open the file. Can be AFC_FILE_READ or | 180 | * @param file_mode The mode to use to open the file. Can be AFC_FILE_READ or |
| 182 | * AFC_FILE_WRITE; the former lets you read and write, | 181 | * AFC_FILE_WRITE; the former lets you read and write, however, and the |
| 183 | * however, and the second one will *create* the file, | 182 | * second one will *create* the file, destroying anything previously |
| 184 | * destroying anything previously there. | 183 | * there. |
| 185 | * @param handle Pointer to a uint64_t that will hold the handle of the file | 184 | * @param handle Pointer to a uint64_t that will hold the handle of the file |
| 186 | * | 185 | * |
| 187 | * @return AFC_E_SUCCESS on success or an AFC_E_* error value. | 186 | * @return AFC_E_SUCCESS on success or an AFC_E_* error value. |
| @@ -199,14 +198,14 @@ afc_error_t afc_file_close(afc_client_t client, uint64_t handle); | |||
| 199 | /** | 198 | /** |
| 200 | * Locks or unlocks a file on the device. | 199 | * Locks or unlocks a file on the device. |
| 201 | * | 200 | * |
| 202 | * makes use of flock on the device, see | 201 | * Makes use of flock on the device. |
| 203 | * http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/flock.2.html | 202 | * @see http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/flock.2.html |
| 204 | * | 203 | * |
| 205 | * @param client The client to lock the file with. | 204 | * @param client The client to lock the file with. |
| 206 | * @param handle File handle of a previously opened file. | 205 | * @param handle File handle of a previously opened file. |
| 207 | * @param operation the lock or unlock operation to perform, this is one of | 206 | * @param operation the lock or unlock operation to perform, this is one of |
| 208 | * AFC_LOCK_SH (shared lock), AFC_LOCK_EX (exclusive lock), | 207 | * AFC_LOCK_SH (shared lock), AFC_LOCK_EX (exclusive lock), or |
| 209 | * or AFC_LOCK_UN (unlock). | 208 | * AFC_LOCK_UN (unlock). |
| 210 | */ | 209 | */ |
| 211 | afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation); | 210 | afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation); |
| 212 | 211 | ||
