9
3

lundump.h 863 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. ** $Id: lundump.h $
  3. ** load precompiled Lua chunks
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lundump_h
  7. #define lundump_h
  8. #include "llimits.h"
  9. #include "lobject.h"
  10. #include "lzio.h"
  11. /* data to catch conversion errors */
  12. #define LUAC_DATA "\x19\x93\r\n\x1a\n"
  13. #define LUAC_INT 0x5678
  14. #define LUAC_NUM cast_num(370.5)
  15. /*
  16. ** Encode major-minor version in one byte, one nibble for each
  17. */
  18. #define MYINT(s) (s[0]-'0') /* assume one-digit numerals */
  19. #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR))
  20. #define LUAC_FORMAT 0 /* this is the official format */
  21. /* load one chunk; from lundump.c */
  22. LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
  23. /* dump one chunk; from ldump.c */
  24. LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
  25. void* data, int strip);
  26. #endif