Google
 

Trailing-Edge - PDP-10 Archives - BB-FB49A-RM - sources/dbgtrb.r36
There are no other files named dbgtrb.r36 in the archive.
%title 'SNT SNA Gateway Access Interface for Bliss     Version 1.00'

! Copyright (c) 1984, 1985 by
! 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:	DECnet/SNA TOPS-20 Trace Protocol Utility.
!
! ABSTRACT:	This module provides SNA Gateway access routines
!               for Bliss.
!
! ENVIRONMENT:	TOPS-20 Operating Systems, user mode.
!
! AUTHOR:       Dennis Brannon,               CREATION DATE: December 7,1983
!
! MODIFIED BY:
!
! 	D. Brannon, 10-Oct-84 : VERSION 1.00
! 
!--
!++
%sbttl 'Supporting Macros'

literal
    DEBUG_BUFFER_LEN = 128;              ! Maximum debug message length

macro $INITIALIZE (BLOCK, BLOCK_SIZE) =
    ch$fill (0, BLOCK_SIZE, ch$ptr (BLOCK,,36)) %;

macro $ASSIGN (ARG1, ARG2) =
    %if not %null (ARG2)
    %then ARG1 = ARG2 %fi %;

macro $VASSIGN (ARG1, ARG2) =
    %if not %null (ARG2)
    %then ARG1 = .ARG2 %fi %;

macro $RETURN (ARG1, ARG2) =
    %if not %null (ARG1)
    %then ARG1 = ARG2 %fi %;

macro $TRACE (ARG, PAT) =
    %if not %null (ARG)
    %then
    begin
    local DEBUG_BUFFER: CH$SEQUENCE (DEBUG_BUFFER_LEN),
	  POINTER;
    external routine
        TXT$WRITE;

    if .CONTROL[GCB_DEBUG_CALLS]
    then
        begin
        POINTER = ch$ptr (DEBUG_BUFFER);
        TXT_WRITE (POINTER,
                   DEBUG_BUFFER_LEN,
                   PAT,
                   ARG);
        GLX$K_SOUT (DEBUG_BUFFER);
        end;
    end %fi %;
%sbttl 'SNTINI - Initialize a Trace'

keywordmacro SNTINI (GATEWAY_NAME = 0,
                     INTERRUPT_CHANNEL = 0,
                     WORK_AREA = 0,
                     RETURN_DATA_ADDRESS = 0,
                     RETURN_DATA_SIZE = 0,
                     RETURN_PROTOCOL_CODE = 0,
                     RETURN_CODE = 0) =
    begin
    local INIBLK: ARGUMENT_BLOCK;
    external routine
        R_INI: MAC novalue;

    $INITIALIZE (INIBLK, ARGUMENT_BLOCK_SIZE);
    $TRACE (, ' Call to R_INI%/');

    $ASSIGN (INIBLK[INI_GATEWAY_NAME], GATEWAY_NAME);
!    $TRACE (.INIBLK[INI_GATEWAY_NAME], '  Gateway_name = %a%/');
    $ASSIGN (INIBLK[INI_WORK_AREA], WORK_AREA);
!    $TRACE (.INIBLK[INI_WORK_AREA], '  Work_area = %O%/');
    $ASSIGN (INIBLK[INI_INTERRUPT_CHANNEL], INTERRUPT_CHANNEL);
!    $TRACE (.INIBLK[INI_INTERRUPT_CHANNEL], '  Interrupt_channel = %M.%/');

    R_INI (INIBLK);

    $RETURN (RETURN_CODE, .INIBLK[INI_RETURN_CODE]);
!    $TRACE (.RETURN_CODE, '%/  Return code = %D.%/');
    $RETURN (RETURN_PROTOCOL_CODE, .INIBLK[INI_RETURN_PROTOCOL_CODE]);
!    $TRACE (.RETURN_PROTOCOL_CODE, '  Return protocol code = %D.%/');
    $RETURN (RETURN_DATA_SIZE, .INIBLK[INI_RETURN_DATA_SIZE]);
!    $TRACE (.RETURN_DATA_SIZE, '  Return data size = %D.%/');
    $RETURN (RETURN_DATA_ADDRESS, .INIBLK[INI_RETURN_DATA_ADDRESS]);
!    $TRACE (.RETURN_DATA_ADDRESS, '  Return data at = %O%/');

    end %;
%sbttl 'SNTRSP - Service Trace Server Response'

keywordmacro SNTRSP (FLAGS = 0,
                     RETURN_DATA_ADDRESS = 0,
                     RETURN_DATA_SIZE = 0,
                     RETURN_PROTOCOL_CODE = 0,
                     RETURN_CODE = 0) =
    begin
    local RSPBLK: ARGUMENT_BLOCK;
    external routine
        R_RSP: MAC novalue;

    $INITIALIZE (RSPBLK, ARGUMENT_BLOCK_SIZE);
    $TRACE (, ' Call to R_RSP%/');

    $ASSIGN (RSPBLK[RSP_FLAGS], FLAGS);

    R_RSP (RSPBLK);

    $RETURN (RETURN_CODE, .RSPBLK[RSP_RETURN_CODE]);
!    $TRACE (.RETURN_CODE, '%/  Return code = %D.%/');
    $RETURN (RETURN_PROTOCOL_CODE, .RSPBLK[RSP_RETURN_PROTOCOL_CODE]);
!    $TRACE (.RETURN_PROTOCOL_CODE, '  Return protocol code = %D.%/');
    $RETURN (RETURN_DATA_SIZE, .RSPBLK[RSP_RETURN_DATA_SIZE]);
!    $TRACE (.RETURN_DATA_SIZE, '  Return data size = %D.%/');
    $RETURN (RETURN_DATA_ADDRESS, .RSPBLK[RSP_RETURN_DATA_ADDRESS]);
!    $TRACE (.RETURN_DATA_ADDRESS, '  Return data at = %O%/');

    end %;
! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: