?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Operating System : Miscellaneous Services 13D Routines' ??
MODULE osm$misc_services_13d;
?? RIGHT := 110 ??

{ PURPOSE:
{   This module contains procedures to interface 1dd procedures to 113 procedures and variables.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc ost$monitor_fault
*copyc ost$system_error_statistic
?? POP ??
*copyc dsp$log_sys_msg_help
*copyc syp$establish_condition_handler
*copyc syp$process_job_rcv_failure
*copyc osv$use_site_welcome_banner
*copyc syv$job_recovery_step
*copyc cml$system_error

  VAR
    osv$debug: [XREF] array [0 .. 15] of integer;

?? TITLE := 'osp$check_for_job_recovery', EJECT ??

  FUNCTION [XDCL, #GATE] osf$use_site_welcome_banner: boolean;

    osf$use_site_welcome_banner := osv$use_site_welcome_banner;

  FUNCEND osf$use_site_welcome_banner;
?? TITLE := 'osp$check_for_job_recovery', EJECT ??

{ PURPOSE:
{   This procedure checks if job recovery is in progress for this job.  If it is
{   syv$recovering_job_count will be decremented and the job will be hung.

  PROCEDURE [XDCL, #GATE] osp$check_for_job_recovery
    (    message: string ( * ));

    VAR
      status: ost$status;

    status.normal := TRUE;
    IF (syv$job_recovery_step > syc$jrs_initial_step) AND
          (syv$job_recovery_step < syc$jrs_recovery_complete) THEN
      syp$process_job_rcv_failure (message, status);
    IFEND;

  PROCEND osp$check_for_job_recovery;
?? TITLE := 'osp$log_system_error', EJECT ??

{ Purpose:
{   This procedure will log the system error statistic.

  PROCEDURE [XDCL, #GATE] osp$log_system_error
    (    error_message: string ( * );
         text: string ( * ));

?? NEWTITLE := 'ch', EJECT ??

    PROCEDURE ch
      (    mf: ost$monitor_fault;
           msa_p: ^ost$minimum_save_area;
       VAR continue: syt$continue_option);

      error_statistic_p := #SEQ (error_statistic);
      dsp$log_sys_msg_help (cml$system_error, error_statistic_p);
      EXIT osp$log_system_error; {----->

    PROCEND ch;

?? OLDTITLE, EJECT ??

    TYPE
      sfsa_type = record
        fill1: 0 .. 0ffff(16),
        p: ^cell,
        a0: integer,
        a1: integer,
        fill2: 0 .. 0ffff(16),
        a2: ^sfsa_type, {previous save area pointer}
      recend,

      variant_trick = record
        case 0 .. 1 of
        = 0 =
          word: integer,
        = 1 =
          fill: 0 .. 0ffff(16),
          pva: ^cell,
        casend,
      recend;

    VAR
      converter: variant_trick,
      error_statistic: ost$system_error_statistic,
      error_statistic_p: ^SEQ ( * ),
      length: integer,
      sfsa_p: ^sfsa_type,
      stack: 0 .. osc$stacks_to_display,
      status: ost$status,
      temp_text: string (osc$system_error_stat_msg_size);

    FOR stack := 1 TO osc$stacks_to_display DO
      error_statistic.counter [stack] := 0ffff80000000(16);
    FOREND;
    converter.word := 0;

    syp$establish_condition_handler (^ch);

    STRINGREP (temp_text, length, text, error_message);
    error_statistic.text := temp_text (1, length);

    sfsa_p := #PREVIOUS_SAVE_AREA ();

  /display_p/
    FOR stack := 1 TO osc$stacks_to_display DO
      converter.pva := sfsa_p^.p;
      error_statistic.counter [stack] := converter.word;
      sfsa_p := sfsa_p^.a2;
      IF sfsa_p = NIL THEN
        EXIT /display_p/ {----->
      IFEND;
    FOREND /display_p/;

    error_statistic_p := #SEQ (error_statistic);
    dsp$log_sys_msg_help (cml$system_error, error_statistic_p);

  PROCEND osp$log_system_error;
?? OLDTITLE ??
?? NEWTITLE := 'OSF$DEBUG', EJECT ??

  FUNCTION [XDCL, #GATE] osf$debug
    (    number: 0 .. 15): integer;

    osf$debug := osv$debug [number];

  FUNCEND osf$debug;
?? OLDTITLE ??
MODEND osm$misc_services_13d;
