You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
627 B
29 lines
627 B
15 years ago
|
/*
|
||
|
* unparse.c -- convert a UUID to string
|
||
|
*
|
||
|
* Copyright (C) 1996, 1997 Theodore Ts'o.
|
||
|
*
|
||
|
* %Begin-Header%
|
||
|
* This file may be redistributed under the terms of the GNU
|
||
|
* Library General Public License.
|
||
|
* %End-Header%
|
||
|
*/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#include "uuidP.h"
|
||
|
|
||
|
void uuid_unparse(const uuid_t uu, char *out)
|
||
|
{
|
||
|
struct uuid uuid;
|
||
|
|
||
|
uuid_unpack(uu, &uuid);
|
||
|
sprintf(out,
|
||
|
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||
|
uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
|
||
|
uuid.clock_seq >> 8, uuid.clock_seq & 0xFF,
|
||
|
uuid.node[0], uuid.node[1], uuid.node[2],
|
||
|
uuid.node[3], uuid.node[4], uuid.node[5]);
|
||
|
}
|
||
|
|