summaryrefslogtreecommitdiffstats
path: root/src/restore.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-01-11 17:24:57 +0100
committerGravatar Nikias Bassen2012-01-11 17:24:57 +0100
commitf6555734bf8a28ce9663d87320a1eff61710d7a4 (patch)
tree67493130aee1ec194336f69521a4c08b5a9eb88a /src/restore.c
parente855f246b3d869a60375207fde1294bbe761fe23 (diff)
downloadlibimobiledevice-f6555734bf8a28ce9663d87320a1eff61710d7a4.tar.gz
libimobiledevice-f6555734bf8a28ce9663d87320a1eff61710d7a4.tar.bz2
restored: allow passing options to restored_start_restore()
Diffstat (limited to 'src/restore.c')
-rw-r--r--src/restore.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/restore.c b/src/restore.c
index fd23d85..10642da 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -391,11 +391,13 @@ restored_error_t restored_goodbye(restored_client_t client)
* Requests to start a restore and retrieve it's port on success.
*
* @param client The restored client
+ * @param options PLIST_DICT with options for the restore process or NULL
+ * @param version the restore protocol version, see restored_query_type()
*
* @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG if a parameter
* is NULL, RESTORE_E_START_RESTORE_FAILED if the request fails
*/
-restored_error_t restored_start_restore(restored_client_t client)
+restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -406,7 +408,10 @@ restored_error_t restored_start_restore(restored_client_t client)
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
plist_dict_insert_item(dict,"Request", plist_new_string("StartRestore"));
- plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(2));
+ if (options) {
+ plist_dict_insert_item(dict, "RestoreOptions", plist_copy(options));
+ }
+ plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(version));
/* send to device */
ret = restored_send(client, dict);