Ruby: ext/zlib/zlib-1.2.13/zutil.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Typedefs | Functions | Variables
zutil.h File Reference
`#include "zlib.h"`
`#include <stddef.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <limits.h>`

Go to the source code of this file.

## Macros
#define | ZLIB_INTERNAL
#define | local static
#define | ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define | ERR_RETURN(strm, err) return (strm->msg = ERR_MSG(err), (err))
#define | DEF_WBITS MAX_WBITS
#define | DEF_MEM_LEVEL MAX_MEM_LEVEL
#define | STORED_BLOCK 0
#define | STATIC_TREES 1
#define | DYN_TREES 2
#define | MIN_MATCH 3
#define | MAX_MATCH 258
#define | PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
#define | fdopen(fd, type) _fdopen(fd,type)
#define | OS_CODE 3 /* assume Unix */
#define | F_OPEN(name, mode) fopen((name), (mode))
#define | HAVE_MEMCPY
#define | zmemcpy memcpy
#define | zmemcmp memcmp
#define | zmemzero(dest, len) memset(dest, 0, len)
#define | Assert(cond, msg)
#define | Trace(x)
#define | Tracev(x)
#define | Tracevv(x)
#define | Tracec(c, x)
#define | Tracecv(c, x)
#define | ZALLOC(strm, items, size) (*((strm)->zalloc))((strm)->opaque, (items), (size))
#define | ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define | TRY_FREE(s, p) {if (p) ZFREE(s, p);}
#define | ZSWAP32(q)

## Typedefs
typedef unsigned char | uch
typedef uch FAR | uchf
typedef unsigned short | ush
typedef ush FAR | ushf
typedef unsigned long | ulg

## Functions
ZEXTERN uLong ZEXPORT adler32_combine64 | OF ((uLong, uLong, z_off_t))
ZEXTERN uLong ZEXPORT crc32_combine_gen64 | OF ((z_off_t))
voidpf ZLIB_INTERNAL zcalloc | OF ((voidpf opaque, unsigned items, unsigned size))
void ZLIB_INTERNAL zcfree | OF ((voidpf opaque, voidpf ptr))

## Variables
z_const char *const | z_errmsg [10]

## Macro Definition Documentation

## ◆ Assert

#define Assert | ( |  | cond,
|  |  | msg
| ) |  |

Definition at line 252 of file zutil.h.

## ◆ DEF_MEM_LEVEL

#define DEF_MEM_LEVEL MAX_MEM_LEVEL

Definition at line 75 of file zutil.h.

## ◆ DEF_WBITS

#define DEF_WBITS MAX_WBITS

Definition at line 68 of file zutil.h.

## ◆ DYN_TREES

#define DYN_TREES 2

Definition at line 81 of file zutil.h.

## ◆ ERR_MSG

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

Definition at line 59 of file zutil.h.

## ◆ ERR_RETURN

#define ERR_RETURN | ( |  | strm,
|  |  | err
| ) |  | return (strm->msg = ERR_MSG(err), (err))

Definition at line 61 of file zutil.h.

## ◆ F_OPEN

#define F_OPEN | ( |  | name,
|  |  | mode
| ) |  | fopen((name), (mode))

Definition at line 206 of file zutil.h.

## ◆ fdopen

#define fdopen | ( |  | fd,
|  |  | type
| ) |  | _fdopen(fd,type)

Definition at line 181 of file zutil.h.

## ◆ HAVE_MEMCPY

#define HAVE_MEMCPY

Definition at line 222 of file zutil.h.

## ◆ local

#define local static

Definition at line 33 of file zutil.h.

## ◆ MAX_MATCH

#define MAX_MATCH 258

Definition at line 85 of file zutil.h.

## ◆ MIN_MATCH

#define MIN_MATCH 3

Definition at line 84 of file zutil.h.

## ◆ OS_CODE

#define OS_CODE 3 /* assume Unix */

Definition at line 202 of file zutil.h.

## ◆ PRESET_DICT

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

Definition at line 88 of file zutil.h.

## ◆ STATIC_TREES

#define STATIC_TREES 1

Definition at line 80 of file zutil.h.

## ◆ STORED_BLOCK

#define STORED_BLOCK 0

Definition at line 79 of file zutil.h.

## ◆ Trace

#define Trace | ( |  | x | ) |

Definition at line 253 of file zutil.h.

## ◆ Tracec

#define Tracec | ( |  | c,
|  |  | x
| ) |  |

Definition at line 256 of file zutil.h.

## ◆ Tracecv

#define Tracecv | ( |  | c,
|  |  | x
| ) |  |

Definition at line 257 of file zutil.h.

## ◆ Tracev

#define Tracev | ( |  | x | ) |

Definition at line 254 of file zutil.h.

## ◆ Tracevv

#define Tracevv | ( |  | x | ) |

Definition at line 255 of file zutil.h.

## ◆ TRY_FREE

#define TRY_FREE | ( |  | s,
|  |  | p
| ) |  | {if (p) ZFREE(s, p);}

Definition at line 269 of file zutil.h.

## ◆ ZALLOC

#define ZALLOC | ( |  | strm,
|  |  | items,
|  |  | size
| ) |  | (*((strm)->zalloc))((strm)->opaque, (items), (size))

Definition at line 266 of file zutil.h.

## ◆ ZFREE

#define ZFREE | ( |  | strm,
|  |  | addr
| ) |  | (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))

Definition at line 268 of file zutil.h.

## ◆ ZLIB_INTERNAL

#define ZLIB_INTERNAL

Definition at line 19 of file zutil.h.

## ◆ zmemcmp

#define zmemcmp memcmp

Definition at line 231 of file zutil.h.

## ◆ zmemcpy

#define zmemcpy memcpy

Definition at line 230 of file zutil.h.

## ◆ zmemzero

#define zmemzero | ( |  | dest,
|  |  | len
| ) |  | memset(dest, 0, len)

Definition at line 232 of file zutil.h.

## ◆ ZSWAP32

#define ZSWAP32 | ( |  | q | ) |

Value:
((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24))

Definition at line 272 of file zutil.h.

## Typedef Documentation

## ◆ uch

typedef unsigned char uch

Definition at line 39 of file zutil.h.

## ◆ uchf

typedef uch FAR uchf

Definition at line 40 of file zutil.h.

## ◆ ulg

typedef unsigned long ulg

Definition at line 43 of file zutil.h.

## ◆ ush

typedef unsigned short ush

Definition at line 41 of file zutil.h.

## ◆ ushf

typedef ush FAR ushf

Definition at line 42 of file zutil.h.

## Function Documentation

## ◆ OF() [1/4]

ZEXTERN uLong ZEXPORT adler32_combine64 OF | ( | (uLong, uLong, z_off_t) |  | ) |

## ◆ OF() [2/4]

voidpf ZLIB_INTERNAL zcalloc OF | ( | (voidpf opaque, unsigned items, unsigned size) |  | ) |

## ◆ OF() [3/4]

void ZLIB_INTERNAL zcfree OF | ( | (voidpf opaque, voidpf ptr) |  | ) |

## ◆ OF() [4/4]

ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF | ( | (z_off_t) |  | ) |

## Variable Documentation

## ◆ z_errmsg

z_const char* const z_errmsg[10]
| extern

Definition at line 13 of file zutil.c.