From 35a22ed1ab15fabb9404d0184165baa1d52394f1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 3 Jun 2002 14:46:34 -0300 Subject: lua_load* replaced by a simple lua_load --- lua.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index 710e0c4d..6277b98c 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.133 2002/05/16 18:39:46 roberto Exp roberto $ +** $Id: lua.h,v 1.134 2002/05/23 20:29:05 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Tecgraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: info@lua.org @@ -51,6 +51,11 @@ typedef struct lua_State lua_State; typedef int (*lua_CFunction) (lua_State *L); +/* +** function for loading Lua code +*/ +typedef const char * (*lua_Getblock) (void *ud, size_t *size); + /* ** basic types @@ -176,9 +181,8 @@ LUA_API void lua_setmetatable (lua_State *L, int objindex); */ LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf); -LUA_API int lua_loadfile (lua_State *L, const char *filename); -LUA_API int lua_loadbuffer (lua_State *L, const char *buff, size_t size, - const char *name); +LUA_API int lua_load (lua_State *L, lua_Getblock getblock, void *ud, + int binary, const char *chunkname); /* @@ -249,11 +253,6 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); ** compatibility macros and functions */ -LUA_API int lua_call (lua_State *L, int nargs, int nresults); -LUA_API int lua_dofile (lua_State *L, const char *filename); -LUA_API int lua_dostring (lua_State *L, const char *str); -LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size, - const char *name); LUA_API int lua_pushupvalues (lua_State *L); @@ -292,6 +291,9 @@ LUA_API int lua_pushupvalues (lua_State *L); ** ======================================================================= */ +/* binary files start with Lua */ +#define LUA_SIGNATURE "\033Lua" + /* formats for Lua numbers */ #ifndef LUA_NUMBER_SCAN #define LUA_NUMBER_SCAN "%lf" -- cgit v1.2.3-55-g6feb