Google
 

Trailing-Edge - PDP-10 Archives - BB-KL11L-BM_1990 - t20src/mxerr.r36
There are 16 other files named mxerr.r36 in the archive. Click here to see a list.
!	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1985, 1989.
!	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.
%title 'MXERR - Error message handler macros'
!++
! Facility: DECMAIL/MS - Message EXchange
!
! Abstract:
!          This set of macros is used to manipulate error strings used
!      by MX.
!
! Environment: Bliss 36,
!
! Author: Richard B. Waddington, Creation Date: October 8, 1984
!
!--
MACRO mx$errors =
        (
            MP$MKF, 'Missing key field',
            MP$SYN, 'Syntax error in line #%D of %A',
            MP$TEL, 'Extraneous text at end of line - "%A"',
            MP$UHF, 'Unsupported host format requested (Internal Error)',
            MQ$MHE, 'Message has expired',
            SP$UIE, 'Unexpected internal error',
            UF$ACF, 'Abort close failed',
            UF$FCF, 'File close failed for %A',
            UF$FRF, 'File read failed for %A',
            UF$FWF, 'File write failed for %A',
            UF$FOF, 'File open failed for %A',
            UF$CGP, 'Cannot get page',
            UF$IFA, 'Invalid file access attempted',
	    UF$IFS, 'Invalid file specification',
            UF$NSR, 'Non-sequential read attempted',
            UF$NSW, 'Non-sequential write attempted',
            UF$TLF, 'Table lookup failed',
            ER$MLE, 'Message level error occured in SERVER or SPOOLER',
            MX$NOM, 'Insufficient memory',
            MX$NOQ, 'Insufficient quota in %A',
            MG$NSU, '%A: No such user %A',
            MG$LTL, 'SMTP: Line too long',
            MG$UEC, 'SMTP: Unexpected command',
            MG$UIC, 'SMTP: Unimplemented command',
            MG$UNC, 'SMTP: Unknown command',
            MG$ARG, 'SMTP: Bad Argument',
            MG$NNK, '%A: Node %A is not known here',
            MG$MFC, 'SMTP: Mail File corrupted - Mail lost',
            MG$IPS, 'Insufficient privilege for sending mail to SYSTEM',
            MG$GPE, '%A: %I',       !Gen. Purpose Error
            SL$NSU, 'No such user %A',
            SL$NNK, 'Node %A is not known here',
            LS$DMF, 'Duplicate message files %A, %A',
            LS$NMF, 'Message file %A does not exist',
            LS$ICP, 'Invalid continuation packet',
            LS$ISP, 'Invalid sender pid',
            LS$ISU, 'Invalid sender uid',
            LS$INN, 'MX does not service node %A',
            LS$IDS, 'Invalid destination string %A',
            NW$ERR, 'Network error at node %A - %A',
            S2$ERR, 'Recipient %A -%/   %A',
            LS$UOQ, 'User %A was over quota',
            DN$INP, 'Invalid DECNET mail protocol',            
            LS$IHT, 'Invalid Scan_packet Header Type',
            LS$IRT, 'Invalid Scan_packet Record Type',
            UF$NQE, 'ENQ Error: %O',
            UF$CGL, 'Could not get lock',
            UF$DQE, 'DEQ Error: %O',
            UF$CFL, 'Could not free lock',
            UF$FPE, 'FILOP Error: %O',
            UF$FPF, 'FILOP failed',
            UF$FNF, 'File not found',
            UF$CNP, 'Could not parse',
            UF$LOK, 'file is locked',
            UF$LEN, 'Could not get length of %A',
            UFD$CR, 'Could not create searchlist for %A',
            LS$CCP, 'Could not create PID %A',
            MX$MZB, 'Message file %A contained zero bytes',
            MX$CTP, 'Could not translate POBOX:',
            MP$PLD, 'Path loop detected at node %A',
            FK$FAE, 'Fork already exists',
            FK$CCF, 'Cannot create fork',
            FK$GJF, 'GTJFN% failed while creating fork',
            FK$GEF, 'GET% failed while creating fork',
            FK$NFL, 'Fork not in FORK_LIST',
            FK$CSS, 'Could not start subfork',
            FK$STO, 'Subfork Timeout',
            NW$UTC, 'Unable to connect to node %A',
            NW$NRF, 'Network read failed. Node: %A',
            NW$NWF, 'Network write failed. Node: %A',
            NW$NFF, 'Remote system unable to forward. Node: %A',
            NW$RCF, 'Received connection from node %A'
          ) %;

