luadebug.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. ** $Id: luadebug.h,v 1.19 2001/03/07 18:09:25 roberto Exp roberto $
  3. ** Debugging API
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef luadebug_h
  7. #define luadebug_h
  8. #include "lua.h"
  9. typedef struct lua_Debug lua_Debug; /* activation record */
  10. typedef struct lua_Localvar lua_Localvar;
  11. typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
  12. LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
  13. LUA_API int lua_getinfo (lua_State *L, const lua_char *what, lua_Debug *ar);
  14. LUA_API const lua_char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
  15. LUA_API const lua_char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
  16. LUA_API lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
  17. LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
  18. #define LUA_IDSIZE 60
  19. struct lua_Debug {
  20. const lua_char *event; /* `call', `return' */
  21. int currentline; /* (l) */
  22. const lua_char *name; /* (n) */
  23. const lua_char *namewhat; /* (n) `global', `tag method', `local', `field' */
  24. int nups; /* (u) number of upvalues */
  25. int linedefined; /* (S) */
  26. const lua_char *what; /* (S) `Lua' function, `C' function, Lua `main' */
  27. const lua_char *source; /* (S) */
  28. lua_char short_src[LUA_IDSIZE]; /* (S) */
  29. /* private part */
  30. struct CallInfo *_ci; /* active function */
  31. };
  32. #endif