From b4165ee0b257aaa9064c5ac82200ff2569a02955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Sun, 19 May 2019 13:52:43 +0300 Subject: Protocol: more work on protocol implementation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Additional functions implemented for protocol and basic functions to work with uuid. Source is buildable but actual build files are not edited to accomodate the changes. Signed-off-by: Ramūnas Mažeikis --- src/common/utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/common/utils.c') diff --git a/src/common/utils.c b/src/common/utils.c index 7bcf767..7e4caa5 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1,5 +1,22 @@ #include "utils.h" +int cmp_uuid(uuid_t *first, uuid_t *second) +{ + if (first->hi == second->hi) { + if (first->low == second->low) { + return 0; + } else if (first->low < second->low) { + return -1; + } else { + return 1; + } + } else if (first->hi < second->hi) { + return -1; + } else { + return 1; + } +} + fpi1_t add(fpi1_t a, fpi1_t b) { return a + b; -- cgit v1.2.3