OpenSync Message Internals
[OpenSync Engine Private API]

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.

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...
OSyncMessageosync_message_new (OSyncMessageCommand cmd, int size, OSyncError **error)
 A Message used by the inter thread messaging library.
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.
OSyncMessageosync_message_new_reply (OSyncMessage *message, OSyncError **error)
 Creates a new reply.
OSyncMessageosync_message_new_errorreply (OSyncMessage *message, OSyncError **error)
 Creates a new error reply.
OSyncMessageosync_message_new_error (OSyncError *error, OSyncError **loc_error)
gboolean osync_message_is_error (OSyncMessage *message)
 Checks if the message is a error.
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.


Detailed Description

A Message used by the inter thread messaging library.

Typedef Documentation

typedef void(* OSyncMessageHandler)(OSyncMessage *message, void *user_data)

Function which can receive messages.

Parameters:
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.


Enumeration Type Documentation

The Type of the message.

Definition at line 16 of file opensync_message_internals.h.


Function Documentation

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

Parameters:
parent Who send this message. Can be any pointer.
msgname The name of the message
type The type of this message
Returns:
Pointer to a newly allocated 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.

Parameters:
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.

Parameters:
parent Who send this message. Can be any pointer.
message The message to which you wish to reply
Returns:
Pointer to a newly allocated message

Definition at line 96 of file opensync_message.c.

OSyncMessage* osync_message_new_errorreply ( OSyncMessage message,
OSyncError **  error 
)

Creates a new error reply.

Parameters:
parent Who send this message. Can be any pointer.
message The message to which you wish to reply
Returns:
Pointer to a newly allocated message

Definition at line 113 of file opensync_message.c.

gboolean osync_message_is_error ( OSyncMessage message  ) 

Checks if the message is a error.

Parameters:
message The message to check
Returns:
TRUE if the message is a error, FALSE otherwise

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

Parameters:
message The message
Returns:
the command

Definition at line 165 of file opensync_message.c.


Generated on Sun Aug 9 05:47:45 2009 for OpenSync by  doxygen 1.5.9