Google
 

Trailing-Edge - PDP-10 Archives - bb-h138e-bm_tops20_v6_1_distr - 6-1-sources/final.bli
There are 11 other files named final.bli in the archive. Click here to see a list.
 %TITLE 'FINAL - end of EDT processing'
MODULE FINAL (				! End of EDT processing
		IDENT = '3-003'			! File: FINAL.BLI Edit: GB3003
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!		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 WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	End of EDT processing.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: August 6, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 18-FEB-1981.  This module was created by
!	extracting routine EDT$$TERMIN  from module TINPUT.
! 1-002	- Regularize headers and call EDT$$WF_CLS  to close the work file.
!	   JBS 19-Feb-1981
! 1-003	- Fix module name and file name.  JBS 04-Mar-1981
! 1-004	- Fix the file name.  JBS 11-Mar-1981
! 1-005	- Change SY_EXIT to EDT$$SYS_EXI .  JBS 31-Mar-1981
! 1-006 - Change the handling of deleting the journal file. STS 18-Jan-1982
! 1-007 - Use routine EDT$WORKIO to close workfile. STS 08-Feb-1982
! 1-008 - Deallocate workfile descriptor, WF_DESC. STS 15-Feb-1982
! 1-009 - Add literals for callable parameters. STS 08-Mar-1982
! 1-010	- Don't reference JOU.  JBS 23-Mar-1982
! 1-011 - Check for open files and close them. STS 07-Apr-1982
! 1-012	- Print messages on CLOSE errors.  JBS 12-Apr-1982
! 1-013 - Add a close of the help file for VMS.  SMB 28-May-1982
! 1-014	- Print a better message if the work file fails to close.  JBS 01-Jun-1982
! 1-015 - Restore the original terminal width if changed. STS 08-Jul-1982
! 1-016	- Fix the PDP-11 external declarations for edit 1-015.  JBS 10-Jul-1982
! 1-017 - Call a routine to reset the screen width.  SMB 29-Jul-1982
! 1-018 - Make use of the bit masks in the options word. STS 17-Aug-1982
! 1-019	- Fix up references to EDT$M_ symbols.  JBS 23-Aug-1982
! 1-020 - Make sure everything is put to journal file. STS 08-Oct-1982
! 1-021 - Remove the deallocation of edt$$z_wf_desc. STS 11-Nov-1982
! 1-022 - Only set the screen width back if it has changed.  SMB 17-Feb-1982
! 3-001 - Modify for TOPS-20. CJG 19-Apr-1983
! 3-002 - Add updates from V3 source kit.  GB 27-Apr-1983
! 3-003 - Remove call to EDT$$CALLFIO, and EDT$$CALLWIO. CJG 10-Jun-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$TERMIN;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

REQUIRE 'SYS:JSYS';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!

EXTERNAL LITERAL
    EDT$M_NOJOURNAL,
    EDT$K_INPUT_FILE,
    EDT$K_COMMAND_FILE,
    EDT$K_JOURNAL_FILE,
    EDT$K_CLOSE,
    EDT$K_CLOSE_DEL;

!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$TERMIN  - end of EDT processing'

GLOBAL ROUTINE EDT$$TERMIN 			! End of EDT processing
    =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Terminate EDT processing by cleaning things up.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	EXITD
!	OPTIONS
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	Same as EDT$$SYS_EXI
!
! SIDE EFFECTS:
!
!	Calls EDT$$SYS_EXI
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$FILEIO,
	EDT$$WF_CLS,
	EDT$$TI_RES,
	EDT$$OUT_FMTBUF,
	EDT$$SC_SETWID,
    	EDT$$TI_FLUSHJOUFI,
	EDT$$SYS_EXI,
	EDT$$FMT_MSG : NOVALUE,
	EDT$$FATAL_IOERR : NOVALUE;

    EXTERNAL
	HELP_SET,			! Help file JFN
	CMD_OPN,			! command file open flag
	EXITD,				! Editor exit flag.
	OPTIONS : BITVECTOR [32],	! Various flags
	TI_WID,				! Terminal's current width
	TI_RESET,			! Has the terminal been reset
	INPUT_OPN,			! main input file open flag
	SAV_TIWID,			! original terminal width
	TI_TYP;				! terminal type

    MESSAGES ((INPFILCLO, JOUFILCLO, COMFILCLO, HLPFILCLO));
!+
! Close the work file.  On VMS deallocate the record descriptor and
! close the Help File
!-

    IF (.HELP_SET NEQ 0)
    THEN
	IF ( NOT _RLJFN(.HELP_SET)) THEN EDT$$FMT_MSG (EDT$_HLPFILCLO);

!+
! Close the work file. If this fails, then EDT$WORKIO does not return.
!-

    EDT$$WF_CLS ();

    IF (.TI_RESET) THEN EDT$$TI_RES ();

    IF (.TI_WID NEQ .SAV_TIWID) THEN EDT$$SC_SETWID (.SAV_TIWID);


!+
! If the input file is still open, close it.
!-

    IF (.INPUT_OPN)
    THEN

	IF ( NOT (EDT$FILEIO (EDT$K_CLOSE, EDT$K_INPUT_FILE, 0)))
	    THEN EDT$$FATAL_IOERR (EDT$_INPFILCLO, -1);

!+
! If the command file is still open, close it.
!-

    IF .CMD_OPN
    THEN

	IF ( NOT (EDT$FILEIO (EDT$K_CLOSE, EDT$K_COMMAND_FILE, 0)))
	    THEN EDT$$FATAL_IOERR (EDT$_COMFILCLO, -1);

!+
! Close the journal file, deleting it if EXITD is 1.
! Failure to properly close the journal file is fatal.
!-

    IF ((.OPTIONS AND EDT$M_NOJOURNAL) EQL 0)	! NOT /NOJOURNAL
    THEN
	BEGIN

	LOCAL
	    CODE;

	IF (.EXITD EQL 1) THEN CODE = EDT$K_CLOSE_DEL ELSE CODE = EDT$K_CLOSE;

	IF ( NOT (EDT$FILEIO (.CODE, EDT$K_JOURNAL_FILE, 0)))
	    THEN EDT$$FATAL_IOERR (EDT$_JOUFILCLO, -1);

	END;

    RETURN (EDT$$SYS_EXI (0));
    END;					! of routine EDT$TERMIN


END
ELUDOM