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>
15 #include "uuid_private.h"
16 #include LC_LIBDEFS_FILE
18 #define CHECK(f1, f2) if (f1 != f2) return f1 < f2 ? -1 : 1;
20 /*****************************************************************************
23 AROS_LH2(int, UUID_Compare
,
26 AROS_LHA(const uuid_t
*, u1
, A0
),
27 AROS_LHA(const uuid_t
*, u2
, A1
),
30 struct uuid_base
*, UUIDBase
, 5, UUID
)
33 Compares between two UUIDs.
36 u1, u2 - UUIDs to be compared.
39 <0 - if the u1 is lexically BEFORE u2
41 >0 - if the u1 is lexically AFTER u2
53 *****************************************************************************/
62 CHECK(u1
->time_low
, u2
->time_low
);
63 CHECK(u1
->time_mid
, u2
->time_mid
);
65 CHECK(u1
->time_hi_and_version
, u2
->time_hi_and_version
); CHECK(u1
->clock_seq_hi_and_reserved
, u2
->clock_seq_hi_and_reserved
);
66 CHECK(u1
->clock_seq_low
, u2
->clock_seq_low
);
68 for (i
= 0; i
< 6; i
++)
70 if (u1
->node
[i
] < u2
->node
[i
])
72 if (u1
->node
[i
] > u2
->node
[i
])