lundump.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. ** $Id: lundump.h,v 1.19 2000/04/24 17:32:29 lhf Exp $
  3. ** load pre-compiled Lua chunks
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lundump_h
  7. #define lundump_h
  8. #include "lobject.h"
  9. #include "lzio.h"
  10. /* load one chunk */
  11. Proto* luaU_undump1 (lua_State* L, ZIO* Z);
  12. /* convert number from text */
  13. double luaU_str2d (lua_State* L, const char* b, const char* where);
  14. /* definitions for headers of binary files */
  15. #define VERSION 0x40 /* last format change was in 4.0 */
  16. #define VERSION0 0x40 /* last major change was in 4.0 */
  17. #define ID_CHUNK 27 /* binary files start with ESC... */
  18. #define SIGNATURE "Lua" /* ...followed by this signature */
  19. /* formats for error messages */
  20. #define xSOURCE "<%d:%.255s>"
  21. #define SOURCE "<%.255s:%d>"
  22. #define IN " in %p " SOURCE
  23. #define INLOC tf,tf->source->str,tf->lineDefined
  24. /* format for numbers in listings and error messages */
  25. #ifndef NUMBER_FMT
  26. #define NUMBER_FMT "%.16g" /* LUA_NUMBER */
  27. #endif
  28. /* a multiple of PI for testing native format */
  29. /* multiplying by 1E8 gives non-trivial integer values */
  30. #define TEST_NUMBER 3.14159265358979323846E8
  31. /* something for testing byte order in instructions */
  32. #define TEST_CODE 0x01020304
  33. #endif