From 118e9cd843d2956d64b86bfdd70f89919153e471 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 25 Oct 2002 18:31:28 -0300 Subject: new facility for dumping chunks --- lua.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index f95ef4fd..3fef586d 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.159 2002/10/22 17:21:25 roberto Exp roberto $ +** $Id: lua.h,v 1.160 2002/10/25 20:05:28 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil ** http://www.lua.org mailto:info@lua.org @@ -52,10 +52,13 @@ typedef int (*lua_CFunction) (lua_State *L); /* -** functions that read blocks when loading Lua chunk +** functions that read/write blocks when loading/dumping Lua chunks */ typedef const char * (*lua_Chunkreader) (lua_State *L, void *ud, size_t *sz); +typedef int (*lua_Chunkwriter) (lua_State *L, const void* p, + size_t sz, void* ud); + /* ** basic types @@ -192,6 +195,8 @@ LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc); LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *dt, const char *chunkname); +LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data); + /* ** coroutine functions -- cgit v1.2.3-55-g6feb