taia_unpack.c (439B)
1 #include <tai/taia.h> 2 3 void taia_unpack(char *s, struct taia *t) 4 { 5 unsigned long x; 6 7 tai_unpack(s,&t->sec); 8 s += 8; 9 10 x = (unsigned char) s[4]; 11 x <<= 8; x += (unsigned char) s[5]; 12 x <<= 8; x += (unsigned char) s[6]; 13 x <<= 8; x += (unsigned char) s[7]; 14 t->atto = x; 15 x = (unsigned char) s[0]; 16 x <<= 8; x += (unsigned char) s[1]; 17 x <<= 8; x += (unsigned char) s[2]; 18 x <<= 8; x += (unsigned char) s[3]; 19 t->nano = x; 20 }