Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

MBX_$COND_GET_REC_CHAN            Domain/OS             MBX_$COND_GET_REC_CHAN


NAME
     mbx_$cond_get_rec_chan - read a channel without waiting

SYNOPSIS (C)
     #include <apollo/base.h>
     #include <apollo/mbx.h>

     void mbx_$cond_get_rec_chan(
          void *&mbx_handle,
          short &mbx_channel,
          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_$cond_get_rec_chan(
          in mbx_handle: univ_ptr;
          in mbx_channel: integer;
          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*2 mbx_channel

           integer*4 buffer_pointer, return_pointer
           character buffer*32766, ret_buffer*32766

           pointer /buffer_pointer/ buffer
           pointer /return_pointer/ ret_buffer

           call mbx_$cond_get_rec_chan(mbx_handle, mbx_channel,
          &                            buffer_pointer, buffer_length,
          &                            return_pointer, return_length, status)

DESCRIPTION
     Mbx_$cond_get_rec_chan retrieves a client message from the channel speci-
     fied by mbx_channel of the mailbox specified by mbx_handle.  If there is
     no message, mbx_$cond_get_rec_chan returns immediately with the status
     mbx_$channel_empty.

     mbx_handle
          The mailbox handle.

     mbx_channel
          The mailbox channel to read from.

     buffer_pointer
          A pointer to the data buffer allocated to receive the message.
          Mbx_$cond_get_rec_chan 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_$cond_get_rec_chan 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, its absolute value is
          the number of bytes from the supplied message remaining in the chan-
          nel, and return_pointer points to only buffer_length bytes of the
          requested message.

          Mbx_$cond_get_rec_chan 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.  A status of mbx_$channel_empty indicates
          there is no message in the channel.

NOTES
     Only a server can use mbx_$cond_get_rec_chan.  Clients must use
     mbx_$get_conditional to conditionally get messages from a mailbox.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026