diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-26 11:50:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-26 11:50:19 -0300 |
commit | 439236773b9d36208375bb8eed251bcd393f7b24 (patch) | |
tree | 6946da44c969c715c09b9d3170e99dfd898d7c54 /lundump.h | |
parent | 2a2b64d6ac2ea7839dac41cc84be1c7a5a18bee7 (diff) | |
download | lua-439236773b9d36208375bb8eed251bcd393f7b24.tar.gz lua-439236773b9d36208375bb8eed251bcd393f7b24.tar.bz2 lua-439236773b9d36208375bb8eed251bcd393f7b24.zip |
changes by lhf
Diffstat (limited to 'lundump.h')
-rw-r--r-- | lundump.h | 42 |
1 files changed, 34 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lundump.h,v 1.4 1998/01/13 20:05:24 lhf Exp $ | 2 | ** $Id: lundump.h,v 1.5 1998/02/06 20:05:39 lhf Exp lhf $ |
3 | ** load pre-compiled Lua chunks | 3 | ** load pre-compiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -10,18 +10,44 @@ | |||
10 | #include "lobject.h" | 10 | #include "lobject.h" |
11 | #include "lzio.h" | 11 | #include "lzio.h" |
12 | 12 | ||
13 | TProtoFunc* luaU_undump1(ZIO* Z); /* load one chunk */ | ||
14 | |||
15 | #define SIGNATURE "Lua" | ||
16 | #define VERSION 0x31 /* last format change was in 3.1 */ | ||
17 | |||
18 | #define IsMain(f) (f->lineDefined==0) | ||
19 | |||
13 | #define ID_CHUNK 27 /* ESC */ | 20 | #define ID_CHUNK 27 /* ESC */ |
14 | #define ID_FUNCTION '#' | ||
15 | #define ID_END '$' | ||
16 | #define ID_NUM 'N' | 21 | #define ID_NUM 'N' |
17 | #define ID_STR 'S' | 22 | #define ID_STR 'S' |
18 | #define ID_FUN 'F' | 23 | #define ID_FUN 'F' |
19 | #define SIGNATURE "Lua" | ||
20 | #define VERSION 0x31 /* last format change was in 3.1 */ | ||
21 | #define TEST_FLOAT 0.123456789e-23 /* a float for testing representation */ | ||
22 | 24 | ||
23 | #define IsMain(f) (f->lineDefined==0) | 25 | #define ID_INT4 'l' |
26 | #define ID_REAL4 'f' | ||
27 | #define ID_REAL8 'd' | ||
28 | #define ID_NATIVE '?' | ||
24 | 29 | ||
25 | TProtoFunc* luaU_undump1(ZIO* Z); /* load one chunk */ | 30 | /* |
31 | * use a multiple of PI for testing number representation. | ||
32 | * multiplying by 10E8 gives notrivial integer values. | ||
33 | */ | ||
34 | #define TEST_NUMBER 3.14159265358979323846E8 | ||
35 | |||
36 | /* LUA_NUMBER */ | ||
37 | /* if you change the definition of real, make sure you set ID_NUMBER | ||
38 | * accordingly, specially if sizeof(long)!=4. | ||
39 | * for types other than the ones listed below, you'll have to write your own | ||
40 | * dump and undump routines. | ||
41 | */ | ||
42 | |||
43 | #if real==float | ||
44 | #define ID_NUMBER ID_REAL4 | ||
45 | #elif real==double | ||
46 | #define ID_NUMBER ID_REAL8 | ||
47 | #elif real==long | ||
48 | #define ID_NUMBER ID_INT4 | ||
49 | #else | ||
50 | #define ID_NUMBER ID_NATIVE | ||
51 | #endif | ||
26 | 52 | ||
27 | #endif | 53 | #endif |