# lzio.h File Reference

`#include "lua.h"`
`#include "lmem.h"`

Go to the source code of this file.

## Classes
struct | Mbuffer
struct | Zio
## Defines
#define | EOZ (-1)
#define | char2int(c) cast(int, cast(unsigned char, (c)))
#define | zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
#define | luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
#define | luaZ_buffer(buff) ((buff)->buffer)
#define | luaZ_sizebuffer(buff) ((buff)->buffsize)
#define | luaZ_bufflen(buff) ((buff)->n)
#define | luaZ_resetbuffer(buff) ((buff)->n = 0)
#define | luaZ_resizebuffer(L, buff, size)
#define | luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
## Typedefs
typedef struct Zio | ZIO
## Functions
LUAI_FUNC char * | luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n)
LUAI_FUNC void | luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data)
LUAI_FUNC size_t | luaZ_read (ZIO *z, void *b, size_t n)
LUAI_FUNC int | luaZ_lookahead (ZIO *z)
LUAI_FUNC int | luaZ_fill (ZIO *z)

## Define Documentation

#define char2int | ( | c |  | ) | cast(int, cast(unsigned char, (c)))

#define EOZ (-1)

#define luaZ_buffer | ( | buff |  | ) | ((buff)->buffer)

#define luaZ_bufflen | ( | buff |  | ) | ((buff)->n)

#define luaZ_freebuffer | ( | L,
|  | buff |  | ) | luaZ_resizebuffer(L, buff, 0)

#define luaZ_initbuffer | ( | L,
|  | buff |  | ) | ((buff)->buffer = NULL, (buff)->buffsize = 0)

#define luaZ_resetbuffer | ( | buff |  | ) | ((buff)->n = 0)

#define luaZ_resizebuffer | ( | L,
|  | buff,
|  | size |  | ) |

Value:

    (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
            (buff)->buffsize = size)

#define luaZ_sizebuffer | ( | buff |  | ) | ((buff)->buffsize)

#define zgetc | ( | z |  | ) | (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))

## Typedef Documentation

typedef struct Zio ZIO

## Function Documentation

LUAI_FUNC int luaZ_fill | ( | ZIO * | z | ) |

LUAI_FUNC void luaZ_init | ( | lua_State * | L,
|  | ZIO * | z,
|  | lua_Reader | reader,
|  | void * | data |
| ) |  |  |

LUAI_FUNC int luaZ_lookahead | ( | ZIO * | z | ) |

LUAI_FUNC char* luaZ_openspace | ( | lua_State * | L,
|  | Mbuffer * | buff,
|  | size_t | n |
| ) |  |  |

LUAI_FUNC size_t luaZ_read | ( | ZIO * | z,
|  | void * | b,
|  | size_t | n |
| ) |  |  |