| opensync.h | | opensync.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| #define OPENSYNC_END_DECLS | | #define OPENSYNC_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #include <windows.h> | | #include <windows.h> | |
| #include <process.h> | | #include <process.h> | |
| #define __func__ __FUNCTION__ | | #define __func__ __FUNCTION__ | |
| #define OSYNC_EXPORT __declspec(dllexport) | | #define OSYNC_EXPORT __declspec(dllexport) | |
| | | | |
|
| #elif __GNUC__ | | #elif defined(__GNUC__) | |
| #include <unistd.h> | | #include <unistd.h> | |
| #define OSYNC_EXPORT __attribute__ ((visibility("default"))) | | #define OSYNC_EXPORT __attribute__ ((visibility("default"))) | |
| | | | |
|
| #elif __sun | | #elif defined(__sun) | |
| #include <unistd.h> | | #include <unistd.h> | |
| #define OSYNC_EXPORT __global | | #define OSYNC_EXPORT __global | |
| | | | |
| #else | | #else | |
| #define OSYNC_EXPORT | | #define OSYNC_EXPORT | |
| #endif | | #endif | |
| | | | |
| /* Some symbols are only exported in the opensync */ | | /* Some symbols are only exported in the opensync */ | |
| /* testing library */ | | /* testing library */ | |
| /* opensync_testing_EXPORTS is defined from CMAKE */ | | /* opensync_testing_EXPORTS is defined from CMAKE */ | |
| /* when the build target is the testing library */ | | /* when the build target is the testing library */ | |
| #ifdef opensync_testing_EXPORTS | | #ifdef opensync_testing_EXPORTS | |
| #define OSYNC_TEST_EXPORT OSYNC_EXPORT | | #define OSYNC_TEST_EXPORT OSYNC_EXPORT | |
| #else | | #else | |
| #define OSYNC_TEST_EXPORT | | #define OSYNC_TEST_EXPORT | |
| #endif | | #endif | |
| | | | |
|
| | | /* Mark function as depercated for a more stable API | |
| | | * (Copied from libsyncml) | |
| | | */ | |
| | | #if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2) | |
| | | /* gcc >= 3.2 */ | |
| | | # define OSYNC_DEPRECATED __attribute__ ((deprecated)) | |
| | | #elif defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER < 1400) | |
| | | /* msvc >= 7 */ | |
| | | # define OSYNC_DEPRECATED __declspec(deprecated) | |
| | | #elif defined(_MSV_VER) && (_MSC_VER >= 1400) | |
| | | /* MS Visual Studio 2005 */ | |
| | | # define OSYNC_DEPRECATED | |
| | | #else | |
| | | # define OSYNC_DEPRECATED | |
| | | #endif | |
| | | | |
| | | #if __GNUC__ | |
| | | #define GCC_FORMAT_CHECK(a,b) __attribute__ ((format(printf, a, b))) | |
| | | #else | |
| | | #define GCC_FORMAT_CHECK(a,b) | |
| | | #endif | |
| | | | |
| OPENSYNC_BEGIN_DECLS | | OPENSYNC_BEGIN_DECLS | |
| | | | |
| /** | | /** | |
| * @defgroup OSyncPrivate OpenSync Private API | | * @defgroup OSyncPrivate OpenSync Private API | |
| * @defgroup OSyncPublic OpenSync Public API | | * @defgroup OSyncPublic OpenSync Public API | |
| */ | | */ | |
| | | | |
| /************************************************************** | | /************************************************************** | |
| * Versions | | * Versions | |
| *************************************************************/ | | *************************************************************/ | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 148 | |
| return; \ | | return; \ | |
| } } while (0) | | } } while (0) | |
| | | | |
| #define osync_return_val_if_fail(condition, val) do { \ | | #define osync_return_val_if_fail(condition, val) do { \ | |
| if (!(condition)) { \ | | if (!(condition)) { \ | |
| return (val); \ | | return (val); \ | |
| } } while (0) | | } } while (0) | |
| | | | |
| #define osync_return_if_fail_and_set_error(condition, error, errortype, for
mat, ...) do { \ | | #define osync_return_if_fail_and_set_error(condition, error, errortype, for
mat, ...) do { \ | |
| if (!(condition)) {
\ | | if (!(condition)) {
\ | |
|
| osync_error_set(error, errortype, format,## __VA_ARGS__, NULL );
\ | | osync_error_set(error, errortype, format,## __VA_ARGS__);
\ | |
| return;
\ | | return;
\ | |
| } } while(0) | | } } while(0) | |
| | | | |
| #define osync_return_val_if_fail_and_set_error(condition, val, error, error
type, format, ...) do { \ | | #define osync_return_val_if_fail_and_set_error(condition, val, error, error
type, format, ...) do { \ | |
| if (!(condition)) {
\ | | if (!(condition)) {
\ | |
|
| osync_error_set(error, errortype, format,## __VA_ARGS__, NULL );
\ | | osync_error_set(error, errortype, format,## __VA_ARGS__);
\ | |
| return (val);
\ | | return (val);
\ | |
| } } while(0) | | } } while(0) | |
| | | | |
| typedef int osync_bool; | | typedef int osync_bool; | |
|
| | | typedef int osync_memberid; | |
| | | typedef int osync_mappingid; | |
| | | typedef int osync_groupid; | |
| | | typedef long long int osync_archiveid; | |
| | | typedef long long int osync_messageid; | |
| | | | |
| /************************************************************** | | /************************************************************** | |
| * Enums | | * Enums | |
| *************************************************************/ | | *************************************************************/ | |
| | | | |
|
| | | /*! @ingroup OSyncPlugin | |
| | | * @brief The possible start types of a plugin or client proxy | |
| | | * | |
| | | * Determines how the sync process is to be run. | |
| | | */ | |
| typedef enum { | | typedef enum { | |
|
| | | /** The start type is unknown (has not been set) */ | |
| OSYNC_START_TYPE_UNKNOWN, | | OSYNC_START_TYPE_UNKNOWN, | |
|
| | | /** Start as child process */ | |
| OSYNC_START_TYPE_PROCESS, | | OSYNC_START_TYPE_PROCESS, | |
|
| | | /** Start in a separate thread */ | |
| OSYNC_START_TYPE_THREAD, | | OSYNC_START_TYPE_THREAD, | |
|
| | | /** Start as a separate external process */ | |
| OSYNC_START_TYPE_EXTERNAL | | OSYNC_START_TYPE_EXTERNAL | |
| } OSyncStartType; | | } OSyncStartType; | |
| | | | |
| /*! @ingroup OSyncChangeCmds | | /*! @ingroup OSyncChangeCmds | |
| * @brief The possible returns of a change comparison | | * @brief The possible returns of a change comparison | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
|
| /** The result is unknown, there was a error */ | | /** The result is unknown, there was an error */ | |
| OSYNC_CONV_DATA_UNKNOWN = 0, | | OSYNC_CONV_DATA_UNKNOWN = 0, | |
| /** The changes are not the same */ | | /** The changes are not the same */ | |
| OSYNC_CONV_DATA_MISMATCH = 1, | | OSYNC_CONV_DATA_MISMATCH = 1, | |
|
| /** The changs are not the same but look similar */ | | /** The changes are not the same but look similar */ | |
| OSYNC_CONV_DATA_SIMILAR = 2, | | OSYNC_CONV_DATA_SIMILAR = 2, | |
| /** The changes are exactly the same */ | | /** The changes are exactly the same */ | |
| OSYNC_CONV_DATA_SAME = 3 | | OSYNC_CONV_DATA_SAME = 3 | |
| } OSyncConvCmpResult; | | } OSyncConvCmpResult; | |
| | | | |
| /*! | | /*! | |
| * @ingroup OSyncChange | | * @ingroup OSyncChange | |
| * @brief The changetypes of a change object */ | | * @brief The changetypes of a change object */ | |
| typedef enum { | | typedef enum { | |
| /** Unknown changetype */ | | /** Unknown changetype */ | |
| | | | |
| skipping to change at line 215 | | skipping to change at line 251 | |
| typedef struct OSyncPluginInfo OSyncPluginInfo; | | typedef struct OSyncPluginInfo OSyncPluginInfo; | |
| typedef struct OSyncPluginEnv OSyncPluginEnv; | | typedef struct OSyncPluginEnv OSyncPluginEnv; | |
| typedef struct OSyncObjTypeSink OSyncObjTypeSink; | | typedef struct OSyncObjTypeSink OSyncObjTypeSink; | |
| typedef struct OSyncPluginConfig OSyncPluginConfig; | | typedef struct OSyncPluginConfig OSyncPluginConfig; | |
| typedef struct OSyncPluginAuthentication OSyncPluginAuthentication; | | typedef struct OSyncPluginAuthentication OSyncPluginAuthentication; | |
| typedef struct OSyncPluginAdvancedOption OSyncPluginAdvancedOption; | | typedef struct OSyncPluginAdvancedOption OSyncPluginAdvancedOption; | |
| typedef struct OSyncPluginAdvancedOptionParameter OSyncPluginAdvancedOption
Parameter; | | typedef struct OSyncPluginAdvancedOptionParameter OSyncPluginAdvancedOption
Parameter; | |
| typedef struct OSyncPluginConnection OSyncPluginConnection; | | typedef struct OSyncPluginConnection OSyncPluginConnection; | |
| typedef struct OSyncPluginLocalization OSyncPluginLocalization; | | typedef struct OSyncPluginLocalization OSyncPluginLocalization; | |
| typedef struct OSyncPluginResource OSyncPluginResource; | | typedef struct OSyncPluginResource OSyncPluginResource; | |
|
| | | typedef struct OSyncPluginExternalPlugin OSyncPluginExternalPlugin; | |
| | | | |
| /* Engine component */ | | /* Engine component */ | |
| typedef struct OSyncEngine OSyncEngine; | | typedef struct OSyncEngine OSyncEngine; | |
| typedef struct OSyncObjEngine OSyncObjEngine; | | typedef struct OSyncObjEngine OSyncObjEngine; | |
| typedef struct OSyncSinkEngine OSyncSinkEngine; | | typedef struct OSyncSinkEngine OSyncSinkEngine; | |
| typedef struct OSyncMappingEntryEngine OSyncMappingEntryEngine; | | typedef struct OSyncMappingEntryEngine OSyncMappingEntryEngine; | |
| typedef struct OSyncMappingEngine OSyncMappingEngine; | | typedef struct OSyncMappingEngine OSyncMappingEngine; | |
| | | | |
| typedef struct OSyncEngineMemberUpdate OSyncEngineMemberUpdate; | | typedef struct OSyncEngineMemberUpdate OSyncEngineMemberUpdate; | |
| typedef struct OSyncEngineChangeUpdate OSyncEngineChangeUpdate; | | typedef struct OSyncEngineChangeUpdate OSyncEngineChangeUpdate; | |
| | | | |
End of changes. 14 change blocks. |
| 6 lines changed or deleted | | 43 lines changed or added | |
|
| opensync_capability.h | | opensync_capability.h | |
| | | | |
| skipping to change at line 149 | | skipping to change at line 149 | |
| * @param capability The pointer to a capability object | | * @param capability The pointer to a capability object | |
| * @param min The min lenth/size of the capability value | | * @param min The min lenth/size of the capability value | |
| */ | | */ | |
| OSYNC_EXPORT void osync_capability_set_min(OSyncCapability *capability, uns
igned int min); | | OSYNC_EXPORT void osync_capability_set_min(OSyncCapability *capability, uns
igned int min); | |
| | | | |
| /** | | /** | |
| * @brief Get capability parameter of this capability object | | * @brief Get capability parameter of this capability object | |
| * @param capability The pointer to a capability object | | * @param capability The pointer to a capability object | |
| * @return Pointer to the capability parameter of this capability object | | * @return Pointer to the capability parameter of this capability object | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncCapabilityParameter *osync_capability_get_parameter(OSync
Capability *capability); | | OSYNC_EXPORT OSyncCapabilityParameter *osync_capability_get_parameter(OSync
Capability *capability) OSYNC_DEPRECATED; | |
| | | | |
| /** | | /** | |
| * @brief Set the capability parameter of the capability object | | * @brief Set the capability parameter of the capability object | |
| * @param capability The pointer to a capability object | | * @param capability The pointer to a capability object | |
| * @param parameter the parameter to set for the capability object | | * @param parameter the parameter to set for the capability object | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_capability_set_parameter(OSyncCapability *capabilit | | OSYNC_EXPORT void osync_capability_set_parameter(OSyncCapability *capabilit | |
| y, OSyncCapabilityParameter *parameter); | | y, OSyncCapabilityParameter *parameter) OSYNC_DEPRECATED; | |
| | | | |
| | | /** | |
| | | * @brief Add a capability parameter to the capability object | |
| | | * @param capability The pointer to a capability object | |
| | | * @param parameter the parameter to add to the capability object | |
| | | */ | |
| | | OSYNC_EXPORT void osync_capability_add_parameter(OSyncCapability *capabilit | |
| | | y, OSyncCapabilityParameter *parameter); | |
| | | | |
| /** | | /** | |
| * @brief Get capability type of this capability object | | * @brief Get capability type of this capability object | |
| * @param capability The pointer to a capability object | | * @param capability The pointer to a capability object | |
| * @return Type of this capability | | * @return Type of this capability | |
| */ | | */ | |
| OSYNC_EXPORT OSyncCapabilityType osync_capability_get_type(OSyncCapability
*capability); | | OSYNC_EXPORT OSyncCapabilityType osync_capability_get_type(OSyncCapability
*capability); | |
| | | | |
| /** | | /** | |
| * @brief Set capability type for capability object | | * @brief Set capability type for capability object | |
| | | | |
End of changes. 2 change blocks. |
| 3 lines changed or deleted | | 11 lines changed or added | |
|
| opensync_client.h | | opensync_client.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| #ifndef OPENSYNC_CLIENT_H_ | | #ifndef OPENSYNC_CLIENT_H_ | |
| #define OPENSYNC_CLIENT_H_ | | #define OPENSYNC_CLIENT_H_ | |
| | | | |
| OSYNC_EXPORT OSyncClient *osync_client_new(OSyncError **error); | | OSYNC_EXPORT OSyncClient *osync_client_new(OSyncError **error); | |
| OSYNC_EXPORT OSyncClient *osync_client_ref(OSyncClient *client); | | OSYNC_EXPORT OSyncClient *osync_client_ref(OSyncClient *client); | |
| OSYNC_EXPORT void osync_client_unref(OSyncClient *client); | | OSYNC_EXPORT void osync_client_unref(OSyncClient *client); | |
| | | | |
| OSYNC_EXPORT osync_bool osync_client_set_incoming_queue(OSyncClient *client
, OSyncQueue *incoming, OSyncError **error); | | OSYNC_EXPORT osync_bool osync_client_set_incoming_queue(OSyncClient *client
, OSyncQueue *incoming, OSyncError **error); | |
| OSYNC_EXPORT osync_bool osync_client_set_outgoing_queue(OSyncClient *client
, OSyncQueue *outgoing, OSyncError **error); | | OSYNC_EXPORT osync_bool osync_client_set_outgoing_queue(OSyncClient *client
, OSyncQueue *outgoing, OSyncError **error); | |
| | | | |
|
| OSYNC_EXPORT void osync_client_run_and_block(OSyncClient *client); | | OSYNC_EXPORT void osync_client_set_plugin(OSyncClient *client, OSyncPlugin | |
| | | *plugin); | |
| | | OSYNC_EXPORT OSyncPlugin *osync_client_get_plugin(OSyncClient *client); | |
| | | | |
| | | OSYNC_EXPORT void osync_client_set_pipe_path(OSyncClient *client, const cha | |
| | | r *pipe_path); | |
| | | OSYNC_EXPORT const char *osync_client_get_pipe_path(OSyncClient *client); | |
| | | | |
| | | OSYNC_EXPORT osync_bool osync_client_run_and_block(OSyncClient *client, OSy | |
| | | ncError **error); | |
| OSYNC_EXPORT osync_bool osync_client_run(OSyncClient *client, OSyncError **
error); | | OSYNC_EXPORT osync_bool osync_client_run(OSyncClient *client, OSyncError **
error); | |
| | | | |
| #endif /*OPENSYNC_CLIENT_H_*/ | | #endif /*OPENSYNC_CLIENT_H_*/ | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 10 lines changed or added | |
|
| opensync_context.h | | opensync_context.h | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| | | | |
| OSYNC_EXPORT OSyncContext *osync_context_new(OSyncError **error); | | OSYNC_EXPORT OSyncContext *osync_context_new(OSyncError **error); | |
| OSYNC_EXPORT OSyncContext *osync_context_ref(OSyncContext *context); | | OSYNC_EXPORT OSyncContext *osync_context_ref(OSyncContext *context); | |
| OSYNC_EXPORT void osync_context_unref(OSyncContext *context); | | OSYNC_EXPORT void osync_context_unref(OSyncContext *context); | |
| | | | |
| OSYNC_EXPORT void osync_context_set_callback(OSyncContext *context, OSyncCo
ntextCallbackFn callback, void *userdata); | | OSYNC_EXPORT void osync_context_set_callback(OSyncContext *context, OSyncCo
ntextCallbackFn callback, void *userdata); | |
| OSYNC_EXPORT void osync_context_set_changes_callback(OSyncContext *context,
OSyncContextChangeFn changes); | | OSYNC_EXPORT void osync_context_set_changes_callback(OSyncContext *context,
OSyncContextChangeFn changes); | |
| OSYNC_EXPORT void osync_context_set_slowsync_callback(OSyncContext *context
, OSyncContextSlowSyncFn slowsync_func, void *userdata); | | OSYNC_EXPORT void osync_context_set_slowsync_callback(OSyncContext *context
, OSyncContextSlowSyncFn slowsync_func, void *userdata); | |
| OSYNC_EXPORT void osync_context_set_warning_callback(OSyncContext *context,
OSyncContextCallbackFn warning); | | OSYNC_EXPORT void osync_context_set_warning_callback(OSyncContext *context,
OSyncContextCallbackFn warning); | |
| | | | |
|
| OSYNC_EXPORT void osync_context_report_error(OSyncContext *context, OSyncEr
rorType type, const char *format, ...); | | OSYNC_EXPORT void osync_context_report_error(OSyncContext *context, OSyncEr
rorType type, const char *format, ...) GCC_FORMAT_CHECK(3, 4); | |
| OSYNC_EXPORT void osync_context_report_success(OSyncContext *context); | | OSYNC_EXPORT void osync_context_report_success(OSyncContext *context); | |
| OSYNC_EXPORT void osync_context_report_osyncerror(OSyncContext *context, OS
yncError *error); | | OSYNC_EXPORT void osync_context_report_osyncerror(OSyncContext *context, OS
yncError *error); | |
| | | | |
| OSYNC_EXPORT void osync_context_report_osyncwarning(OSyncContext *context,
OSyncError *error); | | OSYNC_EXPORT void osync_context_report_osyncwarning(OSyncContext *context,
OSyncError *error); | |
| OSYNC_EXPORT void osync_context_report_change(OSyncContext *context, OSyncC
hange *change); | | OSYNC_EXPORT void osync_context_report_change(OSyncContext *context, OSyncC
hange *change); | |
| OSYNC_EXPORT void osync_context_report_slowsync(OSyncContext *contextr); | | OSYNC_EXPORT void osync_context_report_slowsync(OSyncContext *contextr); | |
|
| | | OSYNC_EXPORT void osync_context_report_uid_update(OSyncContext *ctx, const
char *olduid, const char *newuid); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| OPENSYNC_END_DECLS | | OPENSYNC_END_DECLS | |
| | | | |
| #endif //_OPENSYNC_CONTEXT_H | | #endif //_OPENSYNC_CONTEXT_H | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|
| opensync_group.h | | opensync_group.h | |
| | | | |
| skipping to change at line 191 | | skipping to change at line 191 | |
| */ | | */ | |
| OSYNC_EXPORT void osync_group_remove_member(OSyncGroup *group, OSyncMember
*member); | | OSYNC_EXPORT void osync_group_remove_member(OSyncGroup *group, OSyncMember
*member); | |
| | | | |
| /** @brief Searches for a member by its id | | /** @brief Searches for a member by its id | |
| * | | * | |
| * @param group The group in which to search | | * @param group The group in which to search | |
| * @param id The id of the member | | * @param id The id of the member | |
| * @returns The member, or NULL if not found | | * @returns The member, or NULL if not found | |
| * | | * | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncMember *osync_group_find_member(OSyncGroup *group, long l
ong int id); | | OSYNC_EXPORT OSyncMember *osync_group_find_member(OSyncGroup *group, osync_
memberid id); | |
| | | | |
| /** | | /** | |
| * @brief Returns a OSyncList that contains the OSyncMembers of this group | | * @brief Returns a OSyncList that contains the OSyncMembers of this group | |
| * | | * | |
| * Please be aware that the returned list has to be freed with | | * Please be aware that the returned list has to be freed with | |
| * osync_list_free. If it isn't freed there will be a memory leak. | | * osync_list_free. If it isn't freed there will be a memory leak. | |
| * | | * | |
| * @param group A pointer to a OSyncGroup | | * @param group A pointer to a OSyncGroup | |
| * @return A shallow copy of the internal list of OSyncMembers | | * @return A shallow copy of the internal list of OSyncMembers | |
| */ | | */ | |
| | | | |
| skipping to change at line 268 | | skipping to change at line 268 | |
| */ | | */ | |
| OSYNC_EXPORT time_t osync_group_get_last_synchronization(OSyncGroup *group)
; | | OSYNC_EXPORT time_t osync_group_get_last_synchronization(OSyncGroup *group)
; | |
| | | | |
| /** @brief Set fixed conflict resolution for the group for all appearing co
nflicts | | /** @brief Set fixed conflict resolution for the group for all appearing co
nflicts | |
| * | | * | |
| * @param group The group | | * @param group The group | |
| * @param res The conflict resolution | | * @param res The conflict resolution | |
| * @param winner The Member ID which solves the conflict (winner) | | * @param winner The Member ID which solves the conflict (winner) | |
| * | | * | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_group_set_conflict_resolution(OSyncGroup *group, OS
yncConflictResolution res, long long int winner); | | OSYNC_EXPORT void osync_group_set_conflict_resolution(OSyncGroup *group, OS
yncConflictResolution res, osync_memberid winner); | |
| | | | |
| /** @brief Get fixed conflict resolution for the group for all appearing co
nflicts | | /** @brief Get fixed conflict resolution for the group for all appearing co
nflicts | |
| * | | * | |
| * @param group The group | | * @param group The group | |
| * @param res Pointer to set conflict resolution value | | * @param res Pointer to set conflict resolution value | |
| * @param winner Pointer to set Member ID value which solves the conflict (
winner) | | * @param winner Pointer to set Member ID value which solves the conflict (
winner) | |
| * | | * | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_group_get_conflict_resolution(OSyncGroup *group, OS
yncConflictResolution *res, long long int *winner); | | OSYNC_EXPORT void osync_group_get_conflict_resolution(OSyncGroup *group, OS
yncConflictResolution *res, osync_memberid *winner); | |
| | | | |
| /** @brief Get group configured status of merger use. | | /** @brief Get group configured status of merger use. | |
| * | | * | |
| * @param group The group | | * @param group The group | |
| * @return TRUE if merger is enabled. FALSE if merger is disabled. | | * @return TRUE if merger is enabled. FALSE if merger is disabled. | |
| */ | | */ | |
| OSYNC_EXPORT osync_bool osync_group_get_merger_enabled(OSyncGroup *group); | | OSYNC_EXPORT osync_bool osync_group_get_merger_enabled(OSyncGroup *group); | |
| | | | |
| /** @brief Configure status of merger use. | | /** @brief Configure status of merger use. | |
| * | | * | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| opensync_mapping.h | | opensync_mapping.h | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| * be freed if the reference count reaches zero. | | * be freed if the reference count reaches zero. | |
| * @param mapping Pointer to a mapping object | | * @param mapping Pointer to a mapping object | |
| */ | | */ | |
| OSYNC_EXPORT void osync_mapping_unref(OSyncMapping *mapping); | | OSYNC_EXPORT void osync_mapping_unref(OSyncMapping *mapping); | |
| | | | |
| /** | | /** | |
| * @brief Get the ID of a mapping object | | * @brief Get the ID of a mapping object | |
| * @param mapping Pointer to a mapping object | | * @param mapping Pointer to a mapping object | |
| * @returns the mapping ID | | * @returns the mapping ID | |
| */ | | */ | |
|
| OSYNC_EXPORT long long int osync_mapping_get_id(OSyncMapping *mapping); | | OSYNC_EXPORT osync_mappingid osync_mapping_get_id(OSyncMapping *mapping); | |
| | | | |
| /** | | /** | |
| * @brief Set the ID of a mapping object | | * @brief Set the ID of a mapping object | |
| * @param mapping Pointer to a mapping object | | * @param mapping Pointer to a mapping object | |
| * @param id the mapping ID to set | | * @param id the mapping ID to set | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_mapping_set_id(OSyncMapping *mapping, long long int
id); | | OSYNC_EXPORT void osync_mapping_set_id(OSyncMapping *mapping, osync_mapping
id id); | |
| | | | |
| /** | | /** | |
| * @brief Returns a OSyncList that contains the OSyncMappingEntries of this
mapping | | * @brief Returns a OSyncList that contains the OSyncMappingEntries of this
mapping | |
| * | | * | |
| * Please be aware that the returned list has to be freed with | | * Please be aware that the returned list has to be freed with | |
| * osync_list_free. If it isn't freed there will be a memory leak. | | * osync_list_free. If it isn't freed there will be a memory leak. | |
| * | | * | |
| * @param mapping A pointer to a OSyncMapping | | * @param mapping A pointer to a OSyncMapping | |
| * @return A shallow copy of the internal list of OSyncMappingEntries | | * @return A shallow copy of the internal list of OSyncMappingEntries | |
| */ | | */ | |
| | | | |
| skipping to change at line 104 | | skipping to change at line 104 | |
| * @param entry Pointer to the mapping entry object to remove | | * @param entry Pointer to the mapping entry object to remove | |
| */ | | */ | |
| OSYNC_EXPORT void osync_mapping_remove_entry(OSyncMapping *mapping, OSyncMa
ppingEntry *entry); | | OSYNC_EXPORT void osync_mapping_remove_entry(OSyncMapping *mapping, OSyncMa
ppingEntry *entry); | |
| | | | |
| /** | | /** | |
| * @brief Find an entry in a mapping by its member ID | | * @brief Find an entry in a mapping by its member ID | |
| * @param mapping Pointer to a mapping object | | * @param mapping Pointer to a mapping object | |
| * @param memberid The ID of the member | | * @param memberid The ID of the member | |
| * @returns the entry with the specified member ID or NULL if not found | | * @returns the entry with the specified member ID or NULL if not found | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSync
Mapping *mapping, long long int memberid); | | OSYNC_EXPORT OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSync
Mapping *mapping, osync_memberid memberid); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #endif /* _OPENSYNC_MAPPING_H_*/ | | #endif /* _OPENSYNC_MAPPING_H_*/ | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| opensync_mapping_engine.h | | opensync_mapping_engine.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| | | | |
| #ifndef OPENSYNC_MAPPING_ENGINE_H_ | | #ifndef OPENSYNC_MAPPING_ENGINE_H_ | |
| #define OPENSYNC_MAPPING_ENGINE_H_ | | #define OPENSYNC_MAPPING_ENGINE_H_ | |
| | | | |
| /** @brief Search in the mapping for the change of the member. | | /** @brief Search in the mapping for the change of the member. | |
| * | | * | |
| * @param engine A pointer to the mapping engine | | * @param engine A pointer to the mapping engine | |
| * @param memberid The member id of the request change. | | * @param memberid The member id of the request change. | |
| * @returns The pointer to the change of the member. NULL if member doesn't
have an entry in this mapping. | | * @returns The pointer to the change of the member. NULL if member doesn't
have an entry in this mapping. | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncChange *osync_mapping_engine_member_change(OSyncMappingEn
gine *engine, long long int memberid); | | OSYNC_EXPORT OSyncChange *osync_mapping_engine_member_change(OSyncMappingEn
gine *engine, osync_memberid memberid); | |
| | | | |
| OSYNC_EXPORT OSyncMember *osync_mapping_engine_change_find_member(OSyncMapp
ingEngine *engine, OSyncChange *change); | | OSYNC_EXPORT OSyncMember *osync_mapping_engine_change_find_member(OSyncMapp
ingEngine *engine, OSyncChange *change); | |
| | | | |
| OSYNC_EXPORT osync_bool osync_mapping_engine_supports_ignore(OSyncMappingEn
gine *engine); | | OSYNC_EXPORT osync_bool osync_mapping_engine_supports_ignore(OSyncMappingEn
gine *engine); | |
| OSYNC_EXPORT osync_bool osync_mapping_engine_supports_use_latest(OSyncMappi
ngEngine *engine); | | OSYNC_EXPORT osync_bool osync_mapping_engine_supports_use_latest(OSyncMappi
ngEngine *engine); | |
| | | | |
| OSYNC_EXPORT osync_bool osync_mapping_engine_solve(OSyncMappingEngine *engi
ne, OSyncChange *change, OSyncError **error); | | OSYNC_EXPORT osync_bool osync_mapping_engine_solve(OSyncMappingEngine *engi
ne, OSyncChange *change, OSyncError **error); | |
| OSYNC_EXPORT osync_bool osync_mapping_engine_ignore(OSyncMappingEngine *eng
ine, OSyncError **error); | | OSYNC_EXPORT osync_bool osync_mapping_engine_ignore(OSyncMappingEngine *eng
ine, OSyncError **error); | |
| OSYNC_EXPORT osync_bool osync_mapping_engine_use_latest(OSyncMappingEngine
*engine, OSyncError **error); | | OSYNC_EXPORT osync_bool osync_mapping_engine_use_latest(OSyncMappingEngine
*engine, OSyncError **error); | |
| | | | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|
| opensync_mapping_entry.h | | opensync_mapping_entry.h | |
| | | | |
| skipping to change at line 100 | | skipping to change at line 100 | |
| * @param entry Pointer to a mapping entry object | | * @param entry Pointer to a mapping entry object | |
| * @returns the member's uid for the entry | | * @returns the member's uid for the entry | |
| */ | | */ | |
| OSYNC_EXPORT const char *osync_mapping_entry_get_uid(OSyncMappingEntry *ent
ry); | | OSYNC_EXPORT const char *osync_mapping_entry_get_uid(OSyncMappingEntry *ent
ry); | |
| | | | |
| /** | | /** | |
| * @brief Get the member ID of the entry | | * @brief Get the member ID of the entry | |
| * @param entry Pointer to a mapping entry object | | * @param entry Pointer to a mapping entry object | |
| * @returns the entry's member ID | | * @returns the entry's member ID | |
| */ | | */ | |
|
| OSYNC_EXPORT long long int osync_mapping_entry_get_member_id(OSyncMappingEn
try *entry); | | OSYNC_EXPORT osync_memberid osync_mapping_entry_get_member_id(OSyncMappingE
ntry *entry); | |
| | | | |
| /** | | /** | |
| * @brief Set the member ID of the entry | | * @brief Set the member ID of the entry | |
| * @param entry Pointer to a mapping entry object | | * @param entry Pointer to a mapping entry object | |
| * @param id the member ID to set | | * @param id the member ID to set | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_mapping_entry_set_member_id(OSyncMappingEntry *entr
y, long long int id); | | OSYNC_EXPORT void osync_mapping_entry_set_member_id(OSyncMappingEntry *entr
y, osync_memberid id); | |
| | | | |
| /** | | /** | |
| * @brief Get the ID of the entry | | * @brief Get the ID of the entry | |
| * @param entry Pointer to a mapping entry object | | * @param entry Pointer to a mapping entry object | |
| * @returns the entry's ID | | * @returns the entry's ID | |
| */ | | */ | |
|
| OSYNC_EXPORT long long int osync_mapping_entry_get_id(OSyncMappingEntry *en
try); | | OSYNC_EXPORT osync_mappingid osync_mapping_entry_get_id(OSyncMappingEntry *
entry); | |
| | | | |
| /** | | /** | |
| * @brief Set the ID of the entry | | * @brief Set the ID of the entry | |
| * @param entry Pointer to a mapping entry object | | * @param entry Pointer to a mapping entry object | |
| * @param id the ID to set | | * @param id the ID to set | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_mapping_entry_set_id(OSyncMappingEntry *entry, long
long int id); | | OSYNC_EXPORT void osync_mapping_entry_set_id(OSyncMappingEntry *entry, osyn
c_mappingid id); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #endif /*OPENSYNC_MAPPING_ENTRY_H_*/ | | #endif /*OPENSYNC_MAPPING_ENTRY_H_*/ | |
| | | | |
End of changes. 4 change blocks. |
| 4 lines changed or deleted | | 4 lines changed or added | |
|
| opensync_mapping_table.h | | opensync_mapping_table.h | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 90 | |
| */ | | */ | |
| OSYNC_EXPORT void osync_mapping_table_close(OSyncMappingTable *table); | | OSYNC_EXPORT void osync_mapping_table_close(OSyncMappingTable *table); | |
| | | | |
| /** | | /** | |
| * @brief Search for the mapping object with the mapping id | | * @brief Search for the mapping object with the mapping id | |
| * | | * | |
| * @param table The mapping table object | | * @param table The mapping table object | |
| * @param id The mapping id to search for | | * @param id The mapping id to search for | |
| * @return Returns Mapping object or NULL if no mapping matched the mapping
id | | * @return Returns Mapping object or NULL if no mapping matched the mapping
id | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTab
le *table, long long int id); | | OSYNC_EXPORT OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTab
le *table, osync_mappingid id); | |
| | | | |
| /** | | /** | |
| * @brief Add a mapping to the mapping table | | * @brief Add a mapping to the mapping table | |
| * | | * | |
| * @param table The mapping table object | | * @param table The mapping table object | |
| * @param mapping The mapping to add to the mapping table | | * @param mapping The mapping to add to the mapping table | |
| */ | | */ | |
| OSYNC_EXPORT void osync_mapping_table_add_mapping(OSyncMappingTable *table,
OSyncMapping *mapping); | | OSYNC_EXPORT void osync_mapping_table_add_mapping(OSyncMappingTable *table,
OSyncMapping *mapping); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 125 | |
| * @return A shallow copy of the internal list of OSyncMappings | | * @return A shallow copy of the internal list of OSyncMappings | |
| */ | | */ | |
| OSYNC_EXPORT OSyncList *osync_mapping_table_get_mappings(OSyncMappingTable
*table); | | OSYNC_EXPORT OSyncList *osync_mapping_table_get_mappings(OSyncMappingTable
*table); | |
| | | | |
| /** | | /** | |
| * @brief Get next free mapping id from mapping table | | * @brief Get next free mapping id from mapping table | |
| * | | * | |
| * @param table The mapping table object | | * @param table The mapping table object | |
| * @return Next free mapping id of mapping table | | * @return Next free mapping id of mapping table | |
| */ | | */ | |
|
| OSYNC_EXPORT long long int osync_mapping_table_get_next_id(OSyncMappingTabl
e *table); | | OSYNC_EXPORT osync_mappingid osync_mapping_table_get_next_id(OSyncMappingTa
ble *table); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #endif /* OPENSYNC_MAPPING_TABLE_H_ */ | | #endif /* OPENSYNC_MAPPING_TABLE_H_ */ | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 2 lines changed or added | |
|
| opensync_plugin.h | | opensync_plugin.h | |
| | | | |
| skipping to change at line 79 | | skipping to change at line 79 | |
| /** @brief Gives information about wether the plugin | | /** @brief Gives information about wether the plugin | |
| * has to be configured or not | | * has to be configured or not | |
| **/ | | **/ | |
| typedef enum { | | typedef enum { | |
| /** Plugin has no configuration options */ | | /** Plugin has no configuration options */ | |
| OSYNC_PLUGIN_NO_CONFIGURATION = 0, | | OSYNC_PLUGIN_NO_CONFIGURATION = 0, | |
| /** Plugin can be configured, but will accept the default config in
the initialize function */ | | /** Plugin can be configured, but will accept the default config in
the initialize function */ | |
| OSYNC_PLUGIN_OPTIONAL_CONFIGURATION = 1, | | OSYNC_PLUGIN_OPTIONAL_CONFIGURATION = 1, | |
| /** Plugin must be configured to run correctly */ | | /** Plugin must be configured to run correctly */ | |
| OSYNC_PLUGIN_NEEDS_CONFIGURATION = 2 | | OSYNC_PLUGIN_NEEDS_CONFIGURATION = 2 | |
|
| } OSyncConfigurationType; | | } OSyncPluginConfigurationType; | |
| | | | |
| /** @brief Registers a new plugin | | /** @brief Registers a new plugin | |
| * | | * | |
| * This function creates a new OSyncPlugin object, that | | * This function creates a new OSyncPlugin object, that | |
| * can be used to register a new plugin dynamically. This | | * can be used to register a new plugin dynamically. This | |
| * can be used by a module to register multiple plugins, | | * can be used by a module to register multiple plugins, | |
| * instead of using the get_info() function which allows | | * instead of using the get_info() function which allows | |
| * registering only one plugin. | | * registering only one plugin. | |
| * | | * | |
| * @param error Pointer to an error struct | | * @param error Pointer to an error struct | |
| | | | |
| skipping to change at line 155 | | skipping to change at line 155 | |
| * @param longname the long name to set | | * @param longname the long name to set | |
| * | | * | |
| */ | | */ | |
| OSYNC_EXPORT void osync_plugin_set_longname(OSyncPlugin *plugin, const char
*longname); | | OSYNC_EXPORT void osync_plugin_set_longname(OSyncPlugin *plugin, const char
*longname); | |
| | | | |
| /** @brief Returns whether or not the plugin requires configuration | | /** @brief Returns whether or not the plugin requires configuration | |
| * | | * | |
| * @param plugin Pointer to the plugin | | * @param plugin Pointer to the plugin | |
| * @returns The configuration requirement type of the plugin | | * @returns The configuration requirement type of the plugin | |
| */ | | */ | |
|
| OSYNC_EXPORT OSyncConfigurationType osync_plugin_get_config_type(OSyncPlugi
n *plugin); | | OSYNC_EXPORT OSyncPluginConfigurationType osync_plugin_get_config_type(OSyn
cPlugin *plugin); | |
| | | | |
| /** @brief Sets whether or not the plugin requires configuration | | /** @brief Sets whether or not the plugin requires configuration | |
| * | | * | |
| * @param plugin Pointer to the plugin | | * @param plugin Pointer to the plugin | |
| * @param type The configuration requirement type of the plugin | | * @param type The configuration requirement type of the plugin | |
| */ | | */ | |
|
| OSYNC_EXPORT void osync_plugin_set_config_type(OSyncPlugin *plugin, OSyncCo
nfigurationType type); | | OSYNC_EXPORT void osync_plugin_set_config_type(OSyncPlugin *plugin, OSyncPl
uginConfigurationType type); | |
| | | | |
| /** @brief Returns start type of plugin | | /** @brief Returns start type of plugin | |
| * | | * | |
| * @param plugin Pointer to the plugin | | * @param plugin Pointer to the plugin | |
| * @returns The start type of the plugin | | * @returns The start type of the plugin | |
| */ | | */ | |
| OSYNC_EXPORT OSyncStartType osync_plugin_get_start_type(OSyncPlugin *plugin
); | | OSYNC_EXPORT OSyncStartType osync_plugin_get_start_type(OSyncPlugin *plugin
); | |
| | | | |
| /** @brief Sets the start type of the plugin | | /** @brief Sets the start type of the plugin | |
| * | | * | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| opensync_plugin_config.h | | opensync_plugin_config.h | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| typedef enum { | | typedef enum { | |
| /** Advanced options */ | | /** Advanced options */ | |
| OPENSYNC_PLUGIN_CONFIG_ADVANCEDOPTION = (1 << 0), | | OPENSYNC_PLUGIN_CONFIG_ADVANCEDOPTION = (1 << 0), | |
| /** Authentication options */ | | /** Authentication options */ | |
| OPENSYNC_PLUGIN_CONFIG_AUTHENTICATION = (1 << 1), | | OPENSYNC_PLUGIN_CONFIG_AUTHENTICATION = (1 << 1), | |
| /** Localization options */ | | /** Localization options */ | |
| OPENSYNC_PLUGIN_CONFIG_LOCALIZATION = (1 << 2), | | OPENSYNC_PLUGIN_CONFIG_LOCALIZATION = (1 << 2), | |
| /** Resources */ | | /** Resources */ | |
| OPENSYNC_PLUGIN_CONFIG_RESOURCES = (1 << 3), | | OPENSYNC_PLUGIN_CONFIG_RESOURCES = (1 << 3), | |
| /** Connection options */ | | /** Connection options */ | |
|
| OPENSYNC_PLUGIN_CONFIG_CONNECTION = (1 << 4) | | OPENSYNC_PLUGIN_CONFIG_CONNECTION = (1 << 4), | |
| | | /** External Plugin */ | |
| | | OPENSYNC_PLUGIN_CONFIG_EXTERNALPLUGIN = (1 << 5) | |
| } OSyncPluginConfigSupportedFlag; | | } OSyncPluginConfigSupportedFlag; | |
| | | | |
| /** @brief Set of OSyncPluginConfigSupportedFlags | | /** @brief Set of OSyncPluginConfigSupportedFlags | |
| * | | * | |
| **/ | | **/ | |
| typedef unsigned int OSyncPluginConfigSupportedFlags; | | typedef unsigned int OSyncPluginConfigSupportedFlags; | |
| | | | |
|
| | | /** @brief Returns the built-in default plugin configuration directory | |
| | | * | |
| | | * Returns a string containing the build-time directory where | |
| | | * default plugin config files are stored, including trailing directory | |
| | | * separator character. (Usually "/usr/share/libopensync1/defaults/") | |
| | | * | |
| | | * Note that this is only really necessary if your plugin stores additional | |
| | | * config files in the defaults directory that it needs to access later. | |
| | | * | |
| | | * @returns String with directory | |
| | | * | |
| | | */ | |
| | | OSYNC_EXPORT const char *osync_plugin_get_default_configdir(void); | |
| | | | |
| /** @brief Create a new plugin config object | | /** @brief Create a new plugin config object | |
| * | | * | |
| * @param error Pointer to and error struct | | * @param error Pointer to and error struct | |
| * @returns the newly registered plugin config object | | * @returns the newly registered plugin config object | |
| */ | | */ | |
| OSYNC_EXPORT OSyncPluginConfig *osync_plugin_config_new(OSyncError **error)
; | | OSYNC_EXPORT OSyncPluginConfig *osync_plugin_config_new(OSyncError **error)
; | |
| | | | |
| /** @brief Decrease the reference count on a plugin config object | | /** @brief Decrease the reference count on a plugin config object | |
| * | | * | |
| * @param config Pointer to the plugin config object | | * @param config Pointer to the plugin config object | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 234 | |
| */ | | */ | |
| OSYNC_EXPORT OSyncPluginConnection *osync_plugin_config_get_connection(OSyn
cPluginConfig *config); | | OSYNC_EXPORT OSyncPluginConnection *osync_plugin_config_get_connection(OSyn
cPluginConfig *config); | |
| | | | |
| /**@brief Set the connection settings in a config | | /**@brief Set the connection settings in a config | |
| * | | * | |
| * @param config An OSyncPluginConfig | | * @param config An OSyncPluginConfig | |
| * @param connection the connection settings as an OSyncPluginConnection | | * @param connection the connection settings as an OSyncPluginConnection | |
| */ | | */ | |
| OSYNC_EXPORT void osync_plugin_config_set_connection(OSyncPluginConfig *con
fig, OSyncPluginConnection *connection); | | OSYNC_EXPORT void osync_plugin_config_set_connection(OSyncPluginConfig *con
fig, OSyncPluginConnection *connection); | |
| | | | |
|
| | | /* External Plugin */ | |
| | | /**@brief Get the external plugin settings from a config | |
| | | * | |
| | | * @param config An OSyncPluginConfig | |
| | | * @returns an OSyncPluginExternalPlugin with the details of the external p | |
| | | lugin or NULL if no external plugin settings configured | |
| | | */ | |
| | | OSYNC_EXPORT OSyncPluginExternalPlugin *osync_plugin_config_get_externalplu | |
| | | gin(OSyncPluginConfig *config); | |
| | | | |
| | | /**@brief Set the external plugin configuration | |
| | | * | |
| | | * @param config An OSyncPluginConfig | |
| | | * @param authentication The new external plugin settings as an OSyncPlugin | |
| | | ExternalPlugin | |
| | | */ | |
| | | OSYNC_EXPORT void osync_plugin_config_set_externalplugin(OSyncPluginConfig | |
| | | *config, OSyncPluginExternalPlugin *externalplugin); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #endif /*_OPENSYNC_PLUGIN_CONFIG_H_*/ | | #endif /*_OPENSYNC_PLUGIN_CONFIG_H_*/ | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 36 lines changed or added | |
|
| opensync_time.h | | opensync_time.h | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| * @brief Helper functions for formatting time strings, stripping out | | * @brief Helper functions for formatting time strings, stripping out | |
| * invalid characters, etc. | | * invalid characters, etc. | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /* | | /* | |
| * Time formatting helper | | * Time formatting helper | |
| */ | | */ | |
| | | | |
| /** @brief Function returns a date-timestamp in OSyncTime Spec format | | /** @brief Function returns a date-timestamp in OSyncTime Spec format | |
|
| | | * OSyncTime Spec format is YYYYMMDDTHHMMSSZ with Z optional. | |
| | | * Input format can be in ISO 8601, including dashes and timezone | |
| | | * offsets, and the returned timestamp will adjust it to UTC. | |
| * | | * | |
| * @param vtime The timestamp which gets converted to a valid osync date-ti
mestamp | | * @param vtime The timestamp which gets converted to a valid osync date-ti
mestamp | |
| * @returns vtime date-timestring (the caller is responsible for freeing) | | * @returns vtime date-timestring (the caller is responsible for freeing) | |
| */ | | */ | |
| OSYNC_EXPORT char *osync_time_timestamp(const char *vtime); | | OSYNC_EXPORT char *osync_time_timestamp(const char *vtime); | |
| | | | |
| /** @brief Function returns a date without timestamp in OSyncTime Spec form
at | | /** @brief Function returns a date without timestamp in OSyncTime Spec form
at | |
| * | | * | |
| * @param vtime The timestamp which gets converted to a single datestamp | | * @param vtime The timestamp which gets converted to a single datestamp | |
| * @returns valid single datestamp YYYYMMDD (the caller is responsible for
freeing) | | * @returns valid single datestamp YYYYMMDD (the caller is responsible for
freeing) | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 221 | |
| * | | * | |
| * @param local The point in time when the offset have to be calculated, | | * @param local The point in time when the offset have to be calculated, | |
| * specified in localtime (need for CEST/CET) | | * specified in localtime (need for CEST/CET) | |
| * @param error An OSyncError struct. Always check if error is set using | | * @param error An OSyncError struct. Always check if error is set using | |
| * osync_error_is_set(error) before using the return value | | * osync_error_is_set(error) before using the return value | |
| * @return Seconds of timezone offset. On error, sets the error parameter, | | * @return Seconds of timezone offset. On error, sets the error parameter, | |
| * and the return value cannot be relied upon. | | * and the return value cannot be relied upon. | |
| */ | | */ | |
| OSYNC_EXPORT int osync_time_timezone_diff(const struct tm *local, OSyncErro
r **error); | | OSYNC_EXPORT int osync_time_timezone_diff(const struct tm *local, OSyncErro
r **error); | |
| | | | |
|
| | | /** @brief Parse an ISO 8601 timestamp string, and if a timezone offset | |
| | | * exists, return an offset suitable for feeding into vtime2unix(). | |
| | | * (seconds east of UTC.. i.e. east is positive, west is negative) | |
| | | * | |
| | | * @param iso_vtime String containing an ISO 8601 timestamp string, in the | |
| | | * format of YYYYMMDDTHHMMSS-HHMM or YYYY-MM-DDTHH:MM:SS-HH:MM. | |
| | | * @param found Pointer to an int. Will be set to 1 if a valid offset was | |
| | | * found, or 0 if not. Not all timestamps have a timezone offset. | |
| | | * If not found, 0 will also be returned as the offset. | |
| | | * @param error An OSyncError struct. Always check if error is set using | |
| | | * osync_error_is_set(error) before using the return value. A non- | |
| | | * existing timezone offset is not an error, but a mal-formed one, | |
| | | * like "-03:0" is an error. | |
| | | * @return Seconds of timezone offset. On error, sets the error parameter, | |
| | | * and the return value will be zero. If no offset is found in the | |
| | | * string, return is zero. | |
| | | */ | |
| | | OSYNC_EXPORT int osync_time_parse_iso_timezone_diff(const char *iso_vtime, | |
| | | int *found, OSyncError **error); | |
| | | | |
| /** @brief Function converts (struct tm) ltime from localtime to UTC. | | /** @brief Function converts (struct tm) ltime from localtime to UTC. | |
| * Paramter offset is used as UTC offset. Note that _only_ the | | * Paramter offset is used as UTC offset. Note that _only_ the | |
| * following fields can be relied upon in the result: | | * following fields can be relied upon in the result: | |
| * tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year. | | * tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year. | |
| * | | * | |
| * @param ltime The struct tm which gets converted to UTC timezone | | * @param ltime The struct tm which gets converted to UTC timezone | |
| * @param offset Seconds of UTC offset, in seconds east of UTC. | | * @param offset Seconds of UTC offset, in seconds east of UTC. | |
| * @param error An OSyncError struct | | * @param error An OSyncError struct | |
| * @returns struct tm in UTC (caller is responsible for freeing), NULL on e
rror | | * @returns struct tm in UTC (caller is responsible for freeing), NULL on e
rror | |
| */ | | */ | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 23 lines changed or added | |
|