lundump.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. {
  15. int little_endian;
  16. int sizeof_int;
  17. int sizeof_strsize_t;
  18. int sizeof_lua_Number;
  19. int lua_Number_integral;
  20. int is_arm_fpa;
  21. } DumpTargetInfo;
  22. /* load one chunk; from lundump.c */
  23. LUAI_FUNC Proto *luaU_undump(lua_State *L, ZIO *Z, Mbuffer *buff, const char *name);
  24. /* make header; from lundump.c */
  25. LUAI_FUNC void luaU_header(char *h);
  26. /* dump one chunk to a different target; from ldump.c */
  27. int luaU_dump_crosscompile(lua_State *L, const Proto *f, lua_Writer w, void *data, int strip, DumpTargetInfo target);
  28. /* dump one chunk; from ldump.c */
  29. LUAI_FUNC int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data, int strip);
  30. #ifdef luac_c
  31. /* print one chunk; from print.c */
  32. LUAI_FUNC void luaU_print(const Proto *f, int full);
  33. #endif
  34. /* for header of binary files -- this is Lua 5.1 */
  35. #define LUAC_VERSION 0x51
  36. /* for header of binary files -- this is the official format */
  37. #define LUAC_FORMAT 0
  38. /* size of header of binary files */
  39. #define LUAC_HEADERSIZE 12
  40. /* error codes from cross-compiler */
  41. /* target integer is too small to hold a value */
  42. #define LUA_ERR_CC_INTOVERFLOW 101
  43. /* target lua_Number is integral but a constant is non-integer */
  44. #define LUA_ERR_CC_NOTINTEGER 102
  45. #endif