diff options
Diffstat (limited to 'src/mobilesync.c')
| -rw-r--r-- | src/mobilesync.c | 87 |
1 files changed, 49 insertions, 38 deletions
diff --git a/src/mobilesync.c b/src/mobilesync.c index b7567f2..6dacb9b 100644 --- a/src/mobilesync.c +++ b/src/mobilesync.c | |||
| @@ -74,9 +74,10 @@ static mobilesync_error_t mobilesync_error(device_link_service_error_t err) | |||
| 74 | * @param client Pointer that will be set to a newly allocated | 74 | * @param client Pointer that will be set to a newly allocated |
| 75 | * mobilesync_client_t upon successful return. | 75 | * mobilesync_client_t upon successful return. |
| 76 | * | 76 | * |
| 77 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID ARG if one | 77 | * @retval MOBILESYNC_E_SUCCESS on success |
| 78 | * or more parameters are invalid, or DEVICE_LINK_SERVICE_E_BAD_VERSION if | 78 | * @retval MOBILESYNC_E_INVALID ARG if one or more parameters are invalid |
| 79 | * the mobilesync version on the device is newer. | 79 | * @retval DEVICE_LINK_SERVICE_E_BAD_VERSION if the mobilesync version on |
| 80 | * the device is newer. | ||
| 80 | */ | 81 | */ |
| 81 | mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, | 82 | mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, |
| 82 | mobilesync_client_t * client) | 83 | mobilesync_client_t * client) |
| @@ -114,8 +115,8 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, | |||
| 114 | * | 115 | * |
| 115 | * @param client The mobilesync client to disconnect and free. | 116 | * @param client The mobilesync client to disconnect and free. |
| 116 | * | 117 | * |
| 117 | * @return MOBILESYNC_E_SUCCESS on success, or MOBILESYNC_E_INVALID_ARG | 118 | * @retval MOBILESYNC_E_SUCCESS on success |
| 118 | * if client is NULL. | 119 | * @retval MOBILESYNC_E_INVALID_ARG if client is NULL. |
| 119 | */ | 120 | */ |
| 120 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) | 121 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) |
| 121 | { | 122 | { |
| @@ -173,11 +174,12 @@ mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist) | |||
| 173 | * @param sync_type A pointer to store the sync type reported by the device_anchor | 174 | * @param sync_type A pointer to store the sync type reported by the device_anchor |
| 174 | * @param device_data_class_version The version of the data class storage on the device | 175 | * @param device_data_class_version The version of the data class storage on the device |
| 175 | * | 176 | * |
| 176 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 177 | * @retval MOBILESYNC_E_SUCCESS on success |
| 177 | * one of the parameters is invalid, MOBILESYNC_E_PLIST_ERROR if | 178 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 178 | * the received plist is not of valid form, MOBILESYNC_E_SYNC_REFUSED if the | 179 | * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form |
| 179 | * device refused to sync or MOBILESYNC_E_CANCELLED if the device explicitly | 180 | * @retval MOBILESYNC_E_SYNC_REFUSED if the device refused to sync |
| 180 | * cancelled the sync request | 181 | * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the |
| 182 | * sync request | ||
| 181 | */ | 183 | */ |
| 182 | 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) | 184 | 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) |
| 183 | { | 185 | { |
| @@ -313,9 +315,10 @@ mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data | |||
| 313 | * | 315 | * |
| 314 | * @param client The mobilesync client | 316 | * @param client The mobilesync client |
| 315 | * | 317 | * |
| 316 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 318 | * @retval MOBILESYNC_E_SUCCESS on success |
| 317 | * one of the parameters is invalid, MOBILESYNC_E_PLIST_ERROR if | 319 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 318 | * the received plist is not of valid form | 320 | * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid |
| 321 | * form | ||
| 319 | */ | 322 | */ |
| 320 | mobilesync_error_t mobilesync_finish(mobilesync_client_t client) | 323 | mobilesync_error_t mobilesync_finish(mobilesync_client_t client) |
| 321 | { | 324 | { |
| @@ -409,8 +412,8 @@ static mobilesync_error_t mobilesync_get_records(mobilesync_client_t client, con | |||
| 409 | * | 412 | * |
| 410 | * @param client The mobilesync client | 413 | * @param client The mobilesync client |
| 411 | * | 414 | * |
| 412 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 415 | * @retval MOBILESYNC_E_SUCCESS on success |
| 413 | * one of the parameters is invalid | 416 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 414 | */ | 417 | */ |
| 415 | mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client) | 418 | mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client) |
| 416 | { | 419 | { |
| @@ -424,8 +427,8 @@ mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t cl | |||
| 424 | * | 427 | * |
| 425 | * @param client The mobilesync client | 428 | * @param client The mobilesync client |
| 426 | * | 429 | * |
| 427 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 430 | * @retval MOBILESYNC_E_SUCCESS on success |
| 428 | * one of the parameters is invalid | 431 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 429 | */ | 432 | */ |
| 430 | mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client) | 433 | mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client) |
| 431 | { | 434 | { |
| @@ -440,9 +443,10 @@ mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client | |||
| 440 | * @param is_last_record A pointer to store a flag indiciating if this submission is the last one | 443 | * @param is_last_record A pointer to store a flag indiciating if this submission is the last one |
| 441 | * @param actions A pointer to additional flags the device is sending or NULL to ignore | 444 | * @param actions A pointer to additional flags the device is sending or NULL to ignore |
| 442 | * | 445 | * |
| 443 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 446 | * @retval MOBILESYNC_E_SUCCESS on success |
| 444 | * one of the parameters is invalid, MOBILESYNC_E_CANCELLED if the device | 447 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 445 | * explicitly cancelled the session | 448 | * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the |
| 449 | * session | ||
| 446 | */ | 450 | */ |
| 447 | mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions) | 451 | mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions) |
| 448 | { | 452 | { |
| @@ -516,8 +520,8 @@ mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_ | |||
| 516 | * | 520 | * |
| 517 | * @param client The mobilesync client | 521 | * @param client The mobilesync client |
| 518 | * | 522 | * |
| 519 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 523 | * @retval MOBILESYNC_E_SUCCESS on success |
| 520 | * one of the parameters is invalid | 524 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 521 | */ | 525 | */ |
| 522 | mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client) | 526 | mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client) |
| 523 | { | 527 | { |
| @@ -560,12 +564,15 @@ static plist_t create_process_changes_message(const char *data_class, plist_t en | |||
| 560 | * | 564 | * |
| 561 | * @param client The mobilesync client | 565 | * @param client The mobilesync client |
| 562 | * | 566 | * |
| 563 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 567 | * @retval MOBILESYNC_E_SUCCESS on success |
| 564 | * one of the parameters is invalid, MOBILESYNC_E_PLIST_ERROR if | 568 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 565 | * the received plist is not of valid form, MOBILESYNC_E_WRONG_DIRECTION if the | 569 | * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form |
| 566 | * current sync direction does not permit this call, MOBILESYNC_E_CANCELLED if | 570 | * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does |
| 567 | * the device explicitly cancelled the session or MOBILESYNC_E_NOT_READY if the | 571 | * not permit this call |
| 568 | * device is not ready to start receiving any changes | 572 | * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the |
| 573 | * session | ||
| 574 | * @retval MOBILESYNC_E_NOT_READY if the device is not ready to start | ||
| 575 | * receiving any changes | ||
| 569 | */ | 576 | */ |
| 570 | mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client) | 577 | mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client) |
| 571 | { | 578 | { |
| @@ -639,9 +646,10 @@ mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_cli | |||
| 639 | * @param actions Additional actions for the device created with mobilesync_actions_new() | 646 | * @param actions Additional actions for the device created with mobilesync_actions_new() |
| 640 | * or NULL if no actions should be passed | 647 | * or NULL if no actions should be passed |
| 641 | * | 648 | * |
| 642 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 649 | * @retval MOBILESYNC_E_SUCCESS on success |
| 643 | * one of the parameters is invalid, MOBILESYNC_E_WRONG_DIRECTION if the | 650 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid, |
| 644 | * current sync direction does not permit this call | 651 | * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does |
| 652 | * not permit this call | ||
| 645 | */ | 653 | */ |
| 646 | mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions) | 654 | mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions) |
| 647 | { | 655 | { |
| @@ -677,11 +685,14 @@ mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t e | |||
| 677 | * @param client The mobilesync client | 685 | * @param client The mobilesync client |
| 678 | * @param mapping A pointer to an array plist containing a dict of identifier remappings | 686 | * @param mapping A pointer to an array plist containing a dict of identifier remappings |
| 679 | * | 687 | * |
| 680 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 688 | * @retval MOBILESYNC_E_SUCCESS on success |
| 681 | * one of the parameters is invalid, MOBILESYNC_E_PLIST_ERROR if | 689 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 682 | * the received plist is not of valid form, MOBILESYNC_E_WRONG_DIRECTION if the | 690 | * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid |
| 683 | * current sync direction does not permit this call or MOBILESYNC_E_CANCELLED if | 691 | * form |
| 684 | * the device explicitly cancelled the session | 692 | * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does |
| 693 | * not permit this call | ||
| 694 | * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the | ||
| 695 | * session | ||
| 685 | */ | 696 | */ |
| 686 | mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping) | 697 | mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping) |
| 687 | { | 698 | { |
| @@ -758,8 +769,8 @@ mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plis | |||
| 758 | * @param client The mobilesync client | 769 | * @param client The mobilesync client |
| 759 | * @param reason The reason to supply to the device for cancelling | 770 | * @param reason The reason to supply to the device for cancelling |
| 760 | * | 771 | * |
| 761 | * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if | 772 | * @retval MOBILESYNC_E_SUCCESS on success |
| 762 | * one of the parameters is invalid | 773 | * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid |
| 763 | */ | 774 | */ |
| 764 | mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason) | 775 | mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason) |
| 765 | { | 776 | { |
