aboutsummaryrefslogtreecommitdiff
path: root/src/version.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-08-06 09:24:18 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-08-06 09:24:18 +0000
commitb2873d52168f6a56350ce03536457a367c942343 (patch)
tree061acc452d50c57ed9d7cfc97b88900e59d0a808 /src/version.c
parentde03844917b6785e1b005a547c0b61e26817c93e (diff)
downloadgdbm-b2873d52168f6a56350ce03536457a367c942343.tar.gz
gdbm-b2873d52168f6a56350ce03536457a367c942343.tar.bz2
(gdbm_version_cmp): New function.
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/version.c b/src/version.c
index 6f8bc50..b4b213c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -34,3 +34,24 @@ int const gdbm_version_number[3] = {
GDBM_VERSION_MINOR,
GDBM_VERSION_PATCH
};
+
+int
+gdbm_version_cmp (int const a[], int const b[])
+{
+ if (a[0] > b[0])
+ return 1;
+ else if (a[0] < b[0])
+ return -1;
+
+ if (a[1] > b[1])
+ return 1;
+ else if (a[1] < b[1])
+ return -1;
+
+ if (a[2] > b[2])
+ return 1;
+ else if (a[2] < b[2])
+ return -1;
+
+ return 0;
+}

Return to:

Send suggestions and report system problems to the System administrator.