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 /lapi.c | |
| 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 'lapi.c')
| -rw-r--r-- | lapi.c | 15 |
1 files changed, 3 insertions, 12 deletions
| @@ -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 | ||
| 903 | LUA_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 | |||
| 912 | LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, | 903 | LUA_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 | ||
| 951 | LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, | 942 | LUA_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; |
