typedef struct Chain Chain; extern uchar rtab[]; /* generated by genrtab.c */ #define MSK(nbits) ((1UL<<(nbits))-1) enum{ MaxChLen = 128, /* bytes */ }; /* bit chain, can put at the beginning, get at the end */ struct Chain { int b; /* offset start in bits, (first full) */ int e; /* offset end in bits (first empty) */ uchar buf[MaxChLen]; }; extern void getbits(void *p, Chain *ch, int nbits); extern u32int hmsbputl(u32int *v); extern u32int msbhgetl(u32int *v); extern void printchain(Chain *ch); extern void putbits(Chain *ch, void *p, int nbits);