%(318)% !Add DECnet disconnect codes
MACRO
    dn$errors =
        (
        $dcx0,  'Reject or disconnect by object',
        $dcx1,  'Resource allocation failure',
        $dcx2,  'Destination node does not exist',
        $dcx3,  'Remote node shutting down',
        $dcx4,  'Destination process does not exist',
        $dcx5,  'Invalid process name field',
        $dcx6,  'Object is busy',
        $dcx7,  'Unspecified error',
        $dcx8,  'Third party aborted link',
        $dcx9,  'User abort - asynchronous disconnect',
        $dcx10, 'Invalid node name',
        $dcx11, 'Local node shut down',
        dcxunk, 'unknown',       !12
        dcxunk, 'unknown',       !13
        dcxunk, 'unknown',       !14
        dcxunk, 'unknown',       !15
        dcxunk, 'unknown',       !16
        dcxunk, 'unknown',       !17
        dcxunk, 'unknown',       !18
        dcxunk, 'unknown',       !19
        dcxunk, 'unknown',       !20
        $dcx21, 'Connect initiate with illegal destination address',
        $dcx22, 'Connect confirm with illegal destination address',
        $dcx23, 'Connect initiate or connect confirm with zero source address',
        $dcx24, 'Flow control violation',
        dcxunk, 'unknown',       !25
        dcxunk, 'unknown',       !26
        dcxunk, 'unknown',       !27
        dcxunk, 'unknown',       !28
        dcxunk, 'unknown',       !29
        dcxunk, 'unknown',       !30
        dcxunk, 'unknown',       !31
        $dcx32, 'Too many connections to node',
        $dcx33, 'Too many connections to destination process',
        $dcx34, 'Access not permitted',
        $dcx35, 'Logical link services mismatch',
        $dcx36, 'Invalid account',
        $dcx37, 'Segment size too small',
        $dcx38, 'No response from destination, process aborted',
        $dcx39, 'No path to destination node',
        $dcx40, 'Link aborted due to data loss',
        $dcx41, 'Destination process does not exist',
        $dcx42, 'Confirmation of disconnect initiate',
        $dcx43, 'Image data field too long'
        ) %;

%(318)% !Define some DECnet related constants
LITERAL
    DCXUNK=12,
    MAX_DERR=43;

![318] Add ENQ. and DEQ. Errors for TOPS-10
%IF %SWITCHES(TOPS10) %THEN
MACRO
    nq$errors =
        (
        enqru_, 'At least one requested resource not available',
        enqbp_, 'Illegal number of pooled resources requested',
        enqbj_, 'Illegal job number',
        enqbb_, 'Illegal byte size for byte pointer',
        enqst_, 'ASCIZ string longer than 7 characters',
        enqbf_, 'Illegal function code',
        enqbl_, 'Illegal argument block length',
        enqic_, 'Illegal number of requests',
        enqbc_, 'Illegal channel number',
        enqpi_, 'JACCT or [1,2] privileges required',
        enqnc_, 'Not enough core available',
        enqfn_, 'Device not initialized or not a disk device',
        enqin_, 'Address for byte pointer indirect or indexed',
        enqno_, 'Cannot dequeue unowned resources',
        enqls_, 'Levels not in ascending order',
        enqcc_, 'Illegal modification of ownership',
        enqqe_, 'Enqueue quota exceeded',
        enqpd_, 'Number of resources in pool dissagrees%/ with number in your request',
        enqdr_, 'Duplicate request',
        enqne_, 'Not enqueued on this call',
        enqld_, 'Level in request does not match lock',
        enqed_, 'JP.ENQ privileges required',
        enqme_, 'Mask too long or lengths do not match',
        enqte_, 'Lock-associated block too long',
        enqab_, 'A resource that was requested has been marked as aborted',
        enqgf_, 'Attempt to ENQ. with EQ.FEL option on a "ghost file"'
        ) %;

