lundump.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. ** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
  3. ** load precompiled Lua chunks
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lundump_h
  7. #define lundump_h
  8. #include <stdint.h>
  9. #include "lobject.h"
  10. #include "lzio.h"
  11. typedef uint32_t strsize_t;
  12. /* info about target machine for cross-compilation */
  13. typedef struct {
  14. int little_endian;
  15. int sizeof_int;
  16. int sizeof_strsize_t;
  17. int sizeof_lua_Number;
  18. int lua_Number_integral;
  19. int is_arm_fpa;
  20. } DumpTargetInfo;
  21. /* load one chunk; from lundump.c */
  22. LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
  23. /* make header; from lundump.c */
  24. LUAI_FUNC void luaU_header (char* h);
  25. /* dump one chunk to a different target; from ldump.c */
  26. int luaU_dump_crosscompile (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip, DumpTargetInfo target);
  27. /* dump one chunk; from ldump.c */
  28. LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
  29. #ifdef luac_c
  30. /* print one chunk; from print.c */
  31. LUAI_FUNC void luaU_print (const Proto* f, int full);
  32. #endif
  33. /* for header of binary files -- this is Lua 5.1 */
  34. #define LUAC_VERSION 0x51
  35. /* for header of binary files -- this is the official format */
  36. #define LUAC_FORMAT 0
  37. /* size of header of binary files */
  38. #define LUAC_HEADERSIZE 12
  39. #endif