OpenSync Change Commands
[OpenSync Public API]

High level functions to manipulate changes. More...


Enumerations

enum  OSyncConvCmpResult { CONV_DATA_UNKNOWN = 0, CONV_DATA_MISMATCH = 1, CONV_DATA_SIMILAR = 2, CONV_DATA_SAME = 3 }
 The possible returns of a change comparison. More...

Functions

char * osync_change_get_printable (OSyncChange *change)
 Returns a string describing a change object.
time_t osync_change_get_revision (OSyncChange *change, OSyncError **error)
 Returns the revision of the object.
OSyncConvCmpResult osync_change_compare_data (OSyncChange *leftchange, OSyncChange *rightchange)
 Compares the data of 2 changes.
OSyncConvCmpResult osync_change_compare (OSyncChange *leftchange, OSyncChange *rightchange)
 Compares 2 changes.
osync_bool osync_change_copy_data (OSyncChange *source, OSyncChange *target, OSyncError **error)
 Copies the data from one change to another change.
OSyncChangeosync_change_copy (OSyncChange *source, OSyncError **error)
 Makes a exact copy of change.
osync_bool osync_change_duplicate (OSyncChange *change)
 Duplicates the uid of the change.
osync_bool osync_change_convert_extension (OSyncFormatEnv *env, OSyncChange *change, OSyncObjFormat *targetformat, const char *extension_name, OSyncError **error)
 Convert a change to a specific format with a specific extension.
osync_bool osync_change_convert (OSyncFormatEnv *env, OSyncChange *change, OSyncObjFormat *targetformat, OSyncError **error)
 Convert a change to a specific format.
osync_bool osync_change_convert_to_common (OSyncChange *change, OSyncError **error)
 Convert a change to the specified common format.
osync_bool osync_change_convert_fmtname (OSyncFormatEnv *env, OSyncChange *change, const char *targetname, OSyncError **error)
 Convert a change to a specific format with the given name.
osync_bool osync_change_convert_fmtnames (OSyncFormatEnv *env, OSyncChange *change, const char **targetnames, OSyncError **error)
 Convert a change to some formats.
osync_bool osync_change_convert_member_sink (OSyncFormatEnv *env, OSyncChange *change, OSyncMember *member, OSyncError **error)
 Convert a change to the nearest sink on a member.
OSyncObjTypeosync_change_detect_objtype (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error)
 Tries to detect the object type of the given change.
OSyncObjTypeosync_change_detect_objtype_full (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error)
 Tries to detect the encapsulated object type of the given change.
OSyncObjFormatosync_change_detect_objformat (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error)
 Tries to detect the format of the given change.
OSyncObjFormatosync_change_detect_objformat_full (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error)
 Tries to detect the encapsulated format of the given change.


Detailed Description

High level functions to manipulate changes.

Enumeration Type Documentation

The possible returns of a change comparison.

Enumerator:
CONV_DATA_UNKNOWN  The result is unknown, there was a error
CONV_DATA_MISMATCH  The changes are not the same
CONV_DATA_SIMILAR  The changs are not the same but look similar
CONV_DATA_SAME  The changes are exactly the same

Definition at line 16 of file opensync_convert.h.


Function Documentation

char* osync_change_get_printable ( OSyncChange change  ) 

Returns a string describing a change object.

Some formats cannot be printed directly. To be able to print these objects they should specify a print function.

Parameters:
change The change to get printable
Returns:
A string describing the object

Definition at line 97 of file opensync_changecmds.c.

time_t osync_change_get_revision ( OSyncChange change,
OSyncError **  error 
)

Returns the revision of the object.

Parameters:
change The change to get the revision from
error A error struct
Returns:
The revision of the object in seconds since the epoch in zulu time

Definition at line 119 of file opensync_changecmds.c.

Referenced by osengine_mapping_check_timestamps(), and osengine_mapping_solve_latest().

OSyncConvCmpResult osync_change_compare_data ( OSyncChange leftchange,
OSyncChange rightchange 
)

Compares the data of 2 changes.

Compares the two given changes and returns: CONV_DATA_MISMATCH if they are not the same CONV_DATA_SIMILAR if the are not the same but look similar CONV_DATA_SAME if they are exactly the same

Parameters:
leftchange The left change to compare
rightchange The right change to compare
Returns:
The result of the comparison

Definition at line 157 of file opensync_changecmds.c.

Referenced by osync_change_compare().

OSyncConvCmpResult osync_change_compare ( OSyncChange leftchange,
OSyncChange rightchange 
)

Compares 2 changes.

Compares the two given changes and returns: CONV_DATA_MISMATCH if they are not the same CONV_DATA_SIMILAR if the are not the same but look similar CONV_DATA_SAME if they are exactly the same This function does also compare changetypes etc unlike osync_change_compare_data()

Parameters:
leftchange The left change to compare
rightchange The right change to compare
Returns:
The result of the comparison

Definition at line 217 of file opensync_changecmds.c.

osync_bool osync_change_copy_data ( OSyncChange source,
OSyncChange target,
OSyncError **  error 
)

Copies the data from one change to another change.

Parameters:
source The change to copy from
target The change to copy to
error A error struct
Returns:
TRUE if the copy was successfull

Definition at line 256 of file opensync_changecmds.c.

