From a91e336c24a0d741e47be7adf0cd0b2beb20e5ab Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Mon, 7 Jun 2010 02:24:08 -0400 Subject: I really need to put more descriptive messages here, but im doing stuff all over the place --- src/idevicerestore.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index af66892..f92aad2 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -111,4 +111,18 @@ inline static void debug_plist(plist_t plist) { free(data); } +inline static void print_progress_bar(const char* operation, double progress) { + int i = 0; + if(progress < 0) return; + if(progress > 100) progress = 100; + info("\r%s [", operation); + for(i = 0; i < 50; i++) { + if(i < progress / 2) info("="); + else info(" "); + } + info("] %3.1f%%", progress); + if(progress == 100) info("\n"); + fflush(stdout); +} + #endif -- cgit v1.1-32-gdbae