diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-14 16:22:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-14 16:22:43 -0300 |
commit | e33e1bda97871c17c1ba23ea508ce295125a65e9 (patch) | |
tree | 71de82fd673401fef6d5a41ed5abb35d41ac6f69 | |
parent | 5d8b5b9290c932bdfd7dcc670a5af957bdd58392 (diff) | |
parent | 6aabf4b15e7637c2ab4133abf3df0a77f34b6005 (diff) | |
download | lua-e33e1bda97871c17c1ba23ea508ce295125a65e9.tar.gz lua-e33e1bda97871c17c1ba23ea508ce295125a65e9.tar.bz2 lua-e33e1bda97871c17c1ba23ea508ce295125a65e9.zip |
Merge branch 'master' into nextversion
-rw-r--r-- | lstate.h | 11 | ||||
-rw-r--r-- | ltm.h | 5 | ||||
-rw-r--r-- | lua.h | 16 |
3 files changed, 21 insertions, 11 deletions
@@ -9,6 +9,11 @@ | |||
9 | 9 | ||
10 | #include "lua.h" | 10 | #include "lua.h" |
11 | 11 | ||
12 | |||
13 | /* Some header files included here need this definition */ | ||
14 | typedef struct CallInfo CallInfo; | ||
15 | |||
16 | |||
12 | #include "lobject.h" | 17 | #include "lobject.h" |
13 | #include "ltm.h" | 18 | #include "ltm.h" |
14 | #include "lzio.h" | 19 | #include "lzio.h" |
@@ -170,7 +175,7 @@ typedef struct stringtable { | |||
170 | ** - field 'transferinfo' is used only during call/returnhooks, | 175 | ** - field 'transferinfo' is used only during call/returnhooks, |
171 | ** before the function starts or after it ends. | 176 | ** before the function starts or after it ends. |
172 | */ | 177 | */ |
173 | typedef struct CallInfo { | 178 | struct CallInfo { |
174 | StkIdRel func; /* function index in the stack */ | 179 | StkIdRel func; /* function index in the stack */ |
175 | StkIdRel top; /* top for this function */ | 180 | StkIdRel top; /* top for this function */ |
176 | struct CallInfo *previous, *next; /* dynamic call link */ | 181 | struct CallInfo *previous, *next; /* dynamic call link */ |
@@ -197,7 +202,7 @@ typedef struct CallInfo { | |||
197 | } u2; | 202 | } u2; |
198 | short nresults; /* expected number of results from this function */ | 203 | short nresults; /* expected number of results from this function */ |
199 | unsigned short callstatus; | 204 | unsigned short callstatus; |
200 | } CallInfo; | 205 | }; |
201 | 206 | ||
202 | 207 | ||
203 | /* | 208 | /* |
@@ -293,7 +298,7 @@ typedef struct global_State { | |||
293 | struct lua_State *mainthread; | 298 | struct lua_State *mainthread; |
294 | TString *memerrmsg; /* message for memory-allocation errors */ | 299 | TString *memerrmsg; /* message for memory-allocation errors */ |
295 | TString *tmname[TM_N]; /* array with tag-method names */ | 300 | TString *tmname[TM_N]; /* array with tag-method names */ |
296 | struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */ | 301 | struct Table *mt[LUA_NUMTYPES]; /* metatables for basic types */ |
297 | TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ | 302 | TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ |
298 | lua_WarnFunction warnf; /* warning function */ | 303 | lua_WarnFunction warnf; /* warning function */ |
299 | void *ud_warn; /* auxiliary data to 'warnf' */ | 304 | void *ud_warn; /* auxiliary data to 'warnf' */ |
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | 10 | ||
11 | #include "lobject.h" | 11 | #include "lobject.h" |
12 | #include "lstate.h" | ||
12 | 13 | ||
13 | 14 | ||
14 | /* | 15 | /* |
@@ -95,8 +96,8 @@ LUAI_FUNC int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, | |||
95 | int inv, int isfloat, TMS event); | 96 | int inv, int isfloat, TMS event); |
96 | 97 | ||
97 | LUAI_FUNC void luaT_adjustvarargs (lua_State *L, int nfixparams, | 98 | LUAI_FUNC void luaT_adjustvarargs (lua_State *L, int nfixparams, |
98 | struct CallInfo *ci, const Proto *p); | 99 | CallInfo *ci, const Proto *p); |
99 | LUAI_FUNC void luaT_getvarargs (lua_State *L, struct CallInfo *ci, | 100 | LUAI_FUNC void luaT_getvarargs (lua_State *L, CallInfo *ci, |
100 | StkId where, int wanted); | 101 | StkId where, int wanted); |
101 | 102 | ||
102 | 103 | ||
@@ -131,6 +131,16 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); | |||
131 | typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont); | 131 | typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont); |
132 | 132 | ||
133 | 133 | ||
134 | /* | ||
135 | ** Type used by the debug API to collect debug information | ||
136 | */ | ||
137 | typedef struct lua_Debug lua_Debug; | ||
138 | |||
139 | |||
140 | /* | ||
141 | ** Functions to be called by the debugger in specific events | ||
142 | */ | ||
143 | typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); | ||
134 | 144 | ||
135 | 145 | ||
136 | /* | 146 | /* |
@@ -442,12 +452,6 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx); | |||
442 | #define LUA_MASKLINE (1 << LUA_HOOKLINE) | 452 | #define LUA_MASKLINE (1 << LUA_HOOKLINE) |
443 | #define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) | 453 | #define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) |
444 | 454 | ||
445 | typedef struct lua_Debug lua_Debug; /* activation record */ | ||
446 | |||
447 | |||
448 | /* Functions to be called by the debugger in specific events */ | ||
449 | typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); | ||
450 | |||
451 | 455 | ||
452 | LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar); | 456 | LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar); |
453 | LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar); | 457 | LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar); |