lm-message-handler

lm-message-handler

Functions

Description

Functions

LmHandleMessageFunction ()

LmHandlerResult
(*LmHandleMessageFunction) (LmMessageHandler *handler,
                            LmConnection *connection,
                            LmMessage *message,
                            gpointer user_data);

lm_message_handler_new ()

LmMessageHandler *
lm_message_handler_new (LmHandleMessageFunction function,
                        gpointer user_data,
                        GDestroyNotify notify);

Creates a new message handler. This can be set to handle incoming messages and when a message of the type the handler is registered to handle is received function will be called and user_data will be passed to it. notify is called when the message handler is freed, that way any memory allocated by user_data can be freed.

Parameters

function

a callback

 

user_data

user data passed to function

 

notify

function called when the message handler is freed

 

Returns

a newly created message handler


lm_message_handler_invalidate ()

void
lm_message_handler_invalidate (LmMessageHandler *handler);

Invalidates the handler. Useful if you need to cancel a reply

Parameters

handler

an LmMessageHandler

 

lm_message_handler_is_valid ()

gboolean
lm_message_handler_is_valid (LmMessageHandler *handler);

Fetches whether the handler is valid or not.

Parameters

handler

an LmMessageHandler

 

Returns

TRUE if handler is valid, otherwise FALSE


lm_message_handler_ref ()

LmMessageHandler *
lm_message_handler_ref (LmMessageHandler *handler);

Adds a reference to handler .

Parameters

handler

an LmMessageHandler

 

Returns

the message handler


lm_message_handler_unref ()

void
lm_message_handler_unref (LmMessageHandler *handler);

Removes a reference from handler . When no more references are present the handler is freed.

Parameters

handler

an LmMessagHandler

 

Types and Values