runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

taia_pack.c (360B)


      1 /* Public domain. */
      2 
      3 #include "taia.h"
      4 
      5 void taia_pack(char *s,const struct taia *t)
      6 {
      7   unsigned long x;
      8 
      9   tai_pack(s,&t->sec);
     10   s += 8;
     11 
     12   x = t->atto;
     13   s[7] = x & 255; x >>= 8;
     14   s[6] = x & 255; x >>= 8;
     15   s[5] = x & 255; x >>= 8;
     16   s[4] = x;
     17   x = t->nano;
     18   s[3] = x & 255; x >>= 8;
     19   s[2] = x & 255; x >>= 8;
     20   s[1] = x & 255; x >>= 8;
     21   s[0] = x;
     22 }