aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-08-06 15:01:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-08-06 15:01:50 -0300
commit2e38c6ae5a53cbf1a607a790460fca45ba3b9ca8 (patch)
treecab4a74aba7ce8d38193f0bd2cc6f5e06b5b5690 /lua.h
parentd3dd337fcaf286c83103e283b72b6ef52d837ba3 (diff)
downloadlua-2e38c6ae5a53cbf1a607a790460fca45ba3b9ca8.tar.gz
lua-2e38c6ae5a53cbf1a607a790460fca45ba3b9ca8.tar.bz2
lua-2e38c6ae5a53cbf1a607a790460fca45ba3b9ca8.zip
`luadebug.h' content now is included in `lua.h'
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h56
1 files changed, 53 insertions, 3 deletions
diff --git a/lua.h b/lua.h
index 786ba8d6..955b052a 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.150 2002/08/06 17:06:56 roberto Exp roberto $ 2** $Id: lua.h,v 1.151 2002/08/06 17:26:45 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
@@ -282,8 +282,6 @@ LUA_API int lua_pushupvalues (lua_State *L);
282 282
283#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref) 283#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
284 284
285#endif
286
287 285
288 286
289/* 287/*
@@ -304,6 +302,56 @@ LUA_API int lua_pushupvalues (lua_State *L);
304/* }====================================================================== */ 302/* }====================================================================== */
305 303
306 304
305/*
306** {======================================================================
307** Debug API
308** =======================================================================
309*/
310
311typedef enum lua_Hookevent {
312 LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT
313} lua_Hookevent;
314
315
316#define LUA_MASKCALL (2 << LUA_HOOKCALL)
317#define LUA_MASKRET (2 << LUA_HOOKRET)
318#define LUA_MASKLINE (2 << LUA_HOOKLINE)
319#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1))
320#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1))
321
322typedef struct lua_Debug lua_Debug; /* activation record */
323
324typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
325
326
327LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
328LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
329LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
330LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
331
332LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask);
333LUA_API lua_Hook lua_gethook (lua_State *L);
334LUA_API int lua_gethookmask (lua_State *L);
335
336
337#define LUA_IDSIZE 60
338
339struct lua_Debug {
340 lua_Hookevent event;
341 const char *name; /* (n) */
342 const char *namewhat; /* (n) `global', `local', `field', `method' */
343 const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
344 const char *source; /* (S) */
345 int currentline; /* (l) */
346 int nups; /* (u) number of upvalues */
347 int linedefined; /* (S) */
348 char short_src[LUA_IDSIZE]; /* (S) */
349 /* private part */
350 int i_ci; /* active function */
351};
352
353/* }====================================================================== */
354
307 355
308/****************************************************************************** 356/******************************************************************************
309* Copyright (C) 2002 Tecgraf, PUC-Rio. All rights reserved. 357* Copyright (C) 2002 Tecgraf, PUC-Rio. All rights reserved.
@@ -328,3 +376,5 @@ LUA_API int lua_pushupvalues (lua_State *L);
328* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 376* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
329******************************************************************************/ 377******************************************************************************/
330 378
379
380#endif