summaryrefslogtreecommitdiff
path: root/deadbeef.h
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-09-06 17:32:03 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-09-06 17:32:03 +0200
commit37e7691e7c1956586ff5c9302213cf1b37f235c9 (patch)
tree0ad49fa72fa65cc50bb99124239276aac1a4bb91 /deadbeef.h
parent0eb27da8f4f33b99b5574d3eb1094e0ee6515c7c (diff)
added plugin versioning
Diffstat (limited to 'deadbeef.h')
-rw-r--r--deadbeef.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 68911515..fc9fd897 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -39,11 +39,28 @@ extern "C" {
// extern "C" DB_plugin_t* $MODULENAME_load (DB_functions_t *api);
// where $MODULENAME is a name of module
// e.g. if your plugin is called "myplugin.so", $MODULENAME is "myplugin"
-// plugin should check vmajor and vminor members of api,
-// and return NULL if they are not compatible
-// otherwise it should return pointer to DB_plugin_t structure
+// this function should return pointer to DB_plugin_t structure
// that is enough for both static and dynamic modules
+// add DB_PLUGIN_SET_API_VERSION macro when you define plugin structure
+// like this:
+// static DB_decoder_t plugin = {
+// DB_PLUGIN_SET_API_VERSION
+// ............
+// }
+// this is required for versioning
+// if you don't do it -- no version checking will be done (usefull for
+// debugging/development)
+// DON'T release plugins without DB_PLUGIN_SET_API_VERSION
+
+#define DB_API_VERSION_MAJOR 0
+#define DB_API_VERSION_MINOR 1
+
+#define DB_PLUGIN_SET_API_VERSION\
+ .plugin.api_vmajor = DB_API_VERSION_MAJOR,\
+ .plugin.api_vminor = DB_API_VERSION_MINOR,
+
+////////////////////////////
// playlist structures
// playlist item
@@ -165,7 +182,10 @@ typedef struct {
typedef struct DB_plugin_s {
// type must be one of DB_PLUGIN_ types
int32_t type;
- // version
+ // api version
+ int16_t api_vmajor;
+ int16_t api_vminor;
+ // plugin version
int16_t version_major;
int16_t version_minor;
// may be deactivated on failures after load