F.13. para_msg_unsubscribe

Unsubscribes the module from a message.

Synopsis. 

#include <parabellym/api.h>

int para_msg_unsubscribe(int msgid);

Arguments. 

msgid
Message identifier obtained by an earlier call to para_msg_subscribe.

Access. 

Unrestricted.

Description. 

This functon removes a message from the current module's list of subscription. The module will no longer receive the specified message. When the last module unsubscribes from a message, it is unregistered and its numeric id will be different next time the message is located or subscribed for.

The module is automatically unsubscribed from all messages when the para_mod_body function exits.

Return value. 

PEC_SUCCESS
The message was removed from the current thread's message queue.
PEC_MOD_REQUIRED
The function was called outside a module's main thread. This is not allowed.
PEC_MSG_BAD_ID
An invalid message identifier was used.
PEC_MSG_FAILED
The module is not subscribed to the specified message.