lundump.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. ** $Id: lundump.h,v 1.6 1998/06/13 16:54:15 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. TProtoFunc* luaU_undump1(ZIO* Z); /* load one chunk */
  11. #define SIGNATURE "Lua"
  12. #define VERSION 0x31 /* last format change was in 3.1 */
  13. #define IsMain(f) (f->lineDefined==0)
  14. #define ID_CHUNK 27 /* ESC */
  15. #define ID_NUM 'N'
  16. #define ID_STR 'S'
  17. #define ID_FUN 'F'
  18. /* number representation */
  19. #define ID_INT4 'l' /* 4-byte integers */
  20. #define ID_REAL4 'f' /* 4-byte reals */
  21. #define ID_REAL8 'd' /* 8-byte reals */
  22. #define ID_NATIVE '?' /* whatever your machine uses */
  23. /*
  24. * use a multiple of PI for testing number representation.
  25. * multiplying by 1E8 gives notrivial integer values.
  26. */
  27. #define TEST_NUMBER 3.14159265358979323846E8
  28. /* LUA_NUMBER
  29. * choose one below for the number representation in precompiled chunks.
  30. * the default is ID_REAL8 because the default for LUA_NUM_TYPE is double.
  31. * if your machine does not use IEEE 754, use ID_NATIVE.
  32. * the next version will support conversion to/from IEEE 754.
  33. *
  34. * if you change LUA_NUM_TYPE, make sure you set ID_NUMBER accordingly,
  35. * specially if sizeof(long)!=4.
  36. * for types other than the ones listed below, you'll have to write your own
  37. * dump and undump routines.
  38. */
  39. #define ID_NUMBER ID_REAL8
  40. #if 0
  41. #define ID_NUMBER ID_REAL4
  42. #define ID_NUMBER ID_INT4
  43. #define ID_NUMBER ID_NATIVE
  44. #endif
  45. #endif