LITERAL
    max_nqerr = enqgf_;    

![318] Add FILOP. errors for TOPS-10
MACRO
    fo$errors =
        (
        erfnf_, 'File not found',
        eripp_, 'The UFD does not exist on the specified file structure',
        erprt_, 'Protection failure',
        erfbm_, 'File currently being modified',
        eraef_, 'The specified file name already exists',
        erisu_, 'Illegal sequence of calls',
        ertrn_, 'Transmission, device, or data error',
        ernsf_, 'Not a save file',
        ernec_, 'Not enough core',
        erdna_, 'Device not available',
        ernsd_, 'No such device',
        erilu_, 'Illegal monitor call for FILOP.',
        ernrm_, 'File structure full or disk quota exceeded',
        erwlk_, 'Program cannot write on this structure',
        ernet_, 'Not enough table space in monitor free core',
        erpoa_, 'Partial allocation only',
        erbnf_, 'Block not free on allocated position',
        ercsd_, 'Cannot supercede a directory',
        erdne_, 'Cannot delete a non-empty directory',
        ersnf_, 'Some SFD in the specified path was not found',
        ersle_, 'The search list is empty (generic DSK:)',
        erlvl_, 'SFD creation too deep',
        ernce_, 'No UFD or SFD in the default or specific path',
        ersns_, 'Cannot perform GETSEG from here',
        erfcu_, 'Cannot update file',
        erloh_, 'Lowseg overlaps highseg',
        ernli_, 'The user is not logged in',
        erenq_, 'The file still has outstanding locks',
        erbed_, 'File has bad .EXE file directory',
        erbee_, 'File has bad extension for an .EXE file',
        erdtb_, 'Files .EXE directory is too big',
        erenc_, 'Not enough space for connect message',
        ertna_, 'Task was not available',
        erunn_, 'An unknown network node was specified',
        ersiu_, 'SFD is in use',
        erndr_, 'File has an NDR lock',
        erjch_, 'Too many readers',
        erssl_, 'Cannot rename SFD to lower level',
        ercno_, 'Channel not opened',
        erddu_, 'Device "down" and unusable',
        erdrs_, 'Device is restrictied',
        erdcm_, 'Device is controlled by MDA',
        erdaj_, 'Device is allocated to another job',
        eridm_, 'Illegal I/O data mode',
        eruob_, 'Undefined open bits set',
        erdum_, 'Device in use on an MPX channel',
        ernpc_, 'No per-process table space',
        ernfc_, 'No free channels',
        eruff_, 'Unknown FILOP. function',
        erctb_, 'Channel number is too big',
        ercif_, 'Channel illegal for specified function'
        ) %;

LITERAL
    max_foerr = ercif_;    
%FI !END TOPS10 CONDITIONAL
%(318)% !Change all the facilities
!
! Facility codes:
!
LITERAL
    $ERR = 0,
    $DCN = 1,
    min_facility = $err,
%IF %SWITCHES(TOPS20) %THEN
    max_facility = $dcn,
%FI
%IF %SWITCHES(TOPS10) %THEN
    $ENQ = 2,
    $FOP = 3,
    max_facility = $fop,
%FI
    $MON = max_facility+1;
