OpenSync Member
[OpenSync Group Module]

Used to manipulate members, which represent one device or application in a group. More...


Functions

OSYNC_EXPORT OSyncMemberosync_member_new (OSyncError **error)
 Creates a new member for a group.
OSYNC_EXPORT OSyncMemberosync_member_ref (OSyncMember *member)
 Increase the reference count of the member.
OSYNC_EXPORT void osync_member_unref (OSyncMember *member)
 Decrease the reference count of the member.
OSYNC_EXPORT const char * osync_member_get_pluginname (OSyncMember *member)
 Returns the name of the default plugin of the member.
OSYNC_EXPORT void osync_member_set_pluginname (OSyncMember *member, const char *pluginname)
 Sets the name of the default plugin of a member.
OSYNC_EXPORT const char * osync_member_get_name (OSyncMember *member)
 Returns the inidividual name of the member.
OSYNC_EXPORT void osync_member_set_name (OSyncMember *member, const char *name)
 Sets an individual name of the member.
OSYNC_EXPORT const char * osync_member_get_configdir (OSyncMember *member)
 Returns the configuration directory where this member is stored.
OSYNC_EXPORT void osync_member_set_configdir (OSyncMember *member, const char *configdir)
 Sets the directory where a member is supposed to be stored.
OSYNC_EXPORT osync_bool osync_member_has_config (OSyncMember *member)
 Checks if Member has configuration.
OSYNC_EXPORT OSyncPluginConfigosync_member_get_config_or_default (OSyncMember *member, OSyncError **error)
 Gets the configuration data of this member.
OSYNC_EXPORT OSyncPluginConfigosync_member_get_config (OSyncMember *member, OSyncError **error)
 Gets the configuration data of this member.
OSYNC_EXPORT void osync_member_set_config (OSyncMember *member, OSyncPluginConfig *config)
 Sets the config data for a member.
OSYNC_EXPORT osync_bool osync_member_load (OSyncMember *member, const char *path, OSyncError **error)
 Loads a member from a directory where it has been saved.
OSYNC_EXPORT osync_bool osync_member_save (OSyncMember *member, OSyncError **error)
 Saves a member to it config directory.
OSYNC_EXPORT osync_bool osync_member_delete (OSyncMember *member, OSyncError **error)
 Delete a member.
OSYNC_EXPORT long long int osync_member_get_id (OSyncMember *member)
 Gets the unique id of a member.
OSYNC_EXPORT int osync_member_num_objtypes (OSyncMember *member)
 Get the number of supported object types of this member.
OSYNC_EXPORT const char * osync_member_nth_objtype (OSyncMember *member, int nth)
 Get the name of the nth supported object type of this member.
OSYNC_EXPORT void osync_member_add_objtype_sink (OSyncMember *member, OSyncObjTypeSink *sink)
 Add an OSyncObjTypeSink object to the member list of supported object types of this member.
OSYNC_EXPORT OSyncObjTypeSink * osync_member_find_objtype_sink (OSyncMember *member, const char *objtype)
 Find the object type sink (OSyncObjTypeSink) for the given object type of a certain member.
OSYNC_EXPORT osync_bool osync_member_objtype_enabled (OSyncMember *member, const char *objtype)
 Returns if a certain object type is enabled on this member.
OSYNC_EXPORT void osync_member_set_objtype_enabled (OSyncMember *member, const char *objtype, osync_bool enabled)
 Enables or disables a object type on a member.
OSYNC_EXPORT const OSyncList * osync_member_get_objformats (OSyncMember *member, const char *objtype, OSyncError **error)
 List of all available object formats for a specifc object type of this member.
OSYNC_EXPORT void osync_member_add_objformat (OSyncMember *member, const char *objtype, const char *format)
 Add a specifc Object Format to member.
OSYNC_EXPORT void osync_member_add_objformat_with_config (OSyncMember *member, const char *objtype, const char *format, const char *format_config)
 Add a specifc Object Format with a conversion path config to member.
OSYNC_EXPORT OSyncCapabilitiesosync_member_get_capabilities (OSyncMember *member)
 Get the capabilities of the member.
