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

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

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

Go to the source code of this file.

## Macros
#define | SET_BINARY_MODE(file)
#define | CHUNK 16384

## Functions
int | def (FILE *source, FILE *dest, int level)
int | inf (FILE *source, FILE *dest)
void | zerr (int ret)
int | main (int argc, char **argv)

## Macro Definition Documentation

## ◆ CHUNK

#define CHUNK 16384

Definition at line 28 of file zpipe.c.

## ◆ SET_BINARY_MODE

#define SET_BINARY_MODE | ( |  | file | ) |

Definition at line 25 of file zpipe.c.

## Function Documentation

## ◆ def()

int def | ( | FILE * | source,
|  | FILE * | dest,
|  | int | level
| ) |  |

Definition at line 36 of file zpipe.c.

References assert, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, deflate(), deflateEnd(), deflateInit, feof, ferror, in(), z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, out, Z_ERRNO, Z_FINISH, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, z_stream_s::zalloc, and z_stream_s::zfree.

Referenced by main(), partcompress(), rb_check_funcall_default(), rb_hash_lookup2(), rb_method_definition_create(), rb_method_definition_set(), rb_method_entry_complement_defined_class(), rb_method_entry_create(), recompress(), and yyparse().

## ◆ inf()

int inf | ( | FILE * | source,
|  | FILE * | dest
| ) |  |

Definition at line 92 of file zpipe.c.

References assert, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, ferror, in(), inf(), inflate(), inflateEnd(), inflateInit, z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, out, Z_DATA_ERROR, Z_ERRNO, Z_MEM_ERROR, Z_NEED_DICT, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, z_stream_s::zalloc, and z_stream_s::zfree.

Referenced by inf(), InitVM_process(), isinf(), main(), and recompress().

## ◆ main()

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

Definition at line 176 of file zpipe.c.

References argc, argv, def(), inf(), SET_BINARY_MODE, Z_DEFAULT_COMPRESSION, Z_OK, and zerr().

## ◆ zerr()

void zerr | ( | int | ret | ) |

Definition at line 151 of file zpipe.c.

References ferror, Z_DATA_ERROR, Z_ERRNO, Z_MEM_ERROR, Z_STREAM_ERROR, and Z_VERSION_ERROR.

Referenced by main().