From: <dg...@su...> - 2009-01-05 03:39:21
|
Author: dgollub Date: Mon Jan 5 04:38:59 2009 New Revision: 5011 URL: http://www.opensync.org/changeset/5011 Log: Removed OSyncMessage API from public API. If your plugin is using OSyncMessage - replace it by OSyncMarshal. Added: trunk/opensync/ipc/opensync_message_private.h (contents, props changed) - copied, changed from r5010, trunk/opensync/ipc/opensync_message_internals.h Replaced: trunk/opensync/ipc/opensync_message_internals.h (contents, props changed) - copied, changed from r5010, trunk/opensync/ipc/opensync_message.h Deleted: trunk/opensync/ipc/opensync_message.h Modified: trunk/opensync.sym trunk/opensync/client/opensync_client.c trunk/opensync/client/opensync_client_proxy.c trunk/opensync/common/opensync_xml.c trunk/opensync/common/opensync_xml_internals.h trunk/opensync/ipc/opensync_message.c trunk/opensync/ipc/opensync_queue.c trunk/opensync/ipc/opensync_serializer.c trunk/opensync/opensync-ipc.h trunk/opensync/opensync-serializer.h trunk/tests/client-tests/check_client.c trunk/tests/ipc-tests/check_ipc.c trunk/tests/ipc-tests/check_serializer.c Modified: trunk/opensync.sym ============================================================================== --- trunk/opensync.sym Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync.sym Mon Jan 5 04:38:59 2009 (r5011) @@ -345,42 +345,6 @@ osync_member_set_objtype_enabled osync_member_set_pluginname osync_member_unref -osync_message_get_buffer -osync_message_get_cmd -osync_message_get_command -osync_message_get_commandstr -osync_message_get_handler -osync_message_get_handler_data -osync_message_get_id -osync_message_get_message_size -osync_message_is_answered -osync_message_is_error -osync_message_new -osync_message_new_error -osync_message_new_errorreply -osync_message_new_queue_error -osync_message_new_reply -osync_message_read_buffer -osync_message_read_const_data -osync_message_read_const_string -osync_message_read_data -osync_message_read_int -osync_message_read_long_long_int -osync_message_read_string -osync_message_read_uint -osync_message_ref -osync_message_set_answered -osync_message_set_cmd -osync_message_set_handler -osync_message_set_id -osync_message_set_message_size -osync_message_unref -osync_message_write_buffer -osync_message_write_data -osync_message_write_int -osync_message_write_long_long_int -osync_message_write_string -osync_message_write_uint osync_obj_engine_command osync_obj_engine_event osync_obj_engine_finalize Modified: trunk/opensync/client/opensync_client.c ============================================================================== --- trunk/opensync/client/opensync_client.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/client/opensync_client.c Mon Jan 5 04:38:59 2009 (r5011) @@ -28,6 +28,7 @@ #include "opensync-ipc.h" #include "ipc/opensync_serializer_internals.h" +#include "ipc/opensync_message_internals.h" #include "ipc/opensync_queue_internals.h" #include "opensync-format.h" Modified: trunk/opensync/client/opensync_client_proxy.c ============================================================================== --- trunk/opensync/client/opensync_client_proxy.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/client/opensync_client_proxy.c Mon Jan 5 04:38:59 2009 (r5011) @@ -24,6 +24,7 @@ #include "opensync-data.h" #include "opensync-ipc.h" +#include "ipc/opensync_message_internals.h" #include "ipc/opensync_serializer_internals.h" #include "ipc/opensync_queue_internals.h" #include "plugin/opensync_objtype_sink_internals.h" Modified: trunk/opensync/common/opensync_xml.c ============================================================================== --- trunk/opensync/common/opensync_xml.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/common/opensync_xml.c Mon Jan 5 04:38:59 2009 (r5011) @@ -444,38 +444,6 @@ return TRUE; } -osync_bool osync_xml_marshal(const char *input, unsigned int inpsize, OSyncMessage *message, OSyncError **error) -{ - xmlDoc *doc = (xmlDoc*)input; - xmlChar *result; - int size; - xmlDocDumpMemory(doc, &result, &size); - osync_message_write_buffer(message, result, size); - - return TRUE; -} - -osync_bool osync_xml_demarshal(OSyncMessage *message, char **output, unsigned int *outpsize, OSyncError **error) -{ - void *input = NULL; - int size = 0; - xmlDoc *doc = NULL; - osync_message_read_buffer(message, &input, &size); - - doc = xmlParseMemory((char *)input, size); - if (!doc) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "Invalid XML data received"); - goto error; - } - - *output = (char*)doc; - *outpsize = sizeof(*doc); - return TRUE; - - error: - return FALSE; -} - osync_bool osync_xml_validate_document(xmlDocPtr doc, char *schemafilepath) { int rc = 0; Modified: trunk/opensync/common/opensync_xml_internals.h ============================================================================== --- trunk/opensync/common/opensync_xml_internals.h Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/common/opensync_xml_internals.h Mon Jan 5 04:38:59 2009 (r5011) @@ -78,9 +78,6 @@ char *osync_xml_write_to_string(xmlDoc *doc); osync_bool osync_xml_copy(const char *input, unsigned int inpsize, char **output, unsigned int *outpsize, OSyncError **error); -osync_bool osync_xml_marshal(const char *input, unsigned int inpsize, OSyncMessage *message, OSyncError **error); -osync_bool osync_xml_demarshal(OSyncMessage *message, char **output, unsigned int *outpsize, OSyncError **error); - osync_bool osync_xml_validate_document(xmlDocPtr doc, char *schemafilepath); xmlChar *osync_xml_node_get_content(xmlNodePtr node); Modified: trunk/opensync/ipc/opensync_message.c ============================================================================== --- trunk/opensync/ipc/opensync_message.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/ipc/opensync_message.c Mon Jan 5 04:38:59 2009 (r5011) @@ -24,9 +24,10 @@ #include "common/opensync_marshal.h" #include "opensync_serializer_internals.h" -#include "opensync_message.h" #include "opensync_message_internals.h" +#include "opensync_message_private.h" + OSyncMessage *osync_message_new(OSyncMessageCommand cmd, unsigned int size, OSyncError **error) { Copied and modified: trunk/opensync/ipc/opensync_message_internals.h (from r5010, trunk/opensync/ipc/opensync_message.h) ============================================================================== --- trunk/opensync/ipc/opensync_message.h Mon Jan 5 04:09:37 2009 (r5010, copy source) +++ trunk/opensync/ipc/opensync_message_internals.h Mon Jan 5 04:38:59 2009 (r5011) @@ -18,8 +18,8 @@ * */ -#ifndef _OPENSYNC_MESSAGES_H -#define _OPENSYNC_MESSAGES_H +#ifndef _OPENSYNC_MESSAGES_INTERNALS_H +#define _OPENSYNC_MESSAGES_INTERNALS_H /** * @defgroup OSyncIPC OpenSync IPC Module @@ -77,7 +77,7 @@ * @returns Pointer to a newly allocated message * */ -OSYNC_EXPORT OSyncMessage *osync_message_new(OSyncMessageCommand cmd, unsigned int size, OSyncError **error); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_new(OSyncMessageCommand cmd, unsigned int size, OSyncError **error); /** @brief Creates a new reply * @@ -86,7 +86,7 @@ * @returns Pointer to a newly allocated message * */ -OSYNC_EXPORT OSyncMessage *osync_message_new_reply(OSyncMessage *message, OSyncError **error); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_new_reply(OSyncMessage *message, OSyncError **error); /** @brief Creates a new error reply * @@ -95,7 +95,7 @@ * @param loc_error Pointer to a error-struct for errors which appear while creating message * @returns Pointer to a newly allocated error-reply message */ -OSYNC_EXPORT OSyncMessage *osync_message_new_errorreply(OSyncMessage *message, OSyncError *error, OSyncError **loc_error); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_new_errorreply(OSyncMessage *message, OSyncError *error, OSyncError **loc_error); /** @brief Creates a new error message * @@ -103,7 +103,7 @@ * @param loc_error Pointer to a error-struct for errors which appear while creating message * @returns Pointer to a newly allocated error message */ -OSYNC_EXPORT OSyncMessage *osync_message_new_error(OSyncError *error, OSyncError **loc_error); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_new_error(OSyncError *error, OSyncError **loc_error); /** @brief Creates a new queue error message * @@ -111,7 +111,7 @@ * @param loc_error Pointer to a error-struct for errors which appear while creating message * @returns Pointer to a newly allocated queue error message */ -OSYNC_EXPORT OSyncMessage *osync_message_new_queue_error(OSyncError *error, OSyncError **loc_error); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_new_queue_error(OSyncError *error, OSyncError **loc_error); /** @brief Increase the reference count of the message * @@ -119,14 +119,14 @@ * @returns The referenced message pointer * */ -OSYNC_EXPORT OSyncMessage *osync_message_ref(OSyncMessage *message); +OSYNC_TEST_EXPORT OSyncMessage *osync_message_ref(OSyncMessage *message); /** @brief Decrease the reference count of the message * * @param message The message * */ -OSYNC_EXPORT void osync_message_unref(OSyncMessage *message); +OSYNC_TEST_EXPORT void osync_message_unref(OSyncMessage *message); /** @brief Set new message command for the message object * @@ -134,14 +134,14 @@ * @param cmd The new message command * */ -OSYNC_EXPORT void osync_message_set_cmd(OSyncMessage *message, OSyncMessageCommand cmd); +OSYNC_TEST_EXPORT void osync_message_set_cmd(OSyncMessage *message, OSyncMessageCommand cmd); /** @brief Get message command for the message object * * @param message The message * */ -OSYNC_EXPORT OSyncMessageCommand osync_message_get_cmd(OSyncMessage *message); +OSYNC_TEST_EXPORT OSyncMessageCommand osync_message_get_cmd(OSyncMessage *message); /** @brief Set an ID for the message * @@ -149,7 +149,7 @@ * @param id The ID which get set for supplied message object * */ -OSYNC_EXPORT void osync_message_set_id(OSyncMessage *message, long long int id); +OSYNC_TEST_EXPORT void osync_message_set_id(OSyncMessage *message, long long int id); /** @brief Get message ID of supplied message object * @@ -157,7 +157,7 @@ * @returns The message ID of supplied message * */ -OSYNC_EXPORT long long int osync_message_get_id(OSyncMessage *message); +OSYNC_TEST_EXPORT long long int osync_message_get_id(OSyncMessage *message); /** @brief Get marshal object of supplied message object * @@ -174,7 +174,7 @@ * @returns The message size of supplied message * */ -OSYNC_EXPORT unsigned int osync_message_get_message_size(OSyncMessage *message); +OSYNC_TEST_EXPORT unsigned int osync_message_get_message_size(OSyncMessage *message); /** @brief Set message size for supplied message object * @@ -182,7 +182,7 @@ * @param size The size of the message to set * */ -OSYNC_EXPORT void osync_message_set_message_size(OSyncMessage *message, unsigned int size); +OSYNC_TEST_EXPORT void osync_message_set_message_size(OSyncMessage *message, unsigned int size); /** @brief Get the buffer/content of the message object * @@ -191,7 +191,7 @@ * @param size Size of the data * */ -OSYNC_EXPORT void osync_message_get_buffer(OSyncMessage *message, char **data, unsigned int *size); +OSYNC_TEST_EXPORT void osync_message_get_buffer(OSyncMessage *message, char **data, unsigned int *size); /** @brief Sets the handler that will receive the reply * @@ -200,7 +200,7 @@ * @param user_data Which user data should be passed to the handler * */ -OSYNC_EXPORT void osync_message_set_handler(OSyncMessage *message, OSyncMessageHandler handler, void *user_data); +OSYNC_TEST_EXPORT void osync_message_set_handler(OSyncMessage *message, OSyncMessageHandler handler, void *user_data); /** @brief Get the message handler of the message * @@ -208,7 +208,7 @@ * @returns The message handler of the message * */ -OSYNC_EXPORT OSyncMessageHandler osync_message_get_handler(OSyncMessage *message); +OSYNC_TEST_EXPORT OSyncMessageHandler osync_message_get_handler(OSyncMessage *message); /** @brief Get the data which gets passed to the handler function * @@ -216,7 +216,7 @@ * @returns Pointer of the supplied handler data * */ -OSYNC_EXPORT void *osync_message_get_handler_data(OSyncMessage *message); +OSYNC_TEST_EXPORT void *osync_message_get_handler_data(OSyncMessage *message); /** @brief Checks if the message is a error * @@ -224,7 +224,7 @@ * @return TRUE if the message is a error, FLASE otherwise * */ -OSYNC_EXPORT osync_bool osync_message_is_error(OSyncMessage *message); +OSYNC_TEST_EXPORT osync_bool osync_message_is_error(OSyncMessage *message); /** @brief Gets the command from a message * @@ -233,14 +233,14 @@ * @param message The message * @return the command */ -OSYNC_EXPORT OSyncMessageCommand osync_message_get_command(OSyncMessage *message); +OSYNC_TEST_EXPORT OSyncMessageCommand osync_message_get_command(OSyncMessage *message); /** * @brief Convertes the command of a message to a readable string * @param message The message * @return The command as a string */ -OSYNC_EXPORT char* osync_message_get_commandstr(OSyncMessage *message); +OSYNC_TEST_EXPORT char* osync_message_get_commandstr(OSyncMessage *message); /** @brief Checks if the message got answered * @@ -248,42 +248,42 @@ * @return TRUE if the message got answered, FLASE otherwise * */ -OSYNC_EXPORT osync_bool osync_message_is_answered(OSyncMessage *message); +OSYNC_TEST_EXPORT osync_bool osync_message_is_answered(OSyncMessage *message); /** @brief Set message as answered * * @param message The message to work on * */ -OSYNC_EXPORT void osync_message_set_answered(OSyncMessage *message); +OSYNC_TEST_EXPORT void osync_message_set_answered(OSyncMessage *message); /** @brief Appends an integer value to serialized message buffer * * @param message The message * @param value The integer value to append */ -OSYNC_EXPORT void osync_message_write_int(OSyncMessage *message, int value); +OSYNC_TEST_EXPORT void osync_message_write_int(OSyncMessage *message, int value); /** @brief Appends an unsigned integer value to serialized message buffer * * @param message The message * @param value The integer value to append */ -OSYNC_EXPORT void osync_message_write_uint(OSyncMessage *message, unsigned int value); +OSYNC_TEST_EXPORT void osync_message_write_uint(OSyncMessage *message, unsigned int value); /** @brief Appends a long long integer value to serialized message buffer * * @param message The message * @param value The long long integer value to append */ -OSYNC_EXPORT void osync_message_write_long_long_int(OSyncMessage *message, long long int value); +OSYNC_TEST_EXPORT void osync_message_write_long_long_int(OSyncMessage *message, long long int value); /** @brief Appends a string to serialized message buffer * * @param message The message * @param value The string to append */ -OSYNC_EXPORT void osync_message_write_string(OSyncMessage *message, const char *value); +OSYNC_TEST_EXPORT void osync_message_write_string(OSyncMessage *message, const char *value); /** @brief Appends data with a specific length to the serialized message buffer * @@ -294,7 +294,7 @@ * @param value The data to append * @param size Size of corresponding data parameter */ -OSYNC_EXPORT void osync_message_write_data(OSyncMessage *message, const void *value, int size); +OSYNC_TEST_EXPORT void osync_message_write_data(OSyncMessage *message, const void *value, int size); /** @brief Appends data with a specific length to the serialized message buffer, * plus the length of the data to determine the end. @@ -303,7 +303,7 @@ * @param value The data to append * @param size Size of corresponding data parameter */ -OSYNC_EXPORT void osync_message_write_buffer(OSyncMessage *message, const void *value, int size); +OSYNC_TEST_EXPORT void osync_message_write_buffer(OSyncMessage *message, const void *value, int size); /** @brief Read serialized integer from message buffer. This increments the read * position of the message buffer. @@ -311,7 +311,7 @@ * @param message The message * @param value Reference to store the integer value */ -OSYNC_EXPORT void osync_message_read_int(OSyncMessage *message, int *value); +OSYNC_TEST_EXPORT void osync_message_read_int(OSyncMessage *message, int *value); /** @brief Read serialized unsigned integer from message buffer. This increments the read * position of the message buffer. @@ -319,7 +319,7 @@ * @param message The message * @param value Reference to store the integer value */ -OSYNC_EXPORT void osync_message_read_uint(OSyncMessage *message, unsigned int *value); +OSYNC_TEST_EXPORT void osync_message_read_uint(OSyncMessage *message, unsigned int *value); /** @brief Read serialized long long integer from message buffer. This increments the read * position of the message buffer. @@ -327,7 +327,7 @@ * @param message The message * @param value Reference to store the long long integer value */ -OSYNC_EXPORT void osync_message_read_long_long_int(OSyncMessage *message, long long int *value); +OSYNC_TEST_EXPORT void osync_message_read_long_long_int(OSyncMessage *message, long long int *value); /** @brief Read serialized string from message buffer. This increments the read * position of the message buffer. Caller is responsible for freeing the duplicated @@ -336,7 +336,7 @@ * @param message The message * @param value Reference to store the pointer to the newly allocated string */ -OSYNC_EXPORT void osync_message_read_string(OSyncMessage *message, char **value); +OSYNC_TEST_EXPORT void osync_message_read_string(OSyncMessage *message, char **value); /** @brief Read specific size of serialized data from message buffer. This increments * the read position of the message buffer. Caller is responsible for freeing the @@ -346,7 +346,7 @@ * @param value Reference to store the pointer to the newly allocated data * @param size Size of data */ -OSYNC_EXPORT void osync_message_read_data(OSyncMessage *message, void *value, int size); +OSYNC_TEST_EXPORT void osync_message_read_data(OSyncMessage *message, void *value, int size); /** @brief Read serialized const data from message buffer. This increments the read * position of the message buffer. @@ -355,7 +355,7 @@ * @param value Reference to store the data pointer * @param size The size of data */ -OSYNC_EXPORT void osync_message_read_const_data(OSyncMessage *message, void **value, int size); +OSYNC_TEST_EXPORT void osync_message_read_const_data(OSyncMessage *message, void **value, int size); /** @brief Read serialized const string from message buffer. This increments the read * position of the message buffer. @@ -363,7 +363,7 @@ * @param message The message * @param value Reference to store the string pointer */ -OSYNC_EXPORT void osync_message_read_const_string(OSyncMessage *message, char **value); +OSYNC_TEST_EXPORT void osync_message_read_const_string(OSyncMessage *message, char **value); /** @brief Read serialized data from message buffer. This increments the read * position of the message buffer. Caller is responsible for freeing the duplicated @@ -373,8 +373,9 @@ * @param value Reference to store the pointer to the newly allocated data * @param size Size of data */ -OSYNC_EXPORT void osync_message_read_buffer(OSyncMessage *message, void **value, int *size); +OSYNC_TEST_EXPORT void osync_message_read_buffer(OSyncMessage *message, void **value, int *size); /*@}*/ -#endif /*_OPENSYNC_MESSAGES_H*/ +#endif /* _OPENSYNC_MESSAGES_INTERNALS_H */ + Copied and modified: trunk/opensync/ipc/opensync_message_private.h (from r5010, trunk/opensync/ipc/opensync_message_internals.h) ============================================================================== --- trunk/opensync/ipc/opensync_message_internals.h Mon Jan 5 04:09:37 2009 (r5010, copy source) +++ trunk/opensync/ipc/opensync_message_private.h Mon Jan 5 04:38:59 2009 (r5011) @@ -18,8 +18,8 @@ * */ -#ifndef _OPENSYNC_MESSAGES_INTERNALS_H -#define _OPENSYNC_MESSAGES_INTERNALS_H +#ifndef _OPENSYNC_MESSAGES_PRIVATE_H +#define _OPENSYNC_MESSAGES_PRIVATE_H /** * @defgroup OSyncIPCPrivate OpenSync IPC Module Private @@ -54,5 +54,5 @@ /*@}*/ -#endif /* _OPENSYNC_MESSAGES_INTERNALS_H */ +#endif /* _OPENSYNC_MESSAGES_PRIVATE_H */ Modified: trunk/opensync/ipc/opensync_queue.c ============================================================================== --- trunk/opensync/ipc/opensync_queue.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/ipc/opensync_queue.c Mon Jan 5 04:38:59 2009 (r5011) @@ -22,7 +22,7 @@ #include "opensync.h" #include "opensync_internals.h" -#include "opensync_message.h" +#include "opensync_message_internals.h" #include "opensync_queue.h" #include "opensync_queue_internals.h" Modified: trunk/opensync/ipc/opensync_serializer.c ============================================================================== --- trunk/opensync/ipc/opensync_serializer.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/ipc/opensync_serializer.c Mon Jan 5 04:38:59 2009 (r5011) @@ -21,7 +21,7 @@ #include "opensync.h" #include "opensync_internals.h" -#include "opensync_message.h" +#include "opensync_message_internals.h" #include "opensync-data.h" #include "opensync-format.h" Modified: trunk/opensync/opensync-ipc.h ============================================================================== --- trunk/opensync/opensync-ipc.h Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/opensync-ipc.h Mon Jan 5 04:38:59 2009 (r5011) @@ -25,7 +25,6 @@ #include "opensync-data.h" -#include "ipc/opensync_message.h" #include "ipc/opensync_queue.h" OPENSYNC_END_DECLS Modified: trunk/opensync/opensync-serializer.h ============================================================================== --- trunk/opensync/opensync-serializer.h Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/opensync/opensync-serializer.h Mon Jan 5 04:38:59 2009 (r5011) @@ -24,7 +24,6 @@ OPENSYNC_BEGIN_DECLS #include "common/opensync_marshal.h" -#include "ipc/opensync_message.h" #include "ipc/opensync_serializer.h" OPENSYNC_END_DECLS Modified: trunk/tests/client-tests/check_client.c ============================================================================== --- trunk/tests/client-tests/check_client.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/tests/client-tests/check_client.c Mon Jan 5 04:38:59 2009 (r5011) @@ -1,6 +1,7 @@ #include "support.h" #include <opensync/opensync-ipc.h> +#include "opensync/ipc/opensync_message_internals.h" #include "opensync/ipc/opensync_queue_internals.h" #include <opensync/opensync-client.h> Modified: trunk/tests/ipc-tests/check_ipc.c ============================================================================== --- trunk/tests/ipc-tests/check_ipc.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/tests/ipc-tests/check_ipc.c Mon Jan 5 04:38:59 2009 (r5011) @@ -4,6 +4,7 @@ #endif #include <opensync/opensync-ipc.h> +#include "opensync/ipc/opensync_message_internals.h" #include "opensync/ipc/opensync_queue_internals.h" #ifndef _WIN32 Modified: trunk/tests/ipc-tests/check_serializer.c ============================================================================== --- trunk/tests/ipc-tests/check_serializer.c Mon Jan 5 04:09:37 2009 (r5010) +++ trunk/tests/ipc-tests/check_serializer.c Mon Jan 5 04:38:59 2009 (r5011) @@ -1,6 +1,7 @@ #include "support.h" #include <opensync/opensync-ipc.h> +#include "opensync/ipc/opensync_message_internals.h" #include "opensync/ipc/opensync_serializer_internals.h" #include <opensync/opensync-plugin.h> |