summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-11-07 22:08:53 +0100
committerGravatar Martin Szulecki2012-11-07 22:08:53 +0100
commitb65a7ce7ebca6730fce5dcbfd820d8ef4124e18f (patch)
tree3aaa3a68931bbaf3ec31bef6fad18c951cf7d32f /src/common.c
parentb44ad07bec397f6cd1c597946efe86e5ed2a490b (diff)
downloadidevicerestore-b65a7ce7ebca6730fce5dcbfd820d8ef4124e18f.tar.gz
idevicerestore-b65a7ce7ebca6730fce5dcbfd820d8ef4124e18f.tar.bz2
libidevicerecovery: implemented progress callback logic
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index a2ff7b3..2b364cb 100644
--- a/src/common.c
+++ b/src/common.c
@@ -158,3 +158,15 @@ int mkdir_with_parents(const char *dir, int mode)
}
return res;
}
+
+void idevicerestore_progress(struct idevicerestore_client_t* client, int step, double progress)
+{
+ if(client && client->progress_cb) {
+ client->progress_cb(step, progress, client->progress_cb_data);
+ } else {
+ // we don't want to be too verbose in regular idevicerestore.
+ if ((step == RESTORE_STEP_UPLOAD_FS) || (step == RESTORE_STEP_FLASH_FS) || (step == RESTORE_STEP_FLASH_NOR)) {
+ print_progress_bar(100.0f * progress);
+ }
+ }
+}