PROCEDURE dum$display_client_mainframe_fi , display_client_mainframe_file discmf (
  address, a: integer 0 .. $max_integer = $mem($sa(dfv$p_client_mainframe_file))
  display_option, do: key
     (job_names, jn)
     (job_space, js)
     (attached_files, af)
     (queued_catalogs, qc)
      all
    keyend =  all
  display_deleted_jobs, ddj: boolean = false
  output, o: file = $output
  status)

 " This PROCEDURE displays the file server client mainframe file.
 "  This procedure  assumes you
 " are using RJTs analyze_system, and that dfm$client_mainframe_manager has
 " been added as a debug table.  All pointers maintained in the file are
 " converted to the base segment of the parent address.

  set_file_attributes output fc=legible pf=continuous
  out = output.$eoi

  current = $default_module
  crev status  status
  chadm dfm$client_mainframe_manager status=status
  dispv ?address.dft$client_mainframe_file o=out
  number_of_active_pointers = $pv(?address.dft$client_mainframe_file..
.mainframe_header.client_job_list_root.number_of_active_pointers)
  IF number_of_active_pointers > 0 THEN
    " There are jobs using the server
    p_job_list_pointer_array =  $pv(?address.dft$client_mainframe_file..
.mainframe_header.client_job_list_root.p_job_list_pointer_array)
    " Convert to the right segment
    p_job_list_pointer_array = $ring(address)*100000000000(16) + ..
       $segment(address)*100000000(16) + $offset(p_job_list_pointer_array)
   next_pointer_entry = p_job_list_pointer_array
    FOR pointer = 1 to  number_of_active_pointers do
      disv ' ---POINTER  ------- '//$strrep(Pointer) o=out
      dispv ?next_pointer_entry.dft$client_job_list_pointer ..
          o=out
      p_client_job_list = $pv(..
          ?next_pointer_entry.dft$client_job_list_pointer.p_client_job_list)
      p_client_job_list = $ring(address)*100000000000(16) + ..
         $segment(address)*100000000(16) + $offset(p_client_job_list)
      p_client_job_list_entry = p_client_job_list
      FOR client_job_entry = 1  TO 40 " UPPERVALUE(dft$client_job_list_index)" DO
        IF $pv(?next_pointer_entry.dft$client_job_list_pointer.assignment(?client_job_entry)) = 'A' OR ..
          display_deleted_jobs THEN
          disv ' ========= Client Job list id '//$strrep(pointer)//' '//$strrep(client_job_entry)  o=out
          dispv ?p_client_job_list_entry.dft$client_job_list_entry ..
             o=out
          p_client_job_space = $pv(?p_client_job_list_entry..
.dft$client_job_list_entry.p_client_job_space)
          IF NOT $NIL_PVA(p_client_job_space) THEN
            p_client_job_space = $ring(address)*100000000000(16) + ..
         $segment(address)*100000000(16) + $offset(p_client_job_space)
            IF (display_option = JOB_SPACE) OR (display_option = ALL) THEN
            dispv ?p_client_job_space.dft$client_job_space o=out ..
               status=status
             IFEND
            IF status.normal THEN
              " Display attached pf table
              IF (display_option = ATTACHED_FILES) OR (display_option = ALL) THEN
                 p_attached_pf_table = $pv(..
?p_client_job_space.dft$client_job_space.p_attached_pf_table)
                IF $nil_pva(p_attached_pf_table) THEN
                  disv ' No attached files '  o=out
                ELSE
                  p_attached_pf_table = $ring(address)*100000000000(16) + ..
                    $segment(address)*100000000(16) + $offset(p_attached_pf_table)
                  p_p_attached_pf_table = $pv(^..
?p_client_job_space.dft$client_job_space.p_attached_pf_table)
                  array_size = $mem(p_p_attached_pf_table+6, 4)
                  element_size = $mem(p_p_attached_pf_table+14, 4)
                  disv ' array_size '//$strrep(array_size)//' element_size '//$strrep(element_size) o=out
                  display_attached_pf_table p_attached_pf_table ..
                     array_size element_size o=out  status=status
                  IF NOT status.normal THEN
                    disv ' Unable to display attached pf table ' o=out
                    disv status o=out
                  IFEND
               IFEND
             IFEND

              " Display queued catalog table
             IF (display_option = QUEUED_CATALOGS) OR (display_option = ALL) THEN
                p_queued_catalog_table = $pv(..
?p_client_job_space.dft$client_job_space.p_queued_catalog_table)
                IF $nil_pva(p_queued_catalog_table) THEN
                  disv ' No queued catalogs '  o=out
                ELSE
                  p_queued_catalog_table= $ring(address)*100000000000(16) + ..
                    $segment(address)*100000000(16) + $offset(p_queued_catalog_table)
                  p_p_queued_catalog_table = $pv(^..
?p_client_job_space.dft$client_job_space.p_queued_catalog_table)
                  array_size = $mem(p_p_queued_catalog_table+6, 4)
                  element_size = $mem(p_p_queued_catalog_table+14, 4)
                  disv ' array_size '//$strrep(array_size)//' element_size '//$strrep(element_size) o=out
                  display_queued_catalog_table p_queued_catalog_table  ..
                   array_size element_size o=out status=status
                  IF NOT status.normal THEN
                    disv ' Unable to display queued_catalog_table'  o=out
                    disv status o=out
                  IFEND
                IFEND
              IFEND
            ELSE
              disv ' Unable to display user job area ' o=out
              disv status o=out
            IFEND
          IFEND
        IFEND
        p_client_job_list_entry = p_client_job_list_entry + 80
       "  $PV(#SIZE(0.dft$client_job_list_entry) rounded up to word
      FOREND
      next_pointer_entry = next_pointer_entry + ..
        $PV(#SIZE(0.dft$client_job_list_pointer))
    FOREND
  IFEND
  chadm current
PROCEND dum$display_client_mainframe_fi