!
! Miscellaneous needed macros
!
MACRO
    $GLITERAL =				! Initialize for constant creation
	%ASSIGN( $xpo$distinct, 0 )     !NOTE GLOBAL LITERAL cannot occur
	GLOBAL LITERAL %;               !in LIBRARY file.

MACRO 
    $ERROR_TABLE =
        UNDECLARE mxerrs;
        UNDECLARE dnerrs;
        UNDECLARE errtyp;
        UNDECLARE $ebuf;
        UNDECLARE ext_lines(%remove(mx$errors));

%IF %SWITCHES(TOPS10) %THEN
        UNDECLARE foerrs;
        UNDECLARE nqerrs;
%FI
        $gliteral
        lit_lines(%REMOVE(mx$errors));
        
        GLOBAL mxerrs: VECTOR [max_error]
        INITIAL
            (0,
             STR_LINES(%remove(mx$errors)) );

        GLOBAL dnerrs: VECTOR [max_derr+1]      %(318)%
        INITIAL                                 %(318)%
            (STR_LINES(%remove(dn$errors))      %(318)%
            );                                  %(318)%

%IF %SWITCHES(TOPS10) %THEN                     ![318]
        GLOBAL nqerrs: VECTOR [max_nqerr+1]     ![318]
        INITIAL(                                ![318]
                STR_LINES(%remove(nq$errors))   ![318]
                );                              ![318]

        GLOBAL foerrs: VECTOR [max_foerr+1]     ![318]
        INITIAL(                                ![318]
                STR_LINES(%remove(fo$errors))   ![318]
                );                              ![318]

        GLOBAL errtyp: VECTOR [max_facility+1]  ![318] 
        INITIAL(                                ![318]
                mxerrs,                         ![318]
                dnerrs,                         ![318]
                nqerrs,                         ![318]
                foerrs                          ![318]
                );                              ![318]
%FI                                             ![318]
%IF %SWITCHES(TOPS20) %THEN                     ![318]
        GLOBAL errtyp: VECTOR [max_facility+1]  %(318)%
        INITIAL(                                %(318)%
                mxerrs,                         %(318)%
                dnerrs                          %(318)%
                );                              %(318)%
%FI
        GLOBAL $ebuf: VECTOR[CH$ALLOCATION(256)] %;

macro EXT_LINES (CODE,TEXT)[] =
         CODE
         %if not %null(%remaining) %then ,EXT_LINES(%remaining) 
         %else ;
         %if %declared(max_error) %then 
         UNDECLARE max_error;
         %fi

         LITERAL
            max_error = %count + 2 %fi %;

macro LIT_LINES (CODE,TEXT)[] =
         CODE = $distinct
         %if not %null(%remaining)
         %then
              ,LIT_LINES(%remaining)
         %fi %;

macro STR_LINES (CODE,TEXT)[] =
         ch$ptr(uplit(%string(%asciz TEXT)))
         %if not %null(%remaining)
         %then
              ,STR_LINES(%remaining) %fi %;

EXTERNAL ext_lines(%remove(mx$errors));
EXTERNAL mxerrs: vector[max_error];
EXTERNAL dnerrs: vector[max_derr+1];
EXTERNAL errtyp: vector[max_facility+1];    %(318)%
EXTERNAL $ebuf:  vector[CH$ALLOCATION(256)];

%IF %SWITCHES(TOPS10) %THEN
EXTERNAL foerrs: vector[max_foerr+1];  
EXTERNAL nqerrs: vector[max_nqerr+1];
%FI

MACRO $$cnt(_A_) =
    %LENGTH %;

MACRO $$assign_args(_n, _arg)[] =
    %IF NOT %NULL(_arg) %THEN
    _argblck[_n] = _arg;
    $$assign_args(_n+1, %REMAINING) %FI %;
             
MACRO $$leave_space(_arg)[] =           %(318)%
    %IF NOT %NULL(_arg) %THEN           %(318)%
    0,                                  %(318)%
    $$leave_space(%REMAINING) %FI %;    %(318)%

