format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID */
| 221 | |
| 222 | /* format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID */ |
| 223 | static void format_uuid_v1(xuuid_t * uuid, unsigned16 clock_seq, |
| 224 | uuid_time_t timestamp, uuid_node_t node) |
| 225 | { |
| 226 | /* Construct a version 1 uuid with the information we've gathered |
| 227 | * plus a few constants. */ |
| 228 | uuid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF); |
| 229 | uuid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF); |
| 230 | uuid->time_hi_and_version = (unsigned short)((timestamp >> 48) & 0x0FFF); |
| 231 | uuid->time_hi_and_version |= (1 << 12); |
| 232 | uuid->clock_seq_low = clock_seq & 0xFF; |
| 233 | uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8; |
| 234 | uuid->clock_seq_hi_and_reserved |= 0x80; |
| 235 | memcpy(&uuid->node, &node, sizeof uuid->node); |
| 236 | } |
| 237 | |
| 238 | /* get-current_time -- get time as 60 bit 100ns ticks since whenever. |
| 239 | Compensate for the fact that real clock resolution is less than 100ns. */ |
no test coverage detected