You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <dg...@su...> - 2009-01-19 09:37:33
|
Author: bricks Date: Mon Jan 19 10:36:26 2009 New Revision: 5189 URL: http://www.opensync.org/changeset/5189 Log: Fixed all doxygen warning (Documentation is still missing ;-) ) Modified: trunk/opensync/archive/opensync_archive_internals.h trunk/opensync/common/opensync_string.h trunk/opensync/common/opensync_thread_internals.h trunk/opensync/data/opensync_data.h trunk/opensync/engine/opensync_engine.h trunk/opensync/engine/opensync_mapping_entry_engine_internals.h trunk/opensync/format/opensync_converter.h trunk/opensync/format/opensync_format_env.h trunk/opensync/format/opensync_objformat.h trunk/opensync/format/opensync_objformat_internals.h trunk/opensync/mapping/opensync_mapping_table.h trunk/opensync/module/opensync_module_internals.h trunk/opensync/plugin/opensync_plugin.h trunk/opensync/plugin/opensync_plugin_config.h trunk/opensync/plugin/opensync_plugin_internals.h trunk/opensync/xmlformat/opensync_xmlformat_schema_internals.h Modified: trunk/opensync/archive/opensync_archive_internals.h ============================================================================== --- trunk/opensync/archive/opensync_archive_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/archive/opensync_archive_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -102,7 +102,7 @@ * * @param archive The group archive * @param objtype Requested object type - * @param ids List to store the archive (database) ids of each entry + * @param mappingsids List to store the archive (database) ids of each entry * @param changetypes List to store the changetypes for each entry * @param error Pointer to an error struct * @return TRUE on when all changes successfully loaded otherwise FALSE @@ -114,7 +114,7 @@ * * @param archive The group archive * @param objtype Reported object type of entry - * @param id Mapping Entry ID of entry + * @param mappingid Mapping Entry ID of entry * @param changetype Changetype of entry * @param error Pointer to an error struct * @return Returns TRUE on success, FALSE otherwise Modified: trunk/opensync/common/opensync_string.h ============================================================================== --- trunk/opensync/common/opensync_string.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/common/opensync_string.h Mon Jan 19 10:36:26 2009 (r5189) @@ -39,9 +39,9 @@ */ OSYNC_EXPORT char *osync_strreplace(const char *input, const char *delimiter, const char *replacement); -/** @brief Duplicates a string +/** @brief Duplicates a string * - * Duplicates a string, ending with terminating-zero: \0 + * Duplicates a string, ending with terminating-zero: * * @param str The pointer of the string to duplicate * @returns The duplicate string, caller is responsible for freeing. @@ -49,12 +49,12 @@ */ OSYNC_EXPORT char *osync_strdup(const char *str); -/** @brief Duplicates a formated string +/** @brief Duplicates a formated string * - * Duplicates a formated string, ending with terminating-zero: \0 + * Duplicates a formated string, ending with terminating-zero: * - * @param str The pointer of the string to duplicate - * @param args + * @param format The format for the output + * @param ... vararg list * @returns The duplicate string, caller is responsible for freeing. * */ Modified: trunk/opensync/common/opensync_thread_internals.h ============================================================================== --- trunk/opensync/common/opensync_thread_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/common/opensync_thread_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -23,7 +23,7 @@ #define _OPENSYNC_THREAD_INTERNALS_H /** - * @defroup OSyncThreadInternalAPI OpenSync Thread Internals + * @defgroup OSyncThreadInternalAPI OpenSync Thread Internals * @ingroup OSyncCommonPrivate * @brief Some threading functions */ Modified: trunk/opensync/data/opensync_data.h ============================================================================== --- trunk/opensync/data/opensync_data.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/data/opensync_data.h Mon Jan 19 10:36:26 2009 (r5189) @@ -30,40 +30,40 @@ */ /*@{*/ -/*! @brief Create a new data object +/** @brief Create a new data object * - * @param buffer Character buffer containing the data + * @param data Character buffer containing the data * @param size The size of the data contained in the buffer * @param format The object format of the data * @param error An error struct - * @returns The new data object + * @return The new data object * */ OSYNC_EXPORT OSyncData *osync_data_new(char *data, unsigned int size, OSyncObjFormat *format, OSyncError **error); -/*! @brief Increase the reference count on a data object +/** @brief Increase the reference count on a data object * * @param data The data object * */ OSYNC_EXPORT OSyncData *osync_data_ref(OSyncData *data); -/*! @brief Decrease the reference count on a data object +/** @brief Decrease the reference count on a data object * * @param data The data object * */ OSYNC_EXPORT void osync_data_unref(OSyncData *data); -/*! @brief Get the object format from a data object +/** @brief Get the object format from a data object * * @param data The data object - * @returns the object format of the data object + * @return the object format of the data object * */ OSYNC_EXPORT OSyncObjFormat *osync_data_get_objformat(OSyncData *data); -/*! @brief Set the object format on a data object +/** @brief Set the object format on a data object * * @param data The data object * @param objformat The object format to set @@ -71,15 +71,15 @@ */ OSYNC_EXPORT void osync_data_set_objformat(OSyncData *data, OSyncObjFormat *objformat); -/*! @brief Get the object type from a data object +/** @brief Get the object type from a data object * * @param data The data object - * @returns the name of the object type of the data object + * @return the name of the object type of the data object * */ OSYNC_EXPORT const char *osync_data_get_objtype(OSyncData *data); -/*! @brief Set the object type of a data object +/** @brief Set the object type of a data object * * @param data The data object * @param objtype The name of the object type to set @@ -87,7 +87,7 @@ */ OSYNC_EXPORT void osync_data_set_objtype(OSyncData *data, const char *objtype); -/*! @brief Get the data from a data object +/** @brief Get the data from a data object * * @param data The data object * @param buffer Pointer to a char * that will be set to point to the data if specified. Do not free this buffer. @@ -96,7 +96,7 @@ */ OSYNC_EXPORT void osync_data_get_data(OSyncData *data, char **buffer, unsigned int *size); -/*! @brief Set the data of a data object +/** @brief Set the data of a data object * * @param data The data object * @param buffer The data as a character array. Freeing this buffer will be handled by the data object. @@ -105,39 +105,38 @@ */ OSYNC_EXPORT void osync_data_set_data(OSyncData *data, char *buffer, unsigned int size); -/*! @brief Check if the data object has data stored +/** @brief Check if the data object has data stored * * @param data The data object - * @returns TRUE if the data object has data, FALSE otherwise + * @return TRUE if the data object has data, FALSE otherwise * */ OSYNC_EXPORT osync_bool osync_data_has_data(OSyncData *data); -/*! @brief Returns a string describing a data object +/** @brief Returns a string describing a data object * * Some formats cannot be printed directly. To be able to print these * objects they should specify a print function. * * @param data The data to get printable - * @returns A string describing the object - * + * @return A string describing the object */ OSYNC_EXPORT char *osync_data_get_printable(OSyncData *data); -/*! @brief Clone a data object +/** @brief Clone a data object * - * @param source The data object to clone + * @param data The data object to clone * @param error An error struct - * @returns a copy of the specified data object, or NULL if an error occurred + * @return a copy of the specified data object, or NULL if an error occurred * */ OSYNC_EXPORT OSyncData *osync_data_clone(OSyncData *data, OSyncError **error); -/*! @brief Returns the revision of the object +/** @brief Returns the revision of the object * * @param data The change to get the revision from * @param error An error struct - * @returns The revision of the object in seconds since the epoch in zulu time + * @return The revision of the object in seconds since the epoch in zulu time * */ OSYNC_EXPORT time_t osync_data_get_revision(OSyncData *data, OSyncError **error); Modified: trunk/opensync/engine/opensync_engine.h ============================================================================== --- trunk/opensync/engine/opensync_engine.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/engine/opensync_engine.h Mon Jan 19 10:36:26 2009 (r5189) @@ -252,8 +252,7 @@ * osync_engine_wait_sync_end for this as this might introduce a race condition. * * @param engine A pointer to the engine, which to sync and wait for the sync end - * @param member A pointer to the member, which to discover - * @param error A pointer to a error struct + * @param error A pointer to an error struct * @returns TRUE on success, FALSE otherwise. * */ @@ -382,7 +381,7 @@ * The change status handler will be called every time a new change is received, written etc * * @param engine A pointer to the engine, for which to set the callback - * @param function A pointer to a function which will receive the change status + * @param callback A pointer to a function which will receive the change status * @param user_data Pointer to some data that will get passed to the status function as the last argument * */ @@ -393,7 +392,7 @@ * The mapping status handler will be called every time a mapping is updated * * @param engine A pointer to the engine, for which to set the callback - * @param function A pointer to a function which will receive the mapping status + * @param callback A pointer to a function which will receive the mapping status * @param user_data Pointer to some data that will get passed to the status function as the last argument * */ @@ -404,7 +403,7 @@ * The engine status handler will be called every time the engine is updated (started, stopped etc) * * @param engine A pointer to the engine, for which to set the callback - * @param function A pointer to a function which will receive the engine status + * @param callback A pointer to a function which will receive the engine status * @param user_data Pointer to some data that will get passed to the status function as the last argument * */ @@ -415,7 +414,7 @@ * The member status handler will be called every time a member is updated (connects, disconnects etc) * * @param engine A pointer to the engine, for which to set the callback - * @param function A pointer to a function which will receive the member status + * @param callback A pointer to a function which will receive the member status * @param user_data Pointer to some data that will get passed to the status function as the last argument * */ Modified: trunk/opensync/engine/opensync_mapping_entry_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -42,31 +42,32 @@ */ /*@{*/ -/*! @brief Register a new Mapping Entry Engine +/** @brief Register a new Mapping Entry Engine * * @param entry Pointer to an OSyncMappingEntry * @param mapping_engine Pointer to an OSyncMappingEngine * @param sink_engine Pointer to an OSyncSinkEngine + * @param objengine Pointer to an OSyncObjEngine * @param error Pointer to an error struct * @returns the newly registered Mapping Entry Engine, NULL on error */ OSyncMappingEntryEngine *osync_entry_engine_new(OSyncMappingEntry *entry, OSyncMappingEngine *mapping_engine, OSyncSinkEngine *sink_engine, OSyncObjEngine *objengine, OSyncError **error); -/*! @brief Increase the reference count on a Mapping Entry Engine +/** @brief Increase the reference count on a Mapping Entry Engine * - * @param plugin Pointer to the Mapping Entry Engine + * @param engine Pointer to the Mapping Entry Engine * */ OSyncMappingEntryEngine *osync_entry_engine_ref(OSyncMappingEntryEngine *engine); -/*! @brief Decrease the reference count on a Mapping Entry Engine +/** @brief Decrease the reference count on a Mapping Entry Engine * - * @param plugin Pointer to the Mapping Entry Engine + * @param engine Pointer to the Mapping Entry Engine * */ void osync_entry_engine_unref(OSyncMappingEntryEngine *engine); -/*! @brief Tries to match OSyncMappingEntryEngine with a OSyncChange. +/** @brief Tries to match OSyncMappingEntryEngine with a OSyncChange. * * Based on the UID of the OSyncChange and the Mapping Entry of the * OSyncMappingEntryEngine, this functions tries to match the two objects. @@ -80,14 +81,14 @@ */ osync_bool osync_entry_engine_matches(OSyncMappingEntryEngine *engine, OSyncChange *change); -/*! @brief Get the pointer of the assinged OSyncChange object +/** @brief Get the pointer of the assinged OSyncChange object * * @param engine Pointer to an OSyncMappingEntryEngine * @returns Pointer to assigned OSyncChange, or NULL if no change is set */ OSyncChange *osync_entry_engine_get_change(OSyncMappingEntryEngine *engine); -/*! @brief Update the OSyncChange object in Mapping Entry Engine +/** @brief Update the OSyncChange object in Mapping Entry Engine * * Mapping Entry Engine get flagged as not sync in the Mapping Table, when * change get updated. @@ -97,17 +98,17 @@ */ void osync_entry_engine_update(OSyncMappingEntryEngine *engine, OSyncChange *change); -/*! @brief Set the dirty flag for OSyncMappingEntryEngine +/** @brief Set the dirty flag for OSyncMappingEntryEngine * * If dirty flag for OSyncMappingEntryEngine get set, the entry gets handled * in the engine WRITE section. * * @param engine Pointer to an OSyncMappingEntryEngine - * @param change Pointer to new change to assign or NULL to unset the current change + * @param dirty Boolean value to set */ void osync_entry_engine_set_dirty(OSyncMappingEntryEngine *engine, osync_bool dirty); -/*! @brief Demerge the entry in the OSyncMappingEntryEngine +/** @brief Demerge the entry in the OSyncMappingEntryEngine * * The demerge includes storing the "entire" entry in the Archive. The demerging is done * based on the supplied OSyncCapabilities. @@ -120,7 +121,7 @@ */ osync_bool osync_entry_engine_demerge(OSyncMappingEntryEngine *engine, OSyncArchive *archive, OSyncCapabilities *caps, OSyncError **error); -/*! @brief convert the entry in the OSyncMappingEntryEngine +/** @brief convert the entry in the OSyncMappingEntryEngine * * The conversion of the entry of OSyncMappingEntryEngine, uses the format * configurations of OSyncObjTypeSink (i.e. which supported formats, preferred Modified: trunk/opensync/format/opensync_converter.h ============================================================================== --- trunk/opensync/format/opensync_converter.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/format/opensync_converter.h Mon Jan 19 10:36:26 2009 (r5189) @@ -105,7 +105,7 @@ /** * @brief Detects the Object Format of passed OSyncData - * @param detector Pointer to the detector + * @param converter Pointer to the converter * @param data Pointer to OSyncData object which should be detected * @returns The detected Object Format or NULL */ @@ -193,17 +193,18 @@ /** * @brief Sets the finalize function of a converter * @param converter Pointer to the converter - * @param initialize_func Pointer to the finialize function + * @param finalize_func Pointer to the finalize function */ OSYNC_EXPORT void osync_converter_set_finalize_func(OSyncFormatConverter *converter, OSyncFormatConverterFinalizeFunc finalize_func); /** * @brief Invokes initialize function of a converter * - * @param converter Pointer to the converter which should be initalized + * @param converter Pointer to the converter which should be initialized * @param config configuration + * @param error Pointer to an error struct * - * @todo config is not used currently. Should be usesd in the future to pass a directoy for xml format schema location + * @todo config is not used currently. Should be used in the future to pass a directory for xml format schema location */ OSYNC_EXPORT void osync_converter_initialize(OSyncFormatConverter *converter, const char *config, OSyncError **error); Modified: trunk/opensync/format/opensync_format_env.h ============================================================================== --- trunk/opensync/format/opensync_format_env.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/format/opensync_format_env.h Mon Jan 19 10:36:26 2009 (r5189) @@ -239,9 +239,10 @@ * * @param env The format environment to use * @param sourcedata The OSyncData object which should be converted and the detectors will run on - * @param targetformat The target format to be converted to + * @param targetformat The target format to be converted to + * @param preferred_format Format that should be preferred to build the conversion path * @param error The error-return location - * @returns The appropriate conversion path, or NULL if an error occurred. + * @return The appropriate conversion path, or NULL if an error occurred. * */ OSYNC_EXPORT OSyncFormatConverterPath *osync_format_env_find_path_with_detectors(OSyncFormatEnv *env, OSyncData *sourcedata, OSyncObjFormat *targetformat, const char *preferred_format, OSyncError **error); @@ -251,6 +252,7 @@ * @param env The format environment to use * @param sourcedata The OSyncData object which should be converted and the detectors will run on * @param targets List of possible Object Format Sinks + * @param preferred_format Format that should be preferred to build the conversion path * @param error The error-return location * @returns The appropriate conversion path, or NULL if an error occurred. * Modified: trunk/opensync/format/opensync_objformat.h ============================================================================== --- trunk/opensync/format/opensync_objformat.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/format/opensync_objformat.h Mon Jan 19 10:36:26 2009 (r5189) @@ -207,7 +207,7 @@ * @param format Pointer to the object format * @param demarshal_func The demarshal function to set */ -OSYNC_EXPORT void osync_objformat_set_demarshal_func(OSyncObjFormat *format, OSyncFormatDemarshalFunc marshal_func); +OSYNC_EXPORT void osync_objformat_set_demarshal_func(OSyncObjFormat *format, OSyncFormatDemarshalFunc demarshal_func); /** * @brief Sets the optional validation function for an object format Modified: trunk/opensync/format/opensync_objformat_internals.h ============================================================================== --- trunk/opensync/format/opensync_objformat_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/format/opensync_objformat_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -183,7 +183,8 @@ * * @param format Pointer to the object format * @param data Reference of buffer which stores data to merge - * @param size Refernce of size in bytes of the buffer specified by the data paramter + * @param size Reference of size in bytes of the buffer specified by the data paramter + * @param entire * @param entsize Size in bytes of the base data buffer specified by the entire parameter * @param caps The capabilities list which describes what must get merged: entire -> input * @param error Pointer to an error struct @@ -195,7 +196,7 @@ OSyncCapabilities *caps, OSyncError **error); /** - * @brief Demrge supplied data in format specific way + * @brief Demerge supplied data in format specific way * * @param format Pointer to the object format * @param data Pointer to the buffer which should get demerged Modified: trunk/opensync/mapping/opensync_mapping_table.h ============================================================================== --- trunk/opensync/mapping/opensync_mapping_table.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/mapping/opensync_mapping_table.h Mon Jan 19 10:36:26 2009 (r5189) @@ -87,7 +87,7 @@ * @brief Search for the mapping object with the mapping id * * @param table The mapping table object - * @param long long int 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 */ OSYNC_EXPORT OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTable *table, long long int id); Modified: trunk/opensync/module/opensync_module_internals.h ============================================================================== --- trunk/opensync/module/opensync_module_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/module/opensync_module_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -77,14 +77,12 @@ OSYNC_TEST_EXPORT void osync_module_unref(OSyncModule *module); /** - * @brief dlopen()s a format plugin + * @brief Loads a module * - * The get_info() function on the format plugin gets called - * - * @param env The environment in which to open the plugin - * @param path Where to find this plugin - * @param error Pointer to a error struct - * @return Pointer to the plugin on success, NULL otherwise + * @param module Module that should be loaded + * @param path Where to find this module + * @param error Pointer to an error struct + * @return TRUE on success, FALSE otherwise * */ OSYNC_TEST_EXPORT osync_bool osync_module_load(OSyncModule *module, const char *path, OSyncError **error); @@ -145,9 +143,9 @@ * * Looks up and returns a function * - * @param plugin Pointer to the plugin + * @param module Pointer to the module * @param name The name of the function to look up - * @param error Pointer to a error struct + * @param error Pointer to an error struct * @return Pointer to the function * */ Modified: trunk/opensync/plugin/opensync_plugin.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/plugin/opensync_plugin.h Mon Jan 19 10:36:26 2009 (r5189) @@ -275,16 +275,17 @@ */ OSYNC_EXPORT void osync_plugin_set_finalize_timeout(OSyncPlugin *plugin, unsigned int timeout); -/** @brief Initialize Plugin +/** @brief Initialize a Plugin * * @param plugin Pointer to the plugin + * @param plugin_data Pointer to store the data that is returned by the plugin * @param info Pointer to OSyncPluginInfo which describes the plugin * @param error Pointer to error-struct - * @return Userdata returned by the plugin on success, NULL on error + * @return TREU if successful, FALSE otherwise */ OSYNC_EXPORT osync_bool osync_plugin_initialize(OSyncPlugin *plugin, void **plugin_data, OSyncPluginInfo *info, OSyncError **error); -/** @brief Finalize Plugin +/** @brief Finalize a Plugin * * @param plugin Pointer to the plugin * @param data Pointer to userdata which got returned by plugin initialize function Modified: trunk/opensync/plugin/opensync_plugin_config.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_config.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/plugin/opensync_plugin_config.h Mon Jan 19 10:36:26 2009 (r5189) @@ -81,8 +81,9 @@ * * @param config Contents of config file as OsyncPluginConfig object * @param path Path to file to load + * @param schemadir Path to the schema location. If schmadir is NULL the default value is used * @param error Pointer to error struct - * @returns True on success, False on failure - error will contain details + * @return True on success, False on failure - error will contain details */ OSYNC_EXPORT osync_bool osync_plugin_config_file_load(OSyncPluginConfig *config, const char *path, const char *schemadir, OSyncError **error); Modified: trunk/opensync/plugin/opensync_plugin_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/plugin/opensync_plugin_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -25,9 +25,9 @@ typedef osync_bool (* usable_fn) (OSyncError **); /** - * @defgroup OSyncPluginPrivateAPI OpenSync Plugin Internals + * @defgroup OSyncPluginInternalsAPI OpenSync Plugin Internals * @ingroup OSyncPluginPrivate - * @brief Private functions to manage plugins + * @brief Internal functions to manage plugins * */ Modified: trunk/opensync/xmlformat/opensync_xmlformat_schema_internals.h ============================================================================== --- trunk/opensync/xmlformat/opensync_xmlformat_schema_internals.h Mon Jan 19 01:31:16 2009 (r5188) +++ trunk/opensync/xmlformat/opensync_xmlformat_schema_internals.h Mon Jan 19 10:36:26 2009 (r5189) @@ -29,6 +29,7 @@ * @brief The internal part of the OSyncXMLFormatSchema * */ + /*@{*/ /** @@ -49,4 +50,6 @@ */ OSYNC_TEST_EXPORT OSyncXMLFormatSchema *osync_xmlformat_schema_new_path(const char *objtype, const char *path, OSyncError **error); +/*@}*/ + #endif /* OPENSYNC_XMLFORMAT_SCHEMA_INTERNALS_H_ */ |
From: <dg...@su...> - 2009-01-19 00:32:19
|
Author: dgollub Date: Mon Jan 19 01:31:16 2009 New Revision: 5188 URL: http://www.opensync.org/changeset/5188 Log: Don't use the objtype set by OSyncChange. Use the engine objtype for writing the mapping-entry into the mapping table. FIXME: adapt objtype value of OSyncChange to the "real" target objtype. Modified: trunk/opensync/engine/opensync_sink_engine.c Modified: trunk/opensync/engine/opensync_sink_engine.c ============================================================================== --- trunk/opensync/engine/opensync_sink_engine.c Mon Jan 19 01:20:46 2009 (r5187) +++ trunk/opensync/engine/opensync_sink_engine.c Mon Jan 19 01:31:16 2009 (r5188) @@ -244,7 +244,6 @@ /* FIXME: Don't mix up in this function objtypes */ /* osync_assert_msg(!strcmp(objtype, osync_change_get_objtype(entry_engine->change), "Mixed-objtype in final write!")); */ - const char *objtype = osync_change_get_objtype(entry_engine->change); if (osync_change_get_changetype(entry_engine->change) == OSYNC_CHANGE_TYPE_DELETED) { if (!osync_archive_delete_change(archive, osync_mapping_entry_get_id(entry), objtype, error)) |
From: <dg...@su...> - 2009-01-19 00:21:48
|
Author: dgollub Date: Mon Jan 19 01:20:46 2009 New Revision: 5187 URL: http://www.opensync.org/changeset/5187 Log: Move/reassign changes/entries with different objtype then the ObjEngine, to the native ObjEngine. This is required that entries get written via the native ObjEngine and via the inteded plugin sink function. This allows mixed-objtype syncing. Modified: trunk/opensync/engine/opensync_engine.c trunk/opensync/engine/opensync_engine_internals.h trunk/opensync/engine/opensync_obj_engine.c trunk/opensync/engine/opensync_obj_engine_internals.h Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Mon Jan 19 00:40:31 2009 (r5186) +++ trunk/opensync/engine/opensync_engine.c Mon Jan 19 01:20:46 2009 (r5187) @@ -927,6 +927,64 @@ } +osync_bool osync_engine_handle_mixed_objtypes(OSyncEngine *engine, OSyncError **error) +{ + OSyncList *o, *s, *e; + + for (o = engine->object_engines; o; o = o->next) { + OSyncObjEngine *objengine = o->data; + const char *objtype = objengine->objtype; + + osync_trace(TRACE_INTERNAL, "ObjEngine: %s", objtype); + + for (s = objengine->dummy_sink_engines; s; s = s->next) { + OSyncSinkEngine *sinkengine = s->data; + + for (e = sinkengine->entries; e; e = e->next) { + OSyncMappingEntryEngine *mapping_entry_engine = e->data; + OSyncChange *change; + OSyncObjFormat *objformat; + const char *current_objtype; + OSyncObjEngine *new_objengine; + OSyncSinkEngine *new_sinkengine; + + change = osync_entry_engine_get_change(mapping_entry_engine); + objformat = osync_change_get_objformat(change); + osync_assert(objformat); + current_objtype = osync_objformat_get_objtype(objformat); + + /* ... otherwise we need to reassign the mappin entry engine + * to different objengine + */ + new_objengine = osync_engine_find_objengine(engine, current_objtype); + if (!new_objengine) { + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Couldn't find Object Type Engine for Object Type \"%s\" " + "while preparing for write phase.", __NULLSTR(current_objtype)); + goto error; + } + + new_sinkengine = osync_obj_engine_find_proxy_sinkengine(new_objengine, sinkengine->proxy); + if (!new_sinkengine) { + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Couldn't find Sink Engine for Object Type \"%s\" " + "while preparing for write phase.", __NULLSTR(current_objtype)); + goto error; + } + + sinkengine->entries = osync_list_remove(sinkengine->entries, mapping_entry_engine); + new_sinkengine->entries = osync_list_append(new_sinkengine->entries, mapping_entry_engine); + + } + } + } + + return TRUE; + +error: + return FALSE; +} + static void _osync_engine_generate_end_conflicts_event(OSyncEngine *engine) { @@ -1041,23 +1099,36 @@ static void _osync_engine_generate_prepared_write_event(OSyncEngine *engine) { + OSyncError *locerror = NULL; + if (osync_bitcount(engine->obj_errors | engine->obj_prepared_write) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { - OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while preparing the write event. Aborting"); - osync_trace(TRACE_ERROR, "%s", osync_error_print(&locerror)); - osync_engine_set_error(engine, locerror); - osync_status_update_engine(engine, OSYNC_ENGINE_EVENT_ERROR, locerror); - osync_engine_event(engine, OSYNC_ENGINE_EVENT_ERROR); - //osync_error_unref(&locerror); + goto error; } else { osync_status_update_engine(engine, OSYNC_ENGINE_EVENT_PREPARED_WRITE, NULL); - osync_engine_event(engine, OSYNC_ENGINE_EVENT_PREPARED_WRITE); + if (!osync_engine_handle_mixed_objtypes(engine, &locerror)) + goto error; + + /* This is only for debugging purposes */ + osync_engine_trace_multiply_summary(engine); + if (engine->multiply_callback) + engine->multiply_callback(engine, engine->multiply_userdata); + else + osync_engine_event(engine, OSYNC_ENGINE_EVENT_PREPARED_WRITE); } } else osync_trace(TRACE_INTERNAL, "Not yet: %i", osync_bitcount(engine->obj_errors | engine->obj_prepared_write)); + return; + +error: + osync_trace(TRACE_ERROR, "%s", osync_error_print(&locerror)); + osync_engine_set_error(engine, locerror); + osync_status_update_engine(engine, OSYNC_ENGINE_EVENT_ERROR, locerror); + osync_engine_event(engine, OSYNC_ENGINE_EVENT_ERROR); + //osync_error_unref(&locerror); } static void _osync_engine_generate_written_event(OSyncEngine *engine) Modified: trunk/opensync/engine/opensync_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_engine_internals.h Mon Jan 19 00:40:31 2009 (r5186) +++ trunk/opensync/engine/opensync_engine_internals.h Mon Jan 19 01:20:46 2009 (r5187) @@ -117,6 +117,19 @@ */ OSYNC_TEST_EXPORT void osync_engine_trace_multiply_summary(OSyncEngine *engine); + +/** @brief Reassign entries with a different objtype then the ObjEngine, to the + * native ObjEngine. + * + * TODO: This needs serious profiling. + * + * @param engine Pointer to engine + * @param error Pointer to error-struct which get set on any error + * @returns TRUE on success, or FALSE on any error + * + */ +osync_bool osync_engine_handle_mixed_objtypes(OSyncEngine *engine, OSyncError **error); + /*@}*/ #endif /*OPENSYNC_ENGINE_INTERNALS_H_*/ Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Mon Jan 19 00:40:31 2009 (r5186) +++ trunk/opensync/engine/opensync_obj_engine.c Mon Jan 19 01:20:46 2009 (r5187) @@ -362,7 +362,6 @@ osync_bool osync_obj_engine_receive_change(OSyncObjEngine *objengine, OSyncClientProxy *proxy, OSyncChange *change, OSyncError **error) { OSyncSinkEngine *sinkengine = NULL; - OSyncList *s = NULL; OSyncList *e = NULL; osync_assert(objengine); @@ -370,12 +369,7 @@ osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, objengine, proxy, change, error); /* Find the sinkengine for the proxy */ - for (s = objengine->sink_engines; s; s = s->next) { - sinkengine = s->data; - if (sinkengine->proxy == proxy) - break; - sinkengine = NULL; - } + sinkengine = osync_obj_engine_find_proxy_sinkengine(objengine, proxy); if (!sinkengine) { osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to find sinkengine"); @@ -1184,6 +1178,23 @@ osync_error_ref(&error); } +OSyncSinkEngine *osync_obj_engine_find_proxy_sinkengine(OSyncObjEngine *engine, OSyncClientProxy *proxy) +{ + OSyncList *s; + OSyncSinkEngine *sinkengine; + osync_return_val_if_fail(engine, NULL); + osync_return_val_if_fail(proxy, NULL); + + for (s = engine->sink_engines; s; s = s->next) { + sinkengine = s->data; + if (sinkengine->proxy == proxy) + break; + sinkengine = NULL; + } + + return sinkengine; +} + OSyncSinkEngine *osync_obj_engine_nth_sinkengine(OSyncObjEngine *engine, unsigned int nth) { osync_return_val_if_fail(engine, NULL); Modified: trunk/opensync/engine/opensync_obj_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_obj_engine_internals.h Mon Jan 19 00:40:31 2009 (r5186) +++ trunk/opensync/engine/opensync_obj_engine_internals.h Mon Jan 19 01:20:46 2009 (r5187) @@ -113,7 +113,7 @@ * related to the OSyncObjEngine * * @param engine Pointer to an OSyncObjEngine which should start writing - @param error Pointer to error struct, which get set on any error + * @param error Pointer to error struct, which get set on any error * @returns TRUE on success, FALSE otherwise */ osync_bool osync_obj_engine_write(OSyncObjEngine *engine, OSyncError **error); @@ -141,5 +141,13 @@ */ void osync_obj_engine_written_callback(OSyncClientProxy *proxy, void *userdata, OSyncError *error); +/*! @brief Find OSyncSinkEngine for a specific OSyncClientProxy + * + * @param engine Pointer to OSyncObjEngine to prepare + * @param proxy Pointer to an OSyncClientProxy object + * @returns Pointer of OSyncSinkEngine of the associated proxy, otherwise NULL + */ +OSyncSinkEngine *osync_obj_engine_find_proxy_sinkengine(OSyncObjEngine *engine, OSyncClientProxy *proxy); + #endif /* OPENSYNC_OBJ_ENGINE_INTERNALS_H_ */ |
From: <dg...@su...> - 2009-01-18 23:41:38
|
Author: dgollub Date: Mon Jan 19 00:40:31 2009 New Revision: 5186 URL: http://www.opensync.org/changeset/5186 Log: Use two additional list to handle "active" and "dummy" sinks in OSyncObjEngine . Dropped "dummy"-sattribute from OSyncSinkEngine. Don't use the number "dummy" sinks in the public interface. osync_obj_engine_num_sink_engines() returns now the number of active sinks. All those changes are required for mixed-objtype syncing later. Modified: trunk/opensync/engine/opensync_obj_engine.c trunk/opensync/engine/opensync_obj_engine_internals.h trunk/opensync/engine/opensync_sink_engine.c trunk/opensync/engine/opensync_sink_engine_internals.h Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Sun Jan 18 20:15:11 2009 (r5185) +++ trunk/opensync/engine/opensync_obj_engine.c Mon Jan 19 00:40:31 2009 (r5186) @@ -108,7 +108,7 @@ osync_trace(TRACE_INTERNAL, "SlowSync requested during connect."); } - if (osync_bitcount(engine->sink_errors | engine->sink_connects) == osync_obj_engine_num_active_sinkengines(engine)) { + if (osync_bitcount(engine->sink_errors | engine->sink_connects) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_errors)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one sink_engine failed while connecting"); osync_obj_engine_set_error(engine, locerror); @@ -138,7 +138,7 @@ osync_status_update_member(engine->parent, osync_client_proxy_get_member(proxy), OSYNC_CLIENT_EVENT_CONNECT_DONE, engine->objtype, NULL); } - if (osync_bitcount(engine->sink_errors | engine->sink_connect_done) == osync_obj_engine_num_active_sinkengines(engine)) { + if (osync_bitcount(engine->sink_errors | engine->sink_connect_done) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_connect_done) < osync_bitcount(engine->sink_connects)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Fewer sink_engines reported connect_done than connected"); osync_obj_engine_set_error(engine, locerror); @@ -156,7 +156,7 @@ OSyncError *locerror = NULL; osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine); - if (osync_bitcount(engine->sink_errors | engine->sink_disconnects) == osync_obj_engine_num_active_sinkengines(engine)) { + if (osync_bitcount(engine->sink_errors | engine->sink_disconnects) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_disconnects) < osync_bitcount(engine->sink_connects)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Fewer sink_engines disconnected than connected"); osync_obj_engine_set_error(engine, locerror); @@ -345,7 +345,7 @@ osync_status_update_member(engine->parent, osync_client_proxy_get_member(proxy), OSYNC_CLIENT_EVENT_READ, engine->objtype, NULL); } - if (osync_bitcount(engine->sink_errors | engine->sink_get_changes) == osync_obj_engine_num_active_sinkengines(engine)) { + if (osync_bitcount(engine->sink_errors | engine->sink_get_changes) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_get_changes) < osync_bitcount(engine->sink_connects)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Fewer sink_engines reported get_changes than connected"); @@ -458,7 +458,7 @@ /* And that we received the written replies from all sinks */ /* TODO: Review if this is intended to even check for "dummy" sinks here!i - * Other commands/devent checks for osync_obj_engine_num_active_sinkengines()! */ + * Other commands/devent checks for osync_obj_engine_num_sinkengines()! */ if (osync_bitcount(engine->sink_errors | engine->sink_written) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_written) < osync_bitcount(engine->sink_connects)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Fewer sink_engines reported committed all than connected"); @@ -576,7 +576,7 @@ osync_status_update_member(engine->parent, osync_client_proxy_get_member(proxy), OSYNC_CLIENT_EVENT_SYNC_DONE, engine->objtype, NULL); } - if (osync_bitcount(engine->sink_errors | engine->sink_sync_done) == osync_obj_engine_num_active_sinkengines(engine)) { + if (osync_bitcount(engine->sink_errors | engine->sink_sync_done) == osync_obj_engine_num_sinkengines(engine)) { if (osync_bitcount(engine->sink_sync_done) < osync_bitcount(engine->sink_connects)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Fewer sink_engines reported sync_done than connected"); osync_obj_engine_set_error(engine, locerror); @@ -784,8 +784,6 @@ osync_trace(TRACE_INTERNAL, "Loaded %i mappings", osync_mapping_table_num_mappings(engine->mapping_table)); - engine->dummies = 0; - objtype = osync_obj_engine_get_objtype(engine); num = osync_engine_num_proxies(engine->parent); @@ -809,11 +807,11 @@ if (!sinkengine) goto error; - if (dummy_sink) { - osync_sink_engine_set_dummy(sinkengine, TRUE); - engine->dummies++; - } - + if (dummy_sink) + engine->dummy_sink_engines = osync_list_append(engine->dummy_sink_engines, sinkengine); + else + engine->active_sink_engines = osync_list_append(engine->active_sink_engines, sinkengine); + engine->sink_engines = osync_list_append(engine->sink_engines, sinkengine); } @@ -870,6 +868,11 @@ engine->sink_engines = osync_list_remove(engine->sink_engines, sinkengine); } + + osync_list_free(engine->active_sink_engines); + osync_list_free(engine->dummy_sink_engines); + engine->active_sink_engines = NULL; + engine->dummy_sink_engines = NULL; while (engine->conflicts) { mapping_engine = engine->conflicts->data; @@ -927,34 +930,25 @@ switch (cmd) { case OSYNC_ENGINE_COMMAND_CONNECT: - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { sinkengine = p->data; - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - if (!osync_client_proxy_connect(sinkengine->proxy, _osync_obj_engine_connect_callback, sinkengine, engine->objtype, engine->slowsync, error)) goto error; } break; case OSYNC_ENGINE_COMMAND_CONNECT_DONE: - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { sinkengine = p->data; - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - if (!osync_client_proxy_connect_done(sinkengine->proxy, _osync_obj_engine_connect_done_callback, sinkengine, engine->objtype, error)) goto error; } break; case OSYNC_ENGINE_COMMAND_READ: - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { sinkengine = p->data; - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - for (o = sinkengine->entries; o; o = o->next) { OSyncMappingEntryEngine *entry = o->data; OSyncChange *change = entry->change; @@ -976,7 +970,7 @@ write_sinks = _osync_obj_engine_num_write_sinks(engine); /* Get change entries since last sync. (get_changes) */ - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { OSyncMember *member = NULL; OSyncObjTypeSink *objtype_sink = NULL; @@ -984,9 +978,6 @@ member = osync_client_proxy_get_member(sinkengine->proxy); - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - objtype_sink = osync_member_find_objtype_sink(member, engine->objtype); /* Is there at least one other writeable sink? */ @@ -1099,23 +1090,17 @@ break; case OSYNC_ENGINE_COMMAND_SYNC_DONE: - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { sinkengine = p->data; - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - if (!osync_client_proxy_sync_done(sinkengine->proxy, _osync_obj_engine_sync_done_callback, sinkengine, engine->objtype, error)) goto error; } break; case OSYNC_ENGINE_COMMAND_DISCONNECT:; - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { sinkengine = p->data; - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - /* Don't call client disconnect functions if the sink is already disconnected. This avoids unintended disconnect calls of clients/plugins which might not prepared for a disconnect call when their never got connected. (testcases: *_connect_error, *_connect_timeout ..) */ @@ -1208,13 +1193,7 @@ unsigned int osync_obj_engine_num_sinkengines(OSyncObjEngine *engine) { osync_assert(engine); - return osync_list_length(engine->sink_engines); -} - -unsigned int osync_obj_engine_num_active_sinkengines(OSyncObjEngine *engine) -{ - osync_assert(engine); - return (osync_obj_engine_num_sinkengines(engine) - engine->dummies); + return osync_list_length(engine->active_sink_engines); } unsigned int osync_obj_engine_num_mapping_engines(OSyncObjEngine *engine) @@ -1238,7 +1217,7 @@ if (!merger_enabled && !converter_enabled) return TRUE; - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { OSyncSinkEngine *sinkengine = p->data; if (merger_enabled @@ -1265,22 +1244,11 @@ osync_assert(engine); - for (p = engine->sink_engines; p; p = p->next) { + for (p = engine->active_sink_engines; p; p = p->next) { OSyncSinkEngine *sinkengine = p->data; - /* FIXME: for "clean" mixed-objtype syncing - all peers should report - * via their native OSyncObjEngine. This temp. solution uses not the - * ObjTypeSink to write/commit changes. Later the "native" ObjEngine - * should be used. - - if (osync_sink_engine_is_dummy(sinkengine)) - continue; - */ - member = osync_client_proxy_get_member(sinkengine->proxy); objtype_sink = osync_member_find_objtype_sink(member, engine->objtype); - - /* If sink could not be found use "data" sink if available */ /* TODO: Get rid of hardcoded-"data". Make this indepdendent of "data" */ Modified: trunk/opensync/engine/opensync_obj_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_obj_engine_internals.h Sun Jan 18 20:15:11 2009 (r5185) +++ trunk/opensync/engine/opensync_obj_engine_internals.h Mon Jan 19 00:40:31 2009 (r5186) @@ -46,6 +46,12 @@ /** List of OSyncSinkEngine-elements */ OSyncList *sink_engines; + /** List of Active OSyncSinkEngine-elements */ + OSyncList *active_sink_engines; + + /** List of Dummy OSyncSinkEngine-elements */ + OSyncList *dummy_sink_engines; + /** Pointer to OSyncObjEngine assinged error struct */ OSyncError *error; /** Pointer to format enviornment */ @@ -79,30 +85,14 @@ /** Conflicts already solved */ osync_bool conflicts_solved; - - /** Total number of "dummy" OSyncSinkEngine-elements */ - unsigned int dummies; }; OSyncMappingEngine *_osync_obj_engine_create_mapping_engine(OSyncObjEngine *engine, OSyncError **error); -/*! @brief Get number of "active" Sink Engines (excluded "dummy" Sink Engines) - * in ObjEngine - * - * This function should be used to determine the number of "active" Sink - * Engines. Original purpose of this function is to determine the number of - * Sink Engine to wait for. Excluded are all Sink Engines which have the - * attribute "dummy" set. - * - * @param engine Pointer to OSyncObjEngine - * @returns Number of "active" Sink Engines - */ -unsigned int osync_obj_engine_num_active_sinkengines(OSyncObjEngine *engine); - /*! @brief Get total number of OSyncMappingEngines of this OSyncObjEngine * * @param engine Pointer to OSyncObjEngine - * @returns Total number of "active" and "dummy" Sink Engines + * @returns Total number of Mapping Engines */ unsigned int osync_obj_engine_num_mapping_engines(OSyncObjEngine *engine); Modified: trunk/opensync/engine/opensync_sink_engine.c ============================================================================== --- trunk/opensync/engine/opensync_sink_engine.c Sun Jan 18 20:15:11 2009 (r5185) +++ trunk/opensync/engine/opensync_sink_engine.c Mon Jan 19 00:40:31 2009 (r5186) @@ -109,18 +109,6 @@ return !!(objengine->sink_connects & (1 << engine->position)); } -void osync_sink_engine_set_dummy(OSyncSinkEngine *engine, osync_bool isdummy) -{ - osync_assert(engine); - engine->dummy_sink = isdummy; -} - -osync_bool osync_sink_engine_is_dummy(OSyncSinkEngine *engine) -{ - osync_assert(engine); - return engine->dummy_sink; -} - const OSyncList *osync_sink_engine_get_mapping_entry_engines(OSyncSinkEngine *engine) { osync_return_val_if_fail(engine, NULL); Modified: trunk/opensync/engine/opensync_sink_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_sink_engine_internals.h Sun Jan 18 20:15:11 2009 (r5185) +++ trunk/opensync/engine/opensync_sink_engine_internals.h Mon Jan 19 00:40:31 2009 (r5186) @@ -37,8 +37,6 @@ OSyncList *entries; /** List of assinged OSyncMappingEntryEngine elemebts, but unmapped (no counter-entry) */ OSyncList *unmapped; - /** "dummy" attribute, when set no proxy functions of OSyncSinkEngine get called */ - osync_bool dummy_sink; }; OSyncSinkEngine *osync_sink_engine_new(int position, OSyncClientProxy *proxy, OSyncObjEngine *objengine, OSyncError **error); @@ -46,27 +44,6 @@ void osync_sink_engine_unref(OSyncSinkEngine *engine); osync_bool osync_sink_engine_is_connected(OSyncSinkEngine *engine); - -/*! @brief Set "dummy" attribute for OSyncSinkEngine - * - * If the "dummy" attribute set, then OSyncSinkEngine will not call any proxy - * function inside the OSyncObjEngine. The original purpose of this is to have - * a OSyncSinkEngine for "peers" which make use of mixed-ObjTypes. For this - * reason primarly the lists of OSyncSinkEngine (i.e. entries and unmapped - * entries) get used for mixed-ObjType mappings. - * - * @param engine Pointer to an OSyncSinkEngine which should act as "dummy" - * @param isdummy TRUE or FALSE to set the "dummy" attribute - */ -void osync_sink_engine_set_dummy(OSyncSinkEngine *engine, osync_bool isdummy); - -/*! @brief Get state of "dummy" attribute of OSyncSinkEngine - * - * @param engine Pointer to an OSyncSinkEngine which should act as "dummy" - * @returns TRUE if engine got set as "dummy", FALSE otherwise - */ -osync_bool osync_sink_engine_is_dummy(OSyncSinkEngine *engine); - /*! @brief Demerge all entries of OSyncSinkEngine * * If the Member/Client of the OSyncSinkEngine doesn't have capabilities |
From: <dg...@su...> - 2009-01-18 19:16:16
|
Author: mkoller Date: Sun Jan 18 20:15:11 2009 New Revision: 5185 URL: http://www.opensync.org/changeset/5185 Log: use new sink argument in callbacks directly Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Sun Jan 18 14:10:53 2009 (r5184) +++ plugins/kdepim/src/datasource.cpp Sun Jan 18 20:15:11 2009 (r5185) @@ -14,13 +14,13 @@ /* NB: the userdata passed to the sink callbacks is not the sink's userdata, as * you might expect, but instead the plugin's userdata, which in our case is the * KdePluginImplementation object pointer. So we need to get the sink object from - * osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)) + * osync_objtype_sink_get_userdata(sink) */ static void connect_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(sink); obj->connect(info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -30,7 +30,7 @@ static void disconnect_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(sink); obj->disconnect(info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -41,7 +41,7 @@ OSyncContext *ctx, osync_bool slow_sync,void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(sink); obj->get_changes(info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -52,7 +52,7 @@ OSyncContext *ctx, OSyncChange *chg, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx, chg); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(sink); obj->commit(info, ctx, chg); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -62,7 +62,7 @@ static void sync_done_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(sink); obj->sync_done(info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } |
From: <dg...@su...> - 2009-01-18 13:11:58
|
Author: bricks Date: Sun Jan 18 14:10:53 2009 New Revision: 5184 URL: http://www.opensync.org/changeset/5184 Log: workaround for ticket #1044 prevent call to client_proxy_shutdown on mac os x Modified: trunk/CMakeLists.txt trunk/config.h.cmake trunk/opensync/client/opensync_client_proxy.c Modified: trunk/CMakeLists.txt ============================================================================== --- trunk/CMakeLists.txt Sun Jan 18 13:32:32 2009 (r5183) +++ trunk/CMakeLists.txt Sun Jan 18 14:10:53 2009 (r5184) @@ -125,6 +125,10 @@ SET( CMAKE_REQUIRED_DEFINITIONS "" ) CHECK_FUNCTION_EXISTS( flock HAVE_FLOCK ) +IF ( APPLE ) + SET( OPENSYNC_PREVENT_CLIENT_SHUTDOWN "1" ) +ENDIF ( APPLE ) + # add uninstall target CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/cmake/modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) Modified: trunk/config.h.cmake ============================================================================== --- trunk/config.h.cmake Sun Jan 18 13:32:32 2009 (r5183) +++ trunk/config.h.cmake Sun Jan 18 14:10:53 2009 (r5184) @@ -25,4 +25,6 @@ #define OPENSYNC_TESTDATA "${CMAKE_CURRENT_SOURCE_DIR}/tests/data" #cmakedefine OPENSYNC_UNITTESTS +#cmakedefine OPENSYNC_PREVENT_CLIENT_SHUTDOWN + #endif /* _CONFIG_H_OPENSYNC */ Modified: trunk/opensync/client/opensync_client_proxy.c ============================================================================== --- trunk/opensync/client/opensync_client_proxy.c Sun Jan 18 13:32:32 2009 (r5183) +++ trunk/opensync/client/opensync_client_proxy.c Sun Jan 18 14:10:53 2009 (r5184) @@ -1055,8 +1055,9 @@ goto error; if (proxy->type == OSYNC_START_TYPE_THREAD) { +#ifndef OPENSYNC_PREVENT_CLIENT_SHUTDOWN osync_client_shutdown(proxy->client); - +#endif osync_client_unref(proxy->client); } else if (proxy->type == OSYNC_START_TYPE_PROCESS) { if (proxy->child_pid) { |
From: <dg...@su...> - 2009-01-18 12:33:42
|
Author: bricks Date: Sun Jan 18 13:32:32 2009 New Revision: 5183 URL: http://www.opensync.org/changeset/5183 Log: moved doxygen annotations and rearranged the groups Added: trunk/opensync/format/opensync_time_private.h Modified: trunk/opensync/engine/opensync_status_internals.h trunk/opensync/format/opensync_time.c trunk/opensync/format/opensync_time.h trunk/opensync/plugin/opensync_context_private.h trunk/opensync/plugin/opensync_objtype_sink_internals.h trunk/opensync/plugin/opensync_objtype_sink_private.h trunk/opensync/plugin/opensync_plugin_advancedoptions_private.h trunk/opensync/plugin/opensync_plugin_authentication_private.h trunk/opensync/plugin/opensync_plugin_config_private.h trunk/opensync/plugin/opensync_plugin_connection_internals.h trunk/opensync/plugin/opensync_plugin_connection_private.h trunk/opensync/plugin/opensync_plugin_env_internals.h trunk/opensync/plugin/opensync_plugin_env_private.h trunk/opensync/plugin/opensync_plugin_info_private.h trunk/opensync/plugin/opensync_plugin_internals.h trunk/opensync/plugin/opensync_plugin_localization_private.h trunk/opensync/plugin/opensync_plugin_private.h trunk/opensync/plugin/opensync_plugin_resource_private.h Modified: trunk/opensync/engine/opensync_status_internals.h ============================================================================== --- trunk/opensync/engine/opensync_status_internals.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/engine/opensync_status_internals.h Sun Jan 18 13:32:32 2009 (r5183) @@ -22,10 +22,8 @@ #define OPENSYNC_STATUS_INTERNALS_H_ /** - * @defgroup OSyncStatusPrivate OpenSync Status Private - * @ingroup OSyncPrivate * @defgroup OSyncStatusInternalAPI OpenSync Status Internals - * @ingroup OSyncStatusPrivate + * @ingroup OSyncEnginePrivate * @brief Internals of OpenSync Status */ Modified: trunk/opensync/format/opensync_time.c ============================================================================== --- trunk/opensync/format/opensync_time.c Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/format/opensync_time.c Sun Jan 18 13:32:32 2009 (r5183) @@ -24,6 +24,7 @@ #include "opensync.h" #include "opensync_time.h" +#include "opensync_time_private.h" #include "opensync_internals.h" #ifdef _WIN32 @@ -66,11 +67,6 @@ /*****************************************************************************/ -/*! @brief Function remove dashes from datestamp and colon - * - * @param timestamp The timestamp which gets cleaned - * @returns valid vtime stamp in YYYYMMDD[THHMMDD[Z]] (the caller is responsible for freeing) - */ static char *osync_time_timestamp_remove_dash(const char *timestamp) { int i, len; Modified: trunk/opensync/format/opensync_time.h ============================================================================== --- trunk/opensync/format/opensync_time.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/format/opensync_time.h Sun Jan 18 13:32:32 2009 (r5183) @@ -42,27 +42,27 @@ * Time formatting helper */ -/*! @brief Function returns a date-timestamp in OSyncTime Spec format +/** @brief Function returns a date-timestamp in OSyncTime Spec format * * @param vtime The timestamp which gets converted to a valid osync date-timestamp * @returns vtime date-timestring (the caller is responsible for freeing) */ OSYNC_EXPORT char *osync_time_timestamp(const char *vtime); -/*! @brief Function returns a date without timestamp in OSyncTime Spec format +/** @brief Function returns a date without timestamp in OSyncTime Spec format * * @param vtime The timestamp which gets converted to a single datestamp * @returns valid single datestamp YYYYMMDD (the caller is responsible for freeing) */ OSYNC_EXPORT char *osync_time_datestamp(const char *vtime); -/*! @brief Function returns TRUE if vtime is a valid datestamp (YYYYMMDD) +/** @brief Function returns TRUE if vtime is a valid datestamp (YYYYMMDD) * * @returns FALSE if vtime includes a timestamp, TRUE on a single datestamp */ OSYNC_EXPORT osync_bool osync_time_isdate(const char *vformat); -/*! @brief Function returns TRUE if vtime is in UTC (YYYYMMDDTHH:MM:SSZ) +/** @brief Function returns TRUE if vtime is in UTC (YYYYMMDDTHH:MM:SSZ) * * @returns FALSE if vtime includes no Zulu, TRUE if the timestamp is UTC */ @@ -83,14 +83,14 @@ */ /*@{*/ -/*! @brief Function converts vtime to tm struct +/** @brief Function converts vtime to tm struct * * @param vtime The formatted timestamp (YYYYMMDDTHHMMSS) * @returns struct tm (caller is responsible for freeing) */ OSYNC_EXPORT struct tm *osync_time_vtime2tm(const char *vtime); -/*! @brief Function converts struct tm in vtime string +/** @brief Function converts struct tm in vtime string * * YYYYMMDDTHHMMSS[Z] * Returned timezone is equal to the timezone of struct tm. @@ -115,7 +115,7 @@ */ /*@{*/ -/*! @brief Function converts vtime to unix time +/** @brief Function converts vtime to unix time * * @param offset Seconds of UTC offset * @param vtime The osync formmatted timestamp @@ -123,7 +123,7 @@ */ OSYNC_EXPORT time_t osync_time_vtime2unix(const char *vtime, int offset); -/*! @brief Function converts unix timestamp to vtime in UTC +/** @brief Function converts unix timestamp to vtime in UTC * * @param timestamp The unix timestamp which gets converted * @returns vtime formatted as YYYYMMDDTHHMMSSZ (caller is responsible for freeing) @@ -132,7 +132,7 @@ /* Unix time_t converters */ -/*! @brief Function converts struct tm, in localtime, to unix timestamp. +/** @brief Function converts struct tm, in localtime, to unix timestamp. * This is the same as calling mktime(), except that * localtime is not modified, and tm_isdst is always * forced to -1. Aka, mktime(). @@ -142,7 +142,7 @@ */ OSYNC_EXPORT time_t osync_time_localtm2unix(const struct tm *localtime); -/*! @brief Function converts struct tm, in utc, to unix timestamp. +/** @brief Function converts struct tm, in utc, to unix timestamp. * * @param utctime The struct tm, in utc, which gets converted * @returns time_t (in UTC of course) @@ -158,7 +158,7 @@ */ OSYNC_EXPORT time_t osync_time_utctm2unix(const struct tm *utctime); -/*! @brief Function converts unix timestamp to struct tm in localtime. +/** @brief Function converts unix timestamp to struct tm in localtime. * This is the same as calling localtime_r(), except you * have to free the returned value. Aka, localtime(). * @@ -167,7 +167,7 @@ */ OSYNC_EXPORT struct tm *osync_time_unix2localtm(const time_t *timestamp); -/*! @brief Function converts unix timestamp to struct tm in utc. +/** @brief Function converts unix timestamp to struct tm in utc. * This is the same as calling gmtime_r(), except you * have to free the returned value. Aka, gmtime(). * @@ -193,7 +193,7 @@ */ /*@{*/ -/*! @brief Function gets offset of parameter time between UTC and +/** @brief Function gets offset of parameter time between UTC and * localtime in seconds east of UTC. (i.e. east is positive, * west is negative) * @@ -203,7 +203,7 @@ */ OSYNC_EXPORT int osync_time_timezone_diff(const struct tm *local); -/*! @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 * following fields can be relied upon in the result: * tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year. @@ -214,7 +214,7 @@ */ OSYNC_EXPORT struct tm *osync_time_tm2utc(const struct tm *ltime, int offset); -/*! @brief Function converts (struct tm) utime from UTC to localtime +/** @brief Function converts (struct tm) utime from UTC to localtime * Paramter offset is used as UTC offset. Note that _only_ the * following fields can be relied upon in the result: * tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year. @@ -225,7 +225,7 @@ */ OSYNC_EXPORT struct tm *osync_time_tm2localtime(const struct tm *utime, int offset); -/*! @brief Functions converts a localtime vtime stamp to a UTC vtime stamp +/** @brief Functions converts a localtime vtime stamp to a UTC vtime stamp * * @param localtime The local timestamp in vtime format * @param offset Seconds of UTC offset, in seconds east of UTC. @@ -233,7 +233,7 @@ */ OSYNC_EXPORT char *osync_time_vtime2utc(const char* localtime, int offset); -/*! @brief Functions converts a UTC vtime stamp to a localtime vtime stamp +/** @brief Functions converts a UTC vtime stamp to a localtime vtime stamp * * @param utc The timestap in UTC timezone which gets converted to localtime * @param offset The offset in seconds between UTC and localtime @@ -241,7 +241,7 @@ */ OSYNC_EXPORT char *osync_time_vtime2localtime(const char* utc, int offset); -/*! @brief Function converts UTC offset string in offset in seconds +/** @brief Function converts UTC offset string in offset in seconds * * @param offset The offset string of the form a timezone field (Example +0200) * @returns seconds of UTC offset @@ -264,14 +264,14 @@ /*@{*/ -/*! @brief Functions converts timestamps of vcal to localtime +/** @brief Functions converts timestamps of vcal to localtime * * @param vcal The vcalendar which has to be converted. * @return modified vcalendar with local timestamps (related to system time) */ OSYNC_EXPORT char *osync_time_vcal2localtime(const char *vcal); -/*! @brief Functions converts timestamps of vcal to UTC +/** @brief Functions converts timestamps of vcal to UTC * * @param vcal The vcalendar which has to be converted. * @return modified vcalendar with UTC timestamps (related to system time) @@ -291,14 +291,14 @@ */ /*@{*/ -/*! @brief Functions converts seconds in duration before or after alarm event +/** @brief Functions converts seconds in duration before or after alarm event * * @param seconds * @returns ical alarm duration string (caller is preponsible for freeing) */ OSYNC_EXPORT char *osync_time_sec2alarmdu(int seconds); -/*! @brief Functions converts alarm duration event to seconds needed for reminder of vcal/ical +/** @brief Functions converts alarm duration event to seconds needed for reminder of vcal/ical * * TODO: Test support for ALARM after/before end and after start * @@ -320,7 +320,7 @@ */ /*@{*/ -/*! @brief Function converts a week day string to the struct tm wday integer. +/** @brief Function converts a week day string to the struct tm wday integer. * * FIXME: how do we handle iCal weekday strings with multiple days? * something like the following? @@ -331,7 +331,7 @@ */ OSYNC_EXPORT int osync_time_str2wday(const char *swday); -/*! @brief Function determines the exact date of relative information. +/** @brief Function determines the exact date of relative information. * It is used for example to determine the last sunday of a month (-1SU) * in a specific year. * Note that the RFC2445 spec states that a weekday without Added: trunk/opensync/format/opensync_time_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/opensync/format/opensync_time_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -0,0 +1,33 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2004-2005 Armin Bauer <arm...@op...> + * Copyright (C) 2006-2008 Daniel Gollub <dg...@su...> + * Copyright (C) 2007 Chris Frey <cd...@ne...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_TIME_PRIVATE_H_ +#define _OPENSYNC_TIME_PRIVATE_H_ + +/** @brief Function remove dashes from datestamp and colon + * + * @param timestamp The timestamp which gets cleaned + * @returns valid vtime stamp in YYYYMMDD[THHMMDD[Z]] (the caller is responsible for freeing) + */ +static char *osync_time_timestamp_remove_dash(const char *timestamp); + +#endif /* _OPENSYNC_TIME_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_context_private.h ============================================================================== --- trunk/opensync/plugin/opensync_context_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_context_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,6 +21,13 @@ #ifndef _OPENSYNC_CONTEXT_PRIVATE_H_ #define _OPENSYNC_CONTEXT_PRIVATE_H_ +/** + * @defgroup OSyncContextPrivate OpenSync Context Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + struct OSyncContext { OSyncContextCallbackFn callback_function; OSyncContextCallbackFn warning_function; @@ -30,4 +37,6 @@ int ref_count; }; +/*@}*/ + #endif /*_OPENSYNC_CONTEXT_PRIVATE_H_*/ Modified: trunk/opensync/plugin/opensync_objtype_sink_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink_internals.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_objtype_sink_internals.h Sun Jan 18 13:32:32 2009 (r5183) @@ -22,22 +22,23 @@ #define OPENSYNC_OBJTYPE_SINK_INTERNALS_H_ /** - * @defgroup OSyncObjTypeSinkPrivateAPI OpenSync Object Type Sink Internals - * @ingroup OSyncPrivate + * @defgroup OSyncObjTypeSinkInternalAPI OpenSync Object Type Sink Internals + * @ingroup OSyncPluginPrivate * @brief Internal functions for managing object type sinks * */ + /*@{*/ -/*! @brief Check if sink has an anchor request. +/** @brief Check if sink has an anchor request. * * @param sink Pointer to the sink * @returns TRUE if the sink has an anchor request, FALSE otherwise */ osync_bool osync_objtype_sink_has_anchor(OSyncObjTypeSink *sink); -/*! @brief Set the OSyncAnchor for this sink +/** @brief Set the OSyncAnchor for this sink * * This Anchor is sink specific and can store persistent, sink specific data. * Originally designed to detect if a certain value changed since last @@ -50,14 +51,14 @@ */ void osync_objtype_sink_set_anchor(OSyncObjTypeSink *sink, OSyncAnchor *anchor); -/*! @brief Checks if sink has a read single entries function (read) +/** @brief Checks if sink has a read single entries function (read) * * @param sink Pointer to the sink * @returns TRUE if the sink has a read single entries function (read), FALSE otherwise */ osync_bool osync_objtype_sink_get_function_read(OSyncObjTypeSink *sink); -/*! @brief Sets the status of the read sink function +/** @brief Sets the status of the read sink function * * @param sink Pointer to sink * @param read TRUE if the sink has a read function, FALSE otherwise @@ -65,28 +66,28 @@ void osync_objtype_sink_set_function_read(OSyncObjTypeSink *sink, osync_bool read); -/*! @brief Checks if sink has a get latest changes function (get_changes) +/** @brief Checks if sink has a get latest changes function (get_changes) * * @param sink Pointer to the sink * @returns TRUE if the sink has a get latest changes function (get_changes), FALSE otherwise */ osync_bool osync_objtype_sink_get_function_getchanges(OSyncObjTypeSink *sink); -/*! @brief Sets the status of the get_changes sink function +/** @brief Sets the status of the get_changes sink function * * @param sink Pointer to sink * @param getchanges TRUE if the sink has a get_changes function, FALSE otherwise */ void osync_objtype_sink_set_function_getchanges(OSyncObjTypeSink *sink, osync_bool getchanges); -/*! @brief Checks if sink has a write function (commit) +/** @brief Checks if sink has a write function (commit) * * @param sink Pointer to the sink * @returns TRUE if the sink has a write function (commit), FALSE otherwise */ osync_bool osync_objtype_sink_get_function_write(OSyncObjTypeSink *sink); -/*! @brief Sets the status of the write sink function +/** @brief Sets the status of the write sink function * * @param sink Pointer to sink * @param write TRUE if the sink has a write function, FALSE otherwise @@ -94,7 +95,7 @@ void osync_objtype_sink_set_function_write(OSyncObjTypeSink *sink, osync_bool write); -/*! @brief Get the current or default connect timeout in seconds +/** @brief Get the current or default connect timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -102,7 +103,7 @@ */ unsigned int osync_objtype_sink_get_connect_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current connect timeout in seconds +/** @brief Get the current connect timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -111,7 +112,7 @@ unsigned int osync_objtype_sink_get_connect_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default disconnect timeout in seconds +/** @brief Get the current or default disconnect timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -119,7 +120,7 @@ */ unsigned int osync_objtype_sink_get_disconnect_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current disconnect timeout in seconds +/** @brief Get the current disconnect timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -128,7 +129,7 @@ unsigned int osync_objtype_sink_get_disconnect_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default getchanges timeout in seconds +/** @brief Get the current or default getchanges timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -136,7 +137,7 @@ */ unsigned int osync_objtype_sink_get_getchanges_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current getchanges timeout in seconds +/** @brief Get the current getchanges timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -145,7 +146,7 @@ unsigned int osync_objtype_sink_get_getchanges_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default commit timeout in seconds +/** @brief Get the current or default commit timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -153,7 +154,7 @@ */ unsigned int osync_objtype_sink_get_commit_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current commit timeout in seconds +/** @brief Get the current commit timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -162,7 +163,7 @@ unsigned int osync_objtype_sink_get_commit_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default batchcommit timeout in seconds +/** @brief Get the current or default batchcommit timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -170,7 +171,7 @@ */ unsigned int osync_objtype_sink_get_batchcommit_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current batchcommit timeout in seconds +/** @brief Get the current batchcommit timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -179,7 +180,7 @@ unsigned int osync_objtype_sink_get_batchcommit_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default committedall timeout in seconds +/** @brief Get the current or default committedall timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -187,7 +188,7 @@ */ unsigned int osync_objtype_sink_get_committedall_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current committedall timeout in seconds +/** @brief Get the current committedall timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -196,7 +197,7 @@ unsigned int osync_objtype_sink_get_committedall_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default syncdone timeout in seconds +/** @brief Get the current or default syncdone timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -204,7 +205,7 @@ */ unsigned int osync_objtype_sink_get_syncdone_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current syncdone timeout in seconds +/** @brief Get the current syncdone timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -212,7 +213,7 @@ */ unsigned int osync_objtype_sink_get_syncdone_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default connectdone timeout in seconds +/** @brief Get the current or default connectdone timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -220,7 +221,7 @@ */ unsigned int osync_objtype_sink_get_connectdone_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current connectdone timeout in seconds +/** @brief Get the current connectdone timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -228,7 +229,7 @@ */ unsigned int osync_objtype_sink_get_connectdone_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default write timeout in seconds +/** @brief Get the current or default write timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -236,7 +237,7 @@ */ unsigned int osync_objtype_sink_get_write_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current write timeout in seconds +/** @brief Get the current write timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -245,7 +246,7 @@ unsigned int osync_objtype_sink_get_write_timeout(OSyncObjTypeSink *sink); -/*! @brief Get the current or default read timeout in seconds +/** @brief Get the current or default read timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds @@ -253,7 +254,7 @@ */ unsigned int osync_objtype_sink_get_read_timeout_or_default(OSyncObjTypeSink *sink); -/*! @brief Get the current read timeout in seconds +/** @brief Get the current read timeout in seconds * * @param sink Pointer to the sink * @return The timeout in seconds Modified: trunk/opensync/plugin/opensync_objtype_sink_private.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_objtype_sink_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,6 +21,13 @@ #ifndef OPENSYNC_OBJTYPE_SINK_PRIVATE_H_ #define OPENSYNC_OBJTYPE_SINK_PRIVATE_H_ +/** + * @defgroup OSyncObjTypeSinkPrivateAPI OpenSync Object Type Sink Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + #define OSYNC_SINK_TIMEOUT_TRANSPORT 30 #define OSYNC_SINK_TIMEOUT_SINGLEIO 30 #define OSYNC_SINK_TIMEOUT_BATCHIO 1800 @@ -119,5 +126,7 @@ osync_bool available; }; +/*@}*/ + #endif /* OPENSYNC_OBJTYPE_SINK_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_advancedoptions_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_advancedoptions_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_advancedoptions_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,11 +21,16 @@ #ifndef _OPENSYNC_PLUGIN_ADVANCEDOPTIONS_PRIVATE_H_ #define _OPENSYNC_PLUGIN_ADVANCEDOPTIONS_PRIVATE_H_ -/*! @brief Gives information about advanced plugin options - * - * @ingroup OSyncPluginAdvancedOptionPrivateAPI - **/ +/** + * @defgroup OSyncPluginAdvancedOptionsPrivateAPI OpenSync Plugin Advanced Options Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ +/** + * @brief Gives information about advanced plugin options + **/ struct OSyncPluginAdvancedOption { /** Display Name - this appears in the UI */ @@ -80,6 +85,7 @@ int ref_count; }; -#endif /* _OPENSYNC_PLUGIN_ADVANCEDOPTIONS_PRIVATE_H_ */ +/*@}*/ +#endif /* _OPENSYNC_PLUGIN_ADVANCEDOPTIONS_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_authentication_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_authentication_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_authentication_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,9 +21,15 @@ #ifndef _OPENSYNC_PLUGIN_AUTHENTICATON_PRIVATE_H_ #define _OPENSYNC_PLUGIN_AUTHENTICATON_PRIVATE_H_ -/*! @brief Gives information about required authentication settings - * - * @ingroup OSyncPluginAuthenticationPrivateAPI +/** + * @defgroup OSyncPluginAuthenticationPrivateAPI OpenSync Plugin Authentication Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief Gives information about required authentication settings **/ struct OSyncPluginAuthentication { /** Username (or Login) to identifiy or authentifiy */ @@ -40,5 +46,7 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_AUTHENTICATON_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_config_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_config_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_config_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -23,9 +23,15 @@ #define OSYNC_PLUGIN_CONFING_SCHEMA "plugin_config.xsd" -/*! @brief Gives information about the plugin configuration - * - * @ingroup OSyncPluginConfigPrivateAPI +/** + * @defgroup OSyncPluginConfigPrivateAPI OpenSync Plugin Config Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief Gives information about the plugin configuration **/ struct OSyncPluginConfig { /** Advanced Options */ @@ -46,5 +52,7 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_CONFIG_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_connection_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_connection_internals.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_connection_internals.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,12 +21,16 @@ #ifndef _OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_ #define _OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_ -/*! @brief OSyncPluginConnectionType String Map - * - * @ingroup OSyncPluginConnectionInternalsAPI - **/ +/** + * @defgroup OSyncPluginConnectionInternalsAPI OpenSync Plugin Connection Internals + * @ingroup OSyncPluginPrivate + */ +/*@{*/ +/** + * @brief OSyncPluginConnectionType String Map + **/ typedef struct { OSyncPluginConnectionType type; const char *string; @@ -34,5 +38,7 @@ const char *osync_plugin_connection_get_type_string(OSyncPluginConnectionType conn_type); +/*@}*/ + #endif /*_OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_*/ Modified: trunk/opensync/plugin/opensync_plugin_connection_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_connection_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_connection_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,9 +21,15 @@ #ifndef _OPENSYNC_PLUGIN_CONNECTION_PRIVATE_H_ #define _OPENSYNC_PLUGIN_CONNECTION_PRIVATE_H_ -/*! @brief Gives information about the current connection type - * - * @ingroup OSyncPluginConnectionPrivateAPI +/** + * @defgroup OSyncPluginConnectionPrivateAPI OpenSync Plugin Connection Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief Gives information about the current connection type **/ struct OSyncPluginConnection { /** Connection type */ @@ -70,5 +76,7 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_CONNECTION_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_env_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_env_internals.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_env_internals.h Sun Jan 18 13:32:32 2009 (r5183) @@ -22,14 +22,15 @@ #define _OPENSYNC_PLUGIN_ENV_INTERNALS_H_ /** - * @defgroup OSyncPluginEnvPrivateAPI OpenSync Environment Internals - * @ingroup OSyncPrivate - * @brief The private API of the opensync environment + * @defgroup OSyncPluginEnvInternalAPI OpenSync Plugin Environment Internals + * @ingroup OSyncPluginPrivate + * @brief The internal API of the opensync plugin environment * */ + /*@{*/ -/*! @brief Loads a module into the plugin environment +/** @brief Loads a module into the plugin environment * * @param env Pointer to a plugin environment * @param filename Module filename, as full path, to load @@ -39,7 +40,7 @@ */ osync_bool osync_plugin_env_load_module(OSyncPluginEnv *env, const char *filename, OSyncError **error); -/*! @brief Checks if plugin is usable +/** @brief Checks if plugin is usable * * @param env Pointer to a OSyncPluginEnv environment * @param pluginname The name of the plugin Modified: trunk/opensync/plugin/opensync_plugin_env_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_env_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_env_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,6 +21,13 @@ #ifndef _OPENSYNC_PLUGIN_ENV_PRIVATE_H_ #define _OPENSYNC_PLUGIN_ENV_PRIVATE_H_ +/** + * @defgroup OSyncPluginEnvPrivateAPI OpenSync Plugin Environment Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + struct OSyncPluginEnv { OSyncList *plugins; @@ -31,4 +38,6 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_ENV_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_info_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_info_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_info_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,6 +21,16 @@ #ifndef OPENSYNC_PLUGIN_INFO_PRIVATE_H_ #define OPENSYNC_PLUGIN_INFO_PRIVATE_H_ +/** + * @defgroup OSyncPluginInfoPrivateAPI OpenSync Plugin Info Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief + */ struct OSyncPluginInfo { void *loop; OSyncPluginConfig *config; @@ -43,4 +53,6 @@ #endif }; +/*@}*/ + #endif /* OPENSYNC_PLUGIN_INFO_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_internals.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_internals.h Sun Jan 18 13:32:32 2009 (r5183) @@ -26,13 +26,14 @@ /** * @defgroup OSyncPluginPrivateAPI OpenSync Plugin Internals - * @ingroup OSyncPrivate + * @ingroup OSyncPluginPrivate * @brief Private functions to manage plugins * */ + /*@{*/ -/*! @brief Checks if a plugin is available and usable +/** @brief Checks if a plugin is available and usable * * @param plugin The plugin to check * @param error If the return was FALSE, will contain information on why the plugin is not available @@ -41,7 +42,7 @@ */ OSYNC_TEST_EXPORT osync_bool osync_plugin_is_usable(OSyncPlugin *plugin, OSyncError **error); -/*! @brief Set timeout interval for plugin "usable" function +/** @brief Set timeout interval for plugin "usable" function * * @param plugin The plugin to check * @param timeout Timeout value @@ -49,7 +50,7 @@ */ OSYNC_TEST_EXPORT void osync_plugin_set_useable_timeout(OSyncPlugin *plugin, unsigned int timeout); -/*! @brief Get timeout interval for plugin "usable" function +/** @brief Get timeout interval for plugin "usable" function * * @param plugin The plugin to check * @return Timeout value @@ -57,7 +58,7 @@ */ OSYNC_TEST_EXPORT unsigned int osync_plugin_get_useable_timeout(OSyncPlugin *plugin); -/*! @brief Get timeout interval for plugin initialization +/** @brief Get timeout interval for plugin initialization * * @param plugin The plugin to check * @return Timeout value @@ -65,7 +66,7 @@ */ OSYNC_TEST_EXPORT unsigned int osync_plugin_get_initialize_timeout(OSyncPlugin *plugin); -/*! @brief Get timeout interval for plugin finalization +/** @brief Get timeout interval for plugin finalization * * @param plugin The plugin to check * @return Timeout value @@ -73,7 +74,7 @@ */ OSYNC_TEST_EXPORT unsigned int osync_plugin_get_finalize_timeout(OSyncPlugin *plugin); -/*! @brief Get timeout interval for plugin discovery +/** @brief Get timeout interval for plugin discovery * * @param plugin The plugin to get discvoery timeout * @return Timeout value Modified: trunk/opensync/plugin/opensync_plugin_localization_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_localization_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_localization_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,9 +21,16 @@ #ifndef _OPENSYNC_PLUGIN_LOCALIZATION_PRIVATE_H_ #define _OPENSYNC_PLUGIN_LOCALIZATION_PRIVATE_H_ -/*! @brief Gives information about current localization settings +/** + * @defgroup OSyncPluginLocalizationPrivateAPI OpenSync Plugin Localization Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief Gives information about current localization settings * - * @ingroup OSyncPluginLocalizationPrivateAPI **/ struct OSyncPluginLocalization { /** Encoding of device/service/application (e.g. cp1925, ...) */ @@ -40,5 +47,7 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_LOCALIZATION_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,6 +21,15 @@ #ifndef _OPENSYNC_PLUGIN_PRIVATE_H_ #define _OPENSYNC_PLUGIN_PRIVATE_H_ +/** + * @defgroup OSyncPluginPrivate OpenSync Plugin Module Private + * @ingroup OSyncPrivate + * @defgroup OSyncPluginPrivateAPI OpenSync Plugin Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + #define OSYNC_PLUGIN_TIMEOUT_DEFAULT 60 #define OSYNC_PLUGIN_TIMEOUT_INITIALIZE OSYNC_PLUGIN_TIMEOUT_DEFAULT @@ -69,4 +78,6 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_PRIVATE_H_ */ Modified: trunk/opensync/plugin/opensync_plugin_resource_private.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_resource_private.h Sun Jan 18 11:32:16 2009 (r5182) +++ trunk/opensync/plugin/opensync_plugin_resource_private.h Sun Jan 18 13:32:32 2009 (r5183) @@ -21,9 +21,15 @@ #ifndef _OPENSYNC_PLUGIN_RESOURCE_PRIVATE_H_ #define _OPENSYNC_PLUGIN_RESOURCE_PRIVATE_H_ -/*! @brief Gives information about resource - * - * @ingroup OSyncPluginResourcePrivateAPI +/** + * @defgroup OSyncPluginResourcePrivateAPI OpenSync Plugin Resource Private + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** + * @brief Gives information about resource **/ struct OSyncPluginResource { /** If resource is enabled */ @@ -50,5 +56,7 @@ int ref_count; }; +/*@}*/ + #endif /* _OPENSYNC_PLUGIN_RESOURCE_PRIVATE_H_ */ |
From: <dg...@su...> - 2009-01-18 10:33:19
|
Author: bricks Date: Sun Jan 18 11:32:16 2009 New Revision: 5182 URL: http://www.opensync.org/changeset/5182 Log: doxygen rearrangements moved annotations from c files to header, created new groups, ... Modified: trunk/opensync/common/opensync_error.c trunk/opensync/common/opensync_error.h trunk/opensync/common/opensync_error_private.h trunk/opensync/common/opensync_file.c trunk/opensync/common/opensync_file.h trunk/opensync/common/opensync_marshal.h trunk/opensync/common/opensync_marshal_private.h trunk/opensync/common/opensync_memory.h trunk/opensync/common/opensync_string.h trunk/opensync/common/opensync_thread.c trunk/opensync/common/opensync_thread_internals.h trunk/opensync/common/opensync_thread_private.h trunk/opensync/common/opensync_xml_internals.h trunk/opensync/debug/opensync_trace.h trunk/opensync/helper/opensync_anchor_internals.h Modified: trunk/opensync/common/opensync_error.c ============================================================================== --- trunk/opensync/common/opensync_error.c Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_error.c Sun Jan 18 11:32:16 2009 (r5182) @@ -23,22 +23,6 @@ #include "opensync_error_private.h" -/** - * @defgroup OSyncErrorPrivateAPI OpenSync Error Internals - * @ingroup OSyncPrivate - * @brief The public API of opensync - * - * This gives you an insight in the public API of opensync. - * - */ -/*@{*/ - -/*! @brief Translate a error type into something human readable - * - * @param type The error type to look up - * @returns The name of the error type - * - */ static const char *osync_error_name_from_type(OSyncErrorType type) { switch (type) { @@ -61,14 +45,6 @@ } } -/*! @brief Sets a error from a va_list - * - * @param error A pointer to a error struct - * @param type The type to set - * @param format The message - * @param args The arguments to the message - * - */ void osync_error_set_vargs(OSyncError **error, OSyncErrorType type, const char *format, va_list args) { osync_return_if_fail(error); @@ -85,23 +61,6 @@ return; } -/*@}*/ - -/** - * @defgroup OSyncErrorAPI OpenSync Errors - * @ingroup OSyncPublic - * @brief OpenSync's error reporting facilities - * - */ -/*@{*/ - - -/*! @brief This will return a string describing the type of the error - * - * @param error A pointer to a error struct - * @returns The description, NULL on error - * - */ const char *osync_error_get_name(OSyncError **error) { osync_return_val_if_fail(error != NULL, NULL); @@ -110,12 +69,6 @@ return osync_error_name_from_type((*error)->type); } -/** @brief Increase the reference count of the error object - * - * @param error The error object - * @returns The referenced error pointer - * - */ OSyncError **osync_error_ref(OSyncError **error) { if (!osync_error_is_set(error)) @@ -126,11 +79,6 @@ return error; } -/** @brief Decrease the reference count of the error object - * - * @param error The error object - * - */ void osync_error_unref(OSyncError **error) { if (!osync_error_is_set(error)) @@ -149,12 +97,6 @@ *error = NULL; } -/*! @brief Checks if the error is set - * - * @param error A pointer to a error struct to check - * @returns TRUE if the error is set, FALSE otherwise - * - */ osync_bool osync_error_is_set (OSyncError **error) { if (!error) @@ -169,12 +111,6 @@ return FALSE; } -/*! @brief Returns the type of the error - * - * @param error The error - * @returns The type of the error or OSYNC_NO_ERROR if no error - * - */ OSyncErrorType osync_error_get_type(OSyncError **error) { if (!osync_error_is_set(error)) @@ -182,12 +118,6 @@ return (*error)->type; } -/*! @brief Returns the message of the error - * - * @param error The error to print - * @returns The message of the error or NULL if no error - * - */ const char *osync_error_print(OSyncError **error) { if (!osync_error_is_set(error)) @@ -195,13 +125,6 @@ return (*error)->message; } - -/*! @brief Returns the entired error stack as single string - * - * @param error The error stack to print - * @returns The message of the error or NULL if no error - * - */ char *osync_error_print_stack(OSyncError **error) { char *submessage = NULL; @@ -221,13 +144,6 @@ return message; } -/*! @brief Duplicates the error into the target - * - * - * @param target The target error to update - * @param source The source error which to duplicate - * - */ void osync_error_set_from_error(OSyncError **target, OSyncError **source) { if (!target || osync_error_is_set(target)) @@ -242,15 +158,6 @@ osync_error_ref(target); } -/*! @brief Sets the error - * - * You can use this function to set the error to the given type and message - * - * @param error A pointer to a error struct to set - * @param type The Error type to set - * @param format The message - * - */ void osync_error_set(OSyncError **error, OSyncErrorType type, const char *format, ...) { va_list args; @@ -259,14 +166,6 @@ va_end (args); } -/*! @brief Stack error on another error object - * - * Use this function to stack all errors to describe the root cause of an error - * - * @param parent A pointer to a error which gets the child stacked - * @param child A pointer to a error to which get stacked on parent error - * - */ void osync_error_stack(OSyncError **parent, OSyncError **child) { if (!parent || !*parent) @@ -286,13 +185,6 @@ osync_error_ref(child); } -/*! @brief Get stacked child of an error object - * - * Use this function to read an error stack - * - * @param parent A pointer to a error stack - * - */ OSyncError *osync_error_get_child(OSyncError **parent) { if (!parent || !*parent) @@ -301,12 +193,6 @@ return (*parent)->child; } -/*! @brief Sets the type of an error - * - * @param error A pointer to a error struct to set - * @param type The Error type to set - * - */ void osync_error_set_type(OSyncError **error, OSyncErrorType type) { if (!error) @@ -316,4 +202,3 @@ return; } -/*@}*/ Modified: trunk/opensync/common/opensync_error.h ============================================================================== --- trunk/opensync/common/opensync_error.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_error.h Sun Jan 18 11:32:16 2009 (r5182) @@ -25,7 +25,16 @@ OPENSYNC_BEGIN_DECLS -/*! @ingroup OSyncErrorAPI +/** + * @defgroup OSyncCommon OpenSync Common Module + * @ingroup OSyncPublic + * @defgroup OSyncErrorAPI OpenSync Error + * @ingroup OSyncCommon + */ + +/*@{*/ + + /* * @brief Defines the possible error types */ typedef enum { @@ -48,20 +57,120 @@ OSYNC_ERROR_PLUGIN_NOT_FOUND = 16 } OSyncErrorType; +/** @brief Increase the reference count of the error object + * + * @param error The error object + * @returns The referenced error pointer + * + */ OSYNC_EXPORT OSyncError **osync_error_ref(OSyncError **error); + +/** @brief Decrease the reference count of the error object + * + * @param error The error object + * + */ OSYNC_EXPORT void osync_error_unref(OSyncError **error); + +/** @brief Checks if the error is set + * + * @param error A pointer to a error struct to check + * @returns TRUE if the error is set, FALSE otherwise + * + */ OSYNC_EXPORT osync_bool osync_error_is_set (OSyncError **error); + +/** @brief Sets the error + * + * You can use this function to set the error to the given type and message + * + * @param error A pointer to a error struct to set + * @param type The Error type to set + * @param format The message + * + */ OSYNC_EXPORT void osync_error_set(OSyncError **error, OSyncErrorType type, const char *format, ...); + +/** @brief This will return a string describing the type of the error + * + * @param error A pointer to a error struct + * @returns The description, NULL on error + * + */ OSYNC_EXPORT const char *osync_error_get_name(OSyncError **error); + +/** @brief Duplicates the error into the target + * + * + * @param target The target error to update + * @param source The source error which to duplicate + * + */ OSYNC_EXPORT void osync_error_set_from_error(OSyncError **target, OSyncError **source); + +/** @brief Returns the message of the error + * + * @param error The error to print + * @returns The message of the error or NULL if no error + * + */ OSYNC_EXPORT const char *osync_error_print(OSyncError **error); + +/** @brief Returns the entired error stack as single string + * + * @param error The error stack to print + * @returns The message of the error or NULL if no error + * + */ OSYNC_EXPORT char *osync_error_print_stack(OSyncError **error); + +/** @brief Stack error on another error object + * + * Use this function to stack all errors to describe the root cause of an error + * + * @param parent A pointer to a error which gets the child stacked + * @param child A pointer to a error to which get stacked on parent error + * + */ OSYNC_EXPORT void osync_error_stack(OSyncError **parent, OSyncError **child); + +/** @brief Get stacked child of an error object + * + * Use this function to read an error stack + * + * @param parent A pointer to a error stack + * + */ OSYNC_EXPORT OSyncError *osync_error_get_child(OSyncError **parent); + +/** @brief Returns the type of the error + * + * @param error The error + * @returns The type of the error or OSYNC_NO_ERROR if no error + * + */ OSYNC_EXPORT OSyncErrorType osync_error_get_type(OSyncError **error); + +/** @brief Sets the type of an error + * + * @param error A pointer to a error struct to set + * @param type The Error type to set + * + */ OSYNC_EXPORT void osync_error_set_type(OSyncError **error, OSyncErrorType type); + +/** @brief Sets a error from a va_list + * + * @param error A pointer to a error struct + * @param type The type to set + * @param format The message + * @param args The arguments to the message + * + */ OSYNC_EXPORT void osync_error_set_vargs(OSyncError **error, OSyncErrorType type, const char *format, va_list args); +/*@}*/ + OPENSYNC_END_DECLS #endif //OPENSYNC_ERROR_H_ Modified: trunk/opensync/common/opensync_error_private.h ============================================================================== --- trunk/opensync/common/opensync_error_private.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_error_private.h Sun Jan 18 11:32:16 2009 (r5182) @@ -21,7 +21,16 @@ #ifndef OPENSYNC_ERROR_PRIVATE_H_ #define OPENSYNC_ERROR_PRIVATE_H_ -/*! @brief Represent an error +/** + * @defgroup OSyncCommonPrivate OpenSync Common Module Private + * @ingroup OSyncPrivate + * @defgroup OSyncErrorPrivateAPI OpenSync Error Private + * @ingroup OSyncCommonPrivate + */ + +/*@{*/ + +/** @brief Represent an error */ struct OSyncError { /** The type of the error that occured */ @@ -32,4 +41,14 @@ OSyncError *child; }; +/** @brief Translate a error type into something human readable + * + * @param type The error type to look up + * @returns The name of the error type + * + */ +static const char *osync_error_name_from_type(OSyncErrorType type); + +/*@}*/ + #endif //OPENSYNC_ERROR_PRIVATE_H_ Modified: trunk/opensync/common/opensync_file.c ============================================================================== --- trunk/opensync/common/opensync_file.c Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_file.c Sun Jan 18 11:32:16 2009 (r5182) @@ -119,10 +119,10 @@ } /* While */ g_dir_close(gdir); gdir = NULL; - if (g_rmdir(dirname) < 0){ - g_set_error(&gerror, G_FILE_ERROR, g_file_error_from_errno(errno), "%s", dirname); - goto error; - } + if (g_rmdir(dirname) < 0){ + g_set_error(&gerror, G_FILE_ERROR, g_file_error_from_errno(errno), "%s", dirname); + goto error; + } return 0; Modified: trunk/opensync/common/opensync_file.h ============================================================================== --- trunk/opensync/common/opensync_file.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_file.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,14 +22,14 @@ #define _OPENSYNC_FILE_H /** - * @defgroup OSyncFileAPI OpenSync File interface + * @defgroup OSyncFileAPI OpenSync File * @ingroup OSyncCommon * @brief Functions for handling common file operations */ /*@{*/ -/*! @brief Writes data to a file +/** @brief Writes data to a file * * Writes data to a file * @@ -43,7 +43,7 @@ */ OSYNC_EXPORT osync_bool osync_file_write(const char *filename, const char *data, unsigned int size, int mode, OSyncError **error); -/*! @brief Reads a file +/** @brief Reads a file * * Reads a file * @@ -56,7 +56,7 @@ */ OSYNC_EXPORT osync_bool osync_file_read(const char *filename, char **data, unsigned int *size, OSyncError **error); -/*! @brief Removes a directory recursively +/** @brief Removes a directory recursively * * Removes a directory recursively. This is an * internal function for portability. Modified: trunk/opensync/common/opensync_marshal.h ============================================================================== --- trunk/opensync/common/opensync_marshal.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_marshal.h Sun Jan 18 11:32:16 2009 (r5182) @@ -24,8 +24,8 @@ /** * @defgroup OSyncCommon OpenSync Common Module * @ingroup OSyncPublic - * @defgroup OSyncMarshal OpenSync Marshal - * @ingroup OSyncMarshal + * @defgroup OSyncMarshalAPI OpenSync Marshal + * @ingroup OSyncCommon * @brief Functions for serializing/marshaling data * */ Modified: trunk/opensync/common/opensync_marshal_private.h ============================================================================== --- trunk/opensync/common/opensync_marshal_private.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_marshal_private.h Sun Jan 18 11:32:16 2009 (r5182) @@ -25,14 +25,15 @@ * @defgroup OSyncCommonPrivate OpenSync Common Module Private * @ingroup OSyncPrivate * @defgroup OSyncMarshalPrivateAPI OpenSync Marshal Private - * @ingroup OSyncMarshalPrivate + * @ingroup OSyncCommonPrivate * @brief Serialized buffer * */ /*@{*/ -/*! @brief A OSyncMarshal object - * + +/** + * @brief A OSyncMarshal object */ struct OSyncMarshal { /** Reference counting */ Modified: trunk/opensync/common/opensync_memory.h ============================================================================== --- trunk/opensync/common/opensync_memory.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_memory.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,12 +22,12 @@ #define _OPENSYNC_MEMORY_H /** - * @defgroup OSyncMemoryAPI OpenSync Memory interface + * @defgroup OSyncMemoryAPI OpenSync Memory * @ingroup OSyncCommon * @brief Functions for handling memory operations */ -/*! @brief Safely tries to malloc memory +/** @brief Safely tries to malloc memory * * Tries to malloc memory but returns an error in an OOM situation instead * of aborting @@ -39,7 +39,7 @@ */ OSYNC_EXPORT void *osync_try_malloc0(unsigned int size, OSyncError **error); -/*! @brief Frees memory +/** @brief Frees memory * * Frees memory allocated by osync_try_malloc0() and others osync_* functions. * Modified: trunk/opensync/common/opensync_string.h ============================================================================== --- trunk/opensync/common/opensync_string.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_string.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,14 +22,14 @@ #define _OPENSYNC_STRING_H /** - * @defgroup OSyncStringAPI OpenSync String interface + * @defgroup OSyncStringAPI OpenSync String * @ingroup OSyncCommon * @brief Functions for handling common string operations */ /*@{*/ -/*! @brief String replace +/** @brief String replace * * @param input Input string to work on * @param delimiter Delimiter @@ -39,7 +39,7 @@ */ OSYNC_EXPORT char *osync_strreplace(const char *input, const char *delimiter, const char *replacement); -/*! @brief Duplicates a string +/** @brief Duplicates a string * * Duplicates a string, ending with terminating-zero: \0 * @@ -49,7 +49,7 @@ */ OSYNC_EXPORT char *osync_strdup(const char *str); -/*! @brief Duplicates a formated string +/** @brief Duplicates a formated string * * Duplicates a formated string, ending with terminating-zero: \0 * @@ -60,7 +60,7 @@ */ OSYNC_EXPORT char *osync_strdup_printf(const char *format, ...); -/*! @brief Creates a random string +/** @brief Creates a random string * * Creates a random string of given length or less * Modified: trunk/opensync/common/opensync_thread.c ============================================================================== --- trunk/opensync/common/opensync_thread.c Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_thread.c Sun Jan 18 11:32:16 2009 (r5182) @@ -24,19 +24,6 @@ #include "opensync_thread_private.h" #include "opensync_thread_internals.h" -/** - * @defgroup OSyncThreadAPI OpenSync Thread Module - * @ingroup OSyncPrivate - * @brief Some threading functions - * - */ -/*@{*/ - -/*! @brief Stop callback function to stop thread mainloop - * - * @param data Pointer to passed callback data - * @returns Always FALSE - */ static gboolean osyncThreadStopCallback(gpointer data) { OSyncThread *thread = data; @@ -46,11 +33,6 @@ return FALSE; } -/*! @brief Start callback function to emit signal when thread's mainloop got started - * - * @param data Pointer to passed callback data - * @returns Always FALSE - */ static gboolean osyncThreadStartCallback(gpointer data) { OSyncThread *thread = data; @@ -62,13 +44,6 @@ return FALSE; } -/*! @brief Allocates a new thread with a g_mainloop - * - * @param context Pointer to GMainContext - * @param error The error which will hold the info in case of an error - * @returns A pointer to the new allocated OSyncThread with inactive thread and mainloop - * - */ OSyncThread *osync_thread_new(GMainContext *context, OSyncError **error) { OSyncThread *thread = NULL; @@ -96,11 +71,6 @@ return NULL; } -/** @brief Increases the reference count on thread object - * - * @param thread Pointer to OSyncThread - * - */ OSyncThread *osync_thread_ref(OSyncThread *thread) { osync_trace(TRACE_ENTRY, "%s(%p)", __func__, thread); @@ -112,11 +82,6 @@ return thread; } -/** @brief Decrements reference count on thread object - * - * @param thread Pointer to OSyncThread - * - */ void osync_thread_unref(OSyncThread *thread) { osync_trace(TRACE_ENTRY, "%s(%p)", __func__, thread); @@ -153,29 +118,7 @@ return NULL; }*/ -/*void osync_thread_start(OSyncThread *thread) - { - osync_trace(TRACE_ENTRY, "%s(%p)", __func__, thread); - osync_assert(thread); - - //Start the thread - g_mutex_lock(thread->started_mutex); - thread->thread = g_thread_create (osyncThreadStartCallback, thread, TRUE, NULL); - g_cond_wait(thread->started, thread->started_mutex); - g_mutex_unlock(thread->started_mutex); - - osync_trace(TRACE_EXIT, "%s", __func__); - }*/ - -/*! @brief Start thread and it's mainloop - * - * @param func GThreadFunc Pointer - * @param userdata Custom data poitner which get supplied to thread function - * @param error Pointer to error struct - * @return Newly allocate OSyncThread object with inactive mainloop - * - */ OSyncThread *osync_thread_create(GThreadFunc func, void *userdata, OSyncError **error) { GError *gerror; @@ -210,12 +153,6 @@ return NULL; } - -/*! @brief Start thread and it's mainloop - * - * @param thread Thread object - * - */ void osync_thread_start(OSyncThread *thread) { GSource *idle = NULL; @@ -232,11 +169,6 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -/*! @brief Stops thread's mainloop and joins the thread - * - * @param thread Thread object - * - */ void osync_thread_stop(OSyncThread *thread) { GSource *source = NULL; @@ -255,12 +187,6 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -/*! @brief Exit thread - * - * @param thread Thread object - * @param retval Return value of thread while exiting - * - */ void osync_thread_exit(OSyncThread *thread, int retval) { GSource *source = NULL; @@ -278,7 +204,3 @@ osync_trace(TRACE_EXIT, "%s", __func__); } - - -/*@}*/ - Modified: trunk/opensync/common/opensync_thread_internals.h ============================================================================== --- trunk/opensync/common/opensync_thread_internals.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_thread_internals.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,15 +22,72 @@ #ifndef _OPENSYNC_THREAD_INTERNALS_H #define _OPENSYNC_THREAD_INTERNALS_H +/** + * @defroup OSyncThreadInternalAPI OpenSync Thread Internals + * @ingroup OSyncCommonPrivate + * @brief Some threading functions + */ + +/*@{*/ + typedef struct OSyncThread OSyncThread; +/** @brief Allocates a new thread with a g_mainloop + * + * @param context Pointer to GMainContext + * @param error The error which will hold the info in case of an error + * @returns A pointer to the new allocated OSyncThread with inactive thread and mainloop + * + */ OSYNC_TEST_EXPORT OSyncThread *osync_thread_new(GMainContext *context, OSyncError **error); + +/** @brief Increases the reference count on thread object + * + * @param thread Pointer to OSyncThread + * + */ OSYNC_TEST_EXPORT OSyncThread *osync_thread_ref(OSyncThread *thread); + +/** @brief Decrements reference count on thread object + * + * @param thread Pointer to OSyncThread + * + */ OSYNC_TEST_EXPORT void osync_thread_unref(OSyncThread *thread); + +/** @brief Start thread and it's mainloop + * + * @param thread Thread object + * + */ OSYNC_TEST_EXPORT void osync_thread_start(OSyncThread *thread); + +/** @brief Stops thread's mainloop and joins the thread + * + * @param thread Thread object + * + */ OSYNC_TEST_EXPORT void osync_thread_stop(OSyncThread *thread); + +/** @brief Exit thread + * + * @param thread Thread object + * @param retval Return value of thread while exiting + * + */ OSYNC_TEST_EXPORT void osync_thread_exit(OSyncThread *thread, int retval); + +/** @brief Start thread and it's mainloop + * + * @param func GThreadFunc Pointer + * @param userdata Custom data poitner which get supplied to thread function + * @param error Pointer to error struct + * @return Newly allocate OSyncThread object with inactive mainloop + * + */ OSYNC_TEST_EXPORT OSyncThread *osync_thread_create(GThreadFunc func, void *userdata, OSyncError **error); +/*@}*/ + #endif /* _OPENSYNC_THREAD_INTERNALS_H */ Modified: trunk/opensync/common/opensync_thread_private.h ============================================================================== --- trunk/opensync/common/opensync_thread_private.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_thread_private.h Sun Jan 18 11:32:16 2009 (r5182) @@ -21,14 +21,41 @@ #ifndef _OPENSYNC_THREAD_PRIVATE_H #define _OPENSYNC_THREAD_PRIVATE_H +/** + * @defgroup OSyncThreadPrivateAPI OpenSync Thread Private + * @ingroup OSyncCommonPrivate + */ + +/*@{*/ + +/** + * @brief Represents a Thread + */ struct OSyncThread { GThread *thread; GCond *started; GMutex *started_mutex; GMainContext *context; GMainLoop *loop; + /** reference counter */ int ref_count; }; +/** @brief Start callback function to emit signal when thread's mainloop got started + * + * @param data Pointer to passed callback data + * @returns Always FALSE + */ +static gboolean osyncThreadStartCallback(gpointer data); + +/** @brief Stop callback function to stop thread mainloop + * + * @param data Pointer to passed callback data + * @returns Always FALSE + */ +static gboolean osyncThreadStopCallback(gpointer data); + +/*@}*/ + #endif /* _OPENSYNC_THREAD_PRIVATE_H */ Modified: trunk/opensync/common/opensync_xml_internals.h ============================================================================== --- trunk/opensync/common/opensync_xml_internals.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/common/opensync_xml_internals.h Sun Jan 18 11:32:16 2009 (r5182) @@ -30,6 +30,13 @@ #include <string.h> #include <stdio.h> +/** + * @defgroup OSyncXMLInternalAPI OpenSync XML Internals + * @ingroup OSyncCommonPrivate + */ + +/*@{*/ + typedef enum osxmlEncoding { OSXML_8BIT = 0, OSXML_QUOTED_PRINTABLE = 1, @@ -85,4 +92,6 @@ osync_bool osync_xml_open_file(xmlDocPtr *doc, xmlNodePtr *cur, const char *path, const char *topentry, OSyncError **error); +/*@}*/ + #endif /*_OPENSYNC_XML_H*/ Modified: trunk/opensync/debug/opensync_trace.h ============================================================================== --- trunk/opensync/debug/opensync_trace.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/debug/opensync_trace.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,7 +22,9 @@ #define _OPENSYNC_TRACE_H /** - * @defgroup OSyncDebugAPI OpenSync Debugging + * @defgroup OSyncDebug OpenSync Debug Module + * @ingroup OSyncPublic + * @defgroup OSyncDebugAPI OpenSync Debug * @ingroup OSyncDebug * @brief Functions for debugging */ Modified: trunk/opensync/helper/opensync_anchor_internals.h ============================================================================== --- trunk/opensync/helper/opensync_anchor_internals.h Sun Jan 18 09:51:07 2009 (r5181) +++ trunk/opensync/helper/opensync_anchor_internals.h Sun Jan 18 11:32:16 2009 (r5182) @@ -22,9 +22,7 @@ #define OPENSYNC_ANCHOR_INTERNALS_H_ /** - * @defgroup OSyncHelperInternals OpenSync Helper Module Internals - * @ingroup OSyncPrivate - * @defgroup OSyncAnchorInternalsAPI OpenSync Anchor Internals + * @defgroup OSyncAnchorInternalAPI OpenSync Anchor Internals * @ingroup OSyncHelperPrivate * @brief Internal functions to deal with anchors */ |
From: <dg...@su...> - 2009-01-18 08:52:05
|
Author: bricks Date: Sun Jan 18 09:51:07 2009 New Revision: 5181 URL: http://www.opensync.org/changeset/5181 Log: changed doxygen groups for capabilities module Modified: trunk/opensync/capabilities/opensync_capabilities.h trunk/opensync/capabilities/opensync_capabilities_internals.h trunk/opensync/capabilities/opensync_capabilities_private.h trunk/opensync/capabilities/opensync_capability.h trunk/opensync/capabilities/opensync_capability_internals.h trunk/opensync/capabilities/opensync_capability_private.h Modified: trunk/opensync/capabilities/opensync_capabilities.h ============================================================================== --- trunk/opensync/capabilities/opensync_capabilities.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capabilities.h Sun Jan 18 09:51:07 2009 (r5181) @@ -25,8 +25,10 @@ /** + * @defgroup OSyncCapabilities OpenSync Capabilities Module + * @ingroup OSyncPublic * @defgroup OSyncCapabilitiesAPI OpenSync Capabilities - * @ingroup OSyncMerger + * @ingroup OSyncCapabilities * @brief The public part of the OSyncCapabilities * */ Modified: trunk/opensync/capabilities/opensync_capabilities_internals.h ============================================================================== --- trunk/opensync/capabilities/opensync_capabilities_internals.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capabilities_internals.h Sun Jan 18 09:51:07 2009 (r5181) @@ -27,7 +27,7 @@ /** * @defgroup OSyncCapabilitiesInternalAPI OpenSync Capabilities Internals - * @ingroup OSyncMergerPrivate + * @ingroup OSyncCapabilitiesPrivate * @brief The private part of the OSyncCapabilities * */ Modified: trunk/opensync/capabilities/opensync_capabilities_private.h ============================================================================== --- trunk/opensync/capabilities/opensync_capabilities_private.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capabilities_private.h Sun Jan 18 09:51:07 2009 (r5181) @@ -24,8 +24,10 @@ #define OPENSYNC_CAPABILITIES_PRIVATE_H_ /** + * @defgroup OSyncCapabilitiesPrivate OpenSync Capabilities Module Private + * @ingroup OSyncPrivate * @defgroup OSyncCapabilitiesPrivateAPI OpenSync Capabilities Private - * @ingroup OSyncMergerPrivate + * @ingroup OSyncCapabilitiesPrivate * @brief Private part of OpenSync Capabilities */ Modified: trunk/opensync/capabilities/opensync_capability.h ============================================================================== --- trunk/opensync/capabilities/opensync_capability.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capability.h Sun Jan 18 09:51:07 2009 (r5181) @@ -25,7 +25,7 @@ /** * @defgroup OSyncCapabilityAPI OpenSync Capability - * @ingroup OSyncMerger + * @ingroup OSyncCapabilities * @brief The public part of the OSyncCapability * */ Modified: trunk/opensync/capabilities/opensync_capability_internals.h ============================================================================== --- trunk/opensync/capabilities/opensync_capability_internals.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capability_internals.h Sun Jan 18 09:51:07 2009 (r5181) @@ -25,7 +25,7 @@ /** * @defgroup OSyncCapabilityInternalAPI OpenSync Capability Internals - * @ingroup OSyncMergerPrivate + * @ingroup OSyncCapabilitiesPrivate * @brief The internal part of the OpenSync Capability * */ Modified: trunk/opensync/capabilities/opensync_capability_private.h ============================================================================== --- trunk/opensync/capabilities/opensync_capability_private.h Sun Jan 18 01:44:32 2009 (r5180) +++ trunk/opensync/capabilities/opensync_capability_private.h Sun Jan 18 09:51:07 2009 (r5181) @@ -25,7 +25,7 @@ /** * @defgroup OSyncCapabilityPrivateAPI OpenSync Capability Private - * @ingroup OSyncMergerPrivate + * @ingroup OSyncCapabilitiesPrivate * @brief Private part of OpenSync Capability */ |
From: <dg...@su...> - 2009-01-18 00:45:34
|
Author: dgollub Date: Sun Jan 18 01:44:32 2009 New Revision: 5180 URL: http://www.opensync.org/changeset/5180 Log: Fix build when OPENSYNC_TRACE is disabled. Modified: trunk/opensync/debug/opensync_trace.c Modified: trunk/opensync/debug/opensync_trace.c ============================================================================== --- trunk/opensync/debug/opensync_trace.c Sat Jan 17 17:44:20 2009 (r5179) +++ trunk/opensync/debug/opensync_trace.c Sun Jan 18 01:44:32 2009 (r5180) @@ -66,6 +66,8 @@ return FALSE; } + +#ifdef OPENSYNC_TRACE /*! @brief Initailize tracing * */ @@ -99,8 +101,8 @@ printf("OSYNC_TRACE argument is no directory\n"); return; } - } +#endif /* OPENSYNC_TRACE */ void osync_trace(OSyncTraceType type, const char *message, ...) { |
From: <dg...@su...> - 2009-01-17 16:45:28
|
Author: mkoller Date: Sat Jan 17 17:44:20 2009 New Revision: 5179 URL: http://www.opensync.org/changeset/5179 Log: update to new API Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Sat Jan 17 14:38:00 2009 (r5178) +++ plugins/kdepim/src/datasource.cpp Sat Jan 17 17:44:20 2009 (r5179) @@ -17,7 +17,7 @@ * osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)) */ -static void connect_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); @@ -27,7 +27,7 @@ //-------------------------------------------------------------------------------- -static void disconnect_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); @@ -37,7 +37,8 @@ //-------------------------------------------------------------------------------- -static void get_changes_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, + OSyncContext *ctx, osync_bool slow_sync,void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); @@ -47,7 +48,8 @@ //-------------------------------------------------------------------------------- -static void commit_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg) +static void commit_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, + OSyncContext *ctx, OSyncChange *chg, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx, chg); OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); @@ -57,7 +59,7 @@ //-------------------------------------------------------------------------------- -static void sync_done_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void sync_done_wrapper(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); |
From: <dg...@su...> - 2009-01-17 13:39:03
|
Author: dgollub Date: Sat Jan 17 14:38:00 2009 New Revision: 5178 URL: http://www.opensync.org/changeset/5178 Log: Add CTestConfig with CDash configuration. Added: format-plugins/vformat/CTestConfig.cmake Added: format-plugins/vformat/CTestConfig.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ format-plugins/vformat/CTestConfig.cmake Sat Jan 17 14:38:00 2009 (r5178) @@ -0,0 +1,13 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(Dart) +set(CTEST_PROJECT_NAME "vformat-plugin") +set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "opensync.org") +set(CTEST_DROP_LOCATION "/testing/submit.php?project=vformat-plugin") +set(CTEST_DROP_SITE_CDASH TRUE) |
From: <dg...@su...> - 2009-01-17 00:25:44
|
Author: Graham Cobb Date: Sat Jan 17 01:24:48 2009 New Revision: 5177 URL: http://www.opensync.org/changeset/5177 Log: gpe-sync: fix crash in report_deleted Modified: plugins/gpe/ChangeLog plugins/gpe/src/utils.c Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Sat Jan 17 01:09:13 2009 (r5176) +++ plugins/gpe/ChangeLog Sat Jan 17 01:24:48 2009 (r5177) @@ -1,3 +1,7 @@ +2009-01-17 Graham Cobb <g+...@co...> + + * src/utils.c (report_deleted): Fix end condition for uids loop + 2009-01-16 Graham Cobb <g+...@co...> * src/calendar.c: Update to new sink functions API: gpe_calendar_commit_change, Modified: plugins/gpe/src/utils.c ============================================================================== --- plugins/gpe/src/utils.c Sat Jan 17 01:09:13 2009 (r5176) +++ plugins/gpe/src/utils.c Sat Jan 17 01:24:48 2009 (r5177) @@ -139,7 +139,7 @@ //check for deleted entries ... via hashtable int i; OSyncList *u, *uids = osync_hashtable_get_deleted(sinkenv->hashtable); - for (u = uids; uids; u = u->next) { + for (u = uids; u; u = u->next) { OSyncChange *change = osync_change_new(&error); if (!change) { osync_context_report_osyncwarning(ctx, error); |
From: <dg...@su...> - 2009-01-17 00:10:11
|
Author: Graham Cobb Date: Sat Jan 17 01:09:13 2009 New Revision: 5176 URL: http://www.opensync.org/changeset/5176 Log: gpe-sync: Update to new sink functions API Modified: plugins/gpe/ChangeLog plugins/gpe/src/calendar.c plugins/gpe/src/contacts.c plugins/gpe/src/gpe_sync.c plugins/gpe/src/todo.c Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Sat Jan 17 01:08:04 2009 (r5175) +++ plugins/gpe/ChangeLog Sat Jan 17 01:09:13 2009 (r5176) @@ -1,3 +1,17 @@ +2009-01-16 Graham Cobb <g+...@co...> + + * src/calendar.c: Update to new sink functions API: gpe_calendar_commit_change, + gpe_calendar_get_changes + + * src/contacts.c: Update to new sink functions API: gpe_contacts_commit_change, + gpe_contacts_get_changes + + * src/todo.c: Update to new sink functions API: gpe_todo_commit_change, + gpe_todo_get_changes + + * src/gpe_sync.c: Update to new sink functions API: gpe_connect, gpe_disconnect, + gpe_sync_done + 2009-01-14 Graham Cobb <g+...@co...> * src/gpe_sync.h: Remove already commented out "member" from environment Modified: plugins/gpe/src/calendar.c ============================================================================== --- plugins/gpe/src/calendar.c Sat Jan 17 01:08:04 2009 (r5175) +++ plugins/gpe/src/calendar.c Sat Jan 17 01:09:13 2009 (r5176) @@ -27,12 +27,12 @@ * \param change The change that has to be committed * */ -void gpe_calendar_commit_change (void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +void gpe_calendar_commit_change (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, userdata, info, ctx, change); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, userdata); - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; gchar *response = NULL; char *result = NULL; char *modified = NULL; @@ -113,13 +113,13 @@ * \param ctx Context of the plugin * */ -void gpe_calendar_get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +void gpe_calendar_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slowsync, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %d, %p)", __func__, sink, info, ctx, slowsync, userdata); OSyncError *error = NULL; - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; if (!gpe_assert(env->configured && env->discovered)) { osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); @@ -127,7 +127,7 @@ return; } - if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { + if (slowsync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); Modified: plugins/gpe/src/contacts.c ============================================================================== --- plugins/gpe/src/contacts.c Sat Jan 17 01:08:04 2009 (r5175) +++ plugins/gpe/src/contacts.c Sat Jan 17 01:09:13 2009 (r5176) @@ -27,12 +27,12 @@ * \param change The change that has to be committed * */ -void gpe_contacts_commit_change (void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +void gpe_contacts_commit_change (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, userdata, info, ctx, change); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, userdata); - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; gchar *response = NULL; char *result = NULL; char *modified = NULL; @@ -113,13 +113,13 @@ * \param ctx Context of the plugin * */ -void gpe_contacts_get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +void gpe_contacts_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slowsync, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %d, %p)", __func__, sink, info, ctx, slowsync, userdata); OSyncError *error = NULL; - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; if (!gpe_assert(env->configured && env->discovered)) { osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); @@ -127,7 +127,7 @@ return; } - if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { + if (slowsync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); Modified: plugins/gpe/src/gpe_sync.c ============================================================================== --- plugins/gpe/src/gpe_sync.c Sat Jan 17 01:08:04 2009 (r5175) +++ plugins/gpe/src/gpe_sync.c Sat Jan 17 01:09:13 2009 (r5176) @@ -176,12 +176,11 @@ osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); } -static void gpe_disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void gpe_disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); + sink_environment *sinkenv = (sink_environment *)data; + gpe_environment *env = sinkenv->gpe_env; gpe_disconnect_internal(env); @@ -365,17 +364,15 @@ } -static void gpe_connect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void gpe_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { char *client_err = NULL; OSyncError *error = NULL; - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); - // We need to get the context to load all our stuff. - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + sink_environment *sinkenv = (sink_environment *)data; + gpe_environment *env = sinkenv->gpe_env; /* Re-parse and re-discover */ if ( @@ -427,14 +424,14 @@ * * \param ctx The context of the plugin */ -static void sync_done(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { OSyncError *error = NULL; - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); + + sink_environment *sinkenv = (sink_environment *)data; + gpe_environment *env = sinkenv->gpe_env; if (!gpe_assert(env->configured && env->discovered)) { osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); Modified: plugins/gpe/src/todo.c ============================================================================== --- plugins/gpe/src/todo.c Sat Jan 17 01:08:04 2009 (r5175) +++ plugins/gpe/src/todo.c Sat Jan 17 01:09:13 2009 (r5176) @@ -27,12 +27,12 @@ * \param change The change that has to be committed * */ -void gpe_todo_commit_change (void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +void gpe_todo_commit_change (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, userdata, info, ctx, change); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, userdata); - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; gchar *response = NULL; char *result = NULL; char *modified = NULL; @@ -114,13 +114,13 @@ * \param ctx Context of the plugin * */ -void gpe_todo_get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +void gpe_todo_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slowsync, void *userdata) { - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %d, %p)", __func__, sink, info, ctx, slowsync, userdata); OSyncError *error = NULL; - gpe_environment *env = (gpe_environment *)userdata; - sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + sink_environment *sinkenv = (sink_environment *)userdata; + gpe_environment *env = sinkenv->gpe_env; if (!gpe_assert(env->configured && env->discovered)) { osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); @@ -128,7 +128,7 @@ return; } - if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { + if (slowsync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); |
From: <dg...@su...> - 2009-01-17 00:09:06
|
Author: Graham Cobb Date: Sat Jan 17 01:08:04 2009 New Revision: 5175 URL: http://www.opensync.org/changeset/5175 Log: Merge API changes from trunk r:5174 Modified: branches/timeout/docs/examples/plugins/src/format.c branches/timeout/docs/examples/plugins/src/plugin.c branches/timeout/docs/examples/plugins/src/simple_plugin.c branches/timeout/opensync/format/opensync_format_env.c branches/timeout/opensync/plugin/opensync_objtype_sink.c branches/timeout/opensync/plugin/opensync_objtype_sink.h branches/timeout/tests/engine-tests/check_engine.c branches/timeout/tests/engine-tests/check_engine_error.c branches/timeout/tests/mock-plugin/mock_sync.c Modified: branches/timeout/docs/examples/plugins/src/format.c ============================================================================== --- branches/timeout/docs/examples/plugins/src/format.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/docs/examples/plugins/src/format.c Sat Jan 17 01:08:04 2009 (r5175) @@ -9,12 +9,12 @@ #include <opensync/opensync.h> #include <opensync/opensync-format.h> -typedef struct format_data { +typedef struct converter_data { char *data; -} format_data; +} converter_data; -static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize) +static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize, void *data) { /* * This function can be used to compare two types of your formats. @@ -97,7 +97,7 @@ return TRUE; } -static void destroy_format1(char *input, unsigned int size) +static void destroy_format1(char *input, unsigned int size, void *data) { /* * Here you have to free the data allocated by your format @@ -105,7 +105,7 @@ */ } -static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, OSyncError **error) +static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, void *data, OSyncError **error) { /* * This function can be used to duplicate your format. @@ -120,7 +120,7 @@ return TRUE; } -static char *print_format1(const char *data, unsigned int size) +static char *print_format1(const char *data, unsigned int size, void *user_data) { /* * If your format is not in a human printable format already @@ -132,6 +132,24 @@ return NULL; } +void *init_format1(OSyncError **error) { + /* + * If your format needs specific data e.g. a XML Schema file + * for validation it is possible to load the data in this + * function. If the data should be passes to all format + * functions it has to be returned as a pointer. + */ + char *format_specific_data = osync_try_malloc0(0, error); + return (void *)format_specific_data; +} + +void finialize_format1(void *data) { + /* + * Release all format data + */ + osync_free(data); +} + osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error) { /* @@ -146,6 +164,8 @@ osync_objformat_set_duplicate_func(format, duplicate_format1); osync_objformat_set_print_func(format, print_format1); + osync_objformat_set_initialize_func(format, init_format1); + osync_objformat_set_finalize_func(format, finialize_format1); osync_format_env_register_objformat(env, format); osync_objformat_unref(format); @@ -153,25 +173,26 @@ return TRUE; } -void *initialize(const char* config, OSyncError **error) +void *initialize_converter(const char* config, OSyncError **error) { /* * Here you can create converter specific data. * If you return the converter specific data, it is passed - * to the conversion and detector function as void *userdata + * to the conversion and detector function as void *userdata. + * Converter specific data could be e.g. a XSLT file */ - format_data *userdata = osync_try_malloc0(sizeof(format_data), error); + converter_data *userdata = osync_try_malloc0(sizeof(converter_data), error); return (void*)userdata; } -void finalize(void *userdata) +void finalize_converter(void *userdata) { /* * Here you can free all your converter specific data. */ - format_data *formatdata = (format_data*)userdata; - osync_free(formatdata->data); - osync_free(formatdata); + converter_data *converterdata = (converter_data*)userdata; + osync_free(converterdata->data); + osync_free(converterdata); } osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) @@ -198,8 +219,8 @@ if (!conv) return FALSE; /* set init and finalize functions */ - osync_converter_set_initialize_func(conv, initialize); - osync_converter_set_finalize_func(conv, finalize); + osync_converter_set_initialize_func(conv, initialize_converter); + osync_converter_set_finalize_func(conv, finalize_converter); /* register converter */ osync_format_env_register_converter(env, conv); osync_converter_unref(conv); Modified: branches/timeout/docs/examples/plugins/src/plugin.c ============================================================================== --- branches/timeout/docs/examples/plugins/src/plugin.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/docs/examples/plugins/src/plugin.c Sat Jan 17 01:08:04 2009 (r5175) @@ -24,16 +24,15 @@ osync_free(env); } -static void connect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, userdata); //Each time you get passed a context (which is used to track //calls to your plugin) you can get the data your returned in //initialize via this call: // plugin_environment *env = (plugin_environment *)userdata; - //The sink specific userdata you can get with this calls: - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + //The sink specific userdata you can get with this call: sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); @@ -63,14 +62,18 @@ //you can also use the anchor system to detect a device reset //or some parameter change here. Check the docs to see how it works - char *lanchor = NULL; //Now you get the last stored anchor from the device - char *anchorpath = osync_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); - - if (!osync_anchor_compare(anchorpath, "lanchor", lanchor)) + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + osync_bool anchormatch; + + if (!osync_anchor_compare(anchor, "lanchor", &anchormatch, &error)) { + /* anchor couldn't be compared */ + goto error; + } + if (!anchormatch) { + /* request slow sync */ osync_objtype_sink_set_slowsync(sink, TRUE); - - osync_free(anchorpath); + } osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); @@ -82,13 +85,12 @@ osync_error_unref(&error); } -static void get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, userdata); //plugin_environment *env = (plugin_environment *)userdata; OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); OSyncError *error = NULL; @@ -96,9 +98,8 @@ //If you use opensync hashtables you can detect if you need //to do a slow-sync and set this on the hastable directly //otherwise you have to make 2 function like "get_changes" and - //"get_all" and decide which to use using - //osync_objtype_sink_get_slow_sync - if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { + //"get_all" and decide which to use + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (osync_hashtable_slowsync(sinkenv->hashtable, &error)) { @@ -217,11 +218,10 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void commit_change(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static void commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) { //plugin_environment *env = (plugin_environment *)userdata; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); /* @@ -254,21 +254,21 @@ osync_context_report_success(ctx); } -static void sync_done(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { /* * This function will only be called if the sync was successful */ OSyncError *error = NULL; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); //If we use anchors we have to update it now. //Now you get/calculate the current anchor of the device - char *lanchor = NULL; - char *anchorpath = osync_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); - osync_anchor_update(anchorpath, "lanchor", lanchor); - osync_free(anchorpath); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + if (!osync_anchor_update(anchor, "lanchor", &error)) { + goto error; + } + //Save hashtable to database if (!osync_hashtable_save(sinkenv->hashtable, &error)) goto error; @@ -282,9 +282,8 @@ return; } -static void disconnect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); //Close all stuff you need to close @@ -404,9 +403,9 @@ } /* Here we actually tell opensync which sinks are available. */ -static osync_bool discover(void *userdata, OSyncPluginInfo *info, OSyncError **error) +static osync_bool discover(OSyncPluginInfo *info, void *userdata, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, error); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, info, userdata, error); // plugin_environment *env = (plugin_environment *)userdata; Modified: branches/timeout/docs/examples/plugins/src/simple_plugin.c ============================================================================== --- branches/timeout/docs/examples/plugins/src/simple_plugin.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/docs/examples/plugins/src/simple_plugin.c Sat Jan 17 01:08:04 2009 (r5175) @@ -10,11 +10,11 @@ #include <string.h> typedef struct { - OSyncList *sink_envs; + OSyncList *sink_envs; } plugin_environment; typedef struct { - OSyncObjTypeSink *sink; + OSyncObjTypeSink *sink; } sink_environment; static void free_env(plugin_environment *env) @@ -31,16 +31,15 @@ osync_free(env); } -static void connect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, userdata); //Each time you get passed a context (which is used to track //calls to your plugin) you can get the data your returned in //initialize via this call: // plugin_environment *env = (plugin_environment *)userdata; - //The sink specific userdata you can get with this calls: - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + //The sink specific userdata you can get with this call: sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); @@ -61,14 +60,19 @@ //you can also use the anchor system to detect a device reset //or some parameter change here. Check the docs to see how it works - char *lanchor = NULL; //Now you get the last stored anchor from the device - char *anchorpath = osync_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + osync_bool anchormatch; - if (!osync_anchor_compare(anchorpath, "lanchor", lanchor)) + if (!osync_anchor_compare(anchor, "lanchor", &anchormatch, &error)) { + /* anchor couldn't be compared */ + goto error; + } + + if (!anchormatch) { + /* request slow sync */ osync_objtype_sink_set_slowsync(sink, TRUE); - - osync_free(anchorpath); + } osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); @@ -80,21 +84,16 @@ osync_error_unref(&error); } -static void get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); //plugin_environment *env = (plugin_environment *)userdata; OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); OSyncError *error = NULL; - /* Check for Slow-Sync */ - if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { - } - /* * Now you can get the changes. * Loop over all changes you get and do the following: @@ -160,11 +159,10 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void commit_change(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static void commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) { //plugin_environment *env = (plugin_environment *)userdata; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); /* @@ -192,22 +190,20 @@ osync_context_report_success(ctx); } -static void sync_done(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) { /* * This function will only be called if the sync was successful */ OSyncError *error = NULL; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); //If we use anchors we have to update it now. //Now you get/calculate the current anchor of the device - char *lanchor = NULL; - char *anchorpath = osync_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); - osync_anchor_update(anchorpath, "lanchor", lanchor); - osync_free(anchorpath); - + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + if (!osync_anchor_update(anchor, "lanchor", &error)) + goto error; + //Answer the call osync_context_report_success(ctx); return; @@ -217,9 +213,8 @@ return; } -static void disconnect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); sink_environment *sinkenv = osync_objtype_sink_get_userdata(sink); //Close all stuff you need to close @@ -331,7 +326,7 @@ } /* Here we actually tell opensync which sinks are available. */ -static osync_bool discover(void *userdata, OSyncPluginInfo *info, OSyncError **error) +static osync_bool discover(OSyncPluginInfo *info, void *userdata, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, error); Modified: branches/timeout/opensync/format/opensync_format_env.c ============================================================================== --- branches/timeout/opensync/format/opensync_format_env.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/opensync/format/opensync_format_env.c Sat Jan 17 01:08:04 2009 (r5175) @@ -976,9 +976,10 @@ /* If detected_format is NULL, there is no reason to run the detection * without any chance to report the result */ + osync_assert_msg(detected_format, "detected_format is NULL. Therefore it isn't possible to report a result of the detection."); osync_return_val_if_fail(detected_format, TRUE); - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, env, input, error); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, env, input, detected_format, error); if (!input || !osync_data_has_data(input)) { osync_trace(TRACE_EXIT, "%s: No data provided to detect.", __func__); Modified: branches/timeout/opensync/plugin/opensync_objtype_sink.c ============================================================================== --- branches/timeout/opensync/plugin/opensync_objtype_sink.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/opensync/plugin/opensync_objtype_sink.c Sat Jan 17 01:08:04 2009 (r5175) @@ -272,7 +272,7 @@ } else if (!functions.get_changes) { osync_context_report_success(ctx); } else { - functions.get_changes(plugindata, info, ctx); + functions.get_changes(sink, info, ctx, osync_objtype_sink_get_slowsync(sink), plugindata); } osync_trace(TRACE_EXIT, "%s", __func__); @@ -296,7 +296,7 @@ } else if (!functions.read) { osync_context_report_success(ctx); } else { - functions.read(plugindata, info, ctx, change); + functions.read(sink, info, ctx, change, plugindata); } osync_trace(TRACE_EXIT, "%s", __func__); @@ -313,7 +313,7 @@ if (!functions.connect) { osync_context_report_success(ctx); } else { - functions.connect(plugindata, info, ctx); + functions.connect(sink, info, ctx, plugindata); } osync_trace(TRACE_EXIT, "%s", __func__); @@ -330,7 +330,7 @@ if (!functions.disconnect) { osync_context_report_success(ctx); } else { - functions.disconnect(plugindata, info, ctx); + functions.disconnect(sink, info, ctx, plugindata); } osync_trace(TRACE_EXIT, "%s", __func__); @@ -347,7 +347,7 @@ if (!functions.sync_done) osync_context_report_success(ctx); else - functions.sync_done(plugindata, info, ctx); + functions.sync_done(sink, info, ctx, plugindata); osync_trace(TRACE_EXIT, "%s", __func__); } @@ -363,7 +363,7 @@ if (!functions.connect_done) osync_context_report_success(ctx); else - functions.connect_done(plugindata, info, ctx); + functions.connect_done(sink, info, ctx, plugindata); osync_trace(TRACE_EXIT, "%s", __func__); } @@ -398,7 +398,7 @@ } else if (!functions.commit) { osync_context_report_success(ctx); } else { - functions.commit(plugindata, info, ctx, change); + functions.commit(sink, info, ctx, change, plugindata); } } @@ -444,12 +444,12 @@ osync_list_free(sink->commit_changes); osync_list_free(sink->commit_contexts); - functions.batch_commit(plugindata, info, ctx, contexts, changes); + functions.batch_commit(sink, info, ctx, contexts, changes, plugindata); osync_free(changes); osync_free(contexts); } else if (functions.committed_all) { - functions.committed_all(plugindata, info, ctx); + functions.committed_all(sink, info, ctx, plugindata); } else { osync_context_report_success(ctx); } Modified: branches/timeout/opensync/plugin/opensync_objtype_sink.h ============================================================================== --- branches/timeout/opensync/plugin/opensync_objtype_sink.h Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/opensync/plugin/opensync_objtype_sink.h Sat Jan 17 01:08:04 2009 (r5175) @@ -29,16 +29,16 @@ */ /*@{*/ -typedef void (* OSyncSinkConnectFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -typedef void (* OSyncSinkDisconnectFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -typedef void (* OSyncSinkGetChangesFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -typedef void (* OSyncSinkCommitFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change); -typedef osync_bool (* OSyncSinkWriteFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change); -typedef void (* OSyncSinkCommittedAllFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -typedef osync_bool (* OSyncSinkReadFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change); -typedef void (* OSyncSinkBatchCommitFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncContext **, OSyncChange **changes); -typedef void (* OSyncSinkSyncDoneFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -typedef void (* OSyncSinkConnectDoneFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); +typedef void (* OSyncSinkConnectFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data); +typedef void (* OSyncSinkDisconnectFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data); +typedef void (* OSyncSinkGetChangesFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data); +typedef void (* OSyncSinkCommitFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data); +typedef osync_bool (* OSyncSinkWriteFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data); +typedef void (* OSyncSinkCommittedAllFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data); +typedef osync_bool (* OSyncSinkReadFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data); +typedef void (* OSyncSinkBatchCommitFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncContext **, OSyncChange **changes, void *data); +typedef void (* OSyncSinkSyncDoneFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data); +typedef void (* OSyncSinkConnectDoneFn) (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data); typedef struct OSyncObjTypeSinkFunctions { OSyncSinkConnectFn connect; Modified: branches/timeout/tests/engine-tests/check_engine.c ============================================================================== --- branches/timeout/tests/engine-tests/check_engine.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/tests/engine-tests/check_engine.c Sat Jan 17 01:08:04 2009 (r5175) @@ -134,7 +134,7 @@ } END_TEST -static void connect1(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect1(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -153,7 +153,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -172,7 +172,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void get_changes(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -364,7 +364,7 @@ } END_TEST -static void connect2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -383,7 +383,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void disconnect2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -402,7 +402,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void get_changes2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -421,7 +421,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_connect2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_connect2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -440,7 +440,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_disconnect2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_disconnect2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -459,7 +459,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_get_changes2(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_get_changes2(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -679,7 +679,7 @@ } END_TEST -static void connect3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -699,7 +699,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void disconnect3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -721,7 +721,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void get_changes3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -741,7 +741,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void sync_done3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void sync_done3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -763,7 +763,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_connect3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_connect3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -789,7 +789,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_disconnect3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_disconnect3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -817,7 +817,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_get_changes3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_get_changes3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -844,7 +844,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void main_sync_done3(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_sync_done3(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -1080,7 +1080,7 @@ } END_TEST -static void main_disconnect4(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void main_disconnect4(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -1359,7 +1359,7 @@ } END_TEST -static void connect5(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect5(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -1371,7 +1371,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void disconnect5(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect5(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -1383,7 +1383,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void get_changes5(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes5(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -1430,7 +1430,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void commit_change5(void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static void commit_change5(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data) { mock_env *env = data; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, data, info, ctx, change); @@ -1594,7 +1594,7 @@ } END_TEST -static void get_changes6(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes6(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; int i; @@ -1798,7 +1798,7 @@ } END_TEST -static void get_changes7(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes7(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; int i; Modified: branches/timeout/tests/engine-tests/check_engine_error.c ============================================================================== --- branches/timeout/tests/engine-tests/check_engine_error.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/tests/engine-tests/check_engine_error.c Sat Jan 17 01:08:04 2009 (r5175) @@ -33,7 +33,7 @@ int num_disconnect = 0; int num_get_changes = 0; -static void connect1(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect1(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -44,7 +44,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void connect_error(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void connect_error(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -55,7 +55,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); @@ -66,7 +66,7 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void get_changes(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); Modified: branches/timeout/tests/mock-plugin/mock_sync.c ============================================================================== --- branches/timeout/tests/mock-plugin/mock_sync.c Fri Jan 16 19:30:06 2009 (r5174) +++ branches/timeout/tests/mock-plugin/mock_sync.c Sat Jan 17 01:08:04 2009 (r5175) @@ -25,24 +25,24 @@ static osync_bool mock_get_error(long long int memberid, const char *domain) { - const char *env = g_getenv(domain); + const char *env = g_getenv(domain); - if (!env) - return FALSE; + if (!env) + return FALSE; - int num = atoi(env); - int mask = 1 << (memberid - 1); - if (num & mask) { - char *chancestr = g_strdup_printf("%s_PROB", domain); - const char *chance = g_getenv(chancestr); - g_free(chancestr); - if (!chance) - return TRUE; - int prob = atoi(chance); - if (prob >= g_random_int_range(0, 100)) - return TRUE; - } - return FALSE; + int num = atoi(env); + int mask = 1 << (memberid - 1); + if (num & mask) { + char *chancestr = g_strdup_printf("%s_PROB", domain); + const char *chance = g_getenv(chancestr); + g_free(chancestr); + if (!chance) + return TRUE; + int prob = atoi(chance); + if (prob >= g_random_int_range(0, 100)) + return TRUE; + } + return FALSE; } static char *mock_generate_hash(struct stat *buf) @@ -50,14 +50,13 @@ return g_strdup_printf("%i-%i", (int)buf->st_mtime, (int)buf->st_ctime); } -static void mock_connect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void mock_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { osync_bool anchor_compare_match; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); MockDir *dir = osync_objtype_sink_get_userdata(sink); - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); if (mock_get_error(info->memberid, "CONNECT_ERROR")) { osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering CONNECT_ERROR error"); @@ -102,10 +101,9 @@ return; } -static void mock_connect_done(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void mock_connect_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); if (mock_get_error(info->memberid, "CONNECT_DONE_ERROR")) { @@ -130,11 +128,10 @@ } -static void mock_disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void mock_disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); MockDir *dir = osync_objtype_sink_get_userdata(sink); mock_env *env = data; @@ -172,10 +169,9 @@ //typedef void (* OSyncSinkCommittedAllFn) (void *data, OSyncPluginInfo *info, OSyncContext *ctx); -static osync_bool mock_read(void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static osync_bool mock_read(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, data, info, ctx, change); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); OSyncError *error = NULL; @@ -211,10 +207,9 @@ return TRUE; } -static osync_bool mock_write(void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static osync_bool mock_write(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, data, info, ctx, change); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); OSyncError *error = NULL; OSyncData *odata = NULL; @@ -366,10 +361,9 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void mock_get_changes(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void mock_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %i, %p)", __func__, sink, info, ctx, slow_sync, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); OSyncError *error = NULL; @@ -430,10 +424,9 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void mock_commit_change(void *data, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static void mock_commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data) { - osync_trace(TRACE_ENTRY, "%s", __func__); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); char *filename = NULL; @@ -449,7 +442,7 @@ return; } - if (!mock_write(data, info, ctx, change)) { + if (!mock_write(sink, info, ctx, change, data)) { osync_trace(TRACE_EXIT_ERROR, "%s", __func__); return; } @@ -474,18 +467,17 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void mock_batch_commit(void *data, OSyncPluginInfo *info, OSyncContext *context, OSyncContext **contexts, OSyncChange **changes) +static void mock_batch_commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *context, OSyncContext **contexts, OSyncChange **changes, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, context, contexts, changes); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p, %p)", __func__, sink, info, context, contexts, changes, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); - osync_assert(dir->committed_all == FALSE); - dir->committed_all = TRUE; + osync_assert(dir->committed_all == FALSE); + dir->committed_all = TRUE; - int i; - for (i = 0; contexts[i]; i++) { - if (mock_write(data, info, contexts[i], changes[i])) { + int i; + for (i = 0; contexts[i]; i++) { + if (mock_write(sink, info, contexts[i], changes[i], data)) { char *filename = g_strdup_printf ("%s/%s", dir->path, osync_change_get_uid(changes[i])); char *hash = NULL; @@ -498,49 +490,47 @@ g_free(filename); osync_hashtable_update_change(dir->hashtable, changes[i]); - osync_context_report_success(contexts[i]); - } - } + osync_context_report_success(contexts[i]); + } + } - if (g_getenv("NUM_BATCH_COMMITS")) { - int req = atoi(g_getenv("NUM_BATCH_COMMITS")); - osync_assert(req == i); - } - - if (mock_get_error(info->memberid, "COMMITTED_ALL_ERROR")) { - osync_context_report_error(context, OSYNC_ERROR_EXPECTED, "Triggering COMMITTED_ALL_ERROR error"); - return; - } + if (g_getenv("NUM_BATCH_COMMITS")) { + int req = atoi(g_getenv("NUM_BATCH_COMMITS")); + osync_assert(req == i); + } + + if (mock_get_error(info->memberid, "COMMITTED_ALL_ERROR")) { + osync_context_report_error(context, OSYNC_ERROR_EXPECTED, "Triggering COMMITTED_ALL_ERROR error"); + return; + } - osync_context_report_success(context); + osync_context_report_success(context); - osync_trace(TRACE_EXIT, "%s", __func__); + osync_trace(TRACE_EXIT, "%s", __func__); } -static void mock_committed_all(void *data, OSyncPluginInfo *info, OSyncContext *context) +static void mock_committed_all(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *context, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p)", __func__, context); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, context, data); MockDir *dir = osync_objtype_sink_get_userdata(sink); - osync_assert(dir->committed_all == FALSE); - dir->committed_all = TRUE; + osync_assert(dir->committed_all == FALSE); + dir->committed_all = TRUE; - if (mock_get_error(info->memberid, "COMMITTED_ALL_ERROR")) { - osync_context_report_error(context, OSYNC_ERROR_EXPECTED, "Triggering COMMITTED_ALL_ERROR error"); - osync_trace(TRACE_EXIT_ERROR, "%s: Reporting error", __func__); - return; - } + if (mock_get_error(info->memberid, "COMMITTED_ALL_ERROR")) { + osync_context_report_error(context, OSYNC_ERROR_EXPECTED, "Triggering COMMITTED_ALL_ERROR error"); + osync_trace(TRACE_EXIT_ERROR, "%s: Reporting error", __func__); + return; + } - osync_context_report_success(context); + osync_context_report_success(context); - osync_trace(TRACE_EXIT, "%s", __func__); + osync_trace(TRACE_EXIT, "%s", __func__); } -static void mock_sync_done(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +static void mock_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); MockDir *dir = osync_objtype_sink_get_userdata(sink); @@ -563,7 +553,7 @@ * all _possible_ objtype sinks. */ static void *mock_initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, info, error); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, plugin, info, error); if (mock_get_error(info->memberid, "INIT_NULL_NOERROR")) { osync_trace(TRACE_EXIT, "%s: %s", __func__, "Everything is fine. I don't need plugin userdata."); |
From: <dg...@su...> - 2009-01-16 18:31:02
|
Author: savago Date: Fri Jan 16 19:30:06 2009 New Revision: 5174 URL: http://www.opensync.org/changeset/5174 Log: Making sure that I get a valid sink for each type of data, plus some error checking. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 17:28:53 2009 (r5173) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 19:30:06 2009 (r5174) @@ -202,7 +202,6 @@ static int counter = 0; struct gc_plgdata *plgdata = data; char slow_sync_flag = 0; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); OSyncError *error = NULL; OSyncXMLFormat *xmlformat; OSyncData *odata = NULL; @@ -212,14 +211,21 @@ gcal_event event; OSyncError *anchor_error; - if (!plgdata->gcal_sink) - return; + if ((!plgdata->gcal_sink = osync_plugin_info_get_sink(info))) + goto error; + if (!(osync_objtype_sink_get_anchor(plgdata->gcal_sink))) + goto error; + timestamp = osync_anchor_retrieve(osync_objtype_sink_get_anchor(plgdata->gcal_sink), &anchor_error); - if (timestamp) + if (strlen(timestamp) > 0) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); - else + else { + if (timestamp) + free(timestamp); + timestamp = NULL; osync_trace(TRACE_INTERNAL, "first sync!\n"); + } if (osync_objtype_sink_get_slowsync(plgdata->gcal_sink)) { osync_trace(TRACE_INTERNAL, "\n\t\tgcal: Client asked for slow syncing...\n"); @@ -352,7 +358,6 @@ static int counter = 0; struct gc_plgdata *plgdata = data; char slow_sync_flag = 0; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); OSyncError *error = NULL; OSyncXMLFormat *xmlformat; OSyncData *odata = NULL; @@ -362,15 +367,22 @@ gcal_contact contact; OSyncError *anchor_error; - if (!plgdata->gcont_sink) - return; + if (!(plgdata->gcont_sink = osync_plugin_info_get_sink(info))) + goto error; + + if (!(osync_objtype_sink_get_anchor(plgdata->gcont_sink))) + goto error; timestamp = osync_anchor_retrieve(osync_objtype_sink_get_anchor(plgdata->gcont_sink), &anchor_error); - if (timestamp) + if (strlen(timestamp) > 0) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); - else + else { + if (timestamp) + free(timestamp); + timestamp = NULL; osync_trace(TRACE_INTERNAL, "first sync!\n"); + } if (osync_objtype_sink_get_slowsync(plgdata->gcont_sink)) { osync_trace(TRACE_INTERNAL, "\n\t\tgcont: Client asked for slow syncing...\n"); @@ -904,9 +916,9 @@ } osync_objtype_sink_set_functions(plgdata->gcont_sink, functions_gcont, plgdata); + osync_objtype_sink_enable_anchor(plgdata->gcont_sink, TRUE); osync_plugin_info_add_objtype(info, plgdata->gcont_sink); - osync_objtype_sink_enable_anchor(plgdata->gcont_sink, TRUE); } if (plgdata->calendar) |
From: <dg...@su...> - 2009-01-16 16:29:48
|
Author: savago Date: Fri Jan 16 17:28:53 2009 New Revision: 5173 URL: http://www.opensync.org/changeset/5173 Log: Fixing SEGFAULT by updating parameter list of gc_discover interface. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 16:41:23 2009 (r5172) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 17:28:53 2009 (r5173) @@ -779,7 +779,7 @@ const char *objtype, *tmp; int i, numobjs; - osync_error_set(error, OSYNC_ERROR_GENERIC, "no msg"); + //osync_error_set(error, OSYNC_ERROR_GENERIC, "no msg"); plgdata = osync_try_malloc0(sizeof(struct gc_plgdata), error); config = osync_plugin_info_get_config(info); if ((!plgdata) || (!config)) { @@ -933,7 +933,7 @@ return NULL; } -static osync_bool gc_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +static osync_bool gc_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, error); |
From: <dg...@su...> - 2009-01-16 15:42:25
|
Author: savago Date: Fri Jan 16 16:41:23 2009 New Revision: 5172 URL: http://www.opensync.org/changeset/5172 Log: osync_objtype_sink_get_anchor cannot be called in initialize. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 16:07:58 2009 (r5171) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 16:41:23 2009 (r5172) @@ -100,9 +100,6 @@ gcal_t contacts; struct gcal_event_array all_events; struct gcal_contact_array all_contacts; - /* anchor objects */ - OSyncAnchor *gcontact_anchor; - OSyncAnchor *gcalendar_anchor; /* calendar sink/format */ OSyncObjTypeSink *gcal_sink; OSyncObjFormat *gcal_format; @@ -217,8 +214,8 @@ if (!plgdata->gcal_sink) return; - osync_assert(plgdata->gcalendar_anchor); - timestamp = osync_anchor_retrieve(plgdata->gcalendar_anchor, &anchor_error); + timestamp = osync_anchor_retrieve(osync_objtype_sink_get_anchor(plgdata->gcal_sink), + &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); else @@ -367,8 +364,9 @@ if (!plgdata->gcont_sink) return; - osync_assert(plgdata->gcontact_anchor); - timestamp = osync_anchor_retrieve(plgdata->gcontact_anchor, &anchor_error); + + timestamp = osync_anchor_retrieve(osync_objtype_sink_get_anchor(plgdata->gcont_sink), + &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); else @@ -737,17 +735,15 @@ if (plgdata->calendar && plgdata->cal_timestamp) { osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cal_timestamp); - osync_assert(plgdata->gcalendar_anchor); - osync_anchor_update(plgdata->gcalendar_anchor, plgdata->cal_timestamp, - &anchor_error); + osync_anchor_update(osync_objtype_sink_get_anchor(plgdata->gcal_sink), + plgdata->cal_timestamp, &anchor_error); } if (plgdata->contacts && plgdata->cont_timestamp) { - osync_assert(plgdata->gcontact_anchor); osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cont_timestamp); - osync_anchor_update(plgdata->gcontact_anchor, plgdata->cont_timestamp, - &anchor_error); + osync_anchor_update(osync_objtype_sink_get_anchor(plgdata->gcont_sink), + plgdata->cont_timestamp, &anchor_error); } osync_context_report_success(ctx); @@ -880,11 +876,7 @@ osync_objtype_sink_set_functions(plgdata->gcal_sink, functions_gcal, plgdata); osync_plugin_info_add_objtype(info, plgdata->gcal_sink); - osync_objtype_sink_enable_anchor(plgdata->gcal_sink, TRUE); - if (!(plgdata->gcalendar_anchor = osync_objtype_sink_get_anchor(plgdata->gcal_sink))) { - osync_trace(TRACE_ERROR, "%s", "Failed getting calendar anchor!"); - goto error_freeplg; - } + osync_objtype_sink_enable_anchor(plgdata->gcal_sink, TRUE); } OSyncObjTypeSinkFunctions functions_gcont; @@ -915,10 +907,6 @@ osync_plugin_info_add_objtype(info, plgdata->gcont_sink); osync_objtype_sink_enable_anchor(plgdata->gcont_sink, TRUE); - if (!(plgdata->gcontact_anchor = osync_objtype_sink_get_anchor(plgdata->gcont_sink))) { - osync_trace(TRACE_ERROR, "%s", "Failed getting contact anchor!"); - goto error_freeplg; - } } if (plgdata->calendar) |
From: <dg...@su...> - 2009-01-16 15:08:50
|
Author: savago Date: Fri Jan 16 16:07:58 2009 New Revision: 5171 URL: http://www.opensync.org/changeset/5171 Log: Testing for existence of anchor object. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 15:56:12 2009 (r5170) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 16:07:58 2009 (r5171) @@ -217,6 +217,7 @@ if (!plgdata->gcal_sink) return; + osync_assert(plgdata->gcalendar_anchor); timestamp = osync_anchor_retrieve(plgdata->gcalendar_anchor, &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); @@ -366,6 +367,7 @@ if (!plgdata->gcont_sink) return; + osync_assert(plgdata->gcontact_anchor); timestamp = osync_anchor_retrieve(plgdata->gcontact_anchor, &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); @@ -735,11 +737,13 @@ if (plgdata->calendar && plgdata->cal_timestamp) { osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cal_timestamp); + osync_assert(plgdata->gcalendar_anchor); osync_anchor_update(plgdata->gcalendar_anchor, plgdata->cal_timestamp, &anchor_error); } if (plgdata->contacts && plgdata->cont_timestamp) { + osync_assert(plgdata->gcontact_anchor); osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cont_timestamp); osync_anchor_update(plgdata->gcontact_anchor, plgdata->cont_timestamp, |
From: <dg...@su...> - 2009-01-16 14:57:05
|
Author: savago Date: Fri Jan 16 15:56:12 2009 New Revision: 5170 URL: http://www.opensync.org/changeset/5170 Log: Using osync_trace with ERROR option to warn about failures. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 15:25:26 2009 (r5169) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 15:56:12 2009 (r5170) @@ -778,7 +778,7 @@ OSyncList *r; const char *objtype, *tmp; int i, numobjs; - char *msg_error = "no msg."; + osync_error_set(error, OSYNC_ERROR_GENERIC, "no msg"); plgdata = osync_try_malloc0(sizeof(struct gc_plgdata), error); config = osync_plugin_info_get_config(info); @@ -862,14 +862,14 @@ OSyncFormatEnv *formatenv1 = osync_plugin_info_get_format_env(info); plgdata->gcal_format = osync_format_env_find_objformat(formatenv1, "xmlformat-event"); if (!plgdata->gcal_format) { - msg_error = "Failed to find objformat xmlformat-event!"; + osync_trace(TRACE_ERROR, "%s", "Failed to find objformat xmlformat-event!"); goto error_freeplg; } osync_objformat_ref(plgdata->gcal_format); plgdata->gcal_sink = osync_plugin_info_find_objtype(info, "event"); if (!plgdata->gcal_sink) { - msg_error = "Failed to find objtype event!"; + osync_trace(TRACE_ERROR, "%s", "Failed to find objtype event!"); goto error_freeplg; } @@ -877,9 +877,10 @@ osync_plugin_info_add_objtype(info, plgdata->gcal_sink); osync_objtype_sink_enable_anchor(plgdata->gcal_sink, TRUE); - if (!(plgdata->gcalendar_anchor = osync_objtype_sink_get_anchor(plgdata->gcal_sink))) + if (!(plgdata->gcalendar_anchor = osync_objtype_sink_get_anchor(plgdata->gcal_sink))) { + osync_trace(TRACE_ERROR, "%s", "Failed getting calendar anchor!"); goto error_freeplg; - + } } OSyncObjTypeSinkFunctions functions_gcont; @@ -895,14 +896,14 @@ OSyncFormatEnv *formatenv2 = osync_plugin_info_get_format_env(info); plgdata->gcont_format = osync_format_env_find_objformat(formatenv2, "xmlformat-contact"); if (!plgdata->gcont_format) { - msg_error = "Failed to find objformat xmlformat-contact!"; + osync_trace(TRACE_ERROR, "%s", "Failed to find objformat xmlformat-contact!"); goto error_freeplg; } osync_objformat_ref(plgdata->gcont_format); plgdata->gcont_sink = osync_plugin_info_find_objtype(info, "contact"); if (!plgdata->gcont_sink) { - msg_error = "Failed to find objtype contact!"; + osync_trace(TRACE_ERROR, "%s", "Failed to find objtype contact!"); goto error_freeplg; } @@ -910,9 +911,10 @@ osync_plugin_info_add_objtype(info, plgdata->gcont_sink); osync_objtype_sink_enable_anchor(plgdata->gcont_sink, TRUE); - if (!(plgdata->gcontact_anchor = osync_objtype_sink_get_anchor(plgdata->gcont_sink))) + if (!(plgdata->gcontact_anchor = osync_objtype_sink_get_anchor(plgdata->gcont_sink))) { + osync_trace(TRACE_ERROR, "%s", "Failed getting contact anchor!"); goto error_freeplg; - + } } if (plgdata->calendar) @@ -935,7 +937,7 @@ if (plgdata) free_plg(plgdata); out: - osync_trace(TRACE_EXIT_ERROR, "%s: %s: %s", __func__, msg_error, osync_error_print(error)); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return NULL; } |
From: <dg...@su...> - 2009-01-16 14:26:23
|
Author: savago Date: Fri Jan 16 15:25:26 2009 New Revision: 5169 URL: http://www.opensync.org/changeset/5169 Log: Updating plugin to the newer anchor API introduced (r5021). Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Fri Jan 16 14:42:51 2009 (r5168) +++ plugins/google-calendar/src/gcalendar.c Fri Jan 16 15:25:26 2009 (r5169) @@ -54,7 +54,6 @@ #include <gcontact.h> #include "xslt_aux.h" - static int timestamp_cmp(char *timestamp1, char *timestamp2) { /* timestamp (RFC3339) formating string */ @@ -92,8 +91,6 @@ char *url; char *username; char *password; - char *gcal_anchor_path; - char *gcont_anchor_path; char *timezone; char *xslt_path; /* libgcal resources */ @@ -103,6 +100,9 @@ gcal_t contacts; struct gcal_event_array all_events; struct gcal_contact_array all_contacts; + /* anchor objects */ + OSyncAnchor *gcontact_anchor; + OSyncAnchor *gcalendar_anchor; /* calendar sink/format */ OSyncObjTypeSink *gcal_sink; OSyncObjFormat *gcal_format; @@ -125,10 +125,6 @@ gcal_cleanup_contacts(&(plgdata->all_contacts)); } - if (plgdata->gcal_anchor_path) - g_free(plgdata->gcal_anchor_path); - if (plgdata->gcont_anchor_path) - g_free(plgdata->gcont_anchor_path); if (plgdata->xslt_path) free(plgdata->xslt_path); if (plgdata->xslt_ctx_gcal) @@ -217,10 +213,11 @@ int result = 0, i; char *timestamp = NULL, *msg, *raw_xml = NULL; gcal_event event; + OSyncError *anchor_error; if (!plgdata->gcal_sink) return; - timestamp = osync_anchor_retrieve(plgdata->gcal_anchor_path, "gcalendar"); + timestamp = osync_anchor_retrieve(plgdata->gcalendar_anchor, &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); else @@ -365,11 +362,11 @@ int result = 0, i; char *timestamp = NULL, *msg, *raw_xml = NULL; gcal_contact contact; - slow_sync_flag = 0; + OSyncError *anchor_error; if (!plgdata->gcont_sink) return; - timestamp = osync_anchor_retrieve(plgdata->gcont_anchor_path, "gcontact"); + timestamp = osync_anchor_retrieve(plgdata->gcontact_anchor, &anchor_error); if (timestamp) osync_trace(TRACE_INTERNAL, "timestamp is: %s\n", timestamp); else @@ -733,19 +730,20 @@ osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, ctx); struct gc_plgdata *plgdata = data; OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + OSyncError *anchor_error; if (plgdata->calendar && plgdata->cal_timestamp) { osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cal_timestamp); - osync_anchor_update(plgdata->gcal_anchor_path, "gcalendar", - plgdata->cal_timestamp); + osync_anchor_update(plgdata->gcalendar_anchor, plgdata->cal_timestamp, + &anchor_error); } if (plgdata->contacts && plgdata->cont_timestamp) { osync_trace(TRACE_INTERNAL, "query updated timestamp: %s\n", plgdata->cont_timestamp); - osync_anchor_update(plgdata->gcont_anchor_path, "gcontact", - plgdata->cont_timestamp); + osync_anchor_update(plgdata->gcontact_anchor, plgdata->cont_timestamp, + &anchor_error); } osync_context_report_success(ctx); @@ -780,7 +778,8 @@ OSyncList *r; const char *objtype, *tmp; int i, numobjs; - + char *msg_error = "no msg."; + osync_error_set(error, OSYNC_ERROR_GENERIC, "no msg"); plgdata = osync_try_malloc0(sizeof(struct gc_plgdata), error); config = osync_plugin_info_get_config(info); if ((!plgdata) || (!config)) { @@ -862,17 +861,25 @@ osync_trace(TRACE_INTERNAL, "\tcreating calendar sink...\n"); OSyncFormatEnv *formatenv1 = osync_plugin_info_get_format_env(info); plgdata->gcal_format = osync_format_env_find_objformat(formatenv1, "xmlformat-event"); - if (!plgdata->gcal_format) + if (!plgdata->gcal_format) { + msg_error = "Failed to find objformat xmlformat-event!"; goto error_freeplg; + } osync_objformat_ref(plgdata->gcal_format); plgdata->gcal_sink = osync_plugin_info_find_objtype(info, "event"); - if (!plgdata->gcal_sink) + if (!plgdata->gcal_sink) { + msg_error = "Failed to find objtype event!"; goto error_freeplg; + } osync_objtype_sink_set_functions(plgdata->gcal_sink, functions_gcal, plgdata); osync_plugin_info_add_objtype(info, plgdata->gcal_sink); + osync_objtype_sink_enable_anchor(plgdata->gcal_sink, TRUE); + if (!(plgdata->gcalendar_anchor = osync_objtype_sink_get_anchor(plgdata->gcal_sink))) + goto error_freeplg; + } OSyncObjTypeSinkFunctions functions_gcont; @@ -887,33 +894,26 @@ osync_trace(TRACE_INTERNAL, "\tcreating contact sink...\n"); OSyncFormatEnv *formatenv2 = osync_plugin_info_get_format_env(info); plgdata->gcont_format = osync_format_env_find_objformat(formatenv2, "xmlformat-contact"); - if (!plgdata->gcont_format) + if (!plgdata->gcont_format) { + msg_error = "Failed to find objformat xmlformat-contact!"; goto error_freeplg; + } osync_objformat_ref(plgdata->gcont_format); plgdata->gcont_sink = osync_plugin_info_find_objtype(info, "contact"); - if (!plgdata->gcont_sink) + if (!plgdata->gcont_sink) { + msg_error = "Failed to find objtype contact!"; goto error_freeplg; + } osync_objtype_sink_set_functions(plgdata->gcont_sink, functions_gcont, plgdata); osync_plugin_info_add_objtype(info, plgdata->gcont_sink); - } - - - plgdata->gcal_anchor_path = g_strdup_printf("%s/calendar_anchor.db", - osync_plugin_info_get_configdir(info)); - if (!(plgdata->gcal_anchor_path)) - goto error_freeplg; - else - osync_trace(TRACE_INTERNAL, "\tanchor: %s\n", plgdata->gcal_anchor_path); + osync_objtype_sink_enable_anchor(plgdata->gcont_sink, TRUE); + if (!(plgdata->gcontact_anchor = osync_objtype_sink_get_anchor(plgdata->gcont_sink))) + goto error_freeplg; - plgdata->gcont_anchor_path = g_strdup_printf("%s/contact_anchor.db", - osync_plugin_info_get_configdir(info)); - if (!(plgdata->gcont_anchor_path)) - goto error_freeplg; - else - osync_trace(TRACE_INTERNAL, "\tanchor: %s\n", plgdata->gcont_anchor_path); + } if (plgdata->calendar) if (!(plgdata->xslt_ctx_gcal = xslt_new())) @@ -935,7 +935,7 @@ if (plgdata) free_plg(plgdata); out: - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + osync_trace(TRACE_EXIT_ERROR, "%s: %s: %s", __func__, msg_error, osync_error_print(error)); return NULL; } |
From: <dg...@su...> - 2009-01-16 13:43:45
|
Author: cstender Date: Fri Jan 16 14:42:51 2009 New Revision: 5168 URL: http://www.opensync.org/changeset/5168 Log: reworked convert_xml_rrule_to_vcal and fixed bug #1012 Modified: format-plugins/vformat/src/xmlformat-recurrence.c Modified: format-plugins/vformat/src/xmlformat-recurrence.c ============================================================================== --- format-plugins/vformat/src/xmlformat-recurrence.c Fri Jan 16 14:24:55 2009 (r5167) +++ format-plugins/vformat/src/xmlformat-recurrence.c Fri Jan 16 14:42:51 2009 (r5168) @@ -228,39 +228,36 @@ * convert_xml_rrule_to_vcal get interval and call functions above */ -static char *convert_rrule_vcal_frequency(OSyncXMLField *xmlfield, int frequency_state_id) +static const char *convert_rrule_vcal_frequency(const char *frequency, int freq_mod_id) { - const char *frequency = NULL; - char *frequency_id = NULL; - - /* set Frequency */ - frequency = osync_xmlfield_get_key_value(xmlfield, "Frequency"); + const char *frequency_id = NULL; - /* get frequency: only D(1), W(2), MP(3), MD(4), YD(5) and YM(6) are allowed */ + /* vcal frequency: only D(1), W(2), MP(3), MD(4), YD(5) and YM(6) are allowed */ if (frequency) { if (!strcmp(frequency, "DAILY")) { frequency_id = "D"; } else if (!strcmp(frequency, "WEEKLY")) { frequency_id = "W"; - } else if (!strcmp(frequency, "MONTHLY") && frequency_state_id == 3) { + } else if (!strcmp(frequency, "MONTHLY") && freq_mod_id == 0) { + frequency_id = "MD"; + } else if (!strcmp(frequency, "MONTHLY") && freq_mod_id == 3) { frequency_id = "MP"; - } else if (!strcmp(frequency, "MONTHLY") && frequency_state_id == 4) { + } else if (!strcmp(frequency, "MONTHLY") && freq_mod_id == 4) { frequency_id = "MD"; - } else if (!strcmp(frequency, "YEARLY") && frequency_state_id == 5) { + } else if (!strcmp(frequency, "YEARLY") && freq_mod_id == 0) { frequency_id = "YD"; - } else if (!strcmp(frequency, "YEARLY") && frequency_state_id == 6) { + } else if (!strcmp(frequency, "YEARLY") && freq_mod_id == 5) { + frequency_id = "YD"; + } else if (!strcmp(frequency, "YEARLY") && freq_mod_id == 6) { frequency_id = "YM"; } else { osync_trace(TRACE_ERROR, "invalid frequency"); - return NULL; } } else { - osync_trace(TRACE_INTERNAL, "missing frequency"); - return NULL; + osync_trace(TRACE_ERROR, "missing frequency"); } return frequency_id; - } static char *convert_rrule_vcal_freqmod(OSyncXMLField *xmlfield, gchar **rule, int size, int freqstate) @@ -326,48 +323,61 @@ VFormatAttribute *convert_xml_rrule_to_vcal(VFormat *vformat, OSyncXMLField *xmlfield, const char *rulename, const char *encoding) { VFormatAttribute *attr = vformat_attribute_new(NULL, rulename); - - int frequency_state_id = 0, counter = 0; + const char *interval = NULL; + const char *frequency = NULL; + const char *until_utc = NULL; + const char *count = NULL; + const char *freq_mod = NULL; + int freq_mod_id = 0; char *rule = NULL; + int numberofkeys, i; - // Grad the latest key of the field and check if it is a frequency state - const char *frequency_state = osync_xmlfield_get_nth_key_name(xmlfield, osync_xmlfield_get_key_count(xmlfield)-1); - - - if (frequency_state) { - if ( !strcmp(frequency_state, "ByDay")) - frequency_state_id = 3; - else if (!strcmp(frequency_state, "ByMonthDay")) - frequency_state_id = 4; - else if (!strcmp(frequency_state, "ByYearDay")) - frequency_state_id = 5; - else if (!strcmp(frequency_state, "ByMonth")) - frequency_state_id = 6; + /* parse xmlfield */ + numberofkeys = osync_xmlfield_get_key_count(xmlfield); + for(i=0; i < numberofkeys; i++) { + const char *name = osync_xmlfield_get_nth_key_name(xmlfield, i); + const char *value = osync_xmlfield_get_nth_key_value(xmlfield, i); + if(!strcmp(name, "Interval")) { + interval = value; + } else if(!strcmp(name, "Frequency")) { + frequency = value; + } else if(!strcmp(name, "Until")) { + until_utc = value; + } else if(!strcmp(name, "Count")) { + count = value; + } else if(!strcmp(name, "ByDay")) { + freq_mod_id = 3; + freq_mod = value; + } else if(!strcmp(name, "ByMonthDay")) { + freq_mod_id = 4; + freq_mod = value; + } else if(!strcmp(name, "ByYearDay")) { + freq_mod_id = 5; + freq_mod = value; + } else if(!strcmp(name, "ByMonth")) { + freq_mod_id = 6; + freq_mod = value; + } + /* TODO: handle advanced frequency modifiers */ } - /* get Interval */ - const char *interval = osync_xmlfield_get_key_value(xmlfield, "Interval"); + /* get vcal frequency */ + frequency = convert_rrule_vcal_frequency(frequency, freq_mod_id); - /* set frequency */ - const char *frequency = convert_rrule_vcal_frequency(xmlfield, frequency_state_id); - - if (frequency && interval ) + if (frequency && interval) rule = g_strdup_printf("%s%s", frequency, interval); - // FIXME : handle advanced frequency_mod with a convert_rrule_vcal_freqmod - // We have a frequency state - if (frequency_state_id) { - const char *freq_mod = osync_xmlfield_get_key_value(xmlfield, frequency_state); + if (freq_mod) { + /* TODO: handle advanced frequency modifiers with + * a new function convert_rrule_vcal_freqmod */ rule = g_strdup_printf("%s %s", rule, freq_mod); } - const char *until_utc = osync_xmlfield_get_key_value(xmlfield, "Until"); if (until_utc) { char *until = convert_rrule_vcal_until(until_utc); rule = g_strdup_printf("%s %s", rule, until); } - const char *count = osync_xmlfield_get_key_value(xmlfield, "Count"); if (count) { rule = g_strdup_printf("%s #%s", rule, count); } @@ -376,7 +386,6 @@ vformat_add_attribute(vformat, attr); return attr; - } // End of Basic Recurrence Rule |
From: <dg...@su...> - 2009-01-16 13:25:49
|
Author: bricks Date: Fri Jan 16 14:24:55 2009 New Revision: 5167 URL: http://www.opensync.org/changeset/5167 Log: renamed formatdata to converterdata (missed some lines in the last commit) Modified: trunk/docs/examples/plugins/src/format.c Modified: trunk/docs/examples/plugins/src/format.c ============================================================================== --- trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:21:36 2009 (r5166) +++ trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:24:55 2009 (r5167) @@ -191,8 +191,8 @@ * Here you can free all your converter specific data. */ converter_data *converterdata = (converter_data*)userdata; - osync_free(formatdata->data); - osync_free(formatdata); + osync_free(converterdata->data); + osync_free(converterdata); } osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) |
From: <dg...@su...> - 2009-01-16 13:22:27
|
Author: bricks Date: Fri Jan 16 14:21:36 2009 New Revision: 5166 URL: http://www.opensync.org/changeset/5166 Log: changed format_data to converter_data to differientiate between converters and formats Modified: trunk/docs/examples/plugins/src/format.c Modified: trunk/docs/examples/plugins/src/format.c ============================================================================== --- trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:18:08 2009 (r5165) +++ trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:21:36 2009 (r5166) @@ -9,9 +9,9 @@ #include <opensync/opensync.h> #include <opensync/opensync-format.h> -typedef struct format_data { +typedef struct converter_data { char *data; -} format_data; +} converter_data; static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize, void *data) @@ -178,9 +178,10 @@ /* * Here you can create converter specific data. * If you return the converter specific data, it is passed - * to the conversion and detector function as void *userdata + * to the conversion and detector function as void *userdata. + * Converter specific data could be e.g. a XSLT file */ - format_data *userdata = osync_try_malloc0(sizeof(format_data), error); + converter_data *userdata = osync_try_malloc0(sizeof(converter_data), error); return (void*)userdata; } @@ -189,7 +190,7 @@ /* * Here you can free all your converter specific data. */ - format_data *formatdata = (format_data*)userdata; + converter_data *converterdata = (converter_data*)userdata; osync_free(formatdata->data); osync_free(formatdata); } |
From: <dg...@su...> - 2009-01-16 13:18:59
|
Author: bricks Date: Fri Jan 16 14:18:08 2009 New Revision: 5165 URL: http://www.opensync.org/changeset/5165 Log: Changed for format function api changes Added examples for format init and finalize functions (merger/demerger is still missing) Modified: trunk/docs/examples/plugins/src/format.c Modified: trunk/docs/examples/plugins/src/format.c ============================================================================== --- trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:03:49 2009 (r5164) +++ trunk/docs/examples/plugins/src/format.c Fri Jan 16 14:18:08 2009 (r5165) @@ -14,7 +14,7 @@ } format_data; -static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize) +static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize, void *data) { /* * This function can be used to compare two types of your formats. @@ -97,7 +97,7 @@ return TRUE; } -static void destroy_format1(char *input, unsigned int size) +static void destroy_format1(char *input, unsigned int size, void *data) { /* * Here you have to free the data allocated by your format @@ -105,7 +105,7 @@ */ } -static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, OSyncError **error) +static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, void *data, OSyncError **error) { /* * This function can be used to duplicate your format. @@ -120,7 +120,7 @@ return TRUE; } -static char *print_format1(const char *data, unsigned int size) +static char *print_format1(const char *data, unsigned int size, void *user_data) { /* * If your format is not in a human printable format already @@ -132,6 +132,24 @@ return NULL; } +void *init_format1(OSyncError **error) { + /* + * If your format needs specific data e.g. a XML Schema file + * for validation it is possible to load the data in this + * function. If the data should be passes to all format + * functions it has to be returned as a pointer. + */ + char *format_specific_data = osync_try_malloc0(0, error); + return (void *)format_specific_data; +} + +void finialize_format1(void *data) { + /* + * Release all format data + */ + osync_free(data); +} + osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error) { /* @@ -146,6 +164,8 @@ osync_objformat_set_duplicate_func(format, duplicate_format1); osync_objformat_set_print_func(format, print_format1); + osync_objformat_set_initialize_func(format, init_format1); + osync_objformat_set_finalize_func(format, finialize_format1); osync_format_env_register_objformat(env, format); osync_objformat_unref(format); @@ -153,7 +173,7 @@ return TRUE; } -void *initialize(const char* config, OSyncError **error) +void *initialize_converter(const char* config, OSyncError **error) { /* * Here you can create converter specific data. @@ -164,7 +184,7 @@ return (void*)userdata; } -void finalize(void *userdata) +void finalize_converter(void *userdata) { /* * Here you can free all your converter specific data. @@ -198,8 +218,8 @@ if (!conv) return FALSE; /* set init and finalize functions */ - osync_converter_set_initialize_func(conv, initialize); - osync_converter_set_finalize_func(conv, finalize); + osync_converter_set_initialize_func(conv, initialize_converter); + osync_converter_set_finalize_func(conv, finalize_converter); /* register converter */ osync_format_env_register_converter(env, conv); osync_converter_unref(conv); |