diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-10 14:41:38 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-10 14:41:38 -0300 |
| commit | 6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4 (patch) | |
| tree | 77247f6bb46460afa33749cedfc841f22089f785 /lua.h | |
| parent | 35a6aad0d745d3acb9d5feb895f84a05ae8bf5ba (diff) | |
| download | lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.gz lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.bz2 lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.zip | |
new type lua_KFunction + no more 'lua_getctx'
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 18 |
1 files changed, 12 insertions, 6 deletions
| @@ -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 | ||
| 54 | typedef struct lua_State lua_State; | 54 | typedef struct lua_State lua_State; |
| 55 | 55 | ||
| 56 | /* | ||
| 57 | ** Type for C functions registered with Lua | ||
| 58 | */ | ||
| 56 | typedef int (*lua_CFunction) (lua_State *L); | 59 | typedef int (*lua_CFunction) (lua_State *L); |
| 57 | 60 | ||
| 61 | /* | ||
| 62 | ** Type for continuation functions | ||
| 63 | */ | ||
| 64 | typedef 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 | */ |
| 259 | LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, int ctx, | 267 | LUA_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 | ||
| 263 | LUA_API int (lua_getctx) (lua_State *L, int *ctx); | ||
| 264 | |||
| 265 | LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc, | 271 | LUA_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 | ||
| 269 | LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, | 275 | LUA_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 | */ |
| 279 | LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx, | 285 | LUA_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) |
| 282 | LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); | 288 | LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); |
| 283 | LUA_API int (lua_status) (lua_State *L); | 289 | LUA_API int (lua_status) (lua_State *L); |