!
! $error _argblck offsets
!
LITERAL
    $ecnt = 0,      !%(318)% Count
    $ecc  = 1,      !%(318)% Condition Code
    $eamx = 2,      !%(318)% Active Message Table Index
    $edc  = 3,      !%(318)% Data Counts
    $emd  = 4,      !%(318)% Begining of message data
    $efsz = 5;      !%(318)% Size of the fixed data (not including $ecnt)

%(318)% !Rewrite $error and $signal_error macros
KEYWORDMACRO
    $error(severity, code, facility,
           id=0,
           message_data=,
           optional_message=,
           optional_data=) =

        BEGIN
        OWN
            _argblck: VECTOR[$efsz + $$cnt(%remove(message_data)) +
                                     $$cnt(%remove(optional_data))]
!
! Do the compiletime initialization.  The first value is the argument count
!
        INITIAL($efsz-1 + $$cnt(%remove(message_data)) +
                          $$cnt(%remove(optional_data)),
!
! Save space for the status value
!
                0,
!
! This is the id field.  We'll deal with this at run time, too
!
                0,
!
! Optional Data Count,,Message Data Count
!
               $$cnt(%remove(optional_data))^18 + $$cnt(%remove(message_data)),
!
! Leave space for the message data
!
                $$leave_space(%remove(message_data))
!
! And here is the status code for the optional message
!
                0 );
!
! Now generate runtime code.  Set condition code and the actual id field.
!
        _argblck[$ecc] = sts$value(SEV=severity,COD=code,FAC=facility);
        _argblck[$eamx] = id;
!
! Store the message data if necessary
!
        $$assign_args($emd, %REMOVE(message_data))
!
! Store the optional message
!
%IF NOT %NULL(optional_message) %THEN
        $$assign_args(
            $emd + $$cnt(%REMOVE(message_data)),
            sts$value(%remove(optional_message)))
%FI
!
! Store the optional data if necessary
!
        $$assign_args(
            $emd + $$cnt(%REMOVE(message_data)) + 1,
            %REMOVE(optional_data))
!
! Everything's set up, so call the error processor
!
        mx$error_processor(_argblck);
        $false
        END %;

KEYWORDMACRO
    $signal_error(severity, code, facility,
                  id=0,
                  message_data=,
                  optional_message=0,
                  optional_data=) =
        SIGNAL(
            sts$value(SEV=severity, COD=code, FAC=facility),
            id,
            $$cnt(%REMOVE(optional_data))^18 + $$cnt(%REMOVE(message_data))
            %IF NOT %NULL(message_data) %THEN 
                ,%REMOVE(message_data) %FI
            %IF optional_message EQL 0
            %THEN ,0
            %ELSE ,STS$VALUE(%REMOVE(optional_message)) %FI
            %IF NOT %NULL(optional_data) %THEN 
                ,%REMOVE(optional_data) %FI
                    ) %;

    MACRO
        $e_display(b) =
        %IF %SWITCHES(TOPS20) %THEN
            BEGIN
            DECLARE_JSYS(psout);
            $$psout(b);
            END
        %ELSE
            task_info(b)
        %FI %;

%if $TOPS20 %then
macro
     $LAST_ERROR =
           BEGIN
           declare_jsys(geter);
           local error;

           $$geter($fhslf;error);
           .error<0,18>
           END %;
%fi
!
! Other symbols
!
LITERAL
    $error_code = -1;

MACRO
    abort_mx =
        %IF %SWITCHES(TOPS20) %THEN

        BEGIN
        DECLARE_JSYS(psout,haltf);

        $$psout(crlf_pointer);                          ![314]New MONSYM change
        $$psout(UPLIT(%ASCIZ %STRING('?MX crashed')));
        $$haltf();
        END

        %ELSE
!           %WARN('ABORT_MX not implemented for this OS')
	BEGIN
	BUILTIN UUO;

	UUO(0,EXIT(1));
	END
        %FI %;