libogc  v2.9.0
Macros | Typedefs | Functions
message.h File Reference

Thread subsystem II. More...

#include <gctypes.h>
#include <gcbool.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

◆ MQ_Close()

void MQ_Close ( mqbox_t  mqbox)

Closes the message queue and releases all memory.

Parameters
[in]mqboxhandle to the mqbox_t structure.
Returns
none

◆ MQ_Init()

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

◆ MQ_Jam()

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

◆ MQ_Receive()

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

◆ MQ_Send()

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