Google
 

Trailing-Edge - PDP-10 Archives - TOPS-20_V6.1_DECnetSrc_7-23-85 - mcb/utilities/lbr20.bli
There is 1 other file named lbr20.bli in the archive. Click here to see a list.
MODULE LBR20 (					!Librarian Utility
		IDENT = '001030',
		LANGUAGE (BLISS36) ,
		MAIN = LBR20
		) =
BEGIN
!
!
!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    DIGITAL EQUIPMENT CORPORATION
!                        Maynard, Massachusetts
!
!     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: LBR20 - Librarian Utility
!
! ABSTRACT:
!
!
!	This is the root module for the librarian.
!
!
! ENVIRONMENT: ANY
!
! AUTHOR: ALAN D. PECKHAM, CREATION DATE: 2-MAY-80
!
! MODIFIED BY:
!
!	Alan D. Peckham, : VERSION 01
! 02	- Add COMPRESS function
! 03    - Add support for EPT replacement in FILE_INSERT.
!--

!
! TABLE OF CONTENTS:
!

FORWARD ROUTINE
    LBR20 : NOVALUE;				!LBR20 main routines.

!
! INCLUDE FILES
!

LIBRARY 'LBRCOM';				!LBR20 COMMON DEFINITIONS

!
! MACROS:
!

MACRO
    SUPPORT_STRING =
	%CHAR(LBR_SUPPORT), %,
    VERSION_STRING =
	%NUMBER(LBR_VERSION), %,
    UPDATE_STRING =
	%IF LBR_UPDATE NEQ 0
	%THEN %STRING('.', %NUMBER (LBR_UPDATE)), %FI %,
    EDIT_STRING =
	%IF LBR_EDIT NEQ 0
	%THEN %STRING('-', %NUMBER (LBR_EDIT)), %FI %,
    VERSION_DISPLAY =
	%STRING(SUPPORT_STRING VERSION_STRING UPDATE_STRING EDIT_STRING) %;

!
! EQUATED SYMBOLS:
!

BIND
    VERSION = CH$ASCII ('Version ', VERSION_DISPLAY),
    LENGTH = %CHARCOUNT ('Version ', VERSION_DISPLAY);

GLOBAL BIND
    VERPTR = CH$ASCII (VERSION_DISPLAY),
    VERLNG = %CHARCOUNT (VERSION_DISPLAY);

!
! OWN STORAGE:
!

GLOBAL
    FLAGS : BITVECTOR [M_MAX_BITS],		!Processing flags.
    GBLNAM : BLOCKVECTOR [LBR_MAX_GLOBAL_DELETES, 2],
    GBLNUM : INITIAL (0),
    LIBBLK : INITIAL (0),
    LIBEPT : INITIAL (0),
    LIBHDR : INITIAL (0),
    LIBMNT : INITIAL (0),
    LSTBLK : INITIAL (0),
    MODNAM : BLOCKVECTOR [LBR_MAX_MODULE_DELETES, 2],
    MODNUM : INITIAL (0),
    NUMEPT : INITIAL (0),
    NUMMNT : INITIAL (0),
    OBJBLK : VECTOR [LBR_MAX_OBJ] INITIAL (REP LBR_MAX_OBJ OF (0)),
    OBJFLG : BLOCKVECTOR [LBR_MAX_OBJ, F_MAX],
    OBJNUM : INITIAL (0),
    SIZFIL : INITIAL (0),
    TTYBLK : INITIAL (0);

!
! EXTERNAL REFERENCES:
!

EXTERNAL ROUTINE
    CLOSE,					!Close a file.
    CMD,					!Get a user command.
    ENTRY_DELETE,				!Delete an entry point
    FILE_INSERT,				!Insert modules in the library.
    HELP : NOVALUE,				!Give the user help.
    LIBCLS : NOVALUE,				!Close the library.
    LIBOPN,					!Open the library.
    LIBUPD : NOVALUE,				!Update HDR, EPT and MNT.
    LIST : NOVALUE,				!List the library.
    LSTOPN,					!Initialize the listing device.
    MODULE_DELETE,				!Delete a module
    TTYOPN : NOVALUE,				!Initialize the user's terminal.
    TYPE : NOVALUE;				!Display a line on the user's tty.
ROUTINE LBR20 : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!
!
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS
!
!	NONE
!
!--

    BEGIN
    TTYOPN (TTYBLK);				!Get the user's tty.

    DO
	BEGIN

	IF CMD ()
	THEN
	    BEGIN
	    !
	    ! Open or create the library
	    !

	    IF LIBOPN (LIBBLK)
	    THEN
		BEGIN

		!
		! Delete modules
		!

		IF .MODNUM GTR 0
		THEN
		    BEGIN

		    INCR INDEX FROM 0 TO .MODNUM - 1 DO

			IF NOT MODULE_DELETE (MODNAM [.INDEX, 0, 0, 16, 0])
			THEN
			    EXITLOOP;

		    END;

		!
		! Delete entry points
		!

		IF .GBLNUM GTR 0
		THEN
		    BEGIN

		    INCR INDEX FROM 0 TO .GBLNUM - 1 DO

			IF NOT ENTRY_DELETE (GBLNAM [.INDEX, 0, 0, 16, 0])
			THEN
			    EXITLOOP;

		    END;

		!
		! Insert and replace modules
		!

		IF .OBJNUM GTR 0
		THEN
		    BEGIN

		    LOCAL
			ABORT;

		    ABORT = FALSE;

		    INCR INDEX FROM 0 TO .OBJNUM - 1 DO
			BEGIN

			IF .ABORT
			THEN
			    CLOSE (OBJBLK [.INDEX])
			ELSE

			    IF NOT FILE_INSERT (OBJBLK [.INDEX],
				    .OBJFLG [.INDEX, F_REPLACE],
				    NOT .OBJFLG [.INDEX, F_NOEPT],
				    .OBJFLG [.INDEX, F_RG],
				    .OBJFLG [.INDEX, F_SS])
			    THEN
				ABORT = TRUE;

			END;

		    OBJNUM = 0;
		    END;

                IF .FLAGS [M_FAST] THEN LIBUPD ();

		!
		! List the library
		!

		IF .FLAGS [M_LIST]
		THEN
		    BEGIN
		    LSTOPN (LSTBLK, .FLAGS [M_WIDE], LIBBLK);
		    LIST (LIBBLK);
		    CLOSE (LSTBLK);
		    END;

		LIBCLS ();
		END
	    ELSE
		CLOSE (LIBBLK);

	    END;

	!+
	! Give the LBR20 version number
	!-

	IF .FLAGS [M_VERSION] THEN TYPE (VERSION, LENGTH);

	!+
	! Give the user help
	!-

	IF .FLAGS [M_HELP] THEN HELP (TTYBLK, CH$ASCIZ ('HLP:LBR20.HLP'));

	END
    WHILE NOT .FLAGS [M_EXIT];

    END;					!OF LBR20
END

ELUDOM