1997-04-29 18:53:37 +04:00
|
|
|
/*
|
|
|
|
* Internal routine for unpacking UUID
|
1997-04-29 20:17:09 +04:00
|
|
|
*
|
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
#include <string.h>
|
1997-04-29 18:53:37 +04:00
|
|
|
#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_unpack(const uuid_t in, struct uuid *uu)
|
1997-04-29 18:53:37 +04:00
|
|
|
{
|
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
|
|
|
const __u8 *ptr = in;
|
|
|
|
__u32 tmp;
|
1997-04-29 18:53:37 +04:00
|
|
|
|
|
|
|
tmp = *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
uu->time_low = tmp;
|
|
|
|
|
|
|
|
tmp = *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
uu->time_mid = tmp;
|
|
|
|
|
|
|
|
tmp = *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
uu->time_hi_and_version = tmp;
|
|
|
|
|
|
|
|
tmp = *ptr++;
|
|
|
|
tmp = (tmp << 8) | *ptr++;
|
|
|
|
uu->clock_seq = tmp;
|
|
|
|
|
|
|
|
memcpy(uu->node, ptr, 6);
|
|
|
|
}
|
|
|
|
|