OSYNC_EXPORT osync_bool osync_member_set_capabilities (OSyncMember *member, OSyncCapabilities *capabilities, OSyncError **error)
 Set the capabilities of the member.
OSYNC_EXPORT void osync_member_flush_objtypes (OSyncMember *member)
 Remove all object types from member.
OSYNC_EXPORT OSyncObjTypeSink * osync_member_get_main_sink (OSyncMember *member)
 Get the main sink of member.
OSYNC_EXPORT osync_bool osync_member_config_is_uptodate (OSyncMember *member)
 Checks if the member configuration is up to date.
OSYNC_EXPORT osync_bool osync_member_plugin_is_uptodate (OSyncMember *member)
 Checks if the plugin configuration is up to date.


Detailed Description

Used to manipulate members, which represent one device or application in a group.

Function Documentation

OSYNC_EXPORT OSyncMember* osync_member_new ( OSyncError **  error  ) 

Creates a new member for a group.

Parameters:
error Pointer to a error-struct
Returns:
A newly allocated member

Definition at line 135 of file opensync_member.c.

OSYNC_EXPORT OSyncMember* osync_member_ref ( OSyncMember member  ) 

Increase the reference count of the member.

Parameters:
member The member

Definition at line 160 of file opensync_member.c.

Referenced by osync_group_add_member().

OSYNC_EXPORT void osync_member_unref ( OSyncMember member  ) 

Decrease the reference count of the member.

Parameters:
member The member

Definition at line 169 of file opensync_member.c.

Referenced by osync_group_remove_member().

OSYNC_EXPORT const char* osync_member_get_pluginname ( OSyncMember member  ) 

Returns the name of the default plugin of the member.

Parameters:
member The member
Returns:
The name of the plugin

Definition at line 205 of file opensync_member.c.

Referenced by osync_member_plugin_is_uptodate().

OSYNC_EXPORT void osync_member_set_pluginname ( OSyncMember member,
const char *  pluginname 
)

Sets the name of the default plugin of a member.

Parameters:
member The member
pluginname The name of the default plugin

Definition at line 211 of file opensync_member.c.

OSYNC_EXPORT const char* osync_member_get_name ( OSyncMember member  ) 

Returns the inidividual name of the member.

Parameters:
member The member
Returns:
The name of the plugin

Definition at line 219 of file opensync_member.c.

Referenced by osync_member_save().

OSYNC_EXPORT void osync_member_set_name ( OSyncMember member,
const char *  name 
)

Sets an individual name of the member.

Parameters:
member The member
name The individual name of the member

Definition at line 225 of file opensync_member.c.

Referenced by osync_member_load().

OSYNC_EXPORT const char* osync_member_get_configdir ( OSyncMember member  ) 

Returns the configuration directory where this member is stored.

Parameters:
member The member
Returns:
The configuration directory

Definition at line 233 of file opensync_member.c.

Referenced by osync_capabilities_member_get_capabilities(), osync_capabilities_member_has_capabilities(), osync_capabilities_member_set_capabilities(), osync_group_add_member(), osync_group_reset(), osync_member_config_is_uptodate(), and osync_member_plugin_is_uptodate().

OSYNC_EXPORT void osync_member_set_configdir ( OSyncMember member,
const char *  configdir 
)

Sets the directory where a member is supposed to be stored.

Parameters:
member The member
configdir The name of the directory

Definition at line 239 of file opensync_member.c.

Referenced by osync_group_add_member(), and osync_member_load().

OSYNC_EXPORT osync_bool osync_member_has_config ( OSyncMember member  ) 

Checks if Member has configuration.

Parameters:
member The member
Returns:
TURE if member has configuration, FALSE otherwise

Definition at line 297 of file opensync_member.c.

OSYNC_EXPORT OSyncPluginConfig* osync_member_get_config_or_default ( OSyncMember member,
OSyncError **  error 
)

Gets the configuration data of this member.

The config file is read in this order:

  • If there is a configuration in memory that is not yet saved this is returned
  • If there is a config file in the member directory this is read and returned
  • Otherwise the default config file is loaded from one the opensync directories

