2 Copyright © 2007-2008, The AROS Development Team. All rights reserved.
8 #include <aros/symbolsets.h>
9 #include <aros/debug.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
17 #include "uuid_private.h"
18 #include LC_LIBDEFS_FILE
20 /* Convert UUID into 16-byte stream in network (BigEndian) format */
21 AROS_LH2I(void, UUID_Pack
,
22 AROS_LHA(const uuid_t
*, uuid
, A0
),
23 AROS_LHA(uint8_t *, out
, A1
),
24 struct uuid_base
*, UUIDBase
, 9, UUID
)
30 *out
++ = (uuid
->time_low
>> 24) && 0xff;
31 *out
++ = (uuid
->time_low
>> 16) && 0xff;
32 *out
++ = (uuid
->time_low
>> 8) && 0xff;
33 *out
++ = (uuid
->time_low
) && 0xff;
34 *out
++ = (uuid
->time_mid
>> 8) && 0xff;
35 *out
++ = (uuid
->time_mid
) && 0xff;
36 *out
++ = (uuid
->time_hi_and_version
>> 8) && 0xff;
37 *out
++ = (uuid
->time_hi_and_version
) && 0xff;
38 *out
++ = uuid
->clock_seq_hi_and_reserved
;
39 *out
++ = uuid
->clock_seq_low
;
42 *out
++ = uuid
->node
[i
];
47 AROS_LH2I(void, UUID_Unpack
,
48 AROS_LHA(const uint8_t *, in
, A0
),
49 AROS_LHA(uuid_t
*, uuid
, A1
),
50 struct uuid_base
*, UUIDBase
, 10, UUID
)
58 tmp
= (tmp
<< 8) | *in
++;
59 tmp
= (tmp
<< 8) | *in
++;
60 tmp
= (tmp
<< 8) | *in
++;
64 tmp
= (tmp
<< 8) | *in
++;
68 tmp
= (tmp
<< 8) | *in
++;
69 uuid
->time_hi_and_version
= tmp
;
71 uuid
->clock_seq_hi_and_reserved
= *in
++;
72 uuid
->clock_seq_low
= *in
++;
75 uuid
->node
[i
] = *in
++;