Finds a message by its name.
Synopsis.
#include <parabellym/api.h> int para_msg_find(const char *name);
Arguments.
Access.
Unrestricted.
Description.
This function finds a registered message with the specified name. Messages become registered when at least one module subscribes for them (see para_msg_subscribe for details). If a message with the requested name is not registered, the function fails.
It is recommended that message names are built in a pseudo-hierarchical manner, e.g.: "oss.faerion.parabellym.general.unload".
This function is only suitable for a limited range of cases, because it is a subject to a race condition (the message id may become invalid before you actually use it). Normally, if you plan to send a message somewhat often, it is more appropriate to subscribe for it; this guarantees that the message id will not change (note that the module doesn't receive messages it sends).
Return value.
A positive return value is the message identifier, a negative value is an error code from the Errors section below.
Message codes have built-in reuse control. The same message, if re-registered, will not be assigned the same identifier. This means that while there is no guarantee that the message remains in use, the identifier better not be stored.
Return values.