From b65a7ce7ebca6730fce5dcbfd820d8ef4124e18f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 7 Nov 2012 22:08:53 +0100 Subject: libidevicerecovery: implemented progress callback logic --- src/idevicerestore.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 3201280..c7c80dc 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -29,8 +29,6 @@ extern "C" { #include #include -#include "common.h" - // the flag with value 1 is reserved for internal use only. don't use it. #define FLAG_DEBUG 1 << 1 #define FLAG_ERASE 1 << 2 @@ -43,6 +41,17 @@ extern "C" { struct idevicerestore_client_t; +enum { + RESTORE_STEP_DETECT = 0, + RESTORE_STEP_PREPARE, + RESTORE_STEP_UPLOAD_FS, + RESTORE_STEP_FLASH_FS, + RESTORE_STEP_FLASH_NOR, + RESTORE_NUM_STEPS +}; + +typedef void (*idevicerestore_progress_cb_t)(int step, double step_progress, void* userdata); + struct idevicerestore_client_t* idevicerestore_client_new(); void idevicerestore_client_free(struct idevicerestore_client_t* client); @@ -51,6 +60,8 @@ void idevicerestore_set_udid(struct idevicerestore_client_t* client, const char* void idevicerestore_set_flags(struct idevicerestore_client_t* client, int flags); void idevicerestore_set_ipsw(struct idevicerestore_client_t* client, const char* path); +void idevicerestore_set_progress_callback(struct idevicerestore_client_t* client, idevicerestore_progress_cb_t cbfunc, void* userdata); + int idevicerestore_start(struct idevicerestore_client_t* client); void usage(int argc, char* argv[]); -- cgit v1.1-32-gdbae