summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libimobiledevice/restore.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/libimobiledevice/restore.h b/include/libimobiledevice/restore.h
new file mode 100644
index 0000000..c4b5916
--- /dev/null
+++ b/include/libimobiledevice/restore.h
@@ -0,0 +1,71 @@
1/**
2 * @file libimobiledevice/restore.h
3 * @brief Implementation to communicate with the restore device daemon
4 * \internal
5 *
6 * Copyright (c) 2010 Joshua Hill. All Rights Reserved.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef RESTORE_H
24#define RESTORE_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <libimobiledevice/libimobiledevice.h>
31
32/** @name Error Codes */
33/*@{*/
34#define RESTORE_E_SUCCESS 0
35#define RESTORE_E_INVALID_ARG -1
36#define RESTORE_E_INVALID_CONF -2
37#define RESTORE_E_PLIST_ERROR -3
38#define RESTORE_E_DICT_ERROR -4
39#define RESTORE_E_NOT_ENOUGH_DATA -5
40#define RESTORE_E_MUX_ERROR -6
41#define RESTORE_E_START_RESTORE_FAILED -7
42
43#define RESTORE_E_UNKNOWN_ERROR -256
44/*@}*/
45
46/** Represents an error code. */
47typedef int16_t restored_error_t;
48
49typedef struct restored_client_private restored_client_private;
50typedef restored_client_private *restored_client_t; /**< The client handle. */
51
52/* Interface */
53restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label);
54restored_error_t restored_client_free(restored_client_t client);
55
56restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version);
57restored_error_t restored_send(restored_client_t client, plist_t plist);
58restored_error_t restored_receive(restored_client_t client, plist_t *plist);
59restored_error_t restored_goodbye(restored_client_t client);
60
61restored_error_t restored_start_restore(restored_client_t client);
62restored_error_t restored_reboot(restored_client_t client);
63
64/* Helper */
65void restored_client_set_label(restored_client_t client, const char *label);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif