From: <svn...@op...> - 2009-09-16 22:26:24
|
Author: dgollub Date: Thu Sep 17 00:25:54 2009 New Revision: 5767 URL: http://www.opensync.org/changeset/5767 Log: Completed TODO-task by moving osync_marshal_{read,write}_data to internal/private API. Added: trunk/opensync/common/opensync_marshal_internals.h - copied, changed from r5764, trunk/opensync/common/opensync_marshal_private.h Modified: trunk/opensync.sym trunk/opensync/common/opensync_marshal.c trunk/opensync/common/opensync_marshal.h trunk/opensync/engine/opensync_engine.c trunk/opensync/ipc/opensync_message.c Modified: trunk/opensync.sym ============================================================================== --- trunk/opensync.sym Thu Sep 17 00:12:13 2009 (r5766) +++ trunk/opensync.sym Thu Sep 17 00:25:54 2009 (r5767) @@ -302,7 +302,6 @@ osync_marshal_read_buffer osync_marshal_read_const_data osync_marshal_read_const_string -osync_marshal_read_data osync_marshal_read_int osync_marshal_read_long_long_int osync_marshal_read_string @@ -312,7 +311,6 @@ osync_marshal_sized_new osync_marshal_unref osync_marshal_write_buffer -osync_marshal_write_data osync_marshal_write_int osync_marshal_write_long_long_int osync_marshal_write_string Modified: trunk/opensync/common/opensync_marshal.c ============================================================================== --- trunk/opensync/common/opensync_marshal.c Thu Sep 17 00:12:13 2009 (r5766) +++ trunk/opensync/common/opensync_marshal.c Thu Sep 17 00:25:54 2009 (r5767) @@ -117,7 +117,6 @@ void osync_marshal_write_data(OSyncMarshal *marshal, const void *value, unsigned int size) { - /* TODO move this to PRIVATE API */ g_byte_array_append( marshal->buffer, value, size ); } Modified: trunk/opensync/common/opensync_marshal.h ============================================================================== --- trunk/opensync/common/opensync_marshal.h Thu Sep 17 00:12:13 2009 (r5766) +++ trunk/opensync/common/opensync_marshal.h Thu Sep 17 00:25:54 2009 (r5767) @@ -118,17 +118,6 @@ */ OSYNC_EXPORT void osync_marshal_write_string(OSyncMarshal *marshal, const char *value); -/** @brief Appends data with a specific length to the serialized buffer - * - * This data should be completely serialized. This is only for internal use, - * since this function doesn't append the size/end of the appended data. - * - * @param marshal The marshal object - * @param value The data to append - * @param size Size of corresponding data parameter - */ -OSYNC_EXPORT void osync_marshal_write_data(OSyncMarshal *marshal, const void *value, unsigned int size); - /** @brief Appends data with a specific length to the serialized buffer, * plus the length of the data to determine the end. * @@ -171,16 +160,6 @@ */ OSYNC_EXPORT void osync_marshal_read_string(OSyncMarshal *marshal, char **value); -/** @brief Read specific size of serialized data from marshal buffer. This increments - * the read position of the marshal buffer. Caller is responsible for freeing the - * duplicate data. - * - * @param marshal The marshal object - * @param value Reference to store the pointer to the newly allocated data - * @param size Size of data - */ -OSYNC_EXPORT void osync_marshal_read_data(OSyncMarshal *marshal, void *value, unsigned int size); - /** @brief Read serialized const data from marshal buffer. This increments the read * position of the marshal buffer. * Copied and modified: trunk/opensync/common/opensync_marshal_internals.h (from r5764, trunk/opensync/common/opensync_marshal_private.h) ============================================================================== --- trunk/opensync/common/opensync_marshal_private.h Thu Sep 10 23:20:07 2009 (r5764, copy source) +++ trunk/opensync/common/opensync_marshal_internals.h Thu Sep 17 00:25:54 2009 (r5767) @@ -18,33 +18,42 @@ * */ -#ifndef _OPENSYNC_MARSHAL_PRIVATE_H -#define _OPENSYNC_MARSHAL_PRIVATE_H +#ifndef _OPENSYNC_MARSHAL_INTERNALS_H +#define _OPENSYNC_MARSHAL_INTERNALS_H /** - * @defgroup OSyncCommonPrivate OpenSync Common Module Private - * @ingroup OSyncPrivate - * @defgroup OSyncMarshalPrivateAPI OpenSync Marshal Private - * @ingroup OSyncCommonPrivate + * @defgroup OSyncCommonInternal OpenSync Common Module Internal + * @ingroup OSyncInternal + * @defgroup OSyncMarshalInternalAPI OpenSync Marshal Internal + * @ingroup OSyncCommonInternal * @brief Serialized buffer * */ /*@{*/ -/** - * @brief A OSyncMarshal object +/** @brief Appends data with a specific length to the serialized buffer + * + * This data should be completely serialized. This is only for internal use, + * since this function doesn't append the size/end of the appended data. + * + * @param marshal The marshal object + * @param value The data to append + * @param size Size of corresponding data parameter + */ +OSYNC_TEST_EXPORT void osync_marshal_write_data(OSyncMarshal *marshal, const void *value, unsigned int size); + +/** @brief Read specific size of serialized data from marshal buffer. This increments + * the read position of the marshal buffer. Caller is responsible for freeing the + * duplicate data. + * + * @param marshal The marshal object + * @param value Reference to store the pointer to the newly allocated data + * @param size Size of data */ -struct OSyncMarshal { - /** Reference counting */ - int ref_count; - /** The pointer to the internal **/ - GByteArray *buffer; - /** The current read position **/ - unsigned int buffer_read_pos; -}; +OSYNC_TEST_EXPORT void osync_marshal_read_data(OSyncMarshal *marshal, void *value, unsigned int size); /*@}*/ -#endif /* _OPENSYNC_MARSHAL_PRIVATE_H */ +#endif /* _OPENSYNC_MARSHAL_INTERNALS_H */ Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Thu Sep 17 00:12:13 2009 (r5766) +++ trunk/opensync/engine/opensync_engine.c Thu Sep 17 00:25:54 2009 (r5767) @@ -35,6 +35,7 @@ #include "group/opensync_group_internals.h" #include "group/opensync_member_internals.h" #include "format/opensync_objformat_internals.h" +#include "common/opensync_marshal_internals.h" #include "opensync_status_internals.h" #include "opensync_obj_engine_internals.h" Modified: trunk/opensync/ipc/opensync_message.c ============================================================================== --- trunk/opensync/ipc/opensync_message.c Thu Sep 17 00:12:13 2009 (r5766) +++ trunk/opensync/ipc/opensync_message.c Thu Sep 17 00:25:54 2009 (r5767) @@ -22,6 +22,7 @@ #include "opensync_internals.h" #include "common/opensync_marshal.h" +#include "common/opensync_marshal_internals.h" #include "opensync_serializer_internals.h" |