grab.c

来自「采用zlib标准的压缩源码」· C语言 代码 · 共 36 行

C
36
字号
#include"zlib.h"#include"Grab.h" typedef void * LPVOID; typedef unsigned char BYTE; typedef  BYTE *LPBYTE; typedef  unsigned long int DWORD;int  Grab(unsigned char *DestBuffer,             /* out: Destination  buffer            */                         unsigned long *dwBufLenout,         /* out: length of output from Grab */                  unsigned char *lpBuffer,                /* in: Source  Buffer                    */                                 unsigned long lsbufflen,                 /*  in: length of input  Buffer         */                      int leve )                  /*   The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:   1 gives best speed, 9 gives best compression, 0 gives no compression at   all (the input data is simply copied a block at a time).     Grab returns 0 if success, -4 if there was not enough memory, -5 if there   was not enough room in the output buffer,   -2 if the level parameter is invalid.*/ {   return  compress2 (DestBuffer,dwBufLenout,lpBuffer, lsbufflen,leve);}/*Decompresses the source buffer into the destination buffer*/ int unGrab(unsigned char *lDestpBuffer,       /* out: Destination  buffer              */                     unsigned long  *dwBufLen,          /* (in/out) in:length memset  Buffer                                                                                   out: length of output from Grab    */                                     unsigned char  *GrabBuffer,       /* in: Source Buffer                        */                                                                            unsigned long  lsbufflen  )          /* in: length of input Buffer              */                                                 {   return  uncompress (lDestpBuffer,   dwBufLen, GrabBuffer, lsbufflen);}    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?