luadebug.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. ** $Id: luadebug.h,v 1.12 2000/08/11 16:17:28 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. int lua_getstack (lua_State *L, int level, lua_Debug *ar);
  13. int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
  14. const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int localnum);
  15. const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int localnum);
  16. lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
  17. lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
  18. struct lua_Debug {
  19. const char *event; /* `call', `return' */
  20. const char *source; /* (S) */
  21. int linedefined; /* (S) */
  22. const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
  23. int currentline; /* (l) */
  24. const char *name; /* (n) */
  25. const char *namewhat; /* (n) `global', `tag method', `local', `field' */
  26. int nups; /* (u) number of upvalues */
  27. /* private part */
  28. struct lua_TObject *_func; /* active function */
  29. };
  30. #endif