F.12. para_msg_subscribe

Subscribes to a message.

Synopsis. 

#include <parabellym/api.h>

int para_msg_subscribe(const char *name);

Arguments. 

name
This is the name of the message. See para_msg_find for details.

Access. 

Restricted to the main module thread.

Description. 

This function subscribes the current thread's message queue for a message with the specified name. Subscribing for messages is also a way to fix their id and avoid using para_msg_find; modules do not receive messages they send, so the incoming queue will not be polluted.

Return value. 

Normally, the function returns a positive identifier of the message with the specified name. Other possible values:

PEC_MOD_REQUIRED
The function was called outside a module's main thread. This is not allowed.