OpenSync
0.22
|
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. More... | |
time_t | osync_change_get_revision (OSyncChange *change, OSyncError **error) |
Returns the revision of the object. More... | |
OSyncConvCmpResult | osync_change_compare_data (OSyncChange *leftchange, OSyncChange *rightchange) |
Compares the data of 2 changes. More... | |
OSyncConvCmpResult | osync_change_compare (OSyncChange *leftchange, OSyncChange *rightchange) |
Compares 2 changes. More... | |
osync_bool | osync_change_copy_data (OSyncChange *source, OSyncChange *target, OSyncError **error) |
Copies the data from one change to another change. More... | |
OSyncChange * | osync_change_copy (OSyncChange *source, OSyncError **error) |
Makes a exact copy of change. More... | |
osync_bool | osync_change_duplicate (OSyncChange *change) |
Duplicates the uid of the change. More... | |
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. More... | |
osync_bool | osync_change_convert (OSyncFormatEnv *env, OSyncChange *change, OSyncObjFormat *targetformat, OSyncError **error) |
Convert a change to a specific format. More... | |
osync_bool | osync_change_convert_to_common (OSyncChange *change, OSyncError **error) |
Convert a change to the specified common format. More... | |
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. More... | |
osync_bool | osync_change_convert_fmtnames (OSyncFormatEnv *env, OSyncChange *change, const char **targetnames, OSyncError **error) |
Convert a change to some formats. More... | |
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. More... | |
OSyncObjType * | osync_change_detect_objtype (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error) |
Tries to detect the object type of the given change. More... | |
OSyncObjType * | osync_change_detect_objtype_full (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error) |
Tries to detect the encapsulated object type of the given change. More... | |
OSyncObjFormat * | osync_change_detect_objformat (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error) |
Tries to detect the format of the given change. More... | |
OSyncObjFormat * | osync_change_detect_objformat_full (OSyncFormatEnv *env, OSyncChange *change, OSyncError **error) |
Tries to detect the encapsulated format of the given change. More... | |
High level functions to manipulate changes.
enum OSyncConvCmpResult |
The possible returns of a change comparison.
Definition at line 16 of file opensync_convert.h.
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.
change | The change to get printable |
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.
change | The change to get the revision from |
error | A error struct |
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
leftchange | The left change to compare |
rightchange | The right change to compare |
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()
leftchange | The left change to compare |
rightchange | The right change to compare |
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.
source | The change to copy from |
target | The change to copy to |
error | A error struct |
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.
source | The change to copy from |
error | A error struct |
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.
change | The change to duplicate |
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.
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 |
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.
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 |
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.
change | The change to convert |
error | The error-return location |
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.
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 |
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.
env | The conversion environment to use |
change | The change to convert |
targetnames | NULL-Terminated array of formatnames |
error | The error-return location |
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.
env | The conversion environment to use |
change | The change to convert |
member | The member that will receive the change |
error | The error-return location |
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.
env | The conversion environment to use |
change | The change to detect |
error | The error-return location |
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.
env | The conversion environment to use |
change | The change to detect |
error | The error-return location |
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.
env | The conversion environment to use |
change | The change to detect |
error | The error-return location |
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.
env | The conversion environment to use |
change | The change to detect |
error | The error-return location |
Definition at line 567 of file opensync_changecmds.c.
Referenced by osync_change_detect_objtype_full().