-static unsigned long get_hdr_size(const unsigned char **datap)
-{
- const unsigned char *data = *datap;
- unsigned char cmd = *data++;
- unsigned long size = cmd & ~0x80;
- int i = 7;
- while (cmd & 0x80) {
- cmd = *data++;
- size |= (cmd & ~0x80) << i;
- i += 7;
- }
- *datap = data;
- return size;
-}
-