1997-04-29 18:53:37 +04:00
|
|
|
/*
|
1997-04-29 20:17:09 +04:00
|
|
|
* unparse.c -- convert a UUID to string
|
|
|
|
*
|
|
|
|
* Copyright (C) 1996, 1997 Theodore Ts'o.
|
|
|
|
*
|
|
|
|
* %Begin-Header%
|
2001-06-01 19:03:25 +04:00
|
|
|
* This file may be redistributed under the terms of the GNU
|
|
|
|
* Library General Public License.
|
1997-04-29 20:17:09 +04:00
|
|
|
* %End-Header%
|
1997-04-29 18:53:37 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "uuidP.h"
|
|
|
|
|
compare.c (uuid_compare), copy.c (uuid_copy),
isnull.c (uuid_is_null), pack.c (uuid_pack),
parse.c (uuid_parse), unpack.c (uuid_unpack),
unparse.c (uuid_unparse), uuid.h, uuidP.h,
uuid_time.c (uuid_time, uuid_type, uuid_variant):
Use const for pointer variables that we don't modify. Add
the appropriate ifdef's in uuid.h to make it be C++ friendly.
2001-09-11 04:30:09 +04:00
|
|
|
void uuid_unparse(const uuid_t uu, char *out)
|
1997-04-29 18:53:37 +04:00
|
|
|
{
|
|
|
|
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]);
|
|
|
|
}
|
|
|
|
|