Google
 

Trailing-Edge - PDP-10 Archives - BB-H138F-BM_1988 - 7-sources/wfrbukt.bli
There are 10 other files named wfrbukt.bli in the archive. Click here to see a list.
 %TITLE 'WFRBUKT - make a bucket current'
MODULE WFRBUKT (				! make a bucket the current bucket
		IDENT = '3-001'			! File: WFRBUKT.BLI Edit: CJG3001
		) =
BEGIN
!COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1981, 1988.  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:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	Make a specified bucket the current bucket.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: October 16, 1978
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 23-Feb-1981.  This module was created by
!	extracting routine READ_BUKT from module EDTWF.
! 1-002	- regularize headers.  JBS 19-Mar-1981
! 1-003 - Modify to use EDT$WORKIO. STS 15-Feb-1982
! 1-004 - Add literals for callable parameters. STS 08-Mar-1982
! 3-001 - Remove call to EDT$$CALLWIO. CJG 13-Jun-1983
!--

%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$WF_MAKECUR : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$WF_MAKECUR  - make a bucket current'

GLOBAL ROUTINE EDT$$WF_MAKECUR (		! Make a specified bucket the current bucket
	BUKT_NUM				! Number of the bucket to make current
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine insures that the bucket number passed as a parameter is the
!	current bucket.  If it is not already the current bucket then return the
!	current bucket to the cache (marking it as modified if necessary) and
!	make the new bucket current by bringing it into the cache if necessary.
!
! FORMAL PARAMETERS:
!
!  BUKT_NUM 		the number of the bucket to read.
!
! IMPLICIT INPUTS:
!
!	WF_DESC
!	WK_BUK
!	WK_CURBUK
!	WK_MODFD
!
! IMPLICIT OUTPUTS:
!
!	WF_DESC
!	WK_BUK
!	WK_CURBUK
!	WK_MODFD
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	May write and read the work file, especially if the cache is small.
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$WF_RD : NOVALUE,		! Read from work file
	EDT$$WF_WR : NOVALUE;		! Write to work file

    EXTERNAL
	WF_DESC : BLOCK,		! descriptor for workfile record
	WK_BUK : 			! Pointer to current bucket
	    REF BLOCK [WF_BUKT_SIZE] FIELD (WFB_FIELDS),
	WK_CURBUK,			! Number of the current bucket
	WK_MODFD;			! Flag indicating bucket was modified

!+
! Do not read if we are reading the current bucket
!-

    IF (.WK_CURBUK NEQ .BUKT_NUM)
    THEN
	BEGIN
!+
! Mark the current bucket as modified, if it has been.
!-

	IF .WK_MODFD THEN EDT$$WF_WR (.WK_CURBUK, WF_DESC);

!+
! Read the new bucket, possibly from the cache.
!-
	WK_CURBUK = .BUKT_NUM;
	EDT$$WF_RD (.WK_CURBUK, WF_DESC);
	WK_BUK = .WF_DESC[DSC$A_POINTER];	! get address of record
!+
! The new bucket has not yet been modified.
!-
	WK_MODFD = 0;
	END;

    END;


END
ELUDOM