1 2 struct BLOCK_HEAD { 3 int N; 4 int extend_link; 5 }; 6 // nodes 7 8 typedef struct { 9 int link; // node/extent/text/trash link 10 int key; // only support 32-bit key 11 char flag; 12 } GNODE; 13 14 enum { 15 GNODE_FLAG_CHILD=1, // link point to children 16 GNODE_FLAG_TEXT=2, 17 GNODE_FLAG_TRASH=4, // key = 0 18 }; 19 20 struct Stext { 21 int time; 22 int usecount; // 23 int link; 24 char len; // byte len 25 // text follows 26 }; 27 28 union DBHEAD { 29 struct { 30 int flags; 31 int trash_link; 32 int trash_text_link; 33 GNODE top; 34 int text_link; // use this to seq search 35 } h; 36 char dummy[128]; 37 }; 38