2 * Helper functions to handle compression via zlib
4 * Copyright (C) 2007-2008 Julian Brown
5 * Copyright (C) 2008 Mike Frysinger
7 * Licensed under the GPL-2 or later.
10 #ifndef __ELF2FLT_COMPRESS_H__
11 #define __ELF2FLT_COMPRESS_H__
22 /* Tagged union holding either a regular FILE* handle or a zlib gzFile
35 int fopen_stream_u(stream *fp, const char *path, const char *mode);
36 size_t fread_stream(void *ptr, size_t size, size_t nmemb, stream *str);
37 size_t fwrite_stream(const void *ptr, size_t size, size_t nmemb, stream *str);
38 int fclose_stream(stream *str);
39 int ferror_stream(stream *str);
40 int fseek_stream(stream *str, long offset, int whence);
41 void reopen_stream_compressed(stream *str);
42 void transfer(stream *ifp, stream *ofp, int count);