static void unzzip_cat_file(FILE* disk, char* name, FILE* out) { ZZIP_ENTRY_FILE* file = zzip_entry_ffile (disk, name); if (file) { char buffer[1024]; int len; while ((len = zzip_entry_fread (buffer, 1024, 1, file))) fwrite (buffer, len, 1, out); zzip_entry_fclose (file); } }
static void zzip_entry_fprint(ZZIP_ENTRY* entry, FILE* out) { ZZIP_ENTRY_FILE* file = zzip_entry_fopen (entry, 0); if (file) { char buffer[1024]; int len; while ((len = zzip_entry_fread (buffer, 1024, 1, file))) fwrite (buffer, len, 1, out); zzip_entry_fclose (file); } }
static void unzzip_big_entry_fprint(ZZIP_ENTRY* entry, FILE* out) { ZZIP_ENTRY_FILE* file = zzip_entry_fopen (entry, 0); if (file) { char buffer[1024]; int len; while ((len = zzip_entry_fread (buffer, 1024, 1, file))) { DBG2("entry read %i", len); fwrite (buffer, len, 1, out); } DBG2("entry done %s", strerror(errno)); zzip_entry_fclose (file); } else { DBG2("could not open entry: %s", strerror(errno)); } }