*copyc OSD$DEFAULT_PRAGMATS
MODULE icm$report_status_error;

?? PUSH (LISTEXT := ON) ??
*copyc OST$STATUS
*copyc PMP$LOG
*copyc osp$unpack_status_condition
?? POP ??

?? TITLE := 'PROCEDURE [XDCL ] icp$report_status_error', EJECT ??

  PROCEDURE [XDCL] icp$report_status_error (VAR error_status: ost$status;
        message: string ( * ));

    CONST
      legend_1 = 'Status error on ',
      legend_2 = 'Id:   ; Cond:         ',
      legend_3 = 'Text:                                ';

    VAR
      identifier: ost$status_identifier,
      number: ost$status_condition_number,
      line: string (255),
      status: ost$status,
      i: integer;

{ Log the kind of error report that is to follow

    line (1, 16) := legend_1;
    line (17, STRLENGTH (message)) := message;
    pmp$log (line (1, 16 + STRLENGTH (message)), status);

{ Log the status id and condition code

    line (1, 22) := legend_2;
    osp$unpack_status_condition (error_status.condition, identifier, number);
    line (5, 2) := identifier;
    STRINGREP (line (14, 8), i, number);
    pmp$log (line (1, 21), status);

{ Log the status text

{    line (1, 37) := legend_3;
{    line (7, error_status.text.size) := error_status.text.value (1,
{          error_status.text.size);
{    pmp$log (line (1, 6 + error_status.text.size), status);

  PROCEND icp$report_status_error;

MODEND icm$report_status_error;
