
PROCEDURE dum$display_path_table_files, display_path_table_files, disptf (
  display_option, d, depth, do: key
      path
      (cycle_description, cd)
      (full, all, f)
    keyend = path
  output, o: file = $output
  status)

  "$FORMAT=OFF"
  VAR
    entry_assignment: string
    entry_type: integer
    number_of_entries: integer
    path: string
    path_node_name_size: integer
    pdu_number: integer=0
    "offsets & lengths
    cycle_number_length: integer
    cycle_number_offset: integer
    entries_offset: integer
    entry_assignment_offset: integer
    entry_type_length: integer
    entry_type_offset: integer
    first_cycle_alias_entry_offset: integer
    length: integer
    next_cycle_alias_entry_offset: integer
    next_pdu_offset: integer
    offset: integer
    parental_path_entry_offset: integer
    path_node_name_size_length: integer
    path_node_name_size_offset: integer
    path_node_name_value_offset: integer
    pde_length: integer
    cycle_description_offset: integer
    "addresses
    cycle_description_address: integer
    entries_address: integer
    entry_assignment_address: integer
    parental_path_address: integer
    pde_address: integer
    pdu_address: integer
    page_status: status
  VAREND
  "$FORMAT=ON"


  fmt$path_description_unit field=entry_assignment offset=offset length=length
  entry_assignment_offset = offset/8

  fmt$path_description_unit field=entries offset=offset length=length
  entries_offset = offset/8

  fmt$path_description_entry field=fmt$path_description_entry offset=offset length=length
  pde_length = length/8

  fmt$path_description_entry field=parental_path_entry offset=offset length=length
  parental_path_entry_offset = offset/8

  fmt$path_description_entry field=entry_type offset=offset length=length
  entry_type_offset = offset/8
  entry_type_length = length/8

  fmt$path_description_entry field=cycle_description offset=offset length=length
  cycle_description_offset = offset/8

  fmt$path_description_entry field=first_cycle_alias_entry offset=offset length=length
  first_cycle_alias_entry_offset = offset/8

  fmt$path_description_entry field=next_cycle_alias_entry offset=offset length=length
  next_cycle_alias_entry_offset = offset/8

  fmt$path_description_entry field=path_node_name offset=offset length=length
  fst$path_element field=value offset=path_node_name_value_offset length=length
  path_node_name_value_offset = (offset+path_node_name_value_offset)/8

  fst$path_element field=size offset=path_node_name_size_offset length=length
  path_node_name_size_offset = (offset+path_node_name_size_offset)/8
  path_node_name_size_length = length/8

  fmt$path_description_entry field=cycle_number offset=offset length=length
  cycle_number_offset = offset/8
  cycle_number_length = length/8

  pdu_address = $memory($symbol_address(fmv$initial_pdu_pointer))

  display_value v=('DUM$DISPLAY_PATH_TABLE_FILES') o=output
  out = output.$eoi

  REPEAT
    pdu_number = pdu_number + 1
    entry_assignment_address = $memory((pdu_address+entry_assignment_offset))
    number_of_entries = $memory((pdu_address+entry_assignment_offset+6), 2)
    entry_assignment = $memory_string(entry_assignment_address, number_of_entries)
    entries_address = $memory((pdu_address+entries_offset))

    FOR i = 1 TO number_of_entries DO
      path = ''
      IF $substr(entry_assignment, i, 1) = 'A' THEN
        pde_address = entries_address + ((i-1)* pde_length)
        entry_type = $memory((pde_address+entry_type_offset), entry_type_length)
        IF entry_type = 1 THEN "file_cycle_object
          cycle_description_address = $memory((pde_address+cycle_description_offset))
          IF NOT $nil_pva(cycle_description_address) THEN
            dum$get_path_string $offset(pde_address) path status=page_status
            put_line l=(' PDE Address = '//$strrep(pde_address, 16)//'  path = '//path) o=out
            alias_address = $memory((pde_address+first_cycle_alias_entry_offset))
            WHILE NOT $nil_pva(alias_address) DO
              path_node_name_size = $memory((alias_address+path_node_name_size_offset), ..
                    path_node_name_size_length)
              put_line l=('   PDE Address = '//$strrep(alias_address, 16)//'  alias = '//..
$memory_string((alias_address+path_node_name_value_offset), path_node_name_size)) o=out
              alias_address = $memory(alias_address+next_cycle_alias_entry_offset)
            WHILEND
            IF display_option <> path THEN
              dum$display_pde $offset(pde_address) do=display_option o=out status=page_status
              put_line l='0' o=out
            IFEND
          IFEND
        IFEND
      IFEND
    FOREND
    " first 6 bytes of pdu are ptr to next pdu "
    pdu_address = $memory(pdu_address)
  UNTIL $nil_pva(pdu_address)

PROCEND dum$display_path_table_files
