aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-14 15:10:24 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-14 15:10:24 -0200
commit6cce5c060186c109d5fc87ac13b5d36d9d3997ea (patch)
treeb2215f8fec6effa7adc45e73614a0694b833016a /lauxlib.h
parenteb70f58279e7bd8581ecf58c763d8065a8e2bfb0 (diff)
downloadlua-6cce5c060186c109d5fc87ac13b5d36d9d3997ea.tar.gz
lua-6cce5c060186c109d5fc87ac13b5d36d9d3997ea.tar.bz2
lua-6cce5c060186c109d5fc87ac13b5d36d9d3997ea.zip
new function 'luaL_loadfilex'
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/lauxlib.h b/lauxlib.h
index 5f6de7c7..9cb09f48 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.h,v 1.117 2011/06/16 14:10:12 roberto Exp roberto $ 2** $Id: lauxlib.h,v 1.118 2011/11/11 19:59:17 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -72,7 +72,11 @@ LUALIB_API int (luaL_execresult) (lua_State *L, int stat);
72LUALIB_API int (luaL_ref) (lua_State *L, int t); 72LUALIB_API int (luaL_ref) (lua_State *L, int t);
73LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); 73LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
74 74
75LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); 75LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename,
76 const char *mode);
77
78#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL)
79
76LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, 80LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
77 const char *name); 81 const char *name);
78LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); 82LUALIB_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);
172 176
173/* 177/*
174** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and 178** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and
175** initial structure 'luaIO_Stream' (it may contain other fields 179** initial structure 'luaL_Stream' (it may contain other fields
176** after that initial structure). 180** after that initial structure).
177*/ 181*/
178 182
179#define LUA_FILEHANDLE "FILE*" 183#define LUA_FILEHANDLE "FILE*"
180 184
181 185
182typedef struct luaIO_Stream { 186typedef struct luaL_Stream {
183 FILE *f; /* stream (NULL for incompletely created streams) */ 187 FILE *f; /* stream (NULL for incompletely created streams) */
184 lua_CFunction closef; /* to close stream (NULL for closed streams) */ 188 lua_CFunction closef; /* to close stream (NULL for closed streams) */
185} luaIO_Stream; 189} luaL_Stream;
186 190
187/* }====================================================== */ 191/* }====================================================== */
188 192