lundump.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. ** $Id: lundump.h,v 1.13 1999/03/29 16:16:18 lhf Exp lhf $
  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. TProtoFunc* luaU_undump1 (ZIO* Z); /* load one chunk */
  11. void luaU_badconstant (char* s, int i, TObject* o, TProtoFunc* tf);
  12. /* handle cases that cannot happen */
  13. /* definitions for headers of binary files */
  14. #define VERSION 0x32 /* last format change was in 3.2 */
  15. #define VERSION0 0x32 /* last major change was in 3.2 */
  16. #define ID_CHUNK 27 /* binary files start with ESC... */
  17. #define SIGNATURE "Lua" /* ...followed by this signature */
  18. /* formats for error messages */
  19. #define SOURCE "<%s:%d>"
  20. #define IN " in %p " SOURCE
  21. #define INLOC tf,tf->source->str,tf->lineDefined
  22. /* format for numbers in listings and error messages */
  23. #ifndef NUMBER_FMT
  24. #define NUMBER_FMT "%.16g" /* LUA_NUMBER */
  25. #endif
  26. /* LUA_NUMBER
  27. * by default, numbers are stored in precompiled chunks as decimal strings.
  28. * this is completely portable and fast enough for most applications.
  29. * if you want to use this default, do nothing.
  30. * if you want additional speed at the expense of portability, move the line
  31. * below out of this comment.
  32. #define LUAC_NATIVE
  33. */
  34. #ifdef LUAC_NATIVE
  35. /* a multiple of PI for testing number representation */
  36. /* multiplying by 1E8 gives non-trivial integer values */
  37. #define TEST_NUMBER 3.14159265358979323846E8
  38. #endif
  39. #endif