libOGC  1.0
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
Macros | Typedefs | Functions
message.h File Reference

Thread subsystem II. More...

#include <gctypes.h>

Macros

#define MQ_BOX_NULL   0xffffffff
 
#define MQ_ERROR_SUCCESSFUL   0
 
#define MQ_ERROR_TOOMANY   -5
 
#define MQ_MSG_BLOCK   0
 
#define MQ_MSG_NOBLOCK   1
 

Typedefs

typedef u32 mqbox_t
 typedef for the message queue handle
 
typedef void * mqmsg_t
 typedef for the message pointer
 

Functions

void MQ_Close (mqbox_t mqbox)
 Closes the message queue and releases all memory. More...
 
s32 MQ_Init (mqbox_t *mqbox, u32 count)
 Initializes a message queue. More...
 
BOOL MQ_Jam (mqbox_t mqbox, mqmsg_t msg, u32 flags)
 Sends a message to the given message queue and jams it in front of the queue. More...
 
BOOL MQ_Receive (mqbox_t mqbox, mqmsg_t *msg, u32 flags)
 Sends a message to the given message queue. More...
 
BOOL MQ_Send (mqbox_t mqbox, mqmsg_t msg, u32 flags)
 Sends a message to the given message queue. More...
 

Detailed Description

Thread subsystem II.

Function Documentation

void MQ_Close ( mqbox_t  mqbox)

Closes the message queue and releases all memory.

Parameters
[in]mqboxhandle to the mqbox_t structure.
Returns
none
u32 MQ_Init ( mqbox_t mqbox,
u32  count 
)

Initializes a message queue.

Parameters
[out]mqboxpointer to the mqbox_t handle.
[in]countmaximum number of messages the queue can hold
Returns
0 on success, <0 on error
BOOL MQ_Jam ( mqbox_t  mqbox,
mqmsg_t  msg,
u32  flags 
)

Sends a message to the given message queue and jams it in front of the queue.

Parameters
[in]mqboxmqbox_t handle to the message queue
[in]msgmessage to send
[in]flagsmessage flags (MQ_MSG_BLOCK, MQ_MSG_NOBLOCK)
Returns
bool result
BOOL MQ_Receive ( mqbox_t  mqbox,
mqmsg_t msg,
u32  flags 
)

Sends a message to the given message queue.

Parameters
[in]mqboxmqbox_t handle to the message queue
[in]msgpointer to a mqmsg_t_t-type message to receive.
[in]flagsmessage flags (MQ_MSG_BLOCK, MQ_MSG_NOBLOCK)
Returns
bool result
BOOL MQ_Send ( mqbox_t  mqbox,
mqmsg_t  msg,
u32  flags 
)

Sends a message to the given message queue.

Parameters
[in]mqboxmqbox_t handle to the message queue
[in]msgmessage to send
[in]flagsmessage flags (MQ_MSG_BLOCK, MQ_MSG_NOBLOCK)
Returns
bool result