summaryrefslogtreecommitdiffstats
path: root/src/lilv_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-03-17 16:48:38 -0400
committerDavid Robillard <d@drobilla.net>2016-03-17 16:48:38 -0400
commit4a1e47eb6ff69c2685feca73ba19700a99736b59 (patch)
tree48dcd217ffdee6620e643e0acf93d55727e64e31 /src/lilv_internal.h
parente1c2cf574732c52c4df791274f67381458f5e699 (diff)
downloadlilv-4a1e47eb6ff69c2685feca73ba19700a99736b59.tar.gz
lilv-4a1e47eb6ff69c2685feca73ba19700a99736b59.tar.bz2
lilv-4a1e47eb6ff69c2685feca73ba19700a99736b59.zip
Replace bundle when newer plugin version is loaded
Based on patch from Robin Gareus.
Diffstat (limited to 'src/lilv_internal.h')
-rw-r--r--src/lilv_internal.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index 5fc37fa..ea96418 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -174,7 +174,9 @@ struct LilvWorldImpl {
SordNode* lv2_index;
SordNode* lv2_latency;
SordNode* lv2_maximum;
+ SordNode* lv2_microVersion;
SordNode* lv2_minimum;
+ SordNode* lv2_minorVersion;
SordNode* lv2_name;
SordNode* lv2_optionalFeature;
SordNode* lv2_port;
@@ -235,6 +237,11 @@ struct LilvUIImpl {
LilvNodes* classes;
};
+typedef struct LilvVersion {
+ int minor;
+ int micro;
+} LilvVersion;
+
/*
*
* Functions
@@ -314,6 +321,19 @@ int lilv_lib_compare(const void* a, const void* b, void* user_data);
int lilv_ptr_cmp(const void* a, const void* b, void* user_data);
int lilv_resource_node_cmp(const void* a, const void* b, void* user_data);
+static inline int
+lilv_version_cmp(const LilvVersion* a, const LilvVersion* b)
+{
+ if (a->minor == b->minor && a->micro == b->micro) {
+ return 0;
+ } else if ((a->minor < b->minor)
+ || (a->minor == b->minor && a->micro < b->micro)) {
+ return -1;
+ } else {
+ return 1;
+ }
+}
+
struct LilvHeader*
lilv_collection_get_by_uri(const ZixTree* seq, const LilvNode* uri);