aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/lauxlib.h b/lauxlib.h
index e5d378ae..f68f6af1 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -19,6 +19,8 @@
19#define LUA_GNAME "_G" 19#define LUA_GNAME "_G"
20 20
21 21
22typedef struct luaL_Buffer luaL_Buffer;
23
22 24
23/* extra error code for 'luaL_loadfilex' */ 25/* extra error code for 'luaL_loadfilex' */
24#define LUA_ERRFILE (LUA_ERRERR+1) 26#define LUA_ERRFILE (LUA_ERRERR+1)
@@ -99,8 +101,10 @@ LUALIB_API lua_State *(luaL_newstate) (void);
99 101
100LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx); 102LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
101 103
102LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, 104LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s,
103 const char *r); 105 const char *p, const char *r);
106LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s,
107 const char *p, const char *r);
104 108
105LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); 109LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
106 110
@@ -155,7 +159,7 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
155** ======================================================= 159** =======================================================
156*/ 160*/
157 161
158typedef struct luaL_Buffer { 162struct luaL_Buffer {
159 char *b; /* buffer address */ 163 char *b; /* buffer address */
160 size_t size; /* buffer size */ 164 size_t size; /* buffer size */
161 size_t n; /* number of characters in buffer */ 165 size_t n; /* number of characters in buffer */
@@ -164,7 +168,11 @@ typedef struct luaL_Buffer {
164 LUAI_MAXALIGN; /* ensure maximum alignment for buffer */ 168 LUAI_MAXALIGN; /* ensure maximum alignment for buffer */
165 char b[LUAL_BUFFERSIZE]; /* initial buffer */ 169 char b[LUAL_BUFFERSIZE]; /* initial buffer */
166 } init; 170 } init;
167} luaL_Buffer; 171};
172
173
174#define luaL_bufflen(bf) ((bf)->n)
175#define luaL_buffaddr(bf) ((bf)->b)
168 176
169 177
170#define luaL_addchar(B,c) \ 178#define luaL_addchar(B,c) \