OpenSync  0.22
Functions
OpenSync Conversion

Used to convert, compare and detect changes. More...

Functions

OSyncFormatEnvosync_conv_env_new (OSyncEnv *env)
 This will create a new opensync format environment. More...
 
void osync_conv_env_free (OSyncFormatEnv *env)
 Frees a osync format environment. More...
 
osync_bool osync_conv_set_common_format (OSyncFormatEnv *env, const char *objtypestr, const char *formatname, OSyncError **error)
 Sets the common format for a object type. More...
 
OSyncObjTypeosync_conv_find_objtype (OSyncFormatEnv *env, const char *name)
 Finds the object type with the given name. More...
 
int osync_conv_num_objtypes (OSyncFormatEnv *env)
 Returns the number of available object types. More...
 
OSyncObjTypeosync_conv_nth_objtype (OSyncFormatEnv *env, int nth)
 Gets the nth object type. More...
 
OSyncObjFormatosync_conv_find_objformat (OSyncFormatEnv *env, const char *name)
 Finds the object format with the given name. More...
 
int osync_conv_num_objformats (OSyncObjType *type)
 Returns the number of available object formats. More...
 
OSyncObjFormatosync_conv_nth_objformat (OSyncObjType *type, int nth)
 Gets the nth object format. More...
 
OSyncFormatConverterosync_conv_find_converter (OSyncFormatEnv *env, const char *sourcename, const char *targetname)
 Finds the converter with the given source and target format. More...
 
OSyncFormatExtensionosync_conv_find_extension (OSyncFormatEnv *env, OSyncObjFormat *from_format, OSyncObjFormat *to_format, const char *extension_name)
 Finds the extension that will be invoked when going from the given source to the target format with the given name. More...
 
const char * osync_objtype_get_name (OSyncObjType *type)
 Returns the name of a object type. More...
 
const char * osync_objformat_get_name (OSyncObjFormat *format)
 Returns the name of a object format. More...
 
OSyncObjTypeosync_objformat_get_objtype (OSyncObjFormat *format)
 Returns the object type of a format. More...
 

Detailed Description

Used to convert, compare and detect changes.

Function Documentation

OSyncFormatEnv* osync_conv_env_new ( OSyncEnv *  env)

This will create a new opensync format environment.

The environment will hold all information about plugins, formats etc

Returns
A pointer to a newly allocated environment. NULL on error.

Definition at line 568 of file opensync_convert.c.

Referenced by osync_group_new().

void osync_conv_env_free ( OSyncFormatEnv env)

Frees a osync format environment.

Frees a osync format environment and all resources.

Parameters
envPointer to the environment to free

Definition at line 685 of file opensync_convert.c.

Referenced by osync_group_free().

osync_bool osync_conv_set_common_format ( OSyncFormatEnv env,
const char *  objtypestr,
const char *  formatname,
OSyncError **  error 
)

Sets the common format for a object type.

Parameters
envPointer to the environment
objtypestrThe object type name for which to set the common format
formatnameThe name of the format
errorPointer to a error struct
Returns
TRUE if the format was successfully set

Definition at line 703 of file opensync_convert.c.

Referenced by osync_conv_env_new().

OSyncObjType* osync_conv_find_objtype ( OSyncFormatEnv env,
const char *  name 
)

Finds the object type with the given name.

Parameters
envPointer to the environment
nameName of the object type to find
Returns
The object type, or NULL if not found

Definition at line 726 of file opensync_convert.c.

Referenced by osync_change_get_objtype(), osync_conv_env_new(), osync_conv_set_common_format(), osync_group_get_slow_sync(), osync_group_reset_slow_sync(), osync_group_set_slow_sync(), and osync_member_make_random_data().

int osync_conv_num_objtypes ( OSyncFormatEnv env)

Returns the number of available object types.

Parameters
envPointer to the environment
Returns
The number of object types

Definition at line 747 of file opensync_convert.c.

OSyncObjType* osync_conv_nth_objtype ( OSyncFormatEnv env,
int  nth 
)

Gets the nth object type.

Parameters
envPointer to the environment
nthThe number
Returns
The object type, or NULL if there is no such object type

Definition at line 760 of file opensync_convert.c.

OSyncObjFormat* osync_conv_find_objformat ( OSyncFormatEnv env,
const char *  name 
)

Finds the object format with the given name.

Parameters
envPointer to the environment
nameName of the format type to find
Returns
The object format, or NULL if not found

Definition at line 773 of file opensync_convert.c.

Referenced by osync_change_get_initial_objformat(), osync_change_get_objformat(), osync_conv_env_new(), osync_conv_find_converter(), and osync_conv_set_common_format().

int osync_conv_num_objformats ( OSyncObjType type)

Returns the number of available object formats.

Parameters
typeThe object type for whih to lookup the formats
Returns
The number of object formats

Definition at line 793 of file opensync_convert.c.

OSyncObjFormat* osync_conv_nth_objformat ( OSyncObjType type,
int  nth 
)

Gets the nth object format.

Parameters
typeThe object for which to get the nth format
nthThe number
Returns
The object format, or NULL if there is no such object type

Definition at line 806 of file opensync_convert.c.

OSyncFormatConverter* osync_conv_find_converter ( OSyncFormatEnv env,
const char *  sourcename,
const char *  targetname 
)

Finds the converter with the given source and target format.

Parameters
envPointer to the environment
sourcenameName of the source format
targetnameName of the target format
Returns
The converter, or NULL if not found

Definition at line 820 of file opensync_convert.c.

Referenced by osync_conv_env_new().

OSyncFormatExtension* osync_conv_find_extension ( OSyncFormatEnv env,
OSyncObjFormat from_format,
OSyncObjFormat to_format,
const char *  extension_name 
)

Finds the extension that will be invoked when going from the given source to the target format with the given name.

Parameters
envPointer to the environment
from_formatFrom Format
to_formatTo Format
extension_nameThe name of the extension to search
Returns
The extension, or NULL if not found

Definition at line 845 of file opensync_convert.c.

Referenced by get_next_vertice_neighbour().

const char* osync_objtype_get_name ( OSyncObjType type)

Returns the name of a object type.

Parameters
typeThe object type
Returns
The name of the object type

Definition at line 866 of file opensync_convert.c.

Referenced by _new_change_receiver(), and osync_hashtable_detect_change().

const char* osync_objformat_get_name ( OSyncObjFormat format)

Returns the name of a object format.

Parameters
formatThe object format
Returns
The name of the object format

Definition at line 878 of file opensync_convert.c.

Referenced by _new_change_receiver().

OSyncObjType* osync_objformat_get_objtype ( OSyncObjFormat format)

Returns the object type of a format.

Parameters
formatThe object format
Returns
The object type

Definition at line 890 of file opensync_convert.c.

Referenced by osync_member_has_read_function().