⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zutil.h

📁 DES,MD5,ZLIB算法源代码
💻 H
字号:
/* WARNING: this file should *not* be used by applications. It is
   part of the implementation of the compression library and is
   subject to change. Applications should only use zlib.h.
*/
#ifndef _Z_UTIL_H
#define _Z_UTIL_H

#include "zlib.h"

#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>

/* compile with -Dlocal if your debugger can't find static symbols */

extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */

#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]

#define ERR_RETURN(strm,err) \
  return (strm->msg = (char*)ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */

        /* common constants */

#define DEF_WBITS MAX_WBITS
/* default windowBits for decompression. MAX_WBITS is for compression only */

/*#if MAX_MEM_LEVEL >= 8
#   define DEF_MEM_LEVEL 8
#else*/
#define DEF_MEM_LEVEL  MAX_MEM_LEVEL
//#endif
/* default memLevel */

#define STORED_BLOCK 0
#define STATIC_TREES 1
#define DYN_TREES    2
/* The three kinds of block type */

#define MIN_MATCH  3
#define MAX_MATCH  258
/* The minimum and maximum match lengths */

#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */

       /* functions */
typedef unsigned long (*check_func)(unsigned long check, const BYTE *buf,
				       unsigned int len);
void *zcalloc(void *opaque, unsigned items, unsigned size);
void   zcfree (void *opaque, void *ptr);

#define ZALLOC(strm, items, size) \
           (*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (void *)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}

#endif /* _Z_UTIL_H */

⌨️ 快捷键说明

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