aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-10 14:41:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-10 14:41:38 -0300
commit6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4 (patch)
tree77247f6bb46460afa33749cedfc841f22089f785 /lapi.c
parent35a6aad0d745d3acb9d5feb895f84a05ae8bf5ba (diff)
downloadlua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.gz
lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.bz2
lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.zip
new type lua_KFunction + no more 'lua_getctx'
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/lapi.c b/lapi.c
index 7010ec70..2b874530 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.213 2014/05/15 15:22:45 roberto Exp roberto $ 2** $Id: lapi.c,v 2.214 2014/05/15 20:28:39 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -900,17 +900,8 @@ LUA_API void lua_setuservalue (lua_State *L, int idx) {
900 "results from function overflow current stack size") 900 "results from function overflow current stack size")
901 901
902 902
903LUA_API int lua_getctx (lua_State *L, int *ctx) {
904 if (L->ci->callstatus & CIST_YIELDED) {
905 if (ctx) *ctx = L->ci->u.c.ctx;
906 return L->ci->u.c.status;
907 }
908 else return LUA_OK;
909}
910
911
912LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, 903LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx,
913 lua_CFunction k) { 904 lua_KFunction k) {
914 StkId func; 905 StkId func;
915 lua_lock(L); 906 lua_lock(L);
916 api_check(L, k == NULL || !isLua(L->ci), 907 api_check(L, k == NULL || !isLua(L->ci),
@@ -949,7 +940,7 @@ static void f_call (lua_State *L, void *ud) {
949 940
950 941
951LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, 942LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
952 int ctx, lua_CFunction k) { 943 int ctx, lua_KFunction k) {
953 struct CallS c; 944 struct CallS c;
954 int status; 945 int status;
955 ptrdiff_t func; 946 ptrdiff_t func;