summaryrefslogtreecommitdiff
path: root/lib/uuid/compare.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uuid/compare.c')
-rw-r--r--lib/uuid/compare.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/uuid/compare.c b/lib/uuid/compare.c
new file mode 100644
index 00000000..44052c3e
--- /dev/null
+++ b/lib/uuid/compare.c
@@ -0,0 +1,19 @@
+/*
+ * compare.c --- compare whether or not two UUID's are the same
+ *
+ * Returns 0 if the two UUID's are different, and 1 if they are the same.
+ */
+
+#include "uuidP.h"
+
+int uuid_compare(uuid_t uu1, uuid_t uu2)
+{
+ unsigned char *cp1, *cp2;
+ int i;
+
+ for (i=0, cp1 = uu1, cp2 = uu2; i < 16; i++)
+ if (*cp1++ != *cp2++)
+ return 0;
+ return 1;
+}
+