The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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_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 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_fill (ZIO *z)
 

Macro Definition Documentation

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

Definition at line 15 of file lzio.h.

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

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

Definition at line 30 of file lzio.h.

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

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

Definition at line 32 of file lzio.h.

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

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

Definition at line 41 of file lzio.h.

Referenced by checkSizes(), close_state(), and luaD_protectedparser().

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

Definition at line 28 of file lzio.h.

Referenced by lua_newstate(), and luaD_protectedparser().

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

Definition at line 34 of file lzio.h.

Referenced by escerror(), llex(), and read_long_string().

#define luaZ_resizebuffer (   L,
  buff,
  size 
)
Value:
(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
(buff)->buffsize = size)
#define luaM_reallocvector(L, v, oldn, n, t)
Definition: lmem.h:43
GLuint buffer
Definition: glew.h:1648
GLsizeiptr size
Definition: glew.h:1649

Definition at line 37 of file lzio.h.

Referenced by luaX_setinput(), luaZ_openspace(), and save().

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

Definition at line 31 of file lzio.h.

Referenced by save().

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

Definition at line 19 of file lzio.h.

Referenced by f_parser().

Typedef Documentation

typedef struct Mbuffer Mbuffer
typedef struct Zio ZIO

Definition at line 17 of file lzio.h.

Function Documentation

LUAI_FUNC int luaZ_fill ( ZIO z)

Definition at line 20 of file lzio.cpp.

References cast_uchar, Zio::data, EOZ, Zio::L, lua_lock, lua_unlock, Zio::n, Zio::p, and Zio::reader.

Referenced by luaZ_read().

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

Definition at line 35 of file lzio.cpp.

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

Referenced by lua_load().

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

Definition at line 67 of file lzio.cpp.

References Mbuffer::buffer, Mbuffer::buffsize, LUA_MINBUFFER, and luaZ_resizebuffer.

Referenced by LoadString(), and luaV_concat().

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

Definition at line 45 of file lzio.cpp.

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

Referenced by LoadBlock().