?? NEWTITLE := 'NOS/VE :  ADVANCED ACCESS METHOD, RING BRACKETS 4DD' ??
MODULE amm$get_lock_keyed_record;
?? RIGHT := 110 ??

*copyc amh$also

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc amc$condition_code_limits
*copyc ame$improper_file_id
*copyc amt$call_block
*copyc amt$fap_layer_number
*copyc amt$fap_pointer
?? POP ??
*copyc baf$task_file_entry_p
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := '  [XDCL] AMP$GET_LOCK_KEYED_RECORD', EJECT ??

  PROCEDURE [XDCL, #GATE] amp$get_lock_keyed_record
    (    file_identifier: amt$file_identifier;
         working_storage_area: ^cell;
         working_storage_length: amt$working_storage_length;
         key_location: ^cell;
         major_key_length: amt$major_key_length;
         relation: amt$key_relation;
         wait_for_lock: ost$wait_for_lock;
         unlock_control: amt$unlock_control;
         lock_intent: amt$lock_intent;
     VAR record_length: amt$max_record_length;
     VAR file_position: amt$file_position;
         wait: ost$wait;
     VAR status: ost$status);

    CONST
      interface_name = 'AMP$GET_LOCK_KEYED_RECORD',
      fap_layer_number = 0;

    VAR
      call_block: amt$call_block,
      file_instance_p: ^bat$task_file_entry;

    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;

    call_block.operation := amc$get_lock_keyed_record;

    call_block.get_lock_keyed_record.working_storage_area := working_storage_area;
    call_block.get_lock_keyed_record.working_storage_length := working_storage_length;
    call_block.get_lock_keyed_record.key_location := key_location;
    call_block.get_lock_keyed_record.major_key_length := major_key_length;
    call_block.get_lock_keyed_record.relation := relation;
    call_block.get_lock_keyed_record.wait_for_lock := wait_for_lock;
    call_block.get_lock_keyed_record.unlock_control := unlock_control;
    call_block.get_lock_keyed_record.lock_intent := lock_intent;
    call_block.get_lock_keyed_record.record_length := ^record_length;
    call_block.get_lock_keyed_record.file_position := ^file_position;
    call_block.get_lock_keyed_record.wait := wait;

    file_instance_p^.fap_control_information.first_fap.access_method^
          (file_identifier, call_block, fap_layer_number, status);

    IF NOT status.normal THEN
      IF (file_instance_p^.instance_attributes.dynamic_label.error_exit_procedure <> NIL) THEN
        file_instance_p^.instance_attributes.dynamic_label.error_exit_procedure^ (file_identifier, status);
      IFEND;
    IFEND;

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