From 0966c00988477450691c8c9bce47a3fb30eff6da Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Fri, 4 Jun 2010 23:17:05 -0400 Subject: Even more major cleanups and refactoring, this branch is still broken but starting to mature really well --- src/ipsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index ca28596..6c5d504 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -20,6 +20,7 @@ */ #include +#include #include #include @@ -119,7 +120,7 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi return 0; } -int ipsw_extract_to_memory(const char* ipsw, const char* infile, char** pbuffer, int* psize) { +int ipsw_extract_to_memory(const char* ipsw, const char* infile, char** pbuffer, uint32_t* psize) { ipsw_archive* archive = ipsw_open(ipsw); if (archive == NULL || archive->zip == NULL) { error("ERROR: Invalid archive\n"); -- cgit v1.1-32-gdbae 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/ipsw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index 6c5d504..7ded33e 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -95,7 +95,9 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi int i = 0; int size = 0; + int bytes = 0; int count = 0; + double progress = 0; for (i = zstat.size; i > 0; i -= count) { if (i < BUFSIZE) size = i; @@ -109,9 +111,11 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi return -1; } fwrite(buffer, 1, count, fd); - debug("."); + + bytes += size; + progress = ((double) bytes/ (double) zstat.size) * 100.0; + print_progress_bar("Extracting", progress); } - debug("\n"); fclose(fd); zip_fclose(zfile); -- cgit v1.1-32-gdbae From 51b56ba5bf01af40835a43ad1104a7eff3160127 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Tue, 8 Jun 2010 04:14:29 -0400 Subject: Added a new asr.c file to stick all stuff related to filesystem and abstract the restore process to allow for easier porting --- src/ipsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index 7ded33e..adbaea0 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -98,7 +98,7 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi int bytes = 0; int count = 0; double progress = 0; - for (i = zstat.size; i > 0; i -= count) { + for(i = zstat.size; i > 0; i -= count) { if (i < BUFSIZE) size = i; else -- cgit v1.1-32-gdbae From 24afafe06f902bfd9f5652beb8797f24033c68bc Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Sun, 20 Jun 2010 22:02:18 -0400 Subject: Archived for historical reasons --- src/ipsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index adbaea0..f08e2fd 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -114,7 +114,7 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi bytes += size; progress = ((double) bytes/ (double) zstat.size) * 100.0; - print_progress_bar("Extracting", progress); + print_progress_bar(progress); } fclose(fd); -- cgit v1.1-32-gdbae