3 // Implements the Node and RNode data structures,
4 // which map block ids to LZTrie nodes and
5 // block ids to RevTrie nodes, respectively
7 #ifndef NODEMAPINCLUDED
8 #define NODEMAPINCLUDED
13 typedef struct snodemap
15 uint nbits; // bits per cell
17 uint n; // number of elements in the mapping
21 // creates a nodemap structure from a mapping array, not owning it
22 // n is number of blocks
23 // max is the number of trie nodes
24 nodemap createNodemap(uint *map, uint n, uint max);
25 // frees revtrie structure, including the owned data
26 void destroyNodemap(nodemap M);
28 trieNode mapto(nodemap M, uint id);
30 void saveNodemap(FILE *f, nodemap M);
32 nodemap loadNodemap(FILE *f);
34 uint sizeofNodemap(nodemap M);