diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/dk4ufic.ctr |
Initial commit
Diffstat (limited to 'support/dktools/dk4ufic.ctr')
-rw-r--r-- | support/dktools/dk4ufic.ctr | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/support/dktools/dk4ufic.ctr b/support/dktools/dk4ufic.ctr new file mode 100644 index 0000000000..e32216d0a9 --- /dev/null +++ b/support/dktools/dk4ufic.ctr @@ -0,0 +1,97 @@ +%% options + +copyright owner = Dirk Krause +copyright year = 2015-xxxx +license = bsd + + +%% header + +/** @file + Compare unique file identifiers. +*/ + +#ifndef DK4UFIT_H_INCLUDED +#include "dk4ufit.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** Compare two unique file identifiers. + @param l Left identifier. + @param r Right identifier. + @return 1 if l>r, 0 if l=r, -1 if l<r. +*/ +int +dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r); + +#ifdef __cplusplus +} +#endif + + +%% module + +#include "dk4ufic.h" + +int +dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r) +{ + if (NULL != l) { + if (NULL != r) { +#if DK4_ON_WINDOWS + if (l->ser > r->ser) { + back = 1; + } else { + if (l->ser < r->ser) { + back = -1; + } + } + if (0 == back) { + if (l->inh > r->inh) { + back = 1; + } else { + if (l->inh < r->inh) { + back = -1; + } + } + } + if (0 == back) { + if (l->inl > r->inl) { + back = 1; + } else { + if (l->inl < r->inl) { + back = -1; + } + } + } +#else + if (l->dev > r->dev) { + back = 1; + } else { + if (l->dev < r->dev) { + back = -1; + } + } + if (0 == back) { + if (l->ino > r->ino) { + back = 1; + } else { + if (l->ino < r->ino) { + back = -1; + } + } + } +#endif + } else { + back = 1; + } + } else { + if (NULL != r) { + back = -1; + } + } +} + |