add easy to use functions to read from zip files

..without mounting the zip into the file system first

WARNING: intermediate commit - autodownload system defunct!
This commit is contained in:
ac-stef
2015-09-07 14:53:56 +02:00
parent 816aed4ba6
commit 6c58c9f307
4 changed files with 74 additions and 20 deletions
+8
View File
@@ -958,6 +958,14 @@ char *loadfile(const char *fn, int *size, const char *mode)
return buf;
}
int streamcopy(stream *dest, stream *source, int maxlen)
{
int got = 0, len;
uchar copybuf[1024];
while(got < maxlen && (len = source->read(copybuf, 1024))) got += dest->write(copybuf, len);
return got;
}
#ifndef STANDALONE
void filerotate(const char *basename, const char *ext, int keepold, const char *oldformat) // rotate old logfiles
{