diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-08 15:04:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-08 15:04:33 -0300 |
commit | 70a63fa5adfb2480ce385502f1d0306000217690 (patch) | |
tree | bcf7b3e8ac2c1c995a5bbc83678d1be7e6eef62c /lstate.h | |
parent | fffbaede758abe3b460621962113c352dbd7c605 (diff) | |
download | lua-70a63fa5adfb2480ce385502f1d0306000217690.tar.gz lua-70a63fa5adfb2480ce385502f1d0306000217690.tar.bz2 lua-70a63fa5adfb2480ce385502f1d0306000217690.zip |
first implementation of yieldable 'pcall'
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.39 2009/03/10 17:14:37 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.40 2009/03/23 14:26:12 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -90,6 +90,10 @@ typedef struct CallInfo { | |||
90 | struct { /* only for C functions */ | 90 | struct { /* only for C functions */ |
91 | int ctx; /* context info. in case of yields */ | 91 | int ctx; /* context info. in case of yields */ |
92 | lua_CFunction k; /* continuation in case of yields */ | 92 | lua_CFunction k; /* continuation in case of yields */ |
93 | ptrdiff_t old_errfunc; | ||
94 | ptrdiff_t oldtop; | ||
95 | lu_byte old_allowhook; | ||
96 | lu_byte status; | ||
93 | } c; | 97 | } c; |
94 | } u; | 98 | } u; |
95 | } CallInfo; | 99 | } CallInfo; |
@@ -98,11 +102,13 @@ typedef struct CallInfo { | |||
98 | /* | 102 | /* |
99 | ** Bits in CallInfo status | 103 | ** Bits in CallInfo status |
100 | */ | 104 | */ |
101 | #define CIST_LUA 1 /* call is running a Lua function */ | 105 | #define CIST_LUA (1<<0) /* call is running a Lua function */ |
102 | #define CIST_HOOKED 2 /* call is running a debug hook */ | 106 | #define CIST_HOOKED (1<<1) /* call is running a debug hook */ |
103 | #define CIST_REENTRY 4 /* call is running on same invocation of | 107 | #define CIST_REENTRY (1<<2) /* call is running on same invocation of |
104 | luaV_execute of previous call */ | 108 | luaV_execute of previous call */ |
105 | #define CIST_CTX 8 /* call has a ctx value */ | 109 | #define CIST_YIELDED (1<<3) /* call reentered after suspension */ |
110 | #define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ | ||
111 | #define CIST_STAT (1<<5) /* call has an error status (pcall) */ | ||
106 | 112 | ||
107 | 113 | ||
108 | #define curr_func(L) (clvalue(L->ci->func)) | 114 | #define curr_func(L) (clvalue(L->ci->func)) |