PROCEDURE dum$display_all_fmds, display_all_fmds, disafmds (
  pva: integer = $optional
  output, o: file = $output
  display_option, do: key
      (brief, b), (full, f)
    keyend = brief
  help, h: file = $null
  status)

  "$FORMAT=OFF"
  VAR
    when_status: status
  VAREND
  "$FORMAT=ON"

  WHEN any_fault DO
    when_status = $previous_status
    putl ' Invoked DISAFMDS condition handler due to the following abnormal status:'
    disv when_status
    putl ' Enter commands, "exit_proc" to abort, or "exit_proc with when_status" to abort with status'
    include_file command prompt='disafmds_ch'
  WHENEND

  IF $specified(help) THEN
COLLECT_TEXT o=help until='HELPEND'
DISPLAY_ALL_FMDS or DISAFMDS

  This procedure displays device manager's knowledge of a file by calling
the following procedures, passing the proper parameters to eliminate manual
intervention:

   Procedure             Passed Parameter
1. display_fmd           pva_of_fmd

The display_option and output parameters will be retained for all proce-
dures. This procedure assumes the user has previously selected the correct
exchange package by available analyze_dump commands.

PARAMETERS:

PVA: integer
  This parameter sets the PVA of the first file to be displayed.  This
parameter is required.

DISPLAY_OPTIONS, DO: key full, f, brief, b
  This parameter selects the option of displaying the contents of memory
and the description of the selected fields (full), or the brief
mode of the descriptions only.  This parameter defaults to brief.

OUTPUT, O: file
  This parameter selects the file name to receive the data.  This para-
meter is defaulted to $output.  If a file name other than $output is
entered the data will be formated correctly for printer disposition and
will be sent to the file  "$asis".

STATUS

WARNINGS/KNOWN DEFICIENCIES:

ERROR HANDLER
  When any fatal error is encountered a condition handler is invoked and
the following messages will appear:
 "Invoked DISXXX condition handler due to the following abnormal status:"
 "< the error status message >"
 "Enter commands, "exit_proc" to abort, or "exit_proc with when_status"
  to abort with status"
To exit the handler enter:    "exit_proc"
To exit the handler with status, enter:   "exit_proc with when_status"
 NOTE: XXX is the name of the procedure at the time of the error.

HELPEND
    EXIT_PROC
  IFEND

  IF NOT $specified(pva) THEN
    EXIT_PROC WITH $status(false, 'US', 8, 'Parameter PVA is required')
  IFEND

  "$FORMAT=OFF"
  VAR
    command_line: string
    fmd_p: integer
    next_fmd_p: integer
    next_fmd_pva: integer
    output_file: file
  VAREND
  "$FORMAT=ON"

  IF $file(output open_position) = '$BOI' THEN
    output_file = output.$asis
  ELSE
    output_file = output
  IFEND

  next_fmd_pva = pva

fmd_depth: ..
  REPEAT

    command_line = ' display_fmd pva='//$strrep(next_fmd_pva, 16)//'(16) output='//$strrep(output_file)//..
' display_option='//$strrep(display_option)//' next_fmd_p=next_fmd_p'
    include_line command_line
    next_fmd_pva = next_fmd_p

  UNTIL $nil_pva(next_fmd_p)

PROCEND dum$display_all_fmds
