*copyc OSD$DEFAULT_PRAGMATS
MODULE ifm$get_term_conn_defaults;

{ PURPOSE:  Return the task-level defaults for the requested attributes.
{
{  DESIGN:  This ring 3 module simply calls its ring 2 counterpart,
{           iim$get_term_conn_defaults, to retrieve the values from
{           the default attributes in the connection table (standalone)
{           or the attributes table pointed at by iiv$terminal_request_ptr
{           (dual state).
{
?? TITLE := 'MODULE ifm$get_term_conn_defaults' ??

?? PUSH (LISTEXT := ON) ??
*copyc fst$file_reference
*copyc ife$error_codes
*copyc ifk$keypoints
*copyc ift$get_connection_attributes
*copyc iip$get_term_conn_defaults
*copyc iit$connection_description
*copyc iiv$interactive_terminated
*copyc OST$STATUS
?? POP ??

*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal

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

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

    VAR
      i:integer,
      internal_file_name: amt$local_file_name;

    status.normal := TRUE;

    #KEYPOINT (osk$entry, 0, ifk$get_term_conn_defaults);

    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$GET_TERM_CONN_DEFAULTS', status);
      RETURN;
    IFEND;

    IF iiv$network_identifier = iic$dsiaf_network THEN
      IF NOT iiv$cdcnet_connection THEN

      { For those attributes which are ignored in dual state 255x connections,
      { replace their keys in term_conn_attributes with ifc$null_connection_attribute.

        FOR i := 1 TO UPPERBOUND (term_conn_attributes) DO
          CASE term_conn_attributes [i].key OF
          = ifc$trans_protocol_mode =
            term_conn_attributes [i].key := ifc$null_connection_attribute;


          ELSE
          { All other attributes will have their values returned.
          CASEND;

        FOREND;
      IFEND;
    IFEND;
    iip$get_term_conn_defaults (internal_file_name, term_conn_attributes, status);

    #KEYPOINT (osk$exit, 0, ifk$get_term_conn_defaults);

  PROCEND ifp$get_term_conn_defaults;

MODEND ifm$get_term_conn_defaults;
