summaryrefslogtreecommitdiffstats
path: root/database/eurephiadb.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-11-28 11:47:38 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-11-28 11:47:38 +0100
commit622fb9169d5c554d5f5c8ca42e978f133be5bb45 (patch)
treee717468543fd8dedede65b81e5fd719f956277ae /database/eurephiadb.c
parent8b9e8f47e62d3e097287236a3cf3849215ad7f9d (diff)
downloadeurephia-622fb9169d5c554d5f5c8ca42e978f133be5bb45.tar.gz
eurephia-622fb9169d5c554d5f5c8ca42e978f133be5bb45.tar.xz
eurephia-622fb9169d5c554d5f5c8ca42e978f133be5bb45.zip
Added minimum API version check when loading database driver.
Diffstat (limited to 'database/eurephiadb.c')
-rw-r--r--database/eurephiadb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/database/eurephiadb.c b/database/eurephiadb.c
index 9a6ecbd..bbc655f 100644
--- a/database/eurephiadb.c
+++ b/database/eurephiadb.c
@@ -49,7 +49,7 @@ int eDBlink_close(eurephiaCTX *ctx)
}
-int eDBlink_init(eurephiaCTX *ctx, const char *dbl)
+int eDBlink_init(eurephiaCTX *ctx, const char *dbl, const int minver)
{
#ifdef MEMWATCH
mwStatistics(3);
@@ -76,6 +76,15 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl)
eurephia_log(ctx, LOG_INFO, 1, "Driver loaded: %s (API version %i)",
eDB_DriverVersion(), eDB_DriverAPIVersion());
+ // Check that we are using at least a new enough driver
+ if( eDB_DriverAPIVersion() < minver ) {
+ eurephia_log(ctx, LOG_FATAL, 0,
+ "The requested eurephiaDB driver is too old. This program needs "
+ "API version %i, but this driver only supports API version %i.\n",
+ minver, eDB_DriverAPIVersion());
+ return 0;
+ }
+
// Configure functions contained in the driver, defined by API version
switch( eDB_DriverAPIVersion() ) {
default: