OpenSync Plugin
[OpenSync Public API]

Collaboration diagram for OpenSync Plugin:

Functions to register and manage plugins. More...

Enumerations

enum  OSyncConfigurationType { OSYNC_PLUGIN_NO_CONFIGURATION = 0, OSYNC_PLUGIN_OPTIONAL_CONFIGURATION = 1, OSYNC_PLUGIN_NEEDS_CONFIGURATION = 2 }
 Gives information about wether the plugin has to be configured or not. More...

Functions

OSyncPluginosync_plugin_new (OSyncError **error)
 Registers a new plugin.
OSyncPluginosync_plugin_ref (OSyncPlugin *plugin)
 Increase the reference count on a plugin.
void osync_plugin_unref (OSyncPlugin *plugin)
 Decrease the reference count on a plugin.
const char * osync_plugin_get_name (OSyncPlugin *plugin)
 Returns the name of a plugin.
void osync_plugin_set_name (OSyncPlugin *plugin, const char *name)
 Sets the name of a plugin.
const char * osync_plugin_get_longname (OSyncPlugin *plugin)
 Returns the long name of a plugin.
void osync_plugin_set_longname (OSyncPlugin *plugin, const char *longname)
 Sets the long name of a plugin.
const char * osync_plugin_get_description (OSyncPlugin *plugin)
 Returns the description of a plugin.
void osync_plugin_set_description (OSyncPlugin *plugin, const char *description)
 Sets the description of a plugin.
void * osync_plugin_get_data (OSyncPlugin *plugin)
 Returns the plugin_info data, set by the plugin.
void osync_plugin_set_data (OSyncPlugin *plugin, void *data)
 Set the plugin_info data for the plugin object.
OSyncConfigurationType osync_plugin_get_config_type (OSyncPlugin *plugin)
 Returns whether or not the plugin requires configuration.
void osync_plugin_set_config_type (OSyncPlugin *plugin, OSyncConfigurationType config_type)
 Sets whether or not the plugin requires configuration.
OSyncStartType osync_plugin_get_start_type (OSyncPlugin *plugin)
 Returns start type of plugin.
void osync_plugin_set_start_type (OSyncPlugin *plugin, OSyncStartType start_type)
 Sets the start type of the plugin.
void osync_plugin_set_initialize (OSyncPlugin *plugin, initialize_fn init)
 Sets the initialize function for a plugin.
void osync_plugin_set_finalize (OSyncPlugin *plugin, finalize_fn fin)
 Sets the finalize function for a plugin.
void osync_plugin_set_discover (OSyncPlugin *plugin, discover_fn discover)
 Sets the optional discover function for a plugin.
void * osync_plugin_initialize (OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error)
 Initialize Plugin.
void osync_plugin_finalize (OSyncPlugin *plugin, void *data)
 Finalize Plugin.
osync_bool osync_plugin_discover (OSyncPlugin *plugin, void *data, OSyncPluginInfo *info, OSyncError **error)
 Call plugin discovery.
osync_bool osync_plugin_is_usable (OSyncPlugin *plugin, OSyncError **error)
 Checks if a plugin is available and usable.
unsigned int osync_plugin_get_discover_timeout (OSyncPlugin *plugin)
 Get timeout interval for plugin discovery.
void osync_plugin_set_discover_timeout (OSyncPlugin *plugin, unsigned int timeout)
 Set timeout interval for plugin discovery.
unsigned int osync_plugin_get_initialize_timeout (OSyncPlugin *plugin)
 Get timeout interval for plugin initialization.
void osync_plugin_set_initialize_timeout (OSyncPlugin *plugin, unsigned int timeout)
 Set timeout interval for plugin initialization.
unsigned int osync_plugin_get_finalize_timeout (OSyncPlugin *plugin)
 Get timeout interval for plugin finalization.
void osync_plugin_set_finalize_timeout (OSyncPlugin *plugin, unsigned int timeout)
 Set timeout interval for plugin finalization.
unsigned int osync_plugin_get_useable_timeout (OSyncPlugin *plugin)
 Get timeout interval for plugin "usable" function.
void osync_plugin_set_useable_timeout (OSyncPlugin *plugin, unsigned int timeout)
 Set timeout interval for plugin "usable" function.

Detailed Description

Functions to register and manage plugins.


Enumeration Type Documentation

enum OSyncConfigurationType

Gives information about wether the plugin has to be configured or not.

Enumerator:
OSYNC_PLUGIN_NO_CONFIGURATION  Plugin has no configuration options
OSYNC_PLUGIN_OPTIONAL_CONFIGURATION  Plugin can be configured, but will accept the default config in the initialize function
OSYNC_PLUGIN_NEEDS_CONFIGURATION  Plugin must be configured to run correctly