Parameters:
member The member
error Pointer to a error
Returns:
The member configuration of the plugin default configuration if the member isn't configuered already

Definition at line 247 of file opensync_member.c.

OSYNC_EXPORT OSyncPluginConfig* osync_member_get_config ( OSyncMember member,
OSyncError **  error 
)

Gets the configuration data of this member.

The config file is read in this order:

  • If there is a configuration in memory that is not yet saved this is returned
  • If there is a config file in the member directory this is read and returned
  • Otherwise the default config file is loaded from one the opensync directories (but only if the plugin specified that it can use the default configuration)

Parameters:
member The member
error Pointer to a error
Returns:
Member configuration

Definition at line 303 of file opensync_member.c.

OSYNC_EXPORT void osync_member_set_config ( OSyncMember member,
OSyncPluginConfig config 
)

Sets the config data for a member.

Note that this does not save the config data

Parameters:
member The member
config The new config data

Definition at line 353 of file opensync_member.c.

Referenced by osync_member_get_config(), and osync_member_get_config_or_default().

OSYNC_EXPORT osync_bool osync_member_load ( OSyncMember member,
const char *  path,
OSyncError **  error 
)

Loads a member from a directory where it has been saved.

Parameters:
member The Member pointer of the member which gets loaded
path The path of the member
error Pointer to a error
Returns:
TRUE on success, FALSE if error

Definition at line 366 of file opensync_member.c.

OSYNC_EXPORT osync_bool osync_member_save ( OSyncMember member,
OSyncError **  error 
)

Saves a member to it config directory.

Parameters:
member The member to save
error Pointer to a error
Returns:
TRUE if the member was saved successfully, FALSE otherwise

Definition at line 516 of file opensync_member.c.

Referenced by osync_group_save().

OSYNC_EXPORT osync_bool osync_member_delete ( OSyncMember member,
OSyncError **  error 
)

Delete a member.

Parameters:
member The member to delete
error Pointer to a error
Returns:
TRUE if the member was deleted successfully, FALSE otherwise

Definition at line 601 of file opensync_member.c.

OSYNC_EXPORT long long int osync_member_get_id ( OSyncMember member  ) 

Gets the unique id of a member.

Parameters:
member The member
Returns:
The id of the member thats unique in its group

Definition at line 620 of file opensync_member.c.

Referenced by osync_group_find_member().

OSYNC_EXPORT int osync_member_num_objtypes ( OSyncMember member  ) 

Get the number of supported object types of this member.

Parameters:
member The member pointer
Returns:
Number of supported object type of this member

Definition at line 768 of file opensync_member.c.

Referenced by osync_group_get_supported_objtypes_mixed().

OSYNC_EXPORT const char* osync_member_nth_objtype ( OSyncMember member,
int  nth 
)

Get the name of the nth supported object type of this member.

Parameters:
member The member pointer
nth The nth position of the list of supported object types of this member
Returns:
Name of the nth supported object type

Definition at line 774 of file opensync_member.c.

Referenced by osync_group_get_supported_objtypes_mixed().

OSYNC_EXPORT void osync_member_add_objtype_sink ( OSyncMember member,
OSyncObjTypeSink *  sink 
)

Add an OSyncObjTypeSink object to the member list of supported object types of this member.

Parameters:
member The member pointer
sink The OSyncObjTypeSink object to add

Definition at line 743 of file opensync_member.c.

Referenced by osync_member_load().

OSYNC_EXPORT OSyncObjTypeSink* osync_member_find_objtype_sink ( OSyncMember member,
const char *  objtype 
)

Find the object type sink (OSyncObjTypeSink) for the given object type of a certain member.

Parameters:
member The member pointer
objtype The searched object type
Returns:
OSyncObjTypeSink pointer if object type sink is avaliable, otherwise NULL

Definition at line 626 of file opensync_member.c.

Referenced by osync_member_add_objformat(), osync_member_add_objformat_with_config(), osync_member_get_objformats(), osync_member_objtype_enabled(), and osync_member_set_objtype_enabled().

OSYNC_EXPORT osync_bool osync_member_objtype_enabled ( OSyncMember member,
const char *  objtype 
)

