luadebug.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. ** $Id: luadebug.h,v 1.15 2000/09/12 18:38:02 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 char *what, lua_Debug *ar);
  14. LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar,
  15. int localnum);
  16. LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar,
  17. int localnum);
  18. LUA_API lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
  19. LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
  20. #define LUA_IDSIZE 60
  21. struct lua_Debug {
  22. const char *event; /* `call', `return' */
  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. int linedefined; /* (S) */
  28. const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
  29. const char *source; /* (S) */
  30. char short_src[LUA_IDSIZE]; /* (S) */
  31. /* private part */
  32. struct lua_TObject *_func; /* active function */
  33. };
  34. #endif