summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2005-02-17 13:35:15 +0000
committerFrederic Peters <fpeters@entrouvert.com>2005-02-17 13:35:15 +0000
commit9ea6f71fbef6b0a6ac9444d9d472e74f0dff52dc (patch)
treea05c468e4b9966808b9f38b90c53524a1f586896
parent38d7258b4fe3cbde01d00de68d08586e6a9b997a (diff)
added dumb numerical mode to checkVersion; added swig binding for this
function; generating Lasso.i considered bad idea, cleaned and removed.
-rw-r--r--configure.ac1
-rw-r--r--lasso/lasso.c10
-rw-r--r--swig/Lasso.i (renamed from swig/Lasso.i.in)17
-rw-r--r--swig/Makefile.am2
4 files changed, 17 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 04818f3f..c4958606 100644
--- a/configure.ac
+++ b/configure.ac
@@ -765,7 +765,6 @@ perl/Makefile
php/Makefile
python/Makefile
swig/Makefile
-swig/Lasso.i
tests/Makefile
tests/data/Makefile
tests/data/ca1-la/Makefile
diff --git a/lasso/lasso.c b/lasso/lasso.c
index 8c45f850..d50a30c2 100644
--- a/lasso/lasso.c
+++ b/lasso/lasso.c
@@ -160,6 +160,12 @@ int lasso_shutdown()
int
lasso_check_version(int major, int minor, int subminor, LassoCheckVersionMode mode)
{
+ if (mode == LASSO_CHECK_VERSION_NUMERIC) {
+ if (LASSO_VERSION_MAJOR*10000 + LASSO_VERSION_MINOR*100 + LASSO_VERSION_SUBMINOR <
+ major*10000 + minor*100 + subminor)
+ return 0;
+ return 1;
+ }
/* we always want to have a match for major version number */
if (major != LASSO_VERSION_MAJOR) {
g_message("expected major version=%d;real major version=%d",
@@ -177,6 +183,7 @@ lasso_check_version(int major, int minor, int subminor, LassoCheckVersionMode mo
return 0;
}
}
+
if (mode == LASSO_CHECK_VERSIONABI_COMPATIBLE) {
if (minor < LASSO_VERSION_MINOR || (minor == LASSO_VERSION_MINOR &&
subminor < LASSO_VERSION_SUBMINOR)) {
@@ -189,5 +196,8 @@ lasso_check_version(int major, int minor, int subminor, LassoCheckVersionMode mo
}
}
+ if (mode > LASSO_CHECK_VERSION_NUMERIC)
+ return -1;
+
return 1;
}
diff --git a/swig/Lasso.i.in b/swig/Lasso.i
index 0bc8a2ec..ec478312 100644
--- a/swig/Lasso.i.in
+++ b/swig/Lasso.i
@@ -687,17 +687,7 @@ SET_NODE_INFO(Node, DowncastableNode)
/* Configuration Constants */
-#ifndef SWIGPHP4
-%rename(VERSION_DECIMAL) LASSO_VERSION_DECIMAL;
-%rename(VERSION_MAJOR) LASSO_VERSION_MAJOR;
-%rename(VERSION_MINOR) LASSO_VERSION_MINOR;
-%rename(VERSION_SUBMINOR) LASSO_VERSION_SUBMINOR;
-%rename(WSF_SUPPORT) LASSO_WSF_SUPPORT;
-#endif
-#define LASSO_VERSION_MAJOR @VERSION_MAJOR@
-#define LASSO_VERSION_MINOR @VERSION_MINOR@
-#define LASSO_VERSION_SUBMINOR @VERSION_RELEASE@
-#@LASSO_WSF_ENABLE@
+#undef LASSO_WSF_ENABLE
#ifdef LASSO_WSF_ENABLED
%{
@@ -1099,6 +1089,11 @@ int lasso_init(void);
#endif
int lasso_shutdown(void);
+#ifndef SWIGPHP4
+%rename(checkVersion) lasso_check_version;
+#endif
+int lasso_check_version(int major, int minor, int subminor, LassoCheckVersionMode mode = 2);
+
/***********************************************************************
* Utility functions to handle nodes, strings, lists...
diff --git a/swig/Makefile.am b/swig/Makefile.am
index d247ee69..67ecc6d0 100644
--- a/swig/Makefile.am
+++ b/swig/Makefile.am
@@ -1,3 +1,3 @@
-EXTRA_DIST = Lasso.i.in Lasso-wsf.i inheritance.h
+EXTRA_DIST = Lasso.i Lasso-wsf.i inheritance.h