Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

MBX_$GET_REC                      Domain/OS                       MBX_$GET_REC


NAME
     mbx_$get_rec - get a message from a mailbox

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

     void mbx_$get_rec(
          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_rec(
          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, return_buffer*32766

           pointer /buffer_pointer/ buffer
           pointer /return_pointer/ return_buffer

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

DESCRIPTION
     Mbx_$get_rec gets a message from the mailbox on mbx_handle.  If there
     currently is no message for the caller, mbx_$get_rec doesn't return until
     one arrives.

     Both servers and clients can use mbx_$get_rec.  When a server calls
     mbx_$get_rec, 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_rec 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_rec 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.

          When called by a server, mbx_$get_rec 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 mes-
          sage.

     status
          The completion status.

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