|
From: Daniel G. <go...@b1...> - 2009-11-12 09:21:55
|
On Tuesday 10 November 2009 09:56:22 pm Jakub Marczynski wrote:
> > I could of course create just one default configuration file with both
> > Formats, but a GUI would not be able to figure out that this particular
> > version of the external plugin will only support one of them.
>
> Maybe, as a temporary solution, just make thin new version of a plugin
> exist as a new plugin, with another configuration file. Then, there's no
> need to change the Opensync logic. Does it make any sense?
Right. The "thinest" way is to build a OSyncPlugin* and register it with
osync_plugin_env_register_plugin()!
>
> > I have never figured out what the plugin's get_version is used for.
> > Could it be used here?
>
> This is a good point. I found a statement:
> "The format/conversion and main plugin modules that are part of a plugin
> now each have a function int get_version(void). At the moment this
> function must return 1. "
> Is this "MUST" still so importart?
Yes, check:
---8<---
osync_bool osync_module_check(OSyncModule *module, OSyncError **error)
{
int version = 0;
[...]
version = osync_module_get_version(module);
[...]
if (version != OPENSYNC_PLUGINVERSION) {
osync_error_set(error, OSYNC_ERROR_GENERIC, "Plugin API
version mismatch. Is: %i. Should %i", version, OPENSYNC_PLUGINVERSION);
----->8---
One day we might can use this to support several plugins which are
build/designed against different OpenSync plugins APIs.
Maybe we should introduce some #define instead of a confusing "return 0" ...
something like: return OSYNC_PLUGIN_SYNC_API_VERSION_1;
What do you think?
Best Regards,
Daniel
--
Daniel Gollub Geschaeftsfuehrer: Ralph Dehner
FOSS Developer Unternehmenssitz: Vohburg
B1 Systems GmbH Amtsgericht: Ingolstadt
Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537
EMail: go...@b1... http://www.b1-systems.de
Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D
|