Google
 

Trailing-Edge - PDP-10 Archives - tops20tools_v6_9-jan-86_dumper - tools/recog3/hlp.r32
There are 3 other files named hlp.r32 in the archive. Click here to see a list.
! HLP.R32 prefix file.
!
!	IDENT=V00A01
!
!			  COPYRIGHT (C) 1982 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!
! 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:  HELP
!
! ABSTRACT:
!
!	Contains macros and symbol definitions useful for HLP modules.
!
! ENVIRONMENT:
!
!	Runs under VMS.
!
! AUTHOR:  Stanley Rabinowitz,	 CREATION DATE:  25-Dec-81
!
! MODIFIED BY:
!
!  Stanley Rabinowitz
!  01	- Original version
!
!--
!+
! To initialize each module for correct addressing mode of
! all external references, plits and owns.
!-

SWITCHES

	ADDRESSING_MODE (
		EXTERNAL	= GENERAL,
		NONEXTERNAL	= WORD_RELATIVE);

PSECT

	OWN	= $OWN$ (ADDRESSING_MODE (LONG_RELATIVE) ),
	GLOBAL	= $GLOBAL$ (ADDRESSING_MODE (LONG_RELATIVE) ),
	PLIT	= $PLIT$ (ADDRESSING_MODE (LONG_RELATIVE) );

LIBRARY 'SYS$LIBRARY:LIB';
undeclare %quote $descriptor;
LIBRARY 'SYS$LIBRARY:XPORT';

$FIELD	! TEST

CS_FIELDS =

SET
CS$B_LENGTH	= [$BYTE],
CS$T_STRING	= [$BYTE]	! [$SUB_BLOCK]
TES;

undeclare %quote $descriptor;
LIBRARY 'HELPUSER';

MACRO

	$CAB_ERR[]=SIGNAL(%REMAINING) %,
	$PAB_ERR[]=SIGNAL(%REMAINING) %,
	$BACKUP	= LIB$$HLP$BACKUP(CAB) %,

	$CHAR(HELP_RTN,RECOG_RTN,PABADR) =
		LIB$$HLP$CHAR(%IF %NULL(PABADR)
			  %THEN	PAB
			  %ELSE PABADR
			%FI,
			HELP_RTN,RECOG_RTN) %,

	$UCHAR(HELP_RTN,RECOG_RTN,PABADR) =
		LIB$$HLP$UCHAR(%IF %NULL(PABADR)
			  %THEN	PAB
			  %ELSE PABADR
			%FI,
			HELP_RTN,RECOG_RTN) %,

	$CONTINUE_RECOG =
		IF .CAB[CAB$V_REC]
		  THEN	BEGIN
			CAB[CAB$V_REC]=FALSE;
			CAB[CAB$V_PFR]=TRUE
			END
	%;

LITERAL XYZ=1;

MACRO	$COUNTED_STRING	= BLOCK FIELD(CS_FIELDS) %;

MACRO

    CSDESCR(ACS) =

	BEGIN

	OWN D : VECTOR[2];			! not AST re-entrant!
	BIND CS = ACS: $COUNTED_STRING;

	D[0]=.CS[CS$B_LENGTH];
	D[1]= CS[CS$T_STRING];

	D

	END

	%;

KEYWORDMACRO

    $TIO(CAB,TRMBLK=TERMINATOR_BLOCK) =

	BEGIN
	EXTERNAL ROUTINE LIB$$HLP$GET_INPUT;
	OWN	TERMINATOR_BITS		: BITVECTOR[16*8],	! List of valid terminators
		TERMINATOR_BLOCK	: VECTOR[2] INITIAL(16,TERMINATOR_BITS);
	INCR I FROM 0 TO 31 DO TERMINATOR_BITS[.I]=1;
	TERMINATOR_BITS['?']	= 1;
	TERMINATOR_BITS[127]	= 1;	! DELETE
	LIB$$HLP$GET_INPUT(CAB,TRMBLK)
	END

    %;

MACRO

    $OUT(BUF_DESC,FLAG) =

	BEGIN
	EXTERNAL ROUTINE LIB$$HLP$DEFAULT_OUTPUT;
	BIND ROUTINE

		OUT_ROUTINE = (IF .CAB[CAB$A_PUT] NEQ 0
				THEN .CAB[CAB$A_PUT]
				ELSE  LIB$$HLP$DEFAULT_OUTPUT);

	OUT_ROUTINE(BUF_DESC,
		%IF %NULL(FLAG)
		  %THEN HLP$K_HELP_LINE
		  %ELSE FLAG
		%FI,
		CAB)
	END

    %,

    $SPACES =

	BEGIN
	BIND

		CHAR	=  CAB[CAB$B_TRM]	: BYTE,
		INI	=  CAB[CAB$W_FLD_PTR]	: WORD,
		CLN	=  CAB[CAB$W_CLN]	: WORD,
		PTR	=  CAB[CAB$W_PTR]	: WORD;

	OWN	SPACE_PAB	: $PAB(	CAB=0,
					TYP=TOKEN,
					ARG=%ASCID ' ',
					DEF=%ASCID ' ');

	INI=.PTR;
	SPACE_PAB[PAB$A_CAB]=CAB;
	CHAR = $CHAR(0,LIB$$TOKEN_RECOG,SPACE_PAB);
	IF .CHAR NEQ %C' ' AND .CHAR NEQ 9
	  THEN	$BACKUP
	  ELSE	$OPT_SPACES;
!	WHILE 1 DO
!		BEGIN
!		INI=.PTR;
!		CHAR = $CHAR(0,LIB$$TOKEN_RECOG,SPACE_PAB);
!		IF .CHAR NEQ %C' ' AND .CHAR NEQ 9
!		  THEN	BEGIN
!			$BACKUP;
!			EXITLOOP;
!			END;
!		IF .CAB[CAB$V_REC] AND (.PTR EQL .CLN)
!		  THEN EXITLOOP
!		END;
	END

    %,

    $OPT_SPACES =

	BEGIN
	BIND

		CHAR	=  CAB[CAB$B_TRM]	: BYTE,
		INI	=  CAB[CAB$W_FLD_PTR]	: WORD,
		PTR	=  CAB[CAB$W_PTR]	: WORD;

	OWN

		DUMMY_PAB	: $PAB(CAB=0);

	DUMMY_PAB[PAB$A_CAB]=CAB;

	WHILE 1 DO
		BEGIN
		CHAR = $CHAR(0,0,DUMMY_PAB);
		IF .CHAR NEQ %C' ' AND .CHAR NEQ 9
		  THEN	EXITLOOP
		END;
	$BACKUP;
	INI=.PTR
	END

    %;

LITERAL

	HLP$BRIEF	= 1,
	HLP$FULL	= 2;

LITERAL

	HLP$K_RECOGNIZE	= 27,	! 9 to Use TAB as the recognition character
	HLP$K_HELP	= %C'?',! Use "?" as the help key
	HLP$K_DELIM	= 1;

! Values returned by WILDMAN:

LITERAL

	WILD$K_FULL	= 1,	! did complete recognition
	WILD$K_SOME	= 2,	! did partial  recognition
	WILD$K_NONE	= 3;	! no names matched at all

LITERAL

	TRUE	=	(1 EQL 1),
	FALSE	=	(1 EQL 2);

! End of require file.