Returns if a certain object type is enabled on this member.

Parameters:
member The member
objtype The name of the object type to check
Returns:
TRUE if the object type is enabled, FALSE otherwise

Definition at line 782 of file opensync_member.c.

Referenced by osync_group_objtype_enabled().

OSYNC_EXPORT void osync_member_set_objtype_enabled ( OSyncMember member,
const char *  objtype,
osync_bool  enabled 
)

Enables or disables a object type on a member.

Parameters:
member The member
objtype The name of the object type to change
enabled Set to TRUE if you want to sync the object type, FALSE otherwise
Note: this function should be called only after sink information for the member is available (osync_member_require_sink_info())

Todo:
Change function interface to not require the plugin to be instanced manually. See comments on osync_group_set_objtype_enabled()

Definition at line 792 of file opensync_member.c.

Referenced by osync_group_set_objtype_enabled().

OSYNC_EXPORT const OSyncList* osync_member_get_objformats ( OSyncMember member,
const char *  objtype,
OSyncError **  error 
)

List of all available object formats for a specifc object type of this member.

Parameters:
member The member pointer
objtype The searched object type
error Pointer to a error
Returns:
List of all object formats of a specific object type of the member

Definition at line 667 of file opensync_member.c.

OSYNC_EXPORT void osync_member_add_objformat ( OSyncMember member,
const char *  objtype,
const char *  format 
)

Add a specifc Object Format to member.

Parameters:
member The member pointer
objtype The searched object type
format The name of the Object Format

Definition at line 641 of file opensync_member.c.

OSYNC_EXPORT void osync_member_add_objformat_with_config ( OSyncMember member,
const char *  objtype,
const char *  format,
const char *  format_config 
)

Add a specifc Object Format with a conversion path config to member.

Parameters:
member The member pointer
objtype The searched object type
format The name of the Object Format
format_config The Object Format specific configuration

Definition at line 654 of file opensync_member.c.

OSYNC_EXPORT OSyncCapabilities* osync_member_get_capabilities ( OSyncMember member  ) 

Get the capabilities of the member.

Parameters:
member The member
Returns:
The capabilities of this member, NULL if no capabilities are set

Definition at line 808 of file opensync_member.c.

Referenced by osync_member_save(), and osync_member_unref().

OSYNC_EXPORT osync_bool osync_member_set_capabilities ( OSyncMember member,
OSyncCapabilities capabilities,
OSyncError **  error 
)

Set the capabilities of the member.

Parameters:
member The member
capabilities The capabilities
error Pointer to a error
Returns:
TRUE if the capabilities got set successfully, otherwise FALSE

Definition at line 814 of file opensync_member.c.

Referenced by osync_member_load().

OSYNC_EXPORT void osync_member_flush_objtypes ( OSyncMember member  ) 

Remove all object types from member.

Parameters:
member The member
Note: this function should be called to flush the member before discovering. To detect if something isn't supported anymore.

Definition at line 829 of file opensync_member.c.

Referenced by osync_engine_discover(), and osync_member_unref().

OSYNC_EXPORT OSyncObjTypeSink* osync_member_get_main_sink ( OSyncMember member  ) 

Get the main sink of member.

Parameters:
member The member
Returns:
OSyncObjTypeSink pointer of the main sink.

Definition at line 844 of file opensync_member.c.

OSYNC_EXPORT osync_bool osync_member_config_is_uptodate ( OSyncMember member  ) 

Checks if the member configuration is up to date.

Parameters:
member The member
Returns:
TRUE if member configuration is up to date.

Definition at line 850 of file opensync_member.c.

Referenced by osync_updater_action_required().

OSYNC_EXPORT osync_bool osync_member_plugin_is_uptodate ( OSyncMember member  ) 

Checks if the plugin configuration is up to date.

Parameters:
member The member
Returns:
TRUE if plugin configuration is up to date.

Definition at line 897 of file opensync_member.c.

Referenced by osync_updater_action_required().


Generated on Fri Feb 13 13:33:29 2009 for OpenSync by  doxygen 1.5.7.1