The Battle for Wesnoth  1.15.2+dev
Classes | Macros | Typedefs | Functions
lzio.h File Reference
#include "lua.h"
#include "lmem.h"
Include dependency graph for lzio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Mbuffer
 
struct  Zio
 

Macros

#define EOZ   (-1) /* end of stream */
 
#define zgetc(z)   (((z)->n--)>0 ? cast_uchar(*(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_buffremove(buff, i)   ((buff)->n -= (i))
 
#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
 
typedef struct Mbuffer Mbuffer
 

Functions

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_fill (ZIO *z)
 

Macro Definition Documentation

◆ EOZ

#define EOZ   (-1) /* end of stream */

Definition at line 16 of file lzio.h.

Referenced by esccheck(), llex(), luaZ_fill(), luaZ_read(), read_long_string(), and read_string().

◆ luaZ_buffer

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

Definition at line 31 of file lzio.h.

Referenced by llex(), read_long_string(), read_numeral(), read_string(), and txtToken().

◆ luaZ_bufflen

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

Definition at line 33 of file lzio.h.

Referenced by llex(), read_long_string(), read_string(), and save().

◆ luaZ_buffremove

#define luaZ_buffremove (   buff,
  i 
)    ((buff)->n -= (i))

Definition at line 35 of file lzio.h.

Referenced by read_string(), readdecesc(), readhexaesc(), and readutf8esc().

◆ luaZ_freebuffer

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

Definition at line 44 of file lzio.h.

Referenced by luaD_protectedparser().

◆ luaZ_initbuffer

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

Definition at line 29 of file lzio.h.

Referenced by luaD_protectedparser().

◆ luaZ_resetbuffer

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

Definition at line 36 of file lzio.h.

Referenced by llex(), and read_long_string().

◆ luaZ_resizebuffer

#define luaZ_resizebuffer (   L,
  buff,
  size 
)
Value:
((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \
(buff)->buffsize, size), \
(buff)->buffsize = size)
#define luaM_reallocvchar(L, b, on, n)
Definition: lmem.h:38
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
Definition: unicode.cpp:86

Definition at line 39 of file lzio.h.

Referenced by luaX_setinput(), and save().

◆ luaZ_sizebuffer

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

Definition at line 32 of file lzio.h.

Referenced by save().

◆ zgetc

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

Definition at line 20 of file lzio.h.

Referenced by f_parser().

Typedef Documentation

◆ Mbuffer

typedef struct Mbuffer Mbuffer

◆ ZIO

typedef struct Zio ZIO

Definition at line 18 of file lzio.h.

Function Documentation

◆ luaZ_fill()

LUAI_FUNC int luaZ_fill ( ZIO z)

Definition at line 23 of file lzio.cpp.

References cast_uchar, Zio::data, EOZ, Zio::L, lua_lock, lua_unlock, Zio::n, Zio::p, Zio::reader, and utf8::size().

Referenced by luaZ_read().

◆ luaZ_init()

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

Definition at line 38 of file lzio.cpp.

References Zio::data, Zio::L, Zio::n, Zio::p, and Zio::reader.

Referenced by lua_load().

◆ luaZ_read()

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

Definition at line 48 of file lzio.cpp.

References EOZ, luaZ_fill(), n, Zio::n, and Zio::p.

Referenced by LoadBlock().