Expose minizip API to allow creating zips using scripts
Co-authored-by: Marcelo Fernandez <marcelofg55@gmail.com> Co-authored-by: James Westman <flyingpimonster@gmail.commail> Co-authored-by: MisterMX <mbxd12@web.de> Signed-off-by: MisterMX <mbxd12@web.de>
This commit is contained in:
parent
f8745f2f71
commit
ea6cc3e260
11 changed files with 606 additions and 3 deletions
|
|
@ -37,11 +37,17 @@ void *zipio_open(voidpf opaque, const char *p_fname, int mode) {
|
|||
String fname;
|
||||
fname.parse_utf8(p_fname);
|
||||
|
||||
int file_access_mode = 0;
|
||||
if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
|
||||
(*fa) = FileAccess::open(fname, FileAccess::WRITE);
|
||||
} else {
|
||||
(*fa) = FileAccess::open(fname, FileAccess::READ);
|
||||
file_access_mode |= FileAccess::WRITE;
|
||||
}
|
||||
if (mode & ZLIB_FILEFUNC_MODE_READ) {
|
||||
file_access_mode |= FileAccess::READ;
|
||||
}
|
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE) {
|
||||
file_access_mode |= FileAccess::WRITE_READ;
|
||||
}
|
||||
(*fa) = FileAccess::open(fname, file_access_mode);
|
||||
|
||||
if (fa->is_null()) {
|
||||
return nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue