summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 061d00d..a0ed824 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -86,7 +86,8 @@ int ipsw_get_file_size(const char* ipsw, const char* infile, off_t* size) {
return 0;
}
-int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfile) {
+int ipsw_extract_to_file_with_progress(const char* ipsw, const char* infile, const char* outfile, int print_progress)
+{
int ret = 0;
ipsw_archive* archive = ipsw_open(ipsw);
if (archive == NULL || archive->zip == NULL) {
@@ -145,8 +146,10 @@ 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(progress);
+ if (print_progress) {
+ progress = ((double)bytes / (double)zstat.size) * 100.0;
+ print_progress_bar(progress);
+ }
}
fclose(fd);
@@ -156,6 +159,11 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi
return ret;
}
+int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfile)
+{
+ return ipsw_extract_to_file_with_progress(ipsw, infile, outfile, 0);
+}
+
int ipsw_file_exists(const char* ipsw, const char* infile)
{
ipsw_archive* archive = ipsw_open(ipsw);