?? TITLE := 'NOS/VE :  BASIC ACCESS METHOD, RING BRACKETS 2DD' ??
MODULE amm$add_to_file_description;
?? RIGHT := 110 ??

*copyc amh$also

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc amc$condition_code_limits
*copyc ame$attribute_validation_errors
*copyc ame$improper_file_id
*copyc amt$call_block
*copyc amt$fap_layer_number
*copyc amt$fap_pointer
*copyc amt$log_residence
?? POP ??
*copyc baf$task_file_entry_p
*copyc clf$file_reference_valid
*copyc amp$set_file_instance_abnormal
*copyc bap$add_to_file_description
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal
*copyc amv$attribute_names
?? OLDTITLE ??
?? NEWTITLE := '  [XDCL] AMP$ADD_TO_FILE_DESCRIPTION', EJECT ??

*copyc amh$add_to_file_description

  PROCEDURE [XDCL, #GATE] amp$add_to_file_description ALIAS 'amxatfd'
    (    file_identifier: amt$file_identifier;
         file_attributes: amt$add_to_attributes;
     VAR status: ost$status);

    CONST
      interface_name = 'AMP$ADD_TO_FILE_DESCRIPTION';

    VAR
      bad_value: boolean,
      entry_p: ^amt$add_to_item,
      file_instance_p: ^bat$task_file_entry,
      i: integer;

?? NEWTITLE := '  [XDCL] P$VALID__FILE_DESCRIPTION', EJECT ??


    status.normal := TRUE;
    file_instance_p := baf$task_file_entry_p (file_identifier);
    IF file_instance_p = NIL THEN
      osp$set_status_abnormal (amc$access_method_id, ame$improper_file_id, interface_name, status);
      RETURN; {----->
    IFEND;

    FOR i := 1 TO UPPERBOUND (file_attributes) DO

      entry_p := ^file_attributes [i];

      CASE entry_p^.key OF
      = amc$character_conversion =
        bad_value := (entry_p^.character_conversion < LOWERVALUE (boolean))
{               } OR (entry_p^.character_conversion > UPPERVALUE (boolean));

      = amc$file_contents =
        bad_value := FALSE;

      = amc$file_limit =
        bad_value := (entry_p^.file_limit < LOWERVALUE (amt$file_limit))
{               } OR (entry_p^.file_limit > UPPERVALUE (amt$file_limit));

      = amc$file_processor, amc$file_structure =
        bad_value := FALSE;

      = amc$forced_write =
        bad_value := (entry_p^.forced_write < LOWERVALUE (amt$forced_write))
{               } OR (entry_p^.forced_write > UPPERVALUE (amt$forced_write));

      = amc$internal_code =
        bad_value := (entry_p^.internal_code < LOWERVALUE (amt$internal_code))
{               } OR (entry_p^.internal_code > UPPERVALUE (amt$internal_code));

      = amc$line_number =
        bad_value := (entry_p^.line_number.length < LOWERVALUE (amt$line_number_length))
{               } OR (entry_p^.line_number.length > UPPERVALUE (amt$line_number_length))
{               } OR (entry_p^.line_number.location < LOWERVALUE (amt$line_number_location))
{               } OR (entry_p^.line_number.location > UPPERVALUE (amt$line_number_location));

      = amc$max_block_length =
        bad_value := (entry_p^.max_block_length < LOWERVALUE (amt$max_block_length))
{               } OR (entry_p^.max_block_length > UPPERVALUE (amt$max_block_length));

      = amc$max_record_length =
        bad_value := (entry_p^.max_record_length < LOWERVALUE (amt$max_record_length))
{               } OR (entry_p^.max_record_length > UPPERVALUE (amt$max_record_length));

      = amc$min_block_length =
        bad_value := (entry_p^.min_block_length < LOWERVALUE (amt$min_block_length))
{               } OR (entry_p^.min_block_length > UPPERVALUE (amt$min_block_length));

      = amc$min_record_length =
        bad_value := (entry_p^.min_record_length < LOWERVALUE (amt$min_record_length))
{               } OR (entry_p^.min_record_length > UPPERVALUE (amt$min_record_length));


      = amc$null_attribute =
        bad_value := FALSE;

      = amc$padding_character =
        bad_value := FALSE;

      = amc$page_format =
        bad_value := (entry_p^.page_format < LOWERVALUE (amt$page_format))
{               } OR (entry_p^.page_format > UPPERVALUE (amt$page_format));

      = amc$page_length =
        bad_value := (entry_p^.page_length < LOWERVALUE (amt$page_length))
{               } OR (entry_p^.page_length > UPPERVALUE (amt$page_length));

      = amc$page_width =
        bad_value := (entry_p^.page_width < LOWERVALUE (amt$page_width))
{               } OR (entry_p^.page_width > UPPERVALUE (amt$page_width));

      = amc$record_type =
        bad_value := (entry_p^.record_type < LOWERVALUE (amt$record_type))
{               } OR (entry_p^.record_type > UPPERVALUE (amt$record_type));

      = amc$statement_identifier =
        bad_value := ((entry_p^.statement_identifier.length < LOWERVALUE (amt$statement_id_length))
{               } OR (entry_p^.statement_identifier.length > UPPERVALUE (amt$statement_id_length))
{               } OR (entry_p^.statement_identifier.location < LOWERVALUE (amt$statement_id_location))
{               } OR (entry_p^.statement_identifier.location > UPPERVALUE (amt$statement_id_location)));

      = amc$user_info =
        bad_value := FALSE;

      = amc$vertical_print_density =
        bad_value := (entry_p^.vertical_print_density < LOWERVALUE (amt$vertical_print_density))
{               } OR (entry_p^.vertical_print_density > UPPERVALUE (amt$vertical_print_density));

{ AAM }

      = amc$average_record_length =
        bad_value := (entry_p^.average_record_length < LOWERVALUE (amt$average_record_length))
{               } OR (entry_p^.average_record_length > UPPERVALUE (amt$average_record_length));

      = amc$collate_table =
        bad_value := FALSE;

      = amc$data_padding =
        bad_value := (entry_p^.data_padding < LOWERVALUE (amt$data_padding))
{               } OR (entry_p^.data_padding > UPPERVALUE (amt$data_padding));

      = amc$embedded_key =
        bad_value := (entry_p^.embedded_key < LOWERVALUE (boolean))
{               } OR (entry_p^.embedded_key > UPPERVALUE (boolean));

      = amc$estimated_record_count =
        bad_value := FALSE;

      = amc$index_levels =
        bad_value := (entry_p^.index_levels < LOWERVALUE (amt$index_levels))
{               } OR (entry_p^.index_levels > UPPERVALUE (amt$index_levels));

      = amc$index_padding =
        bad_value := (entry_p^.index_padding < LOWERVALUE (amt$index_padding))
{               } OR (entry_p^.index_padding > UPPERVALUE (amt$index_padding));

      = amc$key_length =
        bad_value := (entry_p^.key_length < LOWERVALUE (amt$key_length))
{               } OR (entry_p^.key_length > UPPERVALUE (amt$key_length));

      = amc$key_position =
        bad_value := (entry_p^.key_position < LOWERVALUE (amt$key_position))
{               } OR (entry_p^.key_position > UPPERVALUE (amt$key_position));

      = amc$key_type =
        bad_value := (entry_p^.key_type < LOWERVALUE (amt$key_type))
{               } OR (entry_p^.key_type > UPPERVALUE (amt$key_type));

      = amc$log_residence =
        bad_value := (entry_p^.log_residence <> NIL) AND (NOT clf$file_reference_valid
              (entry_p^.log_residence^));

      = amc$record_limit =
        bad_value := (entry_p^.record_limit < LOWERVALUE (amt$record_limit))
{               } OR (entry_p^.record_limit > UPPERVALUE (amt$record_limit));

      = amc$records_per_block =
        bad_value := (entry_p^.records_per_block < LOWERVALUE (amt$records_per_block))
{               } OR (entry_p^.records_per_block > UPPERVALUE (amt$records_per_block));

      ELSE
        amp$set_file_instance_abnormal (file_identifier, ame$improper_file_attrib_key,
              amc$add_to_file_description_req, 'FILE_ATTRIBUTES', status);
        osp$append_status_integer (osc$status_parameter_delimiter, i, 10, FALSE, status);
        RETURN; {----->
      CASEND;

      IF bad_value THEN
        IF status.normal THEN
          amp$set_file_instance_abnormal (file_identifier, ame$improper_file_attrib_value,
                amc$add_to_file_description_req, 'FILE_ATTRIBUTES', status);
          osp$append_status_parameter (osc$status_parameter_delimiter, amv$attribute_names [entry_p^.key],
                status);
        ELSE
          osp$append_status_parameter (',', amv$attribute_names [entry_p^.key], status);
        IFEND;
      IFEND;
    FOREND;

    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    bap$add_to_file_description (file_identifier, ^file_attributes, status);

  PROCEND amp$add_to_file_description;
?? OLDTITLE ??
MODEND amm$add_to_file_description;
