luadebug.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. ** $Id: luadebug.h,v 1.9 2000/01/19 12:00:45 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. int lua_getlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v);
  15. int lua_setlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v);
  16. int lua_setdebug (lua_State *L, int debug);
  17. lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
  18. lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
  19. struct lua_Debug {
  20. const char *event; /* `call', `return' */
  21. const char *source; /* (S) */
  22. int linedefined; /* (S) */
  23. const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
  24. int currentline; /* (l) */
  25. const char *name; /* (n) */
  26. const char *namewhat; /* (n) global, tag method, local, field */
  27. int nups; /* (u) number of upvalues */
  28. lua_Object func; /* (f) function being executed */
  29. /* private part */
  30. lua_Object _func; /* active function */
  31. };
  32. struct lua_Localvar {
  33. int index;
  34. const char *name;
  35. lua_Object value;
  36. };
  37. #endif