把gzip的inflate.c改写一下就可以了,别的都不要。(gzip.h也不要)加入: #include <stdio.h> #include <stdlib.h> #include <string.h>typedef unsigned char uch; typedef unsigned short ush; typedef unsigned long ulg;#define slide window #define WSIZE 0x8000 /* window size--must be a power of two */uch *inbuf; // input buffer uch *g_outbuf;// output buffer long bytes_out; // number of output bytes uch window[2L*WSIZE]; // uch window[2*0x8000] 64kunsigned inptr; // index of next byte to be processed in inbuf unsigned outcnt; // bytes in output buffer // void flush_window(); 等等
#include <stdio.h>
#include <stdlib.h>
#include <string.h>typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;#define slide window
#define WSIZE 0x8000 /* window size--must be a power of two */uch *inbuf; // input buffer
uch *g_outbuf;// output buffer
long bytes_out; // number of output bytes
uch window[2L*WSIZE]; // uch window[2*0x8000] 64kunsigned inptr; // index of next byte to be processed in inbuf
unsigned outcnt; // bytes in output buffer
//
void flush_window();
等等