
  PROCEDURE [INLINE] bap$validate_fap_identifier
    (    file_identifier: amt$file_identifier;
     VAR file_instance: ^bat$task_file_entry;
     VAR file_id_is_valid: boolean);

?? PUSH (LISTEXT := ON) ??
?? RIGHT := 110 ??

{ The purpose of this request is to first validate the file identifier
{ as does bap$validate_file_identifier, and second to allocate a dummy
{ file_instance so the calling procedure can have a working copy of the
{ BAM tables.  This allows a BAM FAP to be run as a user FAP for debugging.
{ One limitation is that all interfaces called by the FAP must be callable
{ at the ring the FAP is running.

    VAR
      status: ost$status,
      dummy_pva: ^cell,
      dummy_file_instance: ^bat$task_file_entry;

*copy bai$validate_file_identifier

    amp$fetch_fap_pointer (file_identifier, global_layer_number, dummy_pva, status);

    IF NOT status.normal THEN
      ALLOCATE dummy_file_instance;
      dummy_file_instance^ := file_instance^;
      ALLOCATE dummy_file_instance^.global_file_information;
      dummy_file_instance^.global_file_information^ := file_instance^.global_file_information^;
      ALLOCATE dummy_file_instance^.global_file_information^.device_dependent_info.tape_descriptor:
            [[REP (#SIZE (bat$tape_descriptor)) OF cell]];
      i#move (#LOC (file_instance^.global_file_information^.device_dependent_info.tape_descriptor^),
            #LOC (dummy_file_instance^.global_file_information^.device_dependent_info.tape_descriptor^),
            #SIZE (bat$tape_descriptor));

      dummy_pva := dummy_file_instance;
      amp$store_fap_pointer (file_identifier, global_layer_number, dummy_pva, status);
    IFEND;

    file_instance := dummy_pva;

  PROCEND bap$validate_fap_identifier;

*copyc amt$file_identifier
*copyc bat$task_file_table
*copyc bav$task_file_table
*copyc amp$fetch_fap_pointer
*copyc amp$store_fap_pointer
?? POP ??
