?? RIGHT := 110 ??
?? NEWTITLE := 'INSTALL_SOFTWARE Utility: RAP$ESTABLISH_ICR_PACKLIST_PTRS interface.' ??
MODULE ram$establish_icr_packlist_ptrs;

{ PURPOSE:
{   This module contains the interface that establishes the installation
{   control record's packing list pointers.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc rae$install_software_cc
*copyc rac$control_job_identifier
*copyc rac$packing_list_level
*copyc rac$pacs_processor_version
*copyc rat$installation_control_record
*copyc rat$packing_list_sequence
*copyc rat$sequence_descriptor_types
?? POP ??
*copyc osp$append_status_file
*copyc osp$append_status_parameter
*copyc osp$generate_log_message
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] rap$establish_icr_packlist_ptrs', EJECT ??

{ PURPOSE:
{   This interface establishes the pointers to the major data structures in
{   the packing list.  The pointers are registered in the installation
{   control record passed in.
{
{ DESIGN:
{   The packing list file was previously opened and a pointer to the packing
{   list sequence has albready been established (in the installation contol
{   record).  Using this pointer the major structures of a packing list are
{   established.  At this time the packing list is validated as a packing
{   list and to be at a compatable level to the processor reading it.
{
{   Validation errors are returned in the status variable.
{
{ NOTES:
{

  PROCEDURE [XDCL] rap$establish_icr_packlist_ptrs
    (VAR installation_control_record {input, output} : rat$installation_control_record;
     VAR status: ost$status);


    VAR
      ignore_status: ost$status,
      installation_database: rat$path,
      local_status: ost$status;


    status.normal := TRUE;
    installation_database := installation_control_record.processing_header_p^.installation_defaults.
          installation_database;

    RESET installation_control_record.packing_list_pointers.sequence_p;
    NEXT installation_control_record.packing_list_pointers.sequence_descriptor_p IN
          installation_control_record.packing_list_pointers.sequence_p;
    IF installation_control_record.packing_list_pointers.sequence_descriptor_p = NIL THEN
      osp$set_status_abnormal ('RA', rae$unexpected_eof_packing_list,
            installation_control_record.processing_header_p^.packing_list_name, status);
      osp$append_status_file (osc$status_parameter_delimiter, installation_database.
            path (1, installation_database.size), status);
      RETURN;
    IFEND;

    IF installation_control_record.packing_list_pointers.sequence_descriptor_p^.sequence_type <>
          rac$packing_list_sequence THEN
      osp$set_status_abnormal ('RA', rae$invalid_packing_list,
            installation_control_record.processing_header_p^.packing_list_name, status);
      osp$append_status_file (osc$status_parameter_delimiter, installation_database.
            path (1, installation_database.size), status);
      RETURN;
    IFEND;

    IF installation_control_record.packing_list_pointers.sequence_descriptor_p^.sequence_level <>
          rac$packing_list_level THEN
      osp$set_status_abnormal ('RA', rae$incompatible_sequence_level, 'PACKING LIST', status);
      osp$append_status_parameter (osc$status_parameter_delimiter,
            installation_control_record.packing_list_pointers.sequence_descriptor_p^.sequence_level, status);
      RETURN;
    IFEND;

    IF installation_control_record.packing_list_pointers.sequence_descriptor_p^.processor_version <>
          rac$pacs_processor_version THEN
      osp$set_status_abnormal ('RA', rae$different_processor_version, 'PACKING LIST', local_status);
      osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], local_status, ignore_status);
    IFEND;

    NEXT installation_control_record.packing_list_pointers.header_p IN
          installation_control_record.packing_list_pointers.sequence_p;
    IF installation_control_record.packing_list_pointers.header_p = NIL THEN
      osp$set_status_abnormal ('RA', rae$unexpected_eof_packing_list,
            installation_control_record.processing_header_p^.packing_list_name, status);
      osp$append_status_file (osc$status_parameter_delimiter, installation_database.
            path (1, installation_database.size), status);
      RETURN;
    IFEND;

    installation_control_record.packing_list_pointers.order_medium :=
          installation_control_record.packing_list_pointers.header_p^.order_medium;

    IF installation_control_record.packing_list_pointers.order_medium = rac$tape THEN

      installation_control_record.packing_list_pointers.tape_subproduct_indexer_p :=
            #PTR (installation_control_record.packing_list_pointers.header_p^.tape_subproduct_indexer_p,
            installation_control_record.packing_list_pointers.sequence_p^);

      installation_control_record.packing_list_pointers.tape_vsns_p :=
            #PTR (installation_control_record.packing_list_pointers.header_p^.tape_vsns_p,
            installation_control_record.packing_list_pointers.sequence_p^);

    ELSE { order medium = rac$disk }

      installation_control_record.packing_list_pointers.disk_subproduct_indexer_p :=
            #PTR (installation_control_record.packing_list_pointers.header_p^.disk_subproduct_indexer_p,
            installation_control_record.packing_list_pointers.sequence_p^);

    IFEND;

  PROCEND rap$establish_icr_packlist_ptrs;

MODEND ram$establish_icr_packlist_ptrs;
