Debug swcsa
[SXSI/TextCollection.git] / lzindex / position.h
1
2 #ifndef POSITIONINCLUDED
3 #define POSITIONINCLUDED
4
5 //#include "lztrie.h"
6 #include "nodemap.h"
7
8
9 typedef struct tpos
10  {
11     uint *SuperBlock;  // array with starting positions of superblocks 
12     uint nSuperBlock;  // number of superblocks
13     uint nbitsSB;      // number of bits used for starting positions
14     uint SBlock_size;  // superblock size
15     uint *Offset;      // array of offsets of each phrase within each superblock
16     uint nOffset;      // size of the Offset array (number of LZ78 phrases)
17     uint nbitsOffs;    // number of bits used per offset
18     ulong Tlength;     // text length 
19  } *position;
20  
21  
22 position createPosition(void *T, uint text_length);
23
24 ulong getPosition(position P, uint id);
25
26 ulong sizeofPosition(position P);
27
28 void destroyPosition(position P);
29
30 void savePosition(FILE *f, position P);
31
32 position loadPosition(FILE *f, uint text_length);
33
34 #endif