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>
13 #include "uuid_private.h"
14 #include LC_LIBDEFS_FILE
16 #define CHECK(f1, f2) if (f1 != f2) return f1 < f2 ? -1 : 1;
18 /*****************************************************************************
21 AROS_LH2(int, UUID_Compare
,
24 AROS_LHA(const uuid_t
*, u1
, A0
),
25 AROS_LHA(const uuid_t
*, u2
, A1
),
28 struct uuid_base
*, UUIDBase
, 5, UUID
)
31 Compares between two UUIDs.
34 u1, u2 - UUIDs to be compared.
37 <0 - if the u1 is lexically BEFORE u2
39 >0 - if the u1 is lexically AFTER u2
51 *****************************************************************************/
60 CHECK(u1
->time_low
, u2
->time_low
);
61 CHECK(u1
->time_mid
, u2
->time_mid
);
63 CHECK(u1
->time_hi_and_version
, u2
->time_hi_and_version
); CHECK(u1
->clock_seq_hi_and_reserved
, u2
->clock_seq_hi_and_reserved
);
64 CHECK(u1
->clock_seq_low
, u2
->clock_seq_low
);
66 for (i
= 0; i
< 6; i
++)
68 if (u1
->node
[i
] < u2
->node
[i
])
70 if (u1
->node
[i
] > u2
->node
[i
])