golua.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4. #include "../clua/lua.h"
  5. #include "../clua/lauxlib.h"
  6. #include "../clua/lualib.h"
  7. #undef lua_newuserdata
  8. LUA_API void *lua_newuserdata (lua_State *L, size_t size);
  9. #ifndef GoInterface
  10. typedef struct { void *t; void *v; } GoInterface;
  11. #endif
  12. #ifndef GoUintptr
  13. typedef unsigned int* GoUintptr;
  14. #endif
  15. #define GOLUA_DEFAULT_MSGHANDLER "golua_default_msghandler"
  16. /* function to setup metatables, etc */
  17. void clua_initstate(lua_State* L);
  18. void clua_hide_pcall(lua_State *L);
  19. unsigned int clua_togofunction(lua_State* L, int index);
  20. unsigned int clua_togostruct(lua_State *L, int index);
  21. void clua_pushcallback(lua_State* L);
  22. void clua_pushgofunction(lua_State* L, unsigned int fid);
  23. void clua_pushgostruct(lua_State *L, unsigned int fid);
  24. void clua_setgostate(lua_State* L, size_t gostateindex);
  25. int dump_chunk (lua_State *L);
  26. int load_chunk(lua_State *L, const char *b, int size, const char* chunk_name);
  27. size_t clua_getgostate(lua_State* L);
  28. GoInterface clua_atpanic(lua_State* L, unsigned int panicf_id);
  29. int clua_callluacfunc(lua_State* L, lua_CFunction f);
  30. lua_State* clua_newstate(void* goallocf);
  31. void clua_setallocf(lua_State* L, void* goallocf);
  32. void clua_openbase(lua_State* L);
  33. void clua_openio(lua_State* L);
  34. void clua_openmath(lua_State* L);
  35. void clua_openpackage(lua_State* L);
  36. void clua_openstring(lua_State* L);
  37. void clua_opentable(lua_State* L);
  38. void clua_openos(lua_State* L);
  39. void clua_sethook(lua_State* L, int n);
  40. int clua_isgofunction(lua_State *L, int n);
  41. int clua_isgostruct(lua_State *L, int n);