dovecot-2.2: Added guid_128_equals() helper function.

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 19 13:18:49 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/19e24db0bbd4
changeset: 15847:19e24db0bbd4
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Feb 19 13:17:05 2013 +0200
description:
Added guid_128_equals() helper function.

diffstat:

 src/lib/guid.c |  5 +++++
 src/lib/guid.h |  2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r 670e8d50ce73 -r 19e24db0bbd4 src/lib/guid.c
--- a/src/lib/guid.c	Tue Feb 19 11:25:21 2013 +0200
+++ b/src/lib/guid.c	Tue Feb 19 13:17:05 2013 +0200
@@ -94,6 +94,11 @@
 	return TRUE;
 }
 
+bool guid_128_equals(const guid_128_t guid1, const guid_128_t guid2)
+{
+	return memcmp(guid1, guid2, GUID_128_SIZE) == 0;
+}
+
 int guid_128_from_string(const char *str, guid_128_t guid_r)
 {
 	buffer_t buf;
diff -r 670e8d50ce73 -r 19e24db0bbd4 src/lib/guid.h
--- a/src/lib/guid.h	Tue Feb 19 11:25:21 2013 +0200
+++ b/src/lib/guid.h	Tue Feb 19 13:17:05 2013 +0200
@@ -12,6 +12,8 @@
 void guid_128_generate(guid_128_t guid_r);
 /* Returns TRUE if GUID is empty (not set / unknown). */
 bool guid_128_is_empty(const guid_128_t guid);
+/* Returns TRUE if two GUIDs are equal. */
+bool guid_128_equals(const guid_128_t guid1, const guid_128_t guid2);
 
 /* Returns GUID as a hex string. */
 const char *guid_128_to_string(const guid_128_t guid);


More information about the dovecot-cvs mailing list