diff options
author | 2019-05-19 13:52:43 +0300 | |
---|---|---|
committer | 2019-05-19 13:52:43 +0300 | |
commit | b4165ee0b257aaa9064c5ac82200ff2569a02955 (patch) | |
tree | 5f56cb813bace9b885c0528b7b23342d4e625f6c /src/common/utils.c | |
parent | 9c8ece1538d31dba9a416c9f29f88e18510f4c75 (diff) | |
download | usurpation-b4165ee0b257aaa9064c5ac82200ff2569a02955.tar.gz usurpation-b4165ee0b257aaa9064c5ac82200ff2569a02955.tar.bz2 usurpation-b4165ee0b257aaa9064c5ac82200ff2569a02955.zip |
Protocol: more work on protocol implementation.
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 <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/common/utils.c')
-rw-r--r-- | src/common/utils.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; |