Definition at line 34 of file opensync_plugin.h.


Function Documentation

OSyncPlugin* osync_plugin_new ( OSyncError **  error  ) 

Registers a new plugin.

This function creates a new OSyncPlugin object, that can be used to register a new plugin dynamically. This can be used by a module to register multiple plugins, instead of using the get_info() function which allows registering only one plugin.

Parameters:
error Pointer to an error struct
Returns:
the newly registered plugin

Definition at line 48 of file opensync_plugin.c.

OSyncPlugin* osync_plugin_ref ( OSyncPlugin plugin  ) 

Increase the reference count on a plugin.

Parameters:
plugin Pointer to the plugin

Definition at line 71 of file opensync_plugin.c.

Referenced by osync_plugin_env_register_plugin().

void osync_plugin_unref ( OSyncPlugin plugin  ) 

Decrease the reference count on a plugin.

Parameters:
plugin Pointer to the plugin

Definition at line 85 of file opensync_plugin.c.

Referenced by osync_plugin_env_free().

const char* osync_plugin_get_name ( OSyncPlugin plugin  ) 

Returns the name of a plugin.

Parameters:
plugin Pointer to the plugin
Returns:
Name of the plugin

Definition at line 109 of file opensync_plugin.c.

Referenced by osync_plugin_env_find_plugin().

void osync_plugin_set_name ( OSyncPlugin plugin,
const char *  name 
)

Sets the name of a plugin.

Sets the name of a plugin. This is a short name (maybe < 15 chars).

Parameters:
plugin Pointer to the plugin
name the name to set

Definition at line 123 of file opensync_plugin.c.

const char* osync_plugin_get_longname ( OSyncPlugin plugin  ) 

Returns the long name of a plugin.

Parameters:
plugin Pointer to the plugin
Returns:
Long name of the plugin

Definition at line 137 of file opensync_plugin.c.

void osync_plugin_set_longname ( OSyncPlugin plugin,
const char *  longname 
)

Sets the long name of a plugin.

Sets the long name of a plugin (maybe < 50 chars).

Parameters:
plugin Pointer to the plugin
longname the long name to set

Definition at line 151 of file opensync_plugin.c.

const char* osync_plugin_get_description ( OSyncPlugin plugin  ) 

Returns the description of a plugin.

Parameters:
plugin Pointer to the plugin
Returns:
Description of the plugin

Definition at line 165 of file opensync_plugin.c.

void osync_plugin_set_description ( OSyncPlugin plugin,
const char *  description 
)

Sets the description of a plugin.

Sets a longer description for the plugin (maybe < 200 chars).

Parameters:
plugin Pointer to the plugin
description the description to set

Definition at line 179 of file opensync_plugin.c.

void* osync_plugin_get_data ( OSyncPlugin plugin  ) 

Returns the plugin_info data, set by the plugin.

Parameters:
plugin Pointer to the plugin
Returns:
The void pointer set on plugin->info.plugin_data

Definition at line 192 of file opensync_plugin.c.

void osync_plugin_set_data ( OSyncPlugin plugin,
void *  data 
)

Set the plugin_info data for the plugin object.

Parameters:
plugin Pointer to the plugin
data Pointer to data which should get set

Definition at line 203 of file opensync_plugin.c.

OSyncConfigurationType osync_plugin_get_config_type ( OSyncPlugin plugin  ) 

Returns whether or not the plugin requires configuration.

Parameters:
plugin Pointer to the plugin
Returns:
The configuration requirement type of the plugin

Definition at line 214 of file opensync_plugin.c.

void osync_plugin_set_config_type ( OSyncPlugin plugin,
OSyncConfigurationType  config_type 
)

Sets whether or not the plugin requires configuration.

Parameters:
plugin Pointer to the plugin
config_type The configuration requirement type of the plugin

Definition at line 225 of file opensync_plugin.c.

OSyncStartType osync_plugin_get_start_type ( OSyncPlugin plugin  ) 

Returns start type of plugin.

Parameters:
plugin Pointer to the plugin
Returns:
The start type of the plugin

Definition at line 236 of file opensync_plugin.c.

void osync_plugin_set_start_type ( OSyncPlugin plugin,
OSyncStartType  start_type 
)

Sets the start type of the plugin.

Parameters:
plugin Pointer to the plugin
start_type The start type of the plugin

Definition at line 247 of file opensync_plugin.c.

void osync_plugin_set_initialize ( OSyncPlugin plugin,
initialize_fn  init 
)

Sets the initialize function for a plugin.

The initialize function of a plugin sets up sinks for the plugin as well as other plugin-wide structures.

