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

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

Macros | Functions
fitblk.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <assert.h>`
`#include "zlib.h"`

Go to the source code of this file.

## Macros
#define | local static
#define | RAWLEN 4096 /* intermediate uncompressed buffer size */
#define | EXCESS 256 /* empirically determined stream overage */
#define | MARGIN 8 /* amount to back off for completion */

## Functions
void | quit (char *why)
int | partcompress (FILE *in, z_streamp def)
int | recompress (z_streamp inf, z_streamp def)
int | main (int argc, char **argv)

## Macro Definition Documentation

## ◆ EXCESS

#define EXCESS 256 /* empirically determined stream overage */

Definition at line 123 of file fitblk.c.

## ◆ local

#define local static

Definition at line 59 of file fitblk.c.

## ◆ MARGIN

#define MARGIN 8 /* amount to back off for completion */

Definition at line 124 of file fitblk.c.

## ◆ RAWLEN

#define RAWLEN 4096 /* intermediate uncompressed buffer size */

Definition at line 68 of file fitblk.c.

## Function Documentation

## ◆ main()

int main | ( | int argc | ,
|  | char ** | argv
| ) |  |

Definition at line 127 of file fitblk.c.

References argc, argv, assert, blk, def(), deflateEnd(), deflateInit, deflateReset(), EXCESS, ferror, free, inf(), inflateEnd(), inflateInit, inflateReset(), malloc, MARGIN, NULL, partcompress(), quit(), recompress(), Z_DEFAULT_COMPRESSION, Z_ERRNO, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_END, and Z_STREAM_ERROR.

## ◆ partcompress()

int partcompress | ( | FILE * | in,
|  | z_streamp | def
| ) |  |

Definition at line 73 of file fitblk.c.

References assert, def(), deflate(), feof, ferror, in(), RAWLEN, Z_ERRNO, Z_FINISH, Z_NO_FLUSH, and Z_STREAM_ERROR.

Referenced by main().

## ◆ quit()

void quit | ( | char * | why | ) |

Definition at line 62 of file fitblk.c.

Referenced by main().

## ◆ recompress()

int recompress | ( | z_streamp | inf,
|  | z_streamp | def
| ) |  |

Definition at line 96 of file fitblk.c.

References assert, def(), deflate(), inf(), inflate(), RAWLEN, Z_DATA_ERROR, Z_FINISH, Z_MEM_ERROR, Z_NEED_DICT, Z_NO_FLUSH, Z_STREAM_END, and Z_STREAM_ERROR.

Referenced by main().