lundump.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <limits.h>
  9. #include "llimits.h"
  10. #include "lobject.h"
  11. #include "lzio.h"
  12. /* data to catch conversion errors */
  13. #define LUAC_DATA "\x19\x93\r\n\x1a\n"
  14. #define LUAC_INT 0x5678
  15. #define LUAC_NUM cast_num(370.5)
  16. /*
  17. ** Encode major-minor version in one byte, one nibble for each
  18. */
  19. #define LUAC_VERSION (LUA_VERSION_MAJOR_N*16+LUA_VERSION_MINOR_N)
  20. #define LUAC_FORMAT 0 /* this is the official format */
  21. /*
  22. ** Type to handle MSB Varint encoding: Try to get the largest unsigned
  23. ** integer available. (It was enough to be the largest between size_t and
  24. ** lua_Integer, but the C89 preprocessor knows nothing about size_t.)
  25. */
  26. #if !defined(LUA_USE_C89) && defined(LLONG_MAX)
  27. typedef unsigned long long varint_t;
  28. #else
  29. typedef unsigned long varint_t;
  30. #endif
  31. /* load one chunk; from lundump.c */
  32. LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name,
  33. int fixed);
  34. /* dump one chunk; from ldump.c */
  35. LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
  36. void* data, int strip);
  37. #endif