Ruby: ext/zlib/zlib-1.2.13/examples/gznorm.c File Reference

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

Macros | Functions
gznorm.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <stdarg.h>`
`#include "zlib.h"`

Go to the source code of this file.

## Macros
#define | SET_BINARY_MODE(file)
#define | local static
#define | BYE(...)
#define | CHUNK 16384

## Functions
char * | aprintf (char *fmt,...)
int | gzip_normalize (FILE *in, FILE *out, char **err)
int | main (void)

## Macro Definition Documentation

## ◆ BYE

#define BYE | ( |  | ... | ) |

Value:
do { \
inflateEnd(&strm); \
*err = aprintf(__VA_ARGS__); \
return 1; \
} while (0)
aprintf
char * aprintf(char *fmt,...)
Definition: gznorm.c:36
err
int err
Definition: win32.c:142

Definition at line 58 of file gznorm.c.

## ◆ CHUNK

#define CHUNK 16384

Definition at line 67 of file gznorm.c.

## ◆ local

#define local static

Definition at line 32 of file gznorm.c.

## ◆ SET_BINARY_MODE

#define SET_BINARY_MODE | ( |  | file | ) |

Definition at line 29 of file gznorm.c.

## Function Documentation

## ◆ aprintf()

char * aprintf | ( | char * | fmt,
|  |  | ...
| ) |  |

Definition at line 36 of file gznorm.c.

References len, malloc, NULL, str, and vsnprintf.

## ◆ gzip_normalize()

int gzip_normalize | ( | FILE * | in,
|  | FILE * | out,
|  | char ** | err
| ) |  |

Definition at line 86 of file gznorm.c.

References z_stream_s::avail_in, z_stream_s::avail_out, bits(), BYE, CHUNK, crc32_combine(), z_stream_s::data_type, err, ferror, HEAD, in(), inflate(), inflateEnd(), inflateInit2, inflateReset(), last, len, long(), z_stream_s::msg, z_stream_s::next_in, z_stream_s::next_out, NULL, num, z_stream_s::opaque, out, strerror(), Z_BLOCK, Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NULL, z_off_t, Z_OK, Z_STREAM_END, z_stream_s::zalloc, and z_stream_s::zfree.

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Definition at line 458 of file gznorm.c.

References err, free, gzip_normalize(), and SET_BINARY_MODE.