aboutsummaryrefslogtreecommitdiff
path: root/taia_pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'taia_pack.c')
-rw-r--r--taia_pack.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/taia_pack.c b/taia_pack.c
new file mode 100644
index 0000000..89e2c16
--- /dev/null
+++ b/taia_pack.c
@@ -0,0 +1,20 @@
+#include "taia.h"
+
+void taia_pack(char *s,const struct taia *t)
+{
+ unsigned long x;
+
+ tai_pack(s,&t->sec);
+ s += 8;
+
+ x = t->atto;
+ s[7] = x & 255; x >>= 8;
+ s[6] = x & 255; x >>= 8;
+ s[5] = x & 255; x >>= 8;
+ s[4] = x;
+ x = t->nano;
+ s[3] = x & 255; x >>= 8;
+ s[2] = x & 255; x >>= 8;
+ s[1] = x & 255; x >>= 8;
+ s[0] = x;
+}