Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r--source/blender/blenlib/intern/fileops.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 2e0f4b483b1..b72f31dd128 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -102,6 +102,24 @@ int BLI_gzip(const char *from, const char *to) {
return rval;
}
+/* gzip the file in from_file and write it to memery to_mem, at most size bytes.
+ return the unziped size
+ */
+int BLI_ungzip_to_mem(const char *from_file, char *to_mem, const int size)
+{
+ gzFile gzfile;
+ int readsize;
+
+ gzfile = gzopen( from_file, "rb" );
+ readsize = gzread( gzfile, to_mem, size);
+
+ if (readsize < 0)
+ readsize = EOF;
+
+ return readsize;
+}
+
+
/* return 1 when file can be written */
int BLI_is_writable(const char *filename)
{