From: <svn...@op...> - 2009-06-21 23:24:41
|
Author: dgollub Date: Mon Jun 22 01:24:36 2009 New Revision: 5679 URL: http://www.opensync.org/changeset/5679 Log: Dropped assemble/prase interface from OSyncCapabilities API osynctool requries porting. Applications must not have direct access to edit the internal stored format (e.g. XML editing via editor) refs #1084 Modified: branches/opensync-ticket1084/opensync.sym branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities.h branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities_internals.h branches/opensync-ticket1084/opensync/client/opensync_client_proxy.c Modified: branches/opensync-ticket1084/opensync.sym ============================================================================== --- branches/opensync-ticket1084/opensync.sym Mon Jun 22 01:13:07 2009 (r5678) +++ branches/opensync-ticket1084/opensync.sym Mon Jun 22 01:24:36 2009 (r5679) @@ -1,8 +1,7 @@ -osync_capabilities_assemble osync_capabilities_get_format +osync_capabilities_get_objtype osync_capabilities_new osync_capabilities_objtype_get_caps -osync_capabilities_parse osync_capabilities_ref osync_capabilities_unref osync_capability_get_displayname Modified: branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities.h ============================================================================== --- branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities.h Mon Jun 22 01:13:07 2009 (r5678) +++ branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities.h Mon Jun 22 01:24:36 2009 (r5679) @@ -43,15 +43,6 @@ OSYNC_EXPORT OSyncCapabilities *osync_capabilities_new(const char *capsformat, OSyncError **error); /** - * @brief Creates a new capabilities object from an xml document. - * @param buffer The pointer to the xml document - * @param size The size of the xml document - * @param error The error which will hold the info in case of an error - * @return The pointer to the newly allocated capabilities object or NULL in case of error - */ -OSYNC_EXPORT OSyncCapabilities *osync_capabilities_parse(const char *buffer, unsigned int size, OSyncError **error); - -/** * @brief Increments the reference counter * @param capabilities The pointer to a capabilities object */ @@ -64,24 +55,13 @@ */ OSYNC_EXPORT void osync_capabilities_unref(OSyncCapabilities *capabilities); - /** - * @brief Get the first capability for a given objtype from the capabilities + * @brief Get the first capabilitiesobjtype for a given objtype from the capabilities * @param capabilities The pointer to a capabilities object * @param objtype The name of the objtype (e.g.: contact) - * @return The first capability for a given objtype from the capabilities + * @return The capabilitiesobjtype for a given objtype from the capabilities */ -OSYNC_EXPORT OSyncCapability *osync_capabilities_get_first(OSyncCapabilities *capabilities, const char *objtype); - -/** - * @brief Dump the capabilities into memory. - * @param capabilities The pointer to a capabilities object - * @param error The error which will hold the info in case of an error - * @return The xml document and the size of it. It's up to the caller to free - * the buffer. Always it return TRUE. - */ -OSYNC_EXPORT osync_bool osync_capabilities_assemble(OSyncCapabilities *capabilities, char **buffer, int *size, OSyncError **error); - +OSYNC_EXPORT OSyncCapabilitiesObjType *osync_capabilities_get_objtype(OSyncCapabilities *capabilities, const char *objtype); OSYNC_EXPORT const char *osync_capabilities_get_format(OSyncCapabilities *capabilities); Modified: branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities_internals.h ============================================================================== --- branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities_internals.h Mon Jun 22 01:13:07 2009 (r5678) +++ branches/opensync-ticket1084/opensync/capabilities/opensync_capabilities_internals.h Mon Jun 22 01:24:36 2009 (r5679) @@ -68,12 +68,22 @@ OSYNC_TEST_EXPORT OSyncCapabilities *osync_capabilities_load_identifier(const char *file, OSyncError **error); /** - * @brief Get the first capabilitiesobjtype for a given objtype from the capabilities - * @param capabilities The pointer to a capabilities object - * @param objtype The name of the objtype (e.g.: contact) - * @return The capabilitiesobjtype for a given objtype from the capabilities + * @brief Dump the capabilities into memory. + * @param capabilities The pointer to a capabilities object + * @param error The error which will hold the info in case of an error + * @return The xml document and the size of it. It's up to the caller to free + * the buffer. Always it return TRUE. */ -OSYNC_TEST_EXPORT OSyncCapabilitiesObjType *osync_capabilities_get_objtype(OSyncCapabilities *capabilities, const char *objtype); +OSYNC_TEST_EXPORT osync_bool osync_capabilities_assemble(OSyncCapabilities *capabilities, char **buffer, int *size, OSyncError **error); + +/** + * @brief Creates a new capabilities object from an xml document. + * @param buffer The pointer to the xml document + * @param size The size of the xml document + * @param error The error which will hold the info in case of an error + * @return The pointer to the newly allocated capabilities object or NULL in case of error + */ +OSYNC_TEST_EXPORT OSyncCapabilities *osync_capabilities_parse(const char *buffer, unsigned int size, OSyncError **error); /*@}*/ Modified: branches/opensync-ticket1084/opensync/client/opensync_client_proxy.c ============================================================================== --- branches/opensync-ticket1084/opensync/client/opensync_client_proxy.c Mon Jun 22 01:13:07 2009 (r5678) +++ branches/opensync-ticket1084/opensync/client/opensync_client_proxy.c Mon Jun 22 01:24:36 2009 (r5679) @@ -30,6 +30,8 @@ #include "plugin/opensync_objtype_sink_internals.h" #include "opensync-capabilities.h" +#include "capabilities/opensync_capabilities_internals.h" + #include "opensync-group.h" #include "opensync-plugin.h" #include "opensync-format.h" |