OpenSync
0.22
|
The public API of the OSyncChange. More...
Enumerations | |
enum | OSyncChangeType { CHANGE_UNKNOWN = 0, CHANGE_ADDED = 1, CHANGE_UNMODIFIED = 2, CHANGE_DELETED = 3, CHANGE_MODIFIED = 4 } |
The changetypes of a change object. More... | |
Functions | |
OSyncChange * | osync_change_new (void) |
Spawns a new change object. More... | |
void | osync_change_free (OSyncChange *change) |
Frees a change. More... | |
void | osync_change_free_data (OSyncChange *change) |
Frees the data of a change. More... | |
void | osync_change_reset (OSyncChange *change) |
Resets a change. More... | |
osync_bool | osync_change_save (OSyncChange *change, osync_bool save_format, OSyncError **error) |
This will save a change into the database. More... | |
osync_bool | osync_change_delete (OSyncChange *change, OSyncError **error) |
This will delete a change from the database. More... | |
osync_bool | osync_changes_load (OSyncGroup *group, OSyncChange ***changes, OSyncError **error) |
This will load the changes from the database. More... | |
void | osync_changes_close (OSyncGroup *group) |
Closes the change database. More... | |
OSyncMember * | osync_change_get_member (OSyncChange *change) |
Gets the member which reported a change. More... | |
void | osync_change_set_member (OSyncChange *change, OSyncMember *member) |
Sets the member of a change. More... | |
void | osync_change_set_conv_env (OSyncChange *change, OSyncFormatEnv *env) |
Sets the conversion environment of a change. More... | |
OSyncObjType * | osync_change_get_objtype (OSyncChange *change) |
Gets the object type of a change. More... | |
void | osync_change_set_objtype (OSyncChange *change, OSyncObjType *type) |
Sets the object type of a change. More... | |
void | osync_change_set_objtype_string (OSyncChange *change, const char *name) |
Sets the object type of a change from the name. More... | |
OSyncObjFormat * | osync_change_get_objformat (OSyncChange *change) |
Gets the object format of a change. More... | |
void | osync_change_set_objformat (OSyncChange *change, OSyncObjFormat *objformat) |
Sets the object format of a change. More... | |
void | osync_change_set_objformat_string (OSyncChange *change, const char *name) |
Sets the object format of a change from the name. More... | |
OSyncChangeType | osync_change_get_changetype (OSyncChange *change) |
Gets the changetype of a change. More... | |
void | osync_change_set_changetype (OSyncChange *change, OSyncChangeType type) |
Sets the changetype of a change. More... | |
void | osync_change_set_hash (OSyncChange *change, const char *hash) |
Sets the hash of a change that is used to decide wether a change is new, modifed etc. More... | |
const char * | osync_change_get_hash (OSyncChange *change) |
Gets the hash of a change. More... | |
void | osync_change_set_uid (OSyncChange *change, const char *uid) |
Sets the uid of a change. More... | |
const char * | osync_change_get_uid (OSyncChange *change) |
Gets the uid of a change. More... | |
void | osync_change_set_data (OSyncChange *change, char *data, int size, osync_bool has_data) |
Sets the data of a change. More... | |
osync_bool | osync_change_has_data (OSyncChange *change) |
Returns wether the complete data already has been set. More... | |
char * | osync_change_get_data (OSyncChange *change) |
Gets the data of a change. More... | |
int | osync_change_get_datasize (OSyncChange *change) |
Gets the size of the data of a change. More... | |
long long int | osync_change_get_mappingid (OSyncChange *change) |
Gets the mappingid of a change. More... | |
void | osync_change_set_mappingid (OSyncChange *change, long long int mappingid) |
Sets the mappingid of a change. More... | |
void * | osync_change_get_engine_data (OSyncChange *change) |
Gets data that can be used privately by the engine. More... | |
void | osync_change_set_engine_data (OSyncChange *change, void *engine_data) |
Sets the data of the engine. More... | |
long long int | osync_change_get_id (OSyncChange *change) |
Gets the id of the change which is always unique. More... | |
void | osync_change_update (OSyncChange *source, OSyncChange *target) |
Updated one change from another change. More... | |
The public API of the OSyncChange.
enum OSyncChangeType |
The changetypes of a change object.
Enumerator | |
---|---|
CHANGE_UNKNOWN |
Unknown changetype |
CHANGE_ADDED |
Object was added |
CHANGE_UNMODIFIED |
Object is unmodifed |
CHANGE_DELETED |
Object is deleted |
CHANGE_MODIFIED |
Object has been modified |
Definition at line 28 of file opensync.h.
OSyncChange* osync_change_new | ( | void | ) |
Spawns a new change object.
Definition at line 99 of file opensync_change.c.
Referenced by osync_change_copy(), osync_hashtable_report_deleted(), and osync_member_add_random_data().
void osync_change_free | ( | OSyncChange * | change | ) |
Frees a change.
change | The change to free |
Definition at line 115 of file opensync_change.c.
Referenced by compare_vertice_distance(), osync_change_copy(), and osync_change_decref().
void osync_change_free_data | ( | OSyncChange * | change | ) |
Frees the data of a change.
This frees the data of a change but does not free the change itself
change | The change of which to free the data |
Definition at line 134 of file opensync_change.c.
Referenced by compare_vertice_distance(), and osync_change_copy_data().
void osync_change_reset | ( | OSyncChange * | change | ) |
Resets a change.
Resets the information about changetype, hash, data etc.
change | The change to reset |
Definition at line 156 of file opensync_change.c.
osync_bool osync_change_save | ( | OSyncChange * | change, |
osync_bool | save_format, | ||
OSyncError ** | error | ||
) |
This will save a change into the database.
change | The change to save |
save_format | Wether to save the format or not. |
error | A pointer to a error struct |
Definition at line 182 of file opensync_change.c.
Referenced by _new_change_receiver(), and osengine_mapping_duplicate().
osync_bool osync_change_delete | ( | OSyncChange * | change, |
OSyncError ** | error | ||
) |
This will delete a change from the database.
change | The change to delete |
error | A pointer to a error struct |
Definition at line 196 of file opensync_change.c.
Referenced by osengine_mapping_duplicate().
osync_bool osync_changes_load | ( | OSyncGroup * | group, |
OSyncChange *** | changes, | ||
OSyncError ** | error | ||
) |
This will load the changes from the database.
This opens the change database and returns an array with the changes. The changes have to be freed later. The database has to be closed with a call to osync_changes_close()
group | The group for which to load the changes |
changes | An pointer to an array in which to store the changes |
error | A pointer to a error struct |
Definition at line 213 of file opensync_change.c.
void osync_changes_close | ( | OSyncGroup * | group | ) |
Closes the change database.
group | The group for which to close the database |
Definition at line 223 of file opensync_change.c.
OSyncMember* osync_change_get_member | ( | OSyncChange * | change | ) |
Gets the member which reported a change.
change | The change |
Definition at line 234 of file opensync_change.c.
Referenced by osengine_mapping_ignore_supported().
void osync_change_set_member | ( | OSyncChange * | change, |
OSyncMember * | member | ||
) |
Sets the member of a change.
change | The change |
member | The member of the change |
Definition at line 246 of file opensync_change.c.
Referenced by _new_change_receiver().
void osync_change_set_conv_env | ( | OSyncChange * | change, |
OSyncFormatEnv * | env | ||
) |
Sets the conversion environment of a change.
change | The change |
env | The conversion environment |
Definition at line 259 of file opensync_change.c.
OSyncObjType* osync_change_get_objtype | ( | OSyncChange * | change | ) |
Gets the object type of a change.
change | The change |
Definition at line 271 of file opensync_change.c.
Referenced by _new_change_receiver(), osengine_mapping_ignore_supported(), osync_change_compare_data(), osync_change_convert_to_common(), osync_change_copy(), osync_change_update(), osync_hashtable_detect_change(), osync_hashtable_get_hash(), osync_hashtable_update_hash(), osync_member_commit_change(), osync_member_delete_data(), and osync_member_modify_random_data().
void osync_change_set_objtype | ( | OSyncChange * | change, |
OSyncObjType * | type | ||
) |
Sets the object type of a change.
change | The change |
type | The object type |
Definition at line 297 of file opensync_change.c.
Referenced by _new_change_receiver(), and osync_member_make_random_data().
void osync_change_set_objtype_string | ( | OSyncChange * | change, |
const char * | name | ||
) |
Sets the object type of a change from the name.
change | The change |
name | The object type name |
Definition at line 309 of file opensync_change.c.
Referenced by osync_hashtable_report_deleted().
OSyncObjFormat* osync_change_get_objformat | ( | OSyncChange * | change | ) |
Gets the object format of a change.
change | The change |
Definition at line 329 of file opensync_change.c.
Referenced by _new_change_receiver(), get_next_vertice_neighbour(), osync_change_compare_data(), osync_change_convert_to_common(), osync_change_copy(), osync_change_detect_objformat(), osync_change_detect_objformat_full(), osync_change_duplicate(), osync_change_free_data(), osync_change_get_objtype(), osync_change_get_printable(), osync_change_get_revision(), osync_change_update(), osync_member_commit_change(), osync_member_delete_data(), and osync_member_read_change().
void osync_change_set_objformat | ( | OSyncChange * | change, |
OSyncObjFormat * | objformat | ||
) |
Sets the object format of a change.
change | The change |
objformat | The object format |
Definition at line 357 of file opensync_change.c.
Referenced by osync_member_make_random_data().
void osync_change_set_objformat_string | ( | OSyncChange * | change, |
const char * | name | ||
) |
Sets the object format of a change from the name.
change | The change |
name | The object format name |
Definition at line 373 of file opensync_change.c.
OSyncChangeType osync_change_get_changetype | ( | OSyncChange * | change | ) |
Gets the changetype of a change.
change | The change |
Definition at line 393 of file opensync_change.c.
Referenced by _new_change_receiver(), osengine_mapping_check_timestamps(), osengine_mapping_duplicate(), osengine_mapping_ignore_conflict(), osengine_mapping_solve_latest(), and osync_hashtable_update_hash().
void osync_change_set_changetype | ( | OSyncChange * | change, |
OSyncChangeType | type | ||
) |
Sets the changetype of a change.
change | The change |
type | The changetype to set |
Definition at line 407 of file opensync_change.c.
Referenced by _new_change_receiver(), and osengine_mapping_duplicate().
void osync_change_set_hash | ( | OSyncChange * | change, |
const char * | hash | ||
) |
Sets the hash of a change that is used to decide wether a change is new, modifed etc.
change | The change |
hash | The hash to set |
Definition at line 419 of file opensync_change.c.
Referenced by osync_hashtable_get_hash().
const char* osync_change_get_hash | ( | OSyncChange * | change | ) |
Gets the hash of a change.
change | The change |
Definition at line 433 of file opensync_change.c.
void osync_change_set_uid | ( | OSyncChange * | change, |
const char * | uid | ||
) |
Sets the uid of a change.
change | The change |
uid | The uid to set |
Definition at line 445 of file opensync_change.c.
Referenced by osync_hashtable_report_deleted(), and osync_member_modify_random_data().
const char* osync_change_get_uid | ( | OSyncChange * | change | ) |
Gets the uid of a change.
change | The change |
Definition at line 459 of file opensync_change.c.
Referenced by _new_change_receiver(), and osync_member_modify_random_data().
void osync_change_set_data | ( | OSyncChange * | change, |
char * | data, | ||
int | size, | ||
osync_bool | has_data | ||
) |
Sets the data of a change.
change | The change |
data | The data to set |
size | The size of the data to set |
has_data | Set this to TRUE of this already is the complete data |
Definition at line 473 of file opensync_change.c.
osync_bool osync_change_has_data | ( | OSyncChange * | change | ) |
Returns wether the complete data already has been set.
change | The change |
Definition at line 486 of file opensync_change.c.
Referenced by _new_change_receiver().
char* osync_change_get_data | ( | OSyncChange * | change | ) |
Gets the data of a change.
change | The change |
Definition at line 498 of file opensync_change.c.
Referenced by _new_change_receiver().
int osync_change_get_datasize | ( | OSyncChange * | change | ) |
Gets the size of the data of a change.
change | The change |
Definition at line 510 of file opensync_change.c.
Referenced by _new_change_receiver().
long long int osync_change_get_mappingid | ( | OSyncChange * | change | ) |
Gets the mappingid of a change.
change | The change |
Definition at line 522 of file opensync_change.c.
void osync_change_set_mappingid | ( | OSyncChange * | change, |
long long int | mappingid | ||
) |
Sets the mappingid of a change.
change | The change |
mappingid | The mappingid to set |
Definition at line 534 of file opensync_change.c.
void* osync_change_get_engine_data | ( | OSyncChange * | change | ) |
Gets data that can be used privately by the engine.
change | The change |
Definition at line 546 of file opensync_change.c.
void osync_change_set_engine_data | ( | OSyncChange * | change, |
void * | engine_data | ||
) |
Sets the data of the engine.
change | The change |
engine_data | The data |
Definition at line 558 of file opensync_change.c.
long long int osync_change_get_id | ( | OSyncChange * | change | ) |
Gets the id of the change which is always unique.
change | The change |
Definition at line 570 of file opensync_change.c.
void osync_change_update | ( | OSyncChange * | source, |
OSyncChange * | target | ||
) |
Updated one change from another change.
This function can be used to "merge" the information from 2 changes into one. The uid, hash, data of the target change are overwriten by those of the source change if they are not set already on the target. The data of the source change is copied.
source | The source change |
target | The target change |
Definition at line 587 of file opensync_change.c.