Ruby: ext/zlib/zlib-1.2.13/gzread.c File Reference

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

Functions
gzread.c File Reference
`#include "gzguts.h"`

Go to the source code of this file.

## Functions
int gz_load | OF ((gz_statep, unsigned char *, unsigned, unsigned *))
int gz_avail | OF ((gz_statep))
int gz_skip | OF ((gz_statep, z_off64_t))
z_size_t gz_read | OF ((gz_statep, voidp, z_size_t))
int | gz_load (gz_statep state, unsigned char *buf, unsigned len, unsigned *have)
int | gz_avail (gz_statep state)
int | gz_look (gz_statep state)
int | gz_decomp (gz_statep state)
int | gz_fetch (gz_statep state)
int | gz_skip (gz_statep state, z_off64_t len)
z_size_t | gz_read (gz_statep state, voidp buf, z_size_t len)
int ZEXPORT | gzread (gzFile file, voidp buf, unsigned len)
z_size_t ZEXPORT | gzfread (voidp buf, z_size_t size, z_size_t nitems, gzFile file)
int ZEXPORT | gzgetc (gzFile file)
int ZEXPORT | gzgetc_ (gzFile file)
int ZEXPORT | gzungetc (int c, gzFile file)
char *ZEXPORT | gzgets (gzFile file, char *buf, int len)
int ZEXPORT | gzdirect (gzFile file)
int ZEXPORT | gzclose_r (gzFile file)

## Function Documentation

## ◆ gz_avail()

int gz_avail | ( | gz_statep | state | ) |

Definition at line 56 of file gzread.c.

References gz_load(), state::in, Z_BUF_ERROR, and Z_OK.

Referenced by gz_decomp(), and gz_look().

## ◆ gz_decomp()

int gz_decomp | ( | gz_statep | state | ) |

Definition at line 173 of file gzread.c.

References gz_avail(), gz_error(), inflate(), LOOK, state::next, NULL, Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NEED_DICT, Z_NO_FLUSH, Z_OK, Z_STREAM_END, and Z_STREAM_ERROR.

Referenced by gz_fetch(), and gz_read().

## ◆ gz_fetch()

int gz_fetch | ( | gz_statep | state | ) |

Definition at line 227 of file gzread.c.

References COPY, gz_decomp(), gz_load(), gz_look(), GZIP, LOOK, state::next, and state::out.

Referenced by gz_read(), gz_skip(), and gzgets().

## ◆ gz_load()

int gz_load | ( | gz_statep | state,
|  | unsigned char * | buf,
|  | unsigned | len,
|  | unsigned * | have
| ) |  |

Definition at line 21 of file gzread.c.

References gz_error(), len, max, read(), Z_ERRNO, and zstrerror.

Referenced by gz_avail(), gz_fetch(), and gz_read().

## ◆ gz_look()

int gz_look | ( | gz_statep | state | ) |

Definition at line 91 of file gzread.c.

References COPY, free, gz_avail(), gz_error(), GZIP, state::in, inflateInit2, inflateReset(), malloc, memcpy, state::next, NULL, state::out, Z_MEM_ERROR, Z_NULL, and Z_OK.

Referenced by gz_fetch(), and gzdirect().

## ◆ gz_read()

z_size_t gz_read | ( | gz_statep | state,
|  | voidp | buf,
|  | z_size_t | len
| ) |  |

Definition at line 292 of file gzread.c.

References COPY, gz_decomp(), gz_fetch(), gz_load(), gz_skip(), len, LOOK, memcpy, and state::next.

Referenced by gzfread(), gzgetc(), and gzread().

## ◆ gz_skip()

int gz_skip | ( | gz_statep | state,
|  | z_off64_t | len
| ) |  |

Definition at line 257 of file gzread.c.

References GT_OFF, gz_fetch(), len, state::next, and z_off64_t.

Referenced by gz_read(), gzgets(), and gzungetc().

## ◆ gzclose_r()

int ZEXPORT gzclose_r | ( | gzFile | file | ) |

Definition at line 623 of file gzread.c.

References err, free, gz_error(), GZ_READ, state::in, inflateEnd(), NULL, state::out, Z_BUF_ERROR, Z_ERRNO, Z_OK, and Z_STREAM_ERROR.

Referenced by gzclose().

## ◆ gzdirect()

int ZEXPORT gzdirect | ( | gzFile | file | ) |

Definition at line 603 of file gzread.c.

References gz_look(), GZ_READ, LOOK, and NULL.

## ◆ gzfread()

z_size_t ZEXPORT gzfread | ( | voidp | buf,
|  | z_size_t | size,
|  | z_size_t | nitems,
|  | gzFile | file
| ) |  |

Definition at line 409 of file gzread.c.

References gz_error(), GZ_READ, gz_read(), len, NULL, Z_BUF_ERROR, Z_OK, and Z_STREAM_ERROR.

## ◆ gzgetc()

int ZEXPORT gzgetc | ( | gzFile | file | ) |

Definition at line 445 of file gzread.c.

References GZ_READ, gz_read(), state::next, NULL, Z_BUF_ERROR, and Z_OK.

## ◆ gzgetc_()

int ZEXPORT gzgetc_ | ( | gzFile | file | ) |

Definition at line 472 of file gzread.c.

References gzgetc.

## ◆ gzgets()

char *ZEXPORT gzgets | ( | gzFile | file,
|  | char * | buf,
|  | int | len
| ) |  |

Definition at line 539 of file gzread.c.

References gz_fetch(), GZ_READ, gz_skip(), len, memcpy, state::next, NULL, str, Z_BUF_ERROR, and Z_OK.

## ◆ gzread()

int ZEXPORT gzread | ( | gzFile | file,
|  | voidp | buf,
|  | unsigned | len
| ) |  |

Definition at line 373 of file gzread.c.

References gz_error(), GZ_READ, gz_read(), len, NULL, Z_BUF_ERROR, Z_OK, and Z_STREAM_ERROR.

Referenced by operator>(), read_string(), and tar().

## ◆ gzungetc()

int ZEXPORT gzungetc | ( | int | c,
|  | gzFile | file
| ) |  |

Definition at line 479 of file gzread.c.

References gz_error(), GZ_READ, gz_skip(), state::next, NULL, state::out, Z_BUF_ERROR, Z_DATA_ERROR, and Z_OK.

## ◆ OF() [1/4]

int gz_avail OF | ( | (gz_statep) |  | ) |

## ◆ OF() [2/4]

int gz_load OF | ( | (gz_statep, unsigned char *, unsigned, unsigned *) |  | ) |

## ◆ OF() [3/4]

z_size_t gz_read OF | ( | (gz_statep, voidp, z_size_t) |  | ) |

## ◆ OF() [4/4]

int gz_skip OF | ( | (gz_statep, z_off64_t) |  | ) |