Referenced by osync_change_copy(), and osync_change_update().

OSyncChange* osync_change_copy ( OSyncChange source,
OSyncError **  error 
)

Makes a exact copy of change.

Parameters:
source The change to copy from
error A error struct
Returns:
A new change that is the copy, NULL on error

Definition at line 302 of file opensync_changecmds.c.

osync_bool osync_change_duplicate ( OSyncChange change  ) 

Duplicates the uid of the change.

This will call the duplicate function of a format. This is used if a uid is not unique.

Parameters:
change The change to duplicate
Returns:
TRUE if the uid was duplicated successfull

Definition at line 338 of file opensync_changecmds.c.

osync_bool osync_change_convert_extension ( OSyncFormatEnv env,
OSyncChange change,
OSyncObjFormat targetformat,
const char *  extension_name,
OSyncError **  error 
)

Convert a change to a specific format with a specific extension.

This will convert the change with its data to the specified format if possible. And this will also convert the data to the specified format extension.

Parameters:
env The conversion environment to use
change The change to convert
targetformat To which format you want to convert to
extension_name The name of the extension
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 363 of file opensync_changecmds.c.

Referenced by osync_change_convert().

osync_bool osync_change_convert ( OSyncFormatEnv env,
OSyncChange change,
OSyncObjFormat targetformat,
OSyncError **  error 
)

Convert a change to a specific format.

This will convert the change with its data to the specified format if possible.

Parameters:
env The conversion environment to use
change The change to convert
targetformat To which format you want to convert to
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 387 of file opensync_changecmds.c.

Referenced by osync_change_convert_to_common(), and osync_member_make_random_data().

osync_bool osync_change_convert_to_common ( OSyncChange change,
OSyncError **  error 
)

Convert a change to the specified common format.

Parameters:
change The change to convert
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 399 of file opensync_changecmds.c.

Referenced by _new_change_receiver(), osync_change_compare(), and osync_change_compare_data().

osync_bool osync_change_convert_fmtname ( OSyncFormatEnv env,
OSyncChange change,
const char *  targetname,
OSyncError **  error 
)

Convert a change to a specific format with the given name.

This will convert the change with its data to the specified format if possible.

Parameters:
env The conversion environment to use
change The change to convert
targetname To which format you want to convert to
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 438 of file opensync_changecmds.c.

osync_bool osync_change_convert_fmtnames ( OSyncFormatEnv env,
OSyncChange change,
const char **  targetnames,
OSyncError **  error 
)

Convert a change to some formats.

This will convert the change with its data to one of the specified formats if possible.

Parameters:
env The conversion environment to use
change The change to convert
targetnames NULL-Terminated array of formatnames
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 455 of file opensync_changecmds.c.

osync_bool osync_change_convert_member_sink ( OSyncFormatEnv env,
OSyncChange change,
OSyncMember member,
OSyncError **  error 
)

Convert a change to the nearest sink on a member.

Parameters:
env The conversion environment to use
change The change to convert
member The member that will receive the change
error The error-return location
Returns:
TRUE on success, FALSE otherwise

Definition at line 470 of file opensync_changecmds.c.

OSyncObjType* osync_change_detect_objtype ( OSyncFormatEnv env,
OSyncChange change,
OSyncError **  error 
)

Tries to detect the object type of the given change.

This will try to detect the object type of the data on the change and return it, but not set it.

Parameters:
env The conversion environment to use
change The change to detect
error The error-return location
Returns:
The objecttype on success, NULL otherwise

Definition at line 489 of file opensync_changecmds.c.

OSyncObjType* osync_change_detect_objtype_full ( OSyncFormatEnv env,
OSyncChange change,
OSyncError **  error 
)

Tries to detect the encapsulated object type of the given change.

This will try to detect the encapsulated object type of the data on the change and return it, but not set it. This will try to detect the change, deencapsulate it, detect again etc until it cannot deencapsulate further.

Parameters:
env The conversion environment to use
change The change to detect
error The error-return location
Returns:
The objecttype on success, NULL otherwise

Definition at line 509 of file opensync_changecmds.c.

Referenced by _new_change_receiver().

OSyncObjFormat* osync_change_detect_objformat ( OSyncFormatEnv env,
OSyncChange change,
OSyncError **  error 
)

Tries to detect the format of the given change.

This will try to detect the format of the data on the change and return it, but not set it.

Parameters:
env The conversion environment to use
change The change to detect
error The error-return location
Returns:
The format on success, NULL otherwise

Definition at line 528 of file opensync_changecmds.c.

Referenced by osync_change_detect_objformat_full(), and osync_change_detect_objtype().

OSyncObjFormat* osync_change_detect_objformat_full ( OSyncFormatEnv env,
OSyncChange change,
OSyncError **  error 
)

Tries to detect the encapsulated format of the given change.

This will try to detect the encapsulated format of the data on the change and return it, but not set it. This will try to detect the change, deencapsulate it, detect again etc until it cannot deencapsulate further.

Parameters:
env The conversion environment to use
change The change to detect
error The error-return location
Returns:
The format on success, NULL otherwise

Definition at line 567 of file opensync_changecmds.c.

Referenced by osync_change_detect_objtype_full().


Generated on Wed Mar 25 15:20:46 2009 for OpenSync by  doxygen 1.5.8