Parameters:
plugin Pointer to the plugin
init The initialize function for the plugin

Definition at line 261 of file opensync_plugin.c.

void osync_plugin_set_finalize ( OSyncPlugin plugin,
finalize_fn  fin 
)

Sets the finalize function for a plugin.

The finalize function of a plugin frees any plugin-wide structures that were created in the initialize function.

Parameters:
plugin Pointer to the plugin
fin The finalize function for the plugin

Definition at line 275 of file opensync_plugin.c.

void osync_plugin_set_discover ( OSyncPlugin plugin,
discover_fn  discover 
)

Sets the optional discover function for a plugin.

The discover function of a plugin can be used to specify which of the sinks in the plugin are currently available, and to declare the compatible device versions for the plugin. It can also be used to set the plugin's capabilities.

The discover function is optional.

Parameters:
plugin Pointer to the plugin
discover The discover function for the plugin

Definition at line 294 of file opensync_plugin.c.

void* osync_plugin_initialize ( OSyncPlugin plugin,
OSyncPluginInfo info,
OSyncError **  error 
)

Initialize Plugin.

Parameters:
plugin Pointer to the plugin
info Pointer to OSyncPluginInfo which describes the plugin
error Pointer to error-struct
Returns:
Userdata returned by the plugin on success, NULL on error

Definition at line 307 of file opensync_plugin.c.

void osync_plugin_finalize ( OSyncPlugin plugin,
void *  data 
)

Finalize Plugin.

Parameters:
plugin Pointer to the plugin
data Pointer to userdata which got returned by plugin initialize function

Definition at line 318 of file opensync_plugin.c.

osync_bool osync_plugin_discover ( OSyncPlugin plugin,
void *  data,
OSyncPluginInfo info,
OSyncError **  error 
)

Call plugin discovery.

Parameters:
plugin Pointer to the plugin
data Pointer to userdata which got returned by plugin initialize function
info Pointer to OSyncPluginInfo which describes the plugin
error Pointer to error-struct
Returns:
TRUE on success, FALSE otherwise

Definition at line 332 of file opensync_plugin.c.

osync_bool osync_plugin_is_usable ( OSyncPlugin plugin,
OSyncError **  error 
)

Checks if a plugin is available and usable.

Parameters:
plugin The plugin to check
error If the return was FALSE, will contain information on why the plugin is not available
Returns:
TRUE if the plugin was found and is usable, FALSE otherwise

Definition at line 348 of file opensync_plugin.c.

unsigned int osync_plugin_get_discover_timeout ( OSyncPlugin plugin  ) 

Get timeout interval for plugin discovery.

Parameters:
plugin The plugin to get discvoery timeout
Returns:
Timeout value

Definition at line 367 of file opensync_plugin.c.

void osync_plugin_set_discover_timeout ( OSyncPlugin plugin,
unsigned int  timeout 
)

Set timeout interval for plugin discovery.

Parameters:
plugin The plugin to check
timeout Timeout value

Definition at line 379 of file opensync_plugin.c.

unsigned int osync_plugin_get_initialize_timeout ( OSyncPlugin plugin  ) 

Get timeout interval for plugin initialization.

Parameters:
plugin The plugin to check
Returns:
Timeout value

Definition at line 391 of file opensync_plugin.c.

void osync_plugin_set_initialize_timeout ( OSyncPlugin plugin,
unsigned int  timeout 
)

Set timeout interval for plugin initialization.

Parameters:
plugin The plugin to check
timeout Timeout value

Definition at line 403 of file opensync_plugin.c.

unsigned int osync_plugin_get_finalize_timeout ( OSyncPlugin plugin  ) 

Get timeout interval for plugin finalization.

Parameters:
plugin The plugin to check
Returns:
Timeout value

Definition at line 415 of file opensync_plugin.c.

void osync_plugin_set_finalize_timeout ( OSyncPlugin plugin,
unsigned int  timeout 
)

Set timeout interval for plugin finalization.

Parameters:
plugin The plugin to check
timeout Timeout value

Definition at line 427 of file opensync_plugin.c.

unsigned int osync_plugin_get_useable_timeout ( OSyncPlugin plugin  ) 

Get timeout interval for plugin "usable" function.

Parameters:
plugin The plugin to check
Returns:
Timeout value

Definition at line 439 of file opensync_plugin.c.

void osync_plugin_set_useable_timeout ( OSyncPlugin plugin,
unsigned int  timeout 
)

Set timeout interval for plugin "usable" function.

Parameters:
plugin The plugin to check
timeout Timeout value

Definition at line 451 of file opensync_plugin.c.


Generated on Wed Nov 26 19:04:23 2008 for OpenSync by  doxygen 1.5.1