summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/mobilesync.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libimobiledevice/mobilesync.h')
-rw-r--r--include/libimobiledevice/mobilesync.h53
1 files changed, 28 insertions, 25 deletions
diff --git a/include/libimobiledevice/mobilesync.h b/include/libimobiledevice/mobilesync.h
index 005ef3f..c3bc53d 100644
--- a/include/libimobiledevice/mobilesync.h
+++ b/include/libimobiledevice/mobilesync.h
@@ -34,6 +34,7 @@ extern "C" {
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
+/** Service identifier passed to lockdownd_start_service() to start the mobilesync service */
#define MOBILESYNC_SERVICE_NAME "com.apple.mobilesync"
/** Error Codes */
@@ -59,14 +60,16 @@ typedef enum {
MOBILESYNC_SYNC_TYPE_RESET /**< Reset-sync signals that the computer should send all data again. */
} mobilesync_sync_type_t;
-typedef struct mobilesync_client_private mobilesync_client_private;
+typedef struct mobilesync_client_private mobilesync_client_private; /**< \private */
typedef mobilesync_client_private *mobilesync_client_t; /**< The client handle */
+/** Anchors used by the device and computer (structure) */
typedef struct {
- char *device_anchor;
- char *computer_anchor;
+ char *device_anchor; /**< device anchor */
+ char *computer_anchor; /**< computer anchor */
} mobilesync_anchors;
-typedef mobilesync_anchors *mobilesync_anchors_t; /**< Anchors used by the device and computer. */
+/** Anchors used by the device and computer */
+typedef mobilesync_anchors *mobilesync_anchors_t;
/* Interface */
@@ -83,7 +86,7 @@ typedef mobilesync_anchors *mobilesync_anchors_t; /**< Anchors used by the devic
* @retval DEVICE_LINK_SERVICE_E_BAD_VERSION if the mobilesync version on
* the device is newer.
*/
-mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilesync_client_t * client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilesync_client_t * client);
/**
* Starts a new mobilesync service on the specified device and connects to it.
@@ -98,7 +101,7 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_des
* @return MOBILESYNC_E_SUCCESS on success, or an MOBILESYNC_E_* error
* code otherwise.
*/
-mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t* client, const char* label);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t* client, const char* label);
/**
* Disconnects a mobilesync client from the device and frees up the
@@ -109,7 +112,7 @@ mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_
* @retval MOBILESYNC_E_SUCCESS on success
* @retval MOBILESYNC_E_INVALID_ARG if \a client is NULL.
*/
-mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
/**
@@ -120,7 +123,7 @@ mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
*
* @return an error code
*/
-mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t *plist);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t *plist);
/**
* Sends mobilesync data to the device
@@ -133,7 +136,7 @@ mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t *plist
*
* @return an error code
*/
-mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist);
/**
@@ -156,7 +159,7 @@ mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist);
* @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
* sync request
*/
-mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description);
/**
* Cancels a running synchronization session with a device at any time.
@@ -167,7 +170,7 @@ mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data
* @retval MOBILESYNC_E_SUCCESS on success
* @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
*/
-mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason);
/**
* Finish a synchronization session of a data class on the device.
@@ -180,7 +183,7 @@ mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* rea
* @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid
* form
*/
-mobilesync_error_t mobilesync_finish(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_finish(mobilesync_client_t client);
/**
@@ -193,7 +196,7 @@ mobilesync_error_t mobilesync_finish(mobilesync_client_t client);
* @retval MOBILESYNC_E_SUCCESS on success
* @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
*/
-mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client);
/**
* Requests to receive only changed records of the currently set data class from the device.
@@ -205,7 +208,7 @@ mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t cl
* @retval MOBILESYNC_E_SUCCESS on success
* @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
*/
-mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client);
/**
* Requests the device to delete all records of the current data class
@@ -218,7 +221,7 @@ mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client
* @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
* @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
*/
-mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client);
/**
@@ -234,7 +237,7 @@ mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t cl
* @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
* session
*/
-mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions);
/**
* Acknowledges to the device that the changes have been merged on the computer
@@ -244,7 +247,7 @@ mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_
* @retval MOBILESYNC_E_SUCCESS on success
* @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
*/
-mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client);
/**
@@ -264,7 +267,7 @@ mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_
* @retval MOBILESYNC_E_NOT_READY if the device is not ready to start
* receiving any changes
*/
-mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client);
/**
@@ -281,7 +284,7 @@ mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_cli
* @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does
* not permit this call
*/
-mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions);
/**
* Receives any remapped identifiers reported after the device merged submitted changes.
@@ -298,7 +301,7 @@ mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t e
* @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
* session
*/
-mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping);
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping);
/* Helper */
@@ -311,14 +314,14 @@ mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plis
*
* @return A new #mobilesync_anchors_t struct. Must be freed using mobilesync_anchors_free().
*/
-mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor);
+LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor);
/**
* Free memory used by anchors.
*
* @param anchors The anchors to free.
*/
-void mobilesync_anchors_free(mobilesync_anchors_t anchors);
+LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors);
/**
@@ -326,7 +329,7 @@ void mobilesync_anchors_free(mobilesync_anchors_t anchors);
*
* @return A new plist_t of type PLIST_DICT.
*/
-plist_t mobilesync_actions_new(void);
+LIBIMOBILEDEVICE_API plist_t mobilesync_actions_new(void);
/**
* Add one or more new key:value pairs to the given actions plist.
@@ -340,14 +343,14 @@ plist_t mobilesync_actions_new(void);
* integer to use as a boolean value indicating that the device should
* link submitted changes and report remapped identifiers.
*/
-void mobilesync_actions_add(plist_t actions, ...);
+LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...);
/**
* Free actions plist.
*
* @param actions The actions plist to free. Does nothing if NULL is passed.
*/
-void mobilesync_actions_free(plist_t actions);
+LIBIMOBILEDEVICE_API void mobilesync_actions_free(plist_t actions);
#ifdef __cplusplus
}