Google
 

Trailing-Edge - PDP-10 Archives - CFS_TSU04_19910205_1of1 - update/t20src/diummp.bli
There are 4 other files named diummp.bli in the archive. Click here to see a list.
%TITLE 'Portals to MOVE-MATCHING/MOVE-OTHERS-MATCHING Transform Routines'
MODULE DIUMMP(
       IDENT='253'
       %BLISS32 (,
                 ADDRESSING_MODE(EXTERNAL=GENERAL,NONEXTERNAL=LONG_RELATIVE)
                )
       %BLISS36 (,
                 ENTRY (movmat, deftra)
                )
                               ) = 
BEGIN
!++
!	COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1986.
!	ALL RIGHTS RESERVED.
!
!	THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY  BE  USED  AND
!	COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH
!	THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE  OR
!	ANY  OTHER  COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE
!	AVAILABLE TO ANY OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE
!	SOFTWARE IS HEREBY TRANSFERRED.
!
!	THE INFORMATION IN THIS SOFTWARE IS  SUBJECT  TO  CHANGE  WITHOUT
!	NOTICE  AND  SHOULD  NOT  BE CONSTRUED AS A COMMITMENT BY DIGITAL
!	EQUIPMENT CORPORATION.
!
!	DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF
!	ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
!
! FACILITY:	DIU    Data Interchange Utility  V01-000
!
! ABSTRACT:	Portal to the routines which generate default
!		move-matching and move-others-matching transforms.
!
! AUTHOR:	Sandy Clemens, Creation Date:  25-Oct-84
!
! EDIT HISTORY:
!
!       3	Clean up copyright notices.  Change LIBRARY 'DIUMSG' to
!               'DIU'.  Clean up condition handling.  Remove some of the
!               debugging calls to DIU$DUMP_TRANSFORM.  Fix dot bug in
!		DIU$DEF_TRANS.
!		Sandy Clemens	14-Jun-85
!
!       10	Make default transform generation code use the DIU top level
!               condition handler rather than DIU$TRANS_HANDLER.
!               Sandy Clemens	20-Jun-85
!
!  236  Change library of DIXLIB to DIUDIX.
!       Sandy Clemens  19-Jun-86
!
!  253  Change libraries to new names.
!       Gregory A. Scott 1-Jul-86
!--
!***************************************************"*:**************
!           L I B R A R Y   A N D   R E Q U I R E    F I L E S
!********************************************************************
%IF %BLISS (BLISS32)
%THEN
     LIBRARY 'SYS$LIBRARY:XPORT';       ! XPORT definitions
     UNDECLARE %QUOTE $STRING;
     LIBRARY 'SYS$LIBRARY:STARLET';     ! VMS System Services
     LIBRARY 'DIU$SOURCE_LIB:DIUVMS';	! DIU VMS Specifics
     LIBRARY 'DIU$SOURCE_LIB:DIUMSG';	! DIU MESSAGE Literals
%FI

%IF %BLISS (BLISS36)
%THEN
     LIBRARY 'BLI:XPORT';               ! XPORT definitions
     LIBRARY 'FAOPUT';                  ! Defines $FAO_PUT macro
     LIBRARY 'FAO';
     LIBRARY 'DIU';
%FI

UNDECLARE %QUOTE $DESCRIPTOR;
LIBRARY 'DIUCRX';                       ! CRX data structures
UNDECLARE %QUOTE $DESCRIPTOR;
LIBRARY 'DIUTLB';			! DIU Transform structure
UNDECLARE %QUOTE $DESCRIPTOR;
UNDECLARE %QUOTE STS$K_SEVERE, %QUOTE STS$K_ERROR, %QUOTE STS$K_WARNING,
          %QUOTE STS$K_SUCCESS, %QUOTE SS$_NORMAL, %QUOTE STS$K_INFO;
LIBRARY 'DIUDIX';			! DIX/DIL specific things
LIBRARY 'DIUMLB';			! DIU Mapping routines library

EXTERNAL ROUTINE
	DIU$DUMP_TRANSFORM,
	DIU$CLEAN_TRANS,
	DIU$MATCH_TRANS,
	DIU$TRAVERSE_TREE,
	DIU$DEL_TRANS_LIST;
