void uuid_pack(const struct uuid *uu, uuid_t ptr)
{
- uint32_t tmp;
- unsigned char *out = ptr;
+ uint32_t tmp;
+ unsigned char *out = ptr;
tmp = uu->time_low;
out[3] = (unsigned char) tmp;
out[1] = (unsigned char) tmp;
tmp >>= 8;
out[0] = (unsigned char) tmp;
-
+
tmp = uu->time_mid;
out[5] = (unsigned char) tmp;
tmp >>= 8;
memcpy(out+10, uu->node, 6);
}
-
void uuid_unpack(const uuid_t in, struct uuid *uu)
{
- const uint8_t *ptr = in;
- uint32_t tmp;
+ const uint8_t *ptr = in;
+ uint32_t tmp;
tmp = *ptr++;
tmp = (tmp << 8) | *ptr++;
tmp = *ptr++;
tmp = (tmp << 8) | *ptr++;
uu->time_mid = tmp;
-
+
tmp = *ptr++;
tmp = (tmp << 8) | *ptr++;
uu->time_hi_and_version = tmp;
memcpy(uu->node, ptr, 6);
}
-