aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-16 12:40:14 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-16 12:40:14 +0000
commit4f73b850c5a215e6cce7a559650a3cf7ec89d433 (patch)
treece1cdf78bdaa18bc4c9546b007c2c4fa51d10448 /termkey.c
parentc2dd9675d6af30ab5129519325bac68491087cc1 (diff)
downloadtermo-4f73b850c5a215e6cce7a559650a3cf7ec89d433.tar.gz
termo-4f73b850c5a215e6cce7a559650a3cf7ec89d433.tar.xz
termo-4f73b850c5a215e6cce7a559650a3cf7ec89d433.zip
Added compile-vs-runtime library version checks
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/termkey.c b/termkey.c
index bebaa9a..f099f5f 100644
--- a/termkey.c
+++ b/termkey.c
@@ -8,6 +8,23 @@
#include <stdio.h>
+void termkey_check_version(int major, int minor)
+{
+ if(major != TERMKEY_VERSION_MAJOR) {
+ fprintf(stderr, "libtermkey major version mismatch; %d (wants) != %d (library)\n",
+ major, TERMKEY_VERSION_MAJOR);
+ exit(1);
+ }
+
+ if(minor > TERMKEY_VERSION_MINOR) {
+ fprintf(stderr, "libtermkey minor version mismatch; %d (wants) > %d (library)\n",
+ minor, TERMKEY_VERSION_MINOR);
+ exit(1);
+ }
+
+ // Happy
+}
+
static struct termkey_driver *drivers[] = {
&termkey_driver_ti,
&termkey_driver_csi,