*copyc OSD$DEFAULT_PRAGMATS
MODULE ifm$change_term_conn_attributes;

{ PURPOSE:  This ring 3 module calls IIP$CHANGE_TERM_CONN_ATTRIBUTES
{           to change the default connection attributes for the named
{           file.  It does so only if the file was created by
{           RMP$REQUEST_TERMINAL.
{
{           Note that the attributes defined for previous opens of the
{           file will not be affected by the new attributes.
{
{  DESIGN:  The parameters on this call are used to call
{           IIP$CHANGE_TERM_CONN_ATTRIBUTES which works the same for
{           both dual state and standalone connections.
{
?? TITLE := 'MODULE ifm$change_term_conn_attributes' ??

?? PUSH (LISTEXT := ON) ??
*copyc FST$FILE_REFERENCE
*copyc ife$error_codes
*copyc IFK$KEYPOINTS
*copyc IFT$CONNECTION_ATTRIBUTES
*copyc IIP$CHANGE_TERM_CONN_ATTRIBUTES
*copyc iiv$interactive_terminated
*copyc OST$STATUS
?? POP ??

*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal

?? NEWTITLE := 'PROCEDURE ifp$change_term_conn_attributes', EJECT ??
*copyc ifh$change_term_conn_attributes

  PROCEDURE [XDCL, #GATE {TS_gate} ] ifp$change_term_conn_attributes
    (terminal_file_name: fst$file_reference;
        term_conn_attributes: ift$connection_attributes;
    VAR status: ost$status);

    VAR
      i:integer,
      internal_file_name: amt$local_file_name;

    /change_term_conn_attributes/
    BEGIN
    status.normal := TRUE;
    #KEYPOINT (osk$entry, 0, ifk$change_term_conn_attributes);

    IF STRLENGTH (terminal_file_name) <= osc$max_name_size THEN
      internal_file_name := terminal_file_name;
    ELSE
      osp$set_status_abnormal (ifc$interactive_facility_id,
            ife$file_name_ill_formed, terminal_file_name, status);
      osp$append_status_parameter (osc$status_parameter_delimiter,
        'IFP$CHANGE_TERM_CONN_ATTRIBUTES', status);
      RETURN;
    IFEND;

{ Check for attributes which have no meaning on this type of terminal connection.

    IF iiv$network_identifier = iic$dsiaf_network THEN
      IF NOT iiv$cdcnet_connection THEN
        FOR i := 1 TO UPPERBOUND (term_conn_attributes) DO
          CASE term_conn_attributes [i].key OF
          = ifc$trans_protocol_mode =
            osp$set_status_abnormal (ifc$interactive_facility_id,
                  ife$illegal_nam_ccp_conn_change,
                  'IFP$CHANGE_TERM_CONN_ATTRIBUTES', status);

            EXIT /change_term_conn_attributes/;
          ELSE
          CASEND;
        FOREND;
      IFEND;
    IFEND;

    iip$change_term_conn_attributes (internal_file_name, term_conn_attributes, status);
    END /change_term_conn_attributes/;
    #KEYPOINT (osk$exit, 0, ifk$change_term_conn_attributes);

  PROCEND ifp$change_term_conn_attributes;
MODEND ifm$change_term_conn_attributes;
