This commit was generated by cvs2svn to compensate for changes in r2,

which included commits to RCS files with non-trunk default branches.


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@625 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-08-02 10:01:35 +00:00
parent 9b3b220a13
commit 3e9e73ec59
177 changed files with 37677 additions and 0 deletions

51
Source/czlib.h Normal file
View file

@ -0,0 +1,51 @@
#ifndef __CZLIB_H__
#define __CZLIB_H__
#include "compressor.h"
#include "zlib/ZLIB.H"
class CZlib : public ICompressor {
public:
int Init(int level) {
stream = new z_stream;
if (!stream) return Z_MEM_ERROR;
return deflateInit(stream, level);
}
int End() {
int ret = deflateEnd(stream);
delete stream;
return ret;
}
int Compress(BOOL finish) {
return deflate(stream, finish?Z_FINISH:0);
}
void SetNextIn(char *in, unsigned int size) {
stream->next_in = (unsigned char*)in;
stream->avail_in = size;
}
void SetNextOut(char *out, unsigned int size) {
stream->next_out = (unsigned char*)out;
stream->avail_out = size;
}
virtual char* GetNextOut() {
return (char*)stream->next_out;
}
virtual unsigned int GetAvailIn() {
return stream->avail_in;
}
virtual unsigned int GetAvailOut() {
return stream->avail_out;
}
private:
z_stream *stream;
};
#endif