
?? PUSH (LISTEXT := ON) ??
*copyc OST$GLOBAL_TASK_ID
*copyc OST$STATUS
?? POP ??
  { External constant and type declarations for the NOS/VE memory link
  {interface. }

  CONST

    mlc$max_message_length = ((512*6)+2)*8,
    mlc$max_in_transit = 3,
    mlc$max_permits = 10,
    mlc$unique_name = 0,
    mlc$null_name = mlc$unique_name,
    mlc$max_signons_per_system_name = 6,
    mlc$max_queued_messages = 15;



  CONST

    mlc$error = 0,
{
    mlc$ant_full = mlc$error + 23,
{
{        This status value indicates that the maximum number of applications
{        are currently signed on to MLI.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$bad_c170_parameter = mlc$error + 27,
{
{        This status value indicates that a c170 parameter passed to mli by a
{        c170 job was invalid.  This can be due to a parameter value out of
{        range or because of an address beyond the c170 field length.
{
{        --------------------------------------------------------------
{
    mlc$busy_interlock = mlc$error + 5,
{
{        This status value indicates that one of the following interlocks was
{        found busy, and the request could not be completed:
{         - global interlock
{         - specific application interlock
{         - table space interlock
{         - pool space interlock
{
{        --------------------------------------------------------------
{
    mlc$c170_c170_illegal = mlc$error + 9,
{
{        This status value indicates that a SEND_MESSAGE is being attempted
{        between two applications, both of which are C170 applications.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$dup_permits_ignored = mlc$error + 6,
{
{        This status value indicates that an ADD_SENDER is being attempted for
{        the same application from the same receiver more than once.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$illegal_function = mlc$error + 26,
{
{        This status value indicates that a C170 mli request has specified an
{        illegal MLI function.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$max_msgs_too_large = mlc$error + 22,
{
{        This status value indicates that the max_messages parameter on a
{        SIGN_ON request is larger than mlc$max_queued_messages.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$max_signons_this_appl = mlc$error + 21,
{
{        This status value indicates that the application has tried to SIGN_ON
{        more than mlc$max_signons_per_appl times.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$max_signons_this_task = mlc$error + 24,
{
{        This status value indicates that a SIGN_ON request was attempted, but
{        the task making the request has already signed on
{        (mlc$max_signons_per_system_name) unique applications.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$message_too_long = mlc$error + 17,
{
{        This status value indicates that the length of the message specified
{        in a SEND_MESSAGE request is greater than mlc$max_message_length.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$message_truncated = mlc$error + 15,
{
{        This status value indicates that a RECEIVE_MESSAGE request was made,
{        but the buffer that is to receive the message text is smaller than
{        the actual message.  The request is completed normally, but only as
{        much of the message is transferred as will fit in the buffer.
{
{        --------------------------------------------------------------
{
    mlc$mli_internal_error = mlc$error + 25,
{
{        This status value indicates that some sort of internal error has
{        occurred within MLI.  The request may be retried, but the results
{        are unpredictable.
{
{        --------------------------------------------------------------
{
    mlc$msgs_from_sender_queued = mlc$error + 13,
{
{        This status value indicates that a DELETE_SENDER request is being
{        performed while there are messages queued from this sender.  The
{        request is completed normally, and the messages remain queued.
{
{        --------------------------------------------------------------
{
    mlc$nosve_not_up = mlc$error + 28,
{
{        This status value indicates that a memory link request was performed
{        by a c170 job and that the nos/ve system was not running at the time.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$ok = mlc$error + 0,
{
{        This status value indicates that the request completed without error.
{
{        --------------------------------------------------------------
{
    mlc$permit_list_full = mlc$error + 7,
{
{        This status value indicates that an ADD_SENDER request is being
{        performed, but the permit list of the receiver is full.
{        The maximum number of permits is specified by mlc$max_permits.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$pool_buffer_not_avail = mlc$error + 18,
{
{        This status value indicates that space for either a table (SIGN_ON
{        request) or a message (SEND_MESSAGE request) could not be obtained.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$prior_msg_not_received = mlc$error + 11,
{
{        This status value indicates that a SEND_MESSAGE was attempted between
{        two applications, but the number of unreceived messages from the sender
{        to the receiver equals mlc$max_in_transit.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$queued_msgs_lost = mlc$error + 20,
{
{        This status value indicates that messages were lost (thrown away)
{        because the application did a SIGN_OFF request while there were
{        messages still queued to it.  The request is completed normally but
{        all messages that were queued to the application are lost.
{
{        --------------------------------------------------------------
{
    mlc$receiver_name_syntax_error = mlc$error + 1,
{
{        This status value indicates that the application name of the receiver
{        is not valid.  Currently, the only invalid value is -1.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$receiver_not_signed_on = mlc$error + 3,
{
{        This status value indicates that the receiver application is not
{        currently signed on to MLI.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$receive_list_full = mlc$error + 12,
{
{        This status value indicates that maximum number of messages are queued
{        for the receiver application, so no more may be sent to it.
{        The maximum number of queued messages is specified by the receiver
{        application, but is never larger than mlc$max_queued_messages.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$receive_list_index_invalid = mlc$error + 14,
{
{        This status value indicates that a RECEIVE_MESSAGE request was made,
{        but the receive index specified pointed to a receive entry that does
{        not contain a message ready to be received.  This includes the case
{        where the index is greater than mlc$max_queued_messages.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$sender_name_syntax_error = mlc$error + 2,
{
{        This status value indicates that the application name of the sender is
{        not valid.  Currently, the only invalid value is -1.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$sender_not_permitted = mlc$error + 10,
{
{        This status value indicates that the sender application has not been
{        granted permission by the receiver application to send messages to it
{        (CONFIRM_MESSAGE or SEND_MESSAGE request) or that a DELETE_SENDER
{        request is being performed for an application not currently permitted.
{        The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$sender_not_signed_on = mlc$error + 8,
{
{        This status value indicates that the sender application being
{        referenced is not currently signed on to MLI.  The request is ignored.
{
{        --------------------------------------------------------------
{
    mlc$signal_failed_ignored = mlc$error + 19,
{
{        This status value indicates that for some reason, a PMP$SEND_SIGNAL
{        request failed (SEND_MESSAGE and RECEIVE_MESSAGE requests).
{        The request is completed normally.
{
{        --------------------------------------------------------------
{
    mlc$signal_to_c170_ignored = mlc$error + 16,
{
{        This status value indicates that a SEND_MESSAGE or RECEIVE_MESSAGE
{        request with the signal option specified as TRUE was performed, but
{        the application to receive the signal was a C170 application.
{        The request is completed normally, but no signal is sent.
{
{        --------------------------------------------------------------
{
    mlc$max_job_signons = mlc$error + 29,
{
{ The maximum number of signons for all tasks in this job has been exceeded
{
    mlc$system_name_no_match = mlc$error + 4;
{
{        This status value indicates that the application name specified is
{        signed on to MLI, but by a different task than the one making the
{        request, i.e. the requesting task is not the owner of the application.
{        The request is ignored.
{
{        --------------------------------------------------------------
{

  TYPE

{
{ An application name is defined as follows:
{   C170 default = the jsn used as a 24 bit integer.
{   C170 predefined = 5 display code characters used as a 30 bit integer.
{   C180 default = the task_id of the executing task, used as a 16 bit
{                  integer as follows:  (index * 2 ** 8) + seqno.
{   C180 predefined = 5 ascii characters used as a 40 bit integer.
{   Note that all application names must contain zeros in the upper nine bits.

    mlt$application_name = integer,
    mlt$arbitrary_info = integer,
    mlt$max_messages = 0 .. mlc$max_queued_messages,
    mlt$message_length = 0 .. mlc$max_message_length,
    mlt$receive_index = 0 .. mlc$max_queued_messages,
    mlt$receive_count = 0 .. mlc$max_queued_messages,
    mlt$receive_list = array [1 .. mlc$max_queued_messages] of
      mlt$receive_entry,
    mlt$receive_entry = packed record
{  this record is defined so that the fields and values will be aligned
{  the same for both c170 and c180 users.  using full word integers is
{  the simplest way to do this.  note that some range checking is avoided.
      sender_name: ALIGNED [0 MOD 8] integer,
      arbitrary_info: integer,
      message_length: integer,
      receive_index: integer,
    recend,
    mlt$signal = ^mlt$signal_record,
    mlt$message_ptr = ^cell,
    mlt$direction = (mlc$send, mlc$receive),
    mlt$signal_record = packed record
      pad: 0 .. 0f(16),
      data: packed array [1 .. 7] of 0 .. 0ff(16),
      direction: mlt$direction,
    recend,
    mlt$signaler_application_info = record
      application_name: mlt$application_name,
      global_task_id: ost$global_task_id,
    recend,
    mlt$handler = ^procedure (signalee: mlt$application_name;
      signaler: mlt$signaler_application_info;
      signal: mlt$signal;
      VAR status: ost$status),
    mlt$status = mlc$ok .. mlc$nosve_not_up;

  CONST

    mlc$sign_on_req = 1,
    mlc$sign_off_req = 2,
    mlc$add_sender_req = 3,
    mlc$delete_sender_req = 4,
    mlc$confirm_send_req = 5,
    mlc$send_message_req = 6,
    mlc$fetch_receive_list_req = 7,
    mlc$receive_message_req = 8,
    mlc$fetch_link_partner_info_req = 9;

  TYPE
    mlt$operation = record
      req: mlc$sign_on_req .. mlc$fetch_link_partner_info_req,
      stat_condition: ost$status_condition,
    recend;
