aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/lua.h b/lua.h
index aa187338..5beb5411 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.305 2014/05/08 13:52:20 roberto Exp roberto $ 2** $Id: lua.h,v 1.306 2014/05/13 19:40:28 roberto Exp roberto $
3** Lua - A Scripting Language 3** Lua - A Scripting Language
4** Lua.org, PUC-Rio, Brazil (http://www.lua.org) 4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** See Copyright Notice at the end of this file 5** See Copyright Notice at the end of this file
@@ -53,8 +53,16 @@
53 53
54typedef struct lua_State lua_State; 54typedef struct lua_State lua_State;
55 55
56/*
57** Type for C functions registered with Lua
58*/
56typedef int (*lua_CFunction) (lua_State *L); 59typedef int (*lua_CFunction) (lua_State *L);
57 60
61/*
62** Type for continuation functions
63*/
64typedef int (*lua_KFunction) (lua_State *L, int status, int ctx);
65
58 66
59/* 67/*
60** functions that read/write blocks when loading/dumping Lua chunks 68** functions that read/write blocks when loading/dumping Lua chunks
@@ -257,13 +265,11 @@ LUA_API void (lua_setuservalue) (lua_State *L, int idx);
257** 'load' and 'call' functions (load and run Lua code) 265** 'load' and 'call' functions (load and run Lua code)
258*/ 266*/
259LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, int ctx, 267LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
260 lua_CFunction k); 268 lua_KFunction k);
261#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL) 269#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL)
262 270
263LUA_API int (lua_getctx) (lua_State *L, int *ctx);
264
265LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc, 271LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
266 int ctx, lua_CFunction k); 272 int ctx, lua_KFunction k);
267#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL) 273#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
268 274
269LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, 275LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
@@ -277,7 +283,7 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip);
277** coroutine functions 283** coroutine functions
278*/ 284*/
279LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx, 285LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx,
280 lua_CFunction k); 286 lua_KFunction k);
281#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL) 287#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
282LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); 288LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg);
283LUA_API int (lua_status) (lua_State *L); 289LUA_API int (lua_status) (lua_State *L);