From 6cce5c060186c109d5fc87ac13b5d36d9d3997ea Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 14 Nov 2011 15:10:24 -0200 Subject: new function 'luaL_loadfilex' --- lauxlib.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lauxlib.h') diff --git a/lauxlib.h b/lauxlib.h index 5f6de7c7..9cb09f48 100644 --- a/lauxlib.h +++ b/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.117 2011/06/16 14:10:12 roberto Exp roberto $ +** $Id: lauxlib.h,v 1.118 2011/11/11 19:59:17 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -72,7 +72,11 @@ LUALIB_API int (luaL_execresult) (lua_State *L, int stat); LUALIB_API int (luaL_ref) (lua_State *L, int t); LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); -LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); +LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, + const char *mode); + +#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL) + LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, const char *name); LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); @@ -172,17 +176,17 @@ LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz); /* ** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and -** initial structure 'luaIO_Stream' (it may contain other fields +** initial structure 'luaL_Stream' (it may contain other fields ** after that initial structure). */ #define LUA_FILEHANDLE "FILE*" -typedef struct luaIO_Stream { +typedef struct luaL_Stream { FILE *f; /* stream (NULL for incompletely created streams) */ lua_CFunction closef; /* to close stream (NULL for closed streams) */ -} luaIO_Stream; +} luaL_Stream; /* }====================================================== */ -- cgit v1.2.3-55-g6feb