MBX_$GET_CONDITIONAL Domain/OS MBX_$GET_CONDITIONAL
NAME
mbx_$get_conditional - read a message without waiting
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/mbx.h>
void mbx_$get_conditional(
void *&mbx_handle,
void *&buffer_pointer,
long &buffer_length,
void **return_pointer,
long *return_length,
status_$t *status)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/mbx.ins.pas';
procedure mbx_$get_conditional(
in mbx_handle: univ_ptr;
in buffer_pointer: univ_ptr;
in buffer_length: integer32;
out return_pointer: univ_ptr;
out return_length: integer32;
out status: status_$t);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/mbx.ins.ftn'
integer*4 mbx_handle, buffer_length, return_length, status
integer*4 buffer_pointer, return_pointer
character buffer*32766, ret_buffer*32766
pointer /buffer_pointer/ buffer
pointer /return_pointer/ return_buffer
call mbx_$get_conditional(mbx_handle, buffer_pointer, buffer_length,
& return_pointer, return_length, status)
DESCRIPTION
Mbx_$get_conditional gets a message from the mailbox on mbx_handle if
there is one. If there is no message waiting for the caller,
mbx_$get_conditional returns immediately with a status of
mbx_$channel_empty.
Both servers and clients can call mbx_$get_conditional. When a server
uses mbx_$get_conditional, the mailbox manager guarantees fair service to
each open channel.
mbx_handle
A mailbox handle.
buffer_pointer
A pointer to the data buffer allocated to receive the message.
Mbx_$get_conditional does not always use the buffer at
buffer_pointer, but the caller must provide one.
buffer_length
The number of bytes available in the buffer that buffer_pointer
points to. Mbx_$get_conditional will not write more than
buffer_length bytes at buffer_pointer, and cannot write more than
mbx_$rec_data_max.
return_pointer
A pointer to the requested message. Use this pointer to reference
the message. It is not necessarily equivalent to buffer_pointer.
return_length
If return_length is positive, it is the number of bytes in the mes-
sage supplied at return_pointer, and no part of the message remains
in the channel. If return_length is negative, it's absolute value
is the number of bytes from the supplied message remaining in the
channel, and return_pointer points to only buffer_length bytes of
the requested message.
When called by a server, mbx_$get_conditional supplies the 6-byte
server header each time it gets a portion of a message, so a server
can always look at the cnt field to find out the total length of a
message.
status
The completion status.