diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-09-02 17:00:41 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-09-02 17:00:41 -0300 |
| commit | 7c0ccdfd61f1611ff0f5f6899a7679916686fc65 (patch) | |
| tree | 843f9a7501112b801e90e53e8c3eb7496046b694 | |
| parent | 4964e7c8a0284a75a57cf591c3b3c77febaf40e6 (diff) | |
| download | lua-7c0ccdfd61f1611ff0f5f6899a7679916686fc65.tar.gz lua-7c0ccdfd61f1611ff0f5f6899a7679916686fc65.tar.bz2 lua-7c0ccdfd61f1611ff0f5f6899a7679916686fc65.zip | |
avoid the use of "enum" in the API, as they do not have a fixed representation
| -rw-r--r-- | ldo.c | 4 | ||||
| -rw-r--r-- | ldo.h | 4 | ||||
| -rw-r--r-- | lua.h | 18 |
3 files changed, 17 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.192 2002/08/07 20:55:00 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.193 2002/08/30 19:09:21 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -151,7 +151,7 @@ static void luaD_growCI (lua_State *L) { | |||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | void luaD_callhook (lua_State *L, lua_Hookevent event, int line) { | 154 | void luaD_callhook (lua_State *L, int event, int line) { |
| 155 | lua_Hook hook = L->hook; | 155 | lua_Hook hook = L->hook; |
| 156 | if (hook && allowhook(L)) { | 156 | if (hook && allowhook(L)) { |
| 157 | ptrdiff_t top = savestack(L, L->top); | 157 | ptrdiff_t top = savestack(L, L->top); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.h,v 1.50 2002/08/06 15:32:22 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 1.51 2002/08/07 14:35:55 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -36,7 +36,7 @@ typedef void (*Pfunc) (lua_State *L, void *ud); | |||
| 36 | 36 | ||
| 37 | void luaD_resetprotection (lua_State *L); | 37 | void luaD_resetprotection (lua_State *L); |
| 38 | int luaD_protectedparser (lua_State *L, ZIO *z, int bin); | 38 | int luaD_protectedparser (lua_State *L, ZIO *z, int bin); |
| 39 | void luaD_callhook (lua_State *L, lua_Hookevent event, int line); | 39 | void luaD_callhook (lua_State *L, int event, int line); |
| 40 | StkId luaD_precall (lua_State *L, StkId func); | 40 | StkId luaD_precall (lua_State *L, StkId func); |
| 41 | void luaD_call (lua_State *L, StkId func, int nResults); | 41 | void luaD_call (lua_State *L, StkId func, int nResults); |
| 42 | int luaD_pcall (lua_State *L, int nargs, int nresults, ptrdiff_t errfunc); | 42 | int luaD_pcall (lua_State *L, int nargs, int nresults, ptrdiff_t errfunc); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.155 2002/08/30 19:09:21 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.156 2002/08/30 20:00:59 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
| 5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
| @@ -308,11 +308,19 @@ LUA_API int lua_pushupvalues (lua_State *L); | |||
| 308 | ** ======================================================================= | 308 | ** ======================================================================= |
| 309 | */ | 309 | */ |
| 310 | 310 | ||
| 311 | typedef enum lua_Hookevent { | 311 | |
| 312 | LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT | 312 | /* |
| 313 | } lua_Hookevent; | 313 | ** Event codes |
| 314 | */ | ||
| 315 | #define LUA_HOOKCALL 0 | ||
| 316 | #define LUA_HOOKRET 1 | ||
| 317 | #define LUA_HOOKLINE 2 | ||
| 318 | #define LUA_HOOKCOUNT 3 | ||
| 314 | 319 | ||
| 315 | 320 | ||
| 321 | /* | ||
| 322 | ** Event masks | ||
| 323 | */ | ||
| 316 | #define LUA_MASKCALL (2 << LUA_HOOKCALL) | 324 | #define LUA_MASKCALL (2 << LUA_HOOKCALL) |
| 317 | #define LUA_MASKRET (2 << LUA_HOOKRET) | 325 | #define LUA_MASKRET (2 << LUA_HOOKRET) |
| 318 | #define LUA_MASKLINE (2 << LUA_HOOKLINE) | 326 | #define LUA_MASKLINE (2 << LUA_HOOKLINE) |
| @@ -339,7 +347,7 @@ LUA_API unsigned long lua_gethookmask (lua_State *L); | |||
| 339 | #define LUA_IDSIZE 60 | 347 | #define LUA_IDSIZE 60 |
| 340 | 348 | ||
| 341 | struct lua_Debug { | 349 | struct lua_Debug { |
| 342 | lua_Hookevent event; | 350 | int event; |
| 343 | const char *name; /* (n) */ | 351 | const char *name; /* (n) */ |
| 344 | const char *namewhat; /* (n) `global', `local', `field', `method' */ | 352 | const char *namewhat; /* (n) `global', `local', `field', `method' */ |
| 345 | const char *what; /* (S) `Lua' function, `C' function, Lua `main' */ | 353 | const char *what; /* (S) `Lua' function, `C' function, Lua `main' */ |
