diff options
author | 2024-01-31 02:57:11 +0100 | |
---|---|---|
committer | 2024-01-31 02:57:11 +0100 | |
commit | 63bbac545efc400373a7f472fdd78174149119c3 (patch) | |
tree | f95c8d58b7b0fbf33bd188c5becc0401ee7e64ef /include/libimobiledevice/libimobiledevice.h | |
parent | f723a44513eb5ba5797da24bc2b63d9f09600a6e (diff) | |
download | libimobiledevice-63bbac545efc400373a7f472fdd78174149119c3.tar.gz libimobiledevice-63bbac545efc400373a7f472fdd78174149119c3.tar.bz2 |
Move LIBIMOBILEDEVICE_API to public headers
Diffstat (limited to 'include/libimobiledevice/libimobiledevice.h')
-rw-r--r-- | include/libimobiledevice/libimobiledevice.h | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h index 6851145..66b4145 100644 --- a/include/libimobiledevice/libimobiledevice.h +++ b/include/libimobiledevice/libimobiledevice.h | |||
@@ -35,6 +35,16 @@ extern "C" { | |||
35 | #include <sys/stat.h> | 35 | #include <sys/stat.h> |
36 | #include <plist/plist.h> | 36 | #include <plist/plist.h> |
37 | 37 | ||
38 | #ifndef LIBIMOBILEDEVICE_API | ||
39 | #ifdef LIBIMOBILEDEVICE_STATIC | ||
40 | #define LIBIMOBILEDEVICE_API | ||
41 | #elif defined(_WIN32) | ||
42 | #define LIBIMOBILEDEVICE_API __declspec(dllimport) | ||
43 | #else | ||
44 | #define LIBIMOBILEDEVICE_API | ||
45 | #endif | ||
46 | #endif | ||
47 | |||
38 | /** Error Codes */ | 48 | /** Error Codes */ |
39 | typedef enum { | 49 | typedef enum { |
40 | IDEVICE_E_SUCCESS = 0, | 50 | IDEVICE_E_SUCCESS = 0, |
@@ -104,7 +114,7 @@ typedef struct idevice_subscription_context* idevice_subscription_context_t; | |||
104 | * | 114 | * |
105 | * @param level Set to 0 for no debug output or 1 to enable debug output. | 115 | * @param level Set to 0 for no debug output or 1 to enable debug output. |
106 | */ | 116 | */ |
107 | void idevice_set_debug_level(int level); | 117 | LIBIMOBILEDEVICE_API void idevice_set_debug_level(int level); |
108 | 118 | ||
109 | /** | 119 | /** |
110 | * Subscribe a callback function that will be called when device add/remove | 120 | * Subscribe a callback function that will be called when device add/remove |
@@ -119,7 +129,7 @@ void idevice_set_debug_level(int level); | |||
119 | * | 129 | * |
120 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 130 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
121 | */ | 131 | */ |
122 | idevice_error_t idevice_events_subscribe(idevice_subscription_context_t *context, idevice_event_cb_t callback, void *user_data); | 132 | LIBIMOBILEDEVICE_API idevice_error_t idevice_events_subscribe(idevice_subscription_context_t *context, idevice_event_cb_t callback, void *user_data); |
123 | 133 | ||
124 | /** | 134 | /** |
125 | * Unsubscribe the event callback function that has been registered with | 135 | * Unsubscribe the event callback function that has been registered with |
@@ -129,7 +139,7 @@ idevice_error_t idevice_events_subscribe(idevice_subscription_context_t *context | |||
129 | * | 139 | * |
130 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 140 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
131 | */ | 141 | */ |
132 | idevice_error_t idevice_events_unsubscribe(idevice_subscription_context_t context); | 142 | LIBIMOBILEDEVICE_API idevice_error_t idevice_events_unsubscribe(idevice_subscription_context_t context); |
133 | 143 | ||
134 | /** | 144 | /** |
135 | * (DEPRECATED) Register a callback function that will be called when device add/remove | 145 | * (DEPRECATED) Register a callback function that will be called when device add/remove |
@@ -143,7 +153,7 @@ idevice_error_t idevice_events_unsubscribe(idevice_subscription_context_t contex | |||
143 | * | 153 | * |
144 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 154 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
145 | */ | 155 | */ |
146 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); | 156 | LIBIMOBILEDEVICE_API idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); |
147 | 157 | ||
148 | /** | 158 | /** |
149 | * (DEPRECATED) Release the event callback function that has been registered with | 159 | * (DEPRECATED) Release the event callback function that has been registered with |
@@ -153,7 +163,7 @@ idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_ | |||
153 | * | 163 | * |
154 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 164 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
155 | */ | 165 | */ |
156 | idevice_error_t idevice_event_unsubscribe(void); | 166 | LIBIMOBILEDEVICE_API idevice_error_t idevice_event_unsubscribe(void); |
157 | 167 | ||
158 | /* discovery (synchronous) */ | 168 | /* discovery (synchronous) */ |
159 | 169 | ||
@@ -170,7 +180,7 @@ idevice_error_t idevice_event_unsubscribe(void); | |||
170 | * network devices in the list, use idevice_get_device_list_extended(). | 180 | * network devices in the list, use idevice_get_device_list_extended(). |
171 | * @see idevice_get_device_list_extended | 181 | * @see idevice_get_device_list_extended |
172 | */ | 182 | */ |
173 | idevice_error_t idevice_get_device_list(char ***devices, int *count); | 183 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list(char ***devices, int *count); |
174 | 184 | ||
175 | /** | 185 | /** |
176 | * Free a list of device UDIDs. | 186 | * Free a list of device UDIDs. |
@@ -179,7 +189,7 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count); | |||
179 | * | 189 | * |
180 | * @return Always returnes IDEVICE_E_SUCCESS. | 190 | * @return Always returnes IDEVICE_E_SUCCESS. |
181 | */ | 191 | */ |
182 | idevice_error_t idevice_device_list_free(char **devices); | 192 | LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_free(char **devices); |
183 | 193 | ||
184 | /** | 194 | /** |
185 | * Get a list of currently available devices | 195 | * Get a list of currently available devices |
@@ -190,7 +200,7 @@ idevice_error_t idevice_device_list_free(char **devices); | |||
190 | * | 200 | * |
191 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 201 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
192 | */ | 202 | */ |
193 | idevice_error_t idevice_get_device_list_extended(idevice_info_t **devices, int *count); | 203 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list_extended(idevice_info_t **devices, int *count); |
194 | 204 | ||
195 | /** | 205 | /** |
196 | * Free an extended device list retrieved through idevice_get_device_list_extended(). | 206 | * Free an extended device list retrieved through idevice_get_device_list_extended(). |
@@ -199,7 +209,7 @@ idevice_error_t idevice_get_device_list_extended(idevice_info_t **devices, int * | |||
199 | * | 209 | * |
200 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. | 210 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occurred. |
201 | */ | 211 | */ |
202 | idevice_error_t idevice_device_list_extended_free(idevice_info_t *devices); | 212 | LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_extended_free(idevice_info_t *devices); |
203 | 213 | ||
204 | /* device structure creation and destruction */ | 214 | /* device structure creation and destruction */ |
205 | 215 | ||
@@ -220,7 +230,7 @@ idevice_error_t idevice_device_list_extended_free(idevice_info_t *devices); | |||
220 | * | 230 | * |
221 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 231 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
222 | */ | 232 | */ |
223 | idevice_error_t idevice_new(idevice_t *device, const char *udid); | 233 | LIBIMOBILEDEVICE_API idevice_error_t idevice_new(idevice_t *device, const char *udid); |
224 | 234 | ||
225 | /** | 235 | /** |
226 | * Creates an idevice_t structure for the device specified by UDID, | 236 | * Creates an idevice_t structure for the device specified by UDID, |
@@ -243,14 +253,14 @@ idevice_error_t idevice_new(idevice_t *device, const char *udid); | |||
243 | * | 253 | * |
244 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 254 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
245 | */ | 255 | */ |
246 | idevice_error_t idevice_new_with_options(idevice_t *device, const char *udid, enum idevice_options options); | 256 | LIBIMOBILEDEVICE_API idevice_error_t idevice_new_with_options(idevice_t *device, const char *udid, enum idevice_options options); |
247 | 257 | ||
248 | /** | 258 | /** |
249 | * Cleans up an idevice structure, then frees the structure itself. | 259 | * Cleans up an idevice structure, then frees the structure itself. |
250 | * | 260 | * |
251 | * @param device idevice_t to free. | 261 | * @param device idevice_t to free. |
252 | */ | 262 | */ |
253 | idevice_error_t idevice_free(idevice_t device); | 263 | LIBIMOBILEDEVICE_API idevice_error_t idevice_free(idevice_t device); |
254 | 264 | ||
255 | /* connection/disconnection */ | 265 | /* connection/disconnection */ |
256 | 266 | ||
@@ -264,7 +274,7 @@ idevice_error_t idevice_free(idevice_t device); | |||
264 | * | 274 | * |
265 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 275 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
266 | */ | 276 | */ |
267 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection); | 277 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection); |
268 | 278 | ||
269 | /** | 279 | /** |
270 | * Disconnect from the device and clean up the connection structure. | 280 | * Disconnect from the device and clean up the connection structure. |
@@ -273,7 +283,7 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect | |||
273 | * | 283 | * |
274 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 284 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
275 | */ | 285 | */ |
276 | idevice_error_t idevice_disconnect(idevice_connection_t connection); | 286 | LIBIMOBILEDEVICE_API idevice_error_t idevice_disconnect(idevice_connection_t connection); |
277 | 287 | ||
278 | /* communication */ | 288 | /* communication */ |
279 | 289 | ||
@@ -288,7 +298,7 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection); | |||
288 | * | 298 | * |
289 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 299 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
290 | */ | 300 | */ |
291 | idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); | 301 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); |
292 | 302 | ||
293 | /** | 303 | /** |
294 | * Receive data from a device via the given connection. | 304 | * Receive data from a device via the given connection. |
@@ -305,7 +315,7 @@ idevice_error_t idevice_connection_send(idevice_connection_t connection, const c | |||
305 | * | 315 | * |
306 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 316 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
307 | */ | 317 | */ |
308 | idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); | 318 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); |
309 | 319 | ||
310 | /** | 320 | /** |
311 | * Receive data from a device via the given connection. | 321 | * Receive data from a device via the given connection. |
@@ -320,7 +330,7 @@ idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connecti | |||
320 | * | 330 | * |
321 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 331 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
322 | */ | 332 | */ |
323 | idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes); | 333 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes); |
324 | 334 | ||
325 | /** | 335 | /** |
326 | * Enables SSL for the given connection. | 336 | * Enables SSL for the given connection. |
@@ -331,7 +341,7 @@ idevice_error_t idevice_connection_receive(idevice_connection_t connection, char | |||
331 | * is NULL or connection->ssl_data is non-NULL, or IDEVICE_E_SSL_ERROR when | 341 | * is NULL or connection->ssl_data is non-NULL, or IDEVICE_E_SSL_ERROR when |
332 | * SSL initialization, setup, or handshake fails. | 342 | * SSL initialization, setup, or handshake fails. |
333 | */ | 343 | */ |
334 | idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection); | 344 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection); |
335 | 345 | ||
336 | /** | 346 | /** |
337 | * Disable SSL for the given connection. | 347 | * Disable SSL for the given connection. |
@@ -342,7 +352,7 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection); | |||
342 | * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not | 352 | * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not |
343 | * enabled and does no further error checking on cleanup. | 353 | * enabled and does no further error checking on cleanup. |
344 | */ | 354 | */ |
345 | idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection); | 355 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection); |
346 | 356 | ||
347 | /** | 357 | /** |
348 | * Disable bypass SSL for the given connection without sending out terminate messages. | 358 | * Disable bypass SSL for the given connection without sending out terminate messages. |
@@ -355,7 +365,7 @@ idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection); | |||
355 | * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not | 365 | * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not |
356 | * enabled and does no further error checking on cleanup. | 366 | * enabled and does no further error checking on cleanup. |
357 | */ | 367 | */ |
358 | idevice_error_t idevice_connection_disable_bypass_ssl(idevice_connection_t connection, uint8_t sslBypass); | 368 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_bypass_ssl(idevice_connection_t connection, uint8_t sslBypass); |
359 | 369 | ||
360 | 370 | ||
361 | /** | 371 | /** |
@@ -366,7 +376,7 @@ idevice_error_t idevice_connection_disable_bypass_ssl(idevice_connection_t conne | |||
366 | * | 376 | * |
367 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 377 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
368 | */ | 378 | */ |
369 | idevice_error_t idevice_connection_get_fd(idevice_connection_t connection, int *fd); | 379 | LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_get_fd(idevice_connection_t connection, int *fd); |
370 | 380 | ||
371 | /* misc */ | 381 | /* misc */ |
372 | 382 | ||
@@ -378,7 +388,7 @@ idevice_error_t idevice_connection_get_fd(idevice_connection_t connection, int * | |||
378 | * | 388 | * |
379 | * @return IDEVICE_E_SUCCESS on success, otherwise an error code. | 389 | * @return IDEVICE_E_SUCCESS on success, otherwise an error code. |
380 | */ | 390 | */ |
381 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); | 391 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); |
382 | 392 | ||
383 | /** | 393 | /** |
384 | * Gets the Unique Device ID for the device. | 394 | * Gets the Unique Device ID for the device. |
@@ -388,7 +398,7 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); | |||
388 | * | 398 | * |
389 | * @return IDEVICE_E_SUCCESS on success, otherwise an error code. | 399 | * @return IDEVICE_E_SUCCESS on success, otherwise an error code. |
390 | */ | 400 | */ |
391 | idevice_error_t idevice_get_udid(idevice_t device, char **udid); | 401 | LIBIMOBILEDEVICE_API idevice_error_t idevice_get_udid(idevice_t device, char **udid); |
392 | 402 | ||
393 | #ifdef __cplusplus | 403 | #ifdef __cplusplus |
394 | } | 404 | } |