summaryrefslogtreecommitdiffstats
path: root/src/mobilesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mobilesync.c')
-rw-r--r--src/mobilesync.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/mobilesync.c b/src/mobilesync.c
index f0fc4b2..6138762 100644
--- a/src/mobilesync.c
+++ b/src/mobilesync.c
@@ -65,7 +65,7 @@ static mobilesync_error_t mobilesync_error(device_link_service_error_t err)
65 return MOBILESYNC_E_UNKNOWN_ERROR; 65 return MOBILESYNC_E_UNKNOWN_ERROR;
66} 66}
67 67
68mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, 68LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service,
69 mobilesync_client_t * client) 69 mobilesync_client_t * client)
70{ 70{
71 if (!device || !service || service->port == 0 || !client || *client) 71 if (!device || !service || service->port == 0 || !client || *client)
@@ -95,14 +95,14 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_des
95 return ret; 95 return ret;
96} 96}
97 97
98mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label) 98LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label)
99{ 99{
100 mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR; 100 mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR;
101 service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err); 101 service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err);
102 return err; 102 return err;
103} 103}
104 104
105mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) 105LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
106{ 106{
107 if (!client) 107 if (!client)
108 return MOBILESYNC_E_INVALID_ARG; 108 return MOBILESYNC_E_INVALID_ARG;
@@ -112,7 +112,7 @@ mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
112 return err; 112 return err;
113} 113}
114 114
115mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist) 115LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist)
116{ 116{
117 if (!client) 117 if (!client)
118 return MOBILESYNC_E_INVALID_ARG; 118 return MOBILESYNC_E_INVALID_ARG;
@@ -120,14 +120,14 @@ mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plis
120 return ret; 120 return ret;
121} 121}
122 122
123mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist) 123LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist)
124{ 124{
125 if (!client || !plist) 125 if (!client || !plist)
126 return MOBILESYNC_E_INVALID_ARG; 126 return MOBILESYNC_E_INVALID_ARG;
127 return mobilesync_error(device_link_service_send(client->parent, plist)); 127 return mobilesync_error(device_link_service_send(client->parent, plist));
128} 128}
129 129
130mobilesync_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) 130LIBIMOBILEDEVICE_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)
131{ 131{
132 if (!client || client->data_class || !data_class || 132 if (!client || client->data_class || !data_class ||
133 !anchors || !anchors->computer_anchor) { 133 !anchors || !anchors->computer_anchor) {
@@ -253,7 +253,7 @@ mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data
253 return err; 253 return err;
254} 254}
255 255
256mobilesync_error_t mobilesync_finish(mobilesync_client_t client) 256LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_finish(mobilesync_client_t client)
257{ 257{
258 if (!client || !client->data_class) { 258 if (!client || !client->data_class) {
259 return MOBILESYNC_E_INVALID_ARG; 259 return MOBILESYNC_E_INVALID_ARG;
@@ -338,17 +338,17 @@ static mobilesync_error_t mobilesync_get_records(mobilesync_client_t client, con
338 return err; 338 return err;
339} 339}
340 340
341mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client) 341LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client)
342{ 342{
343 return mobilesync_get_records(client, "SDMessageGetAllRecordsFromDevice"); 343 return mobilesync_get_records(client, "SDMessageGetAllRecordsFromDevice");
344} 344}
345 345
346mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client) 346LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client)
347{ 347{
348 return mobilesync_get_records(client, "SDMessageGetChangesFromDevice"); 348 return mobilesync_get_records(client, "SDMessageGetChangesFromDevice");
349} 349}
350 350
351mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions) 351LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions)
352{ 352{
353 if (!client || !client->data_class) { 353 if (!client || !client->data_class) {
354 return MOBILESYNC_E_INVALID_ARG; 354 return MOBILESYNC_E_INVALID_ARG;
@@ -415,7 +415,7 @@ mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_
415 return err; 415 return err;
416} 416}
417 417
418mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client) 418LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client)
419{ 419{
420 if (!client || !client->data_class) { 420 if (!client || !client->data_class) {
421 return MOBILESYNC_E_INVALID_ARG; 421 return MOBILESYNC_E_INVALID_ARG;
@@ -484,7 +484,7 @@ mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t cl
484 return err; 484 return err;
485} 485}
486 486
487mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client) 487LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client)
488{ 488{
489 if (!client || !client->data_class) { 489 if (!client || !client->data_class) {
490 return MOBILESYNC_E_INVALID_ARG; 490 return MOBILESYNC_E_INVALID_ARG;
@@ -518,7 +518,7 @@ static plist_t create_process_changes_message(const char *data_class, plist_t en
518 return msg; 518 return msg;
519} 519}
520 520
521mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client) 521LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client)
522{ 522{
523 if (!client || !client->data_class) { 523 if (!client || !client->data_class) {
524 return MOBILESYNC_E_INVALID_ARG; 524 return MOBILESYNC_E_INVALID_ARG;
@@ -585,7 +585,7 @@ mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_cli
585 return err; 585 return err;
586} 586}
587 587
588mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions) 588LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions)
589{ 589{
590 if (!client || !client->data_class || !entities) { 590 if (!client || !client->data_class || !entities) {
591 return MOBILESYNC_E_INVALID_ARG; 591 return MOBILESYNC_E_INVALID_ARG;
@@ -613,7 +613,7 @@ mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t e
613 return err; 613 return err;
614} 614}
615 615
616mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping) 616LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping)
617{ 617{
618 if (!client || !client->data_class) { 618 if (!client || !client->data_class) {
619 return MOBILESYNC_E_INVALID_ARG; 619 return MOBILESYNC_E_INVALID_ARG;
@@ -682,7 +682,7 @@ mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plis
682 return err; 682 return err;
683} 683}
684 684
685mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason) 685LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason)
686{ 686{
687 if (!client || !client->data_class || !reason) { 687 if (!client || !client->data_class || !reason) {
688 return MOBILESYNC_E_INVALID_ARG; 688 return MOBILESYNC_E_INVALID_ARG;
@@ -708,7 +708,7 @@ mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* rea
708 return err; 708 return err;
709} 709}
710 710
711mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor) 711LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor)
712{ 712{
713 mobilesync_anchors_t anchors = (mobilesync_anchors_t) malloc(sizeof(mobilesync_anchors)); 713 mobilesync_anchors_t anchors = (mobilesync_anchors_t) malloc(sizeof(mobilesync_anchors));
714 if (device_anchor != NULL) { 714 if (device_anchor != NULL) {
@@ -725,7 +725,7 @@ mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const cha
725 return anchors; 725 return anchors;
726} 726}
727 727
728void mobilesync_anchors_free(mobilesync_anchors_t anchors) 728LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors)
729{ 729{
730 if (anchors->device_anchor != NULL) { 730 if (anchors->device_anchor != NULL) {
731 free(anchors->device_anchor); 731 free(anchors->device_anchor);
@@ -739,12 +739,12 @@ void mobilesync_anchors_free(mobilesync_anchors_t anchors)
739 anchors = NULL; 739 anchors = NULL;
740} 740}
741 741
742plist_t mobilesync_actions_new() 742LIBIMOBILEDEVICE_API plist_t mobilesync_actions_new()
743{ 743{
744 return plist_new_dict(); 744 return plist_new_dict();
745} 745}
746 746
747void mobilesync_actions_add(plist_t actions, ...) 747LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...)
748{ 748{
749 if (!actions) 749 if (!actions)
750 return; 750 return;
@@ -776,7 +776,7 @@ void mobilesync_actions_add(plist_t actions, ...)
776 va_end(args); 776 va_end(args);
777} 777}
778 778
779void mobilesync_actions_free(plist_t actions) 779LIBIMOBILEDEVICE_API void mobilesync_actions_free(plist_t actions)
780{ 780{
781 if (actions) { 781 if (actions) {
782 plist_free(actions); 782 plist_free(actions);