*copyc OSD$DEFAULT_PRAGMATS
MODULE ifm$store_term_conn_attributes;

{ MODULE DECK IFMST }
*copyc AMH$ALSO

?? TITLE := 'NOS/VE :  BASIC ACCESS METHOD' ??
?? NEWTITLE := '  [XDCL] IFP$STORE_TERM_CONN_ATTRIBUTES' ??
?? PUSH (LISTEXT := ON) ??
*copyc AMT$FAP_DECLARATIONS
*copyc IFK$KEYPOINTS
*copyc AMC$CONDITION_CODE_LIMITS
*copyc AME$IMPROPER_FILE_ID
*copyc OST$CALLER_IDENTIFIER
*copyc BAP$VALIDATE_FILE_IDENTIFIER
*copyc OSP$SET_STATUS_ABNORMAL
?? POP ??
?? EJECT ??
*copyc IFH$STORE_TERMINAL

  PROCEDURE [XDCL, #GATE] ifp$store_term_conn_attributes (file_identifier:
    amt$file_identifier;
        terminal_attributes: ift$connection_attributes;
    VAR status: ost$status);


    CONST
      interface_name = 'IFP$STORE_TERM_CONN_ATTRIBUTES',
      fap_layer_number = 0;

    VAR
      bam_status: ost$status,
      caller_id: ost$caller_identifier,
      file_id_is_valid: boolean,
      call_block: amt$call_block,
      file_instance: ^bat$task_file_entry,
      store_attributes: ^ift$connection_attributes;


    #KEYPOINT (osk$entry, file_identifier.ordinal * osk$m, ifk$store_term_conn_attributes);
    #caller_id (caller_id);
    status.normal := TRUE;
    bam_status.normal := TRUE;

*copy BAI$VALIDATE_FILE_IDENTIFIER

    IF NOT file_id_is_valid THEN
      osp$set_status_abnormal (amc$access_method_id, ame$improper_file_id,
            interface_name, status);
      RETURN;
    IFEND;

    call_block.operation := ifc$store_terminal_req;

    PUSH store_attributes: [LOWERBOUND (terminal_attributes) .. UPPERBOUND
          (terminal_attributes)];
    store_attributes^ := terminal_attributes;
    call_block.store_terminal.terminal_attributes := store_attributes;

*copy bai$call_fap_control

    IF bam_status.normal THEN
      #KEYPOINT (osk$exit, 0, ifk$store_term_conn_attributes);
    ELSE
      IF (file_instance^.instance_attributes.dynamic_label.
            error_exit_procedure <> NIL) THEN
        file_instance^.instance_attributes.dynamic_label.
              error_exit_procedure^ (file_identifier, bam_status);
      IFEND;
      IF bam_status.normal THEN
        #KEYPOINT (osk$exit, 0, ifk$store_term_conn_attributes);
      ELSE
        status := bam_status;
        #KEYPOINT (osk$exit, 0, ifk$store_term_conn_attributes);
      IFEND;
    IFEND;
  PROCEND ifp$store_term_conn_attributes;
MODEND ifm$store_term_conn_attributes;
