OpenSync
0.22
|
A Message used by the inter thread messaging library. More...
Data Structures | |
struct | OSyncMessage |
A OSyncMessage. More... | |
Typedefs | |
typedef void(* | OSyncMessageHandler )(OSyncMessage *message, void *user_data) |
Function which can receive messages. More... | |
Enumerations | |
enum | OSyncMessageCommand { OSYNC_MESSAGE_NOOP, OSYNC_MESSAGE_CONNECT, OSYNC_MESSAGE_DISCONNECT, OSYNC_MESSAGE_GET_CHANGES, OSYNC_MESSAGE_GET_CHANGEDATA, OSYNC_MESSAGE_COMMIT_CHANGE, OSYNC_MESSAGE_COMMITTED_ALL, OSYNC_MESSAGE_SYNC_DONE, OSYNC_MESSAGE_CALL_PLUGIN, OSYNC_MESSAGE_NEW_CHANGE, OSYNC_MESSAGE_REPLY, OSYNC_MESSAGE_ERRORREPLY, OSYNC_MESSAGE_INITIALIZE, OSYNC_MESSAGE_FINALIZE, OSYNC_MESSAGE_SYNCHRONIZE, OSYNC_MESSAGE_ENGINE_CHANGED, OSYNC_MESSAGE_MAPPING_CHANGED, OSYNC_MESSAGE_MAPPINGENTRY_CHANGED, OSYNC_MESSAGE_ERROR, OSYNC_MESSAGE_QUEUE_ERROR, OSYNC_MESSAGE_QUEUE_HUP, OSYNC_MESSAGE_SYNC_ALERT } |
The Type of the message. More... | |
OSyncMessage * | osync_message_new (OSyncMessageCommand cmd, int size, OSyncError **error) |
A Message used by the inter thread messaging library. More... | |
void | osync_message_ref (OSyncMessage *message) |
void | osync_message_unref (OSyncMessage *message) |
void | osync_message_set_handler (OSyncMessage *message, OSyncMessageHandler handler, gpointer user_data) |
Sets the handler that will receive the reply. More... | |
OSyncMessage * | osync_message_new_reply (OSyncMessage *message, OSyncError **error) |
Creates a new reply. More... | |
OSyncMessage * | osync_message_new_errorreply (OSyncMessage *message, OSyncError **error) |
Creates a new error reply. More... | |
OSyncMessage * | osync_message_new_error (OSyncError *error, OSyncError **loc_error) |
gboolean | osync_message_is_error (OSyncMessage *message) |
Checks if the message is a error. More... | |
osync_bool | osync_message_is_answered (OSyncMessage *message) |
void | osync_message_set_answered (OSyncMessage *message) |
OSyncMessageCommand | osync_message_get_command (OSyncMessage *message) |
Gets the command from a message. More... | |
A Message used by the inter thread messaging library.
typedef void(* OSyncMessageHandler)(OSyncMessage *message, void *user_data) |
Function which can receive messages.
sender | The sender of the received reply |
message | The reply that is being received. |
user_data | The userdata which was set previously |
Definition at line 48 of file opensync_message_internals.h.
enum OSyncMessageCommand |
The Type of the message.
Definition at line 16 of file opensync_message_internals.h.
OSyncMessage* osync_message_new | ( | OSyncMessageCommand | cmd, |
int | size, | ||
OSyncError ** | error | ||
) |
A Message used by the inter thread messaging library.
Creates a new message of the given type
This function will create a new message of the given type, with the given parent and signal name. The parent will be passed to the OSyncMessageHandler
parent | Who send this message. Can be any pointer. |
msgname | The name of the message |
type | The type of this message |
Definition at line 43 of file opensync_message.c.
Referenced by osengine_synchronize(), osync_message_new_errorreply(), and osync_message_new_reply().
void osync_message_set_handler | ( | OSyncMessage * | message, |
OSyncMessageHandler | handler, | ||
gpointer | user_data | ||
) |
Sets the handler that will receive the reply.
message | The message to work on |
replyqueue | Which queue should receive the reply |
handler | Which handler should be called when the reply is received |
user_data | Which user data should be passed to the handler |
Definition at line 82 of file opensync_message.c.
OSyncMessage* osync_message_new_reply | ( | OSyncMessage * | message, |
OSyncError ** | error | ||
) |
Creates a new reply.
parent | Who send this message. Can be any pointer. |
message | The message to which you wish to reply |
Definition at line 96 of file opensync_message.c.
OSyncMessage* osync_message_new_errorreply | ( | OSyncMessage * | message, |
OSyncError ** | error | ||
) |
Creates a new error reply.
parent | Who send this message. Can be any pointer. |
message | The message to which you wish to reply |
Definition at line 113 of file opensync_message.c.
gboolean osync_message_is_error | ( | OSyncMessage * | message | ) |
Checks if the message is a error.
message | The message to check |
Definition at line 141 of file opensync_message.c.
OSyncMessageCommand osync_message_get_command | ( | OSyncMessage * | message | ) |
Gets the command from a message.
This function will return the command of a message
message | The message |
Definition at line 165 of file opensync_message.c.