Skip to main content

gzungetc

Function gzungetc 

Source
pub unsafe extern "C" fn gzungetc(c: c_int, file: gzFile) -> c_int
Available on crate feature gz only.
Expand description

Push c back onto the stream for file to be read as the first character on the next read. At least one character of push-back is always allowed.

gzungetc will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer.)

The pushed character will be discarded if the stream is repositioned with gzseek or gzrewind.

§Returns

  • The character pushed, on success.
  • -1 on failure.

§Safety

  • file, if non-null, must be an open file handle obtained from gzopen or gzdopen.