!******************************************************************
!                    D I U $ M O V E _ M A T
!******************************************************************
GLOBAL ROUTINE DIU$MOVE_MAT (mm_flg,src_tree,dst_tree,trans,dimsrc,dimdst) =
BEGIN
!++
! FUNCTIONAL DESCRIPTION
!
!	This routine is the portal to the routines which generate
!       default move-matching and move-others-matching transforms.
!       This routine can be called with subtrees and/or to perform
!       a move-matching on a structure, etc.
!
! FORMAL PARAMETERS
!
!	mm_flg		is a flag which indicates either move_matching
!			or move_others_matching
!
!	src_tree	is the address of the record description
!			tree or subtree for the source record
!
!	dst_tree	is the address of the record description
!			tree or subtree for the destination record
!
!       trans           location where the address of the first transform
!                       nodes should be returned
!
!       dimsrc          is the address of the current DIMS node which
!                       applies to the source record description subtree
!                       or 0 if none
!
!       dimdst          is the address of the current DIMS node which
!                       applies to the destination record description
!                       subtree or 0 if none
!
!                       
! IMPLICIT PARAMETERS
!
!	None
!
! ROUTINE VALUE
!
!	STATUS; ALSO modifys address passed in parameter TRANS
!
!--

BIND    transform_list = .trans,
        s_tree = .src_tree,
        d_tree = .dst_tree,
        p_srcdim = .dimsrc,
        p_dstdim = .dimdst;

LOCAL   status : INITIAL(0),
        dst_trans_lst : INITIAL (0);

!++
! Traverse the source record description tree and create
! a default transform.
!--
status = DIU$TRAVERSE_TREE (s_tree, transform_list, .mm_flg, p_srcdim);
IF NOT .status
THEN RETURN(.status);

!++
! Traverse the destination record description tree and create
! a default transform.
!--
status = DIU$TRAVERSE_TREE (d_tree, dst_trans_lst, .mm_flg, p_dstdim);
IF NOT .status
THEN RETURN(.status);

!++
! Call DIU$MATCH_TRANS to match up the two transforms and find fields
! which can be moved with move-matching / move-others-matching.
!--
status = DIU$MATCH_TRANS(.transform_list, .dst_trans_lst);
IF NOT .status
THEN RETURN (.status);

!++
! Release the memory used by the temporary transform structure which
! is only needed until the "matching" is done by routine DIU$MATCH_TRANS.
!--
DIU$DEL_TRANS_LIST (.dst_trans_lst);

!++
! Call DIU$CLEAN_TRANS to remove any fields from the transform which
! weren't "matched" by the DIU$MATCH_TRANS routine.
!--
transform_list = DIU$CLEAN_TRANS (.transform_list);

%IF diu$k_tra_debug                     ! debug code
%THEN
     $FAO_PUT (1, ' ');
     $FAO_PUT (1, ' ');
     $FAO_PUT (1, 'FINAL TRANSFORM STRUCTURE: ');
     DIU$DUMP_TRANSFORM (.transform_list);
%FI

RETURN DIU$_NORMAL;                     ! return normal status

END;
!******************************************************************
!                    D I U $ D E F _ T R A N S
!******************************************************************
GLOBAL ROUTINE DIU$DEF_TRANS (stree,dtree,trans) =
BEGIN
!++
! FUNCTIONAL DESCRIPTION
!
!	This routine is a portal to the routines which generate
!       default transforms.  This routine should not be used to
!       generate transforms for subtrees and cannot be used for
!       move-others-matching -- it assumes move-matching!  This
!       routine simply calls DIU$MOVE_MAT with default parameters...
!
! FORMAL PARAMETERS
!
!	stree   	is the address of the record description
!			tree or subtree for the source record
!
!	dtree   	is the address of the record description
!			tree or subtree for the destination record
!
!       trans           location where the address of the first transform
!                       nodes should be returned
!
!                       
! IMPLICIT PARAMETERS
!
!	None
!
! ROUTINE VALUE
!
!	STATUS; ALSO modifys address passed in parameter TRANS
!
!--

LOCAL mm_flg : INITIAL (DIU$K_MOV_MAT),
      dims_src : INITIAL (0),
      dims_dst : INITIAL (0),
      status : INITIAL (0);

!++
! In case there is still a trans list hanging around, get rid of it at this
! point -- we should be starting fresh at this point!!
!--
IF ..trans NEQ 0
THEN DIU$DEL_TRANS_LIST (..trans);
.trans = 0;

!++
! call move-matching portal with correct "default" parameters...
!--
status = DIU$MOVE_MAT (.mm_flg, .stree, .dtree, .trans,
                       .dims_src, .dims_dst);

IF NOT .status
THEN RETURN (.status);

RETURN DIU$_NORMAL;

END;

END
ELUDOM