15 }; |
14 }; |
16 |
15 |
17 /******************************************************/ |
16 /******************************************************/ |
18 /******************************************************/ |
17 /******************************************************/ |
19 /******************************************************/ |
18 /******************************************************/ |
20 |
|
21 typedef void WriterProc(uint len); |
|
22 typedef uint ReaderProc(); |
|
23 |
|
24 typedef uint ReferenceToIntProc(void *v, uint t); |
|
25 typedef void *IntToReferenceProc(uint r, uint t); |
|
26 |
|
27 typedef struct { |
|
28 bool save; |
|
29 byte need_length; |
|
30 byte block_mode; |
|
31 bool error; |
|
32 byte version; |
|
33 |
|
34 int obj_len; |
|
35 int array_index, last_array_index; |
|
36 |
|
37 uint32 offs_base; |
|
38 |
|
39 WriterProc *write_bytes; |
|
40 ReaderProc *read_bytes; |
|
41 |
|
42 ReferenceToIntProc *ref_to_int_proc; |
|
43 IntToReferenceProc *int_to_ref_proc; |
|
44 |
|
45 const ChunkHandler * const * chs; |
|
46 const byte * const *includes; |
|
47 |
|
48 byte *bufp, *bufe; |
|
49 |
|
50 int tmp; |
|
51 |
|
52 // these 3 may be used by compressor/decompressors. |
|
53 byte *buf; // pointer and size to read/write, initialized by init |
|
54 uint bufsize; |
|
55 FILE *fh; |
|
56 |
|
57 void (*excpt_uninit)(); |
|
58 const char *excpt_msg; |
|
59 jmp_buf excpt; // used to jump to "exception handler" |
|
60 } SaverLoader; |
|
61 |
19 |
62 enum NeedLengthValues { NL_NONE = 0,NL_WANTLENGTH = 1,NL_CALCLENGTH = 2}; |
20 enum NeedLengthValues { NL_NONE = 0,NL_WANTLENGTH = 1,NL_CALCLENGTH = 2}; |
63 |
21 |
64 SaverLoader _sl; |
22 SaverLoader _sl; |
65 |
23 |