! ! COPYRIGHT (c) 1983, 1984 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: ! XPORT - BLISS Transportability Support Package ! ! ABSTRACT: ! This REQUIRE file defines non-public XPORT macros and symbols. ! ! ENVIRONMENT: ! User mode ! ! AUTHOR: Ward Clark, CREATION DATE: 17-Mar-81 ! ! MODIFIED BY: Edward G. Freedman ! ! REVISION HISTORY: ! ! 3-Apr-84 LYS Changed $XPO$SYS_IDENT for version 1.3 ! ! 24-Aug-84 LYS Increased XPO$K_MAX_ATTR to 246 for Tops-20 ! ! END OF REVISION HISTORY !-- ! ! XPOSYS.REQ - Non-public XPORT Declarations ! ! ! XPOSYS.REQ Version Identifier ! ! This should be updated with every change to XPOSYS.REQ. ! The corresponding macro in XPORT.REQ ($XPO_IDENT) should be updated ! according to this same format with every change to that file. ! ! Format is " Avv.ll-gg " ! where: ! A is one of {V, T, E, X} (This stands for Version, Test, Engineering_test, eXperimental) ! vv is version number from XPO$K_VERSION ! ll is level number from XPO$K_LEVEL ! gg is generation number of this CMS element ! MACRO $XPO$SYS_IDENT = 'V1.3-17' %; ! Update this with every change to XPOSYS.REQ ! ! XPORT System-specific Declarations ! MACRO $TOPS10 = %VARIANT EQL 1 %, $TOPS20 = %VARIANT EQL 2 %, $VMS = %VARIANT EQL 3 %, $11M = %VARIANT EQL 4 %, $IAS = %VARIANT EQL 5 %, $RSTS = %VARIANT EQL 6 %, $RT11 = %VARIANT EQL 7 %, $ALL = 1 %, $XPO_SYS_TEST[ system_flag ] = %IF system_flag %THEN %IF $TOPS10 %THEN %PRINT( ' This module was compiled for TOPS-10' ) %ELSE %IF $TOPS20 %THEN %PRINT( ' This module was compiled for TOPS-20' ) %ELSE %IF $VMS %THEN %PRINT( ' This module was compiled for VAX/VMS' ) %ELSE %IF $11M %THEN %PRINT( ' This module was compiled for RSX-11M' ) %ELSE %IF $IAS %THEN %PRINT( ' This module was compiled for IAS' ) %ELSE %IF $RSTS %THEN %PRINT( ' This module was compiled for RSTS' ) %ELSE %IF $RT11 %THEN %PRINT( ' This module was compiled for RT11' ) %ELSE %IF %BLISS(BLISS16) %THEN %PRINT( ' This module was compiled for any PDP-11 system' ) %ELSE %IF %BLISS(BLISS32) %THEN %PRINT( ' This module was compiled for any VAX-11 system' ) %ELSE %IF %BLISS(BLISS36) %THEN %PRINT( ' This module was compiled for any PDP-10 system' ) %FI %FI %FI %FI %FI %FI %FI %FI %FI %FI %print (' XPORT ', $xpo_ident, ' XPOSYS ', $xpo$sys_ident, ' XPO$K_VERSION = ', %NUMBER (xpo$k_version), ' XPO$K_LEVEL = ', %NUMBER (xpo$k_level) ) %EXITMACRO %FI %IF %COUNT EQL %LENGTH-1 %THEN %ERRORMACRO( 'Variant setting (', %VARIANT, ') is invalid' ) %FI %; ! ! $XPO_DFLT_DEV - Default device specification ! MACRO $XPO_DFLT_DEV = %IF $TOPS10 OR $TOPS20 %THEN 'DSK:' %FI %IF $VMS %THEN 'SYS$DISK:' %FI %IF $11M OR $IAS %THEN 'SY0:' %FI %IF $RSTS %THEN 'SY:' %FI %IF $RT11 %THEN 'DK:' %FI % ; ! ! XPORT System-independent Declarations ! MACRO $xpo$comp_code( code ) = %IF %IDENTICAL( code, %REMOVE(code) ) %THEN %NAME( 'XPO$_', code ) %ELSE code %FI %, %IF %BLISS(BLISS36) %THEN $XPO_PSECTS = %, %ELSE $XPO_PSECTS = PSECT OWN = _XPO$DATA %BLISS32( (PIC,ADDRESSING_MODE(LONG_RELATIVE)) ), GLOBAL = _XPO$DATA %BLISS32( (PIC,ADDRESSING_MODE(LONG_RELATIVE)) ), CODE = _XPO$CODE ( NOWRITE %BLISS32( ,SHARE,PIC ) ), PLIT = _XPO$CODE; %, %FI $XPO_ADDRESS( pointer ) = ! Converts character pointer to memory address %IF NOT %BLISS(BLISS36) %THEN %WARN( 'This macro may not appear in BLISS-16 or BLISS-32 code' ) %FI ( (pointer AND 1^19-1) + 1 ) %, $XPO_MAIN_BEGIN( function, fixup ) = COMPILETIME $xpo$function = %NAME( 'XPO$K_', function ), $xpo$main_block = 1; %IF %IDENTICAL( function, IO ) %THEN BIND primary_code = iob[IOB$G_COMP_CODE], secondary_code = iob[IOB$G_2ND_CODE]; %ELSE LOCAL primary_code, secondary_code; %FI LABEL MAIN_BLOCK; MAIN_BLOCK: BEGIN %IF NOT %NULL( fixup ) %THEN IF .iob[IOB$H_LENGTH] EQL 0 AND ! If an OWN/GLOBAL IOB has not been initialized, .iob[IOB$B_VERSION] EQL 0 AND ! .iob[IOB$B_LEVEL] EQL 0 AND ! .iob[IOB$G_COMP_CODE] EQL 0 ! THEN ! BEGIN ! iob[IOB$H_LENGTH] = IOB$K_LENGTH; ! setup the IOB length, iob[IOB$B_VERSION] = XPO$K_VERSION; ! XPORT version number, iob[IOB$B_LEVEL] = XPO$K_LEVEL; ! and XPORT base level number. END; iob[$SUB_FIELD(IOB$T_RESULTANT,STR$B_DTYPE)] = STR$K_DTYPE_T; iob[$SUB_FIELD(IOB$T_RESULTANT,STR$B_CLASS)] = STR$K_CLASS_D; %FI %IF %IDENTICAL( function, IO ) %THEN IF .iob[IOB$H_LENGTH] NEQ IOB$K_LENGTH ! If the IOB is not the proper size, THEN ! $XPO_QUIT( BAD_IOB, BAD_LENGTH ); ! return error codes to the caller. %FI secondary_code = 0; ! Clear the secondary completion code %, $XPO_QUIT( primary, secondary ) = BEGIN %IF NOT %NULL( primary ) %THEN primary_code = $xpo$comp_code( primary ); %FI %IF NOT %NULL( secondary ) %THEN secondary_code = $xpo$comp_code( secondary ); %FI %IF $xpo$main_block %THEN LEAVE MAIN_BLOCK %FI END %, $XPO_MAIN_END = END; ! End of MAIN_BLOCK %ASSIGN( $xpo$main_block, 0 ) %, $XPO_RETURN( primary, secondary ) = BEGIN %IF NOT %NULL( secondary ) %THEN iob[IOB$G_2ND_CODE] = $xpo$comp_code( secondary ); %FI iob[IOB$G_COMP_CODE] = $xpo$comp_code( primary ); RETURN $xpo$comp_code( primary ) END %, $XPO_RETURN2( primary, secondary ) = BEGIN .SECONDARY_CODE = $xpo$comp_code( secondary ); RETURN $xpo$comp_code( primary ) END %, $XPO_VALID_IOB( iob, primary ) = BEGIN $xpo$ex_routine( XPO$VALID_IOB ) IF NOT XPO$VALID_IOB( iob ) THEN %IF NOT %NULL(primary) %THEN $XPO_QUIT( primary ); %ELSE $XPO_QUIT(); %FI END %, $XPO_BUILD_SPEC( iob, primary ) = BEGIN $xpo$ex_routine( XPO$BUILD_SPEC ) IF NOT XPO$BUILD_SPEC( iob ) THEN %IF NOT %NULL(primary) %THEN $XPO_QUIT( primary ); %ELSE $XPO_QUIT(); %FI END %, $XPO_ACTION_RTN( action_argument ) = %IF NOT %DECLARED( success_action ) OR NOT %DECLARED( failure_action ) OR NOT %DECLARED( primary_code ) OR NOT %DECLARED( secondary_code ) %THEN %WARN( 'SUCCESS_ACTION, FAILURE_ACTION, PRIMARY_CODE and SECONDARY_CODE must be defined' ) %EXITMACRO %FI BEGIN LOCAL $xpo$action; ! address of appropriate action routine IF .primary_code ! If the function was successful, THEN ! $xpo$action = .success_action ! save the address of the success action routine. ELSE $xpo$action = .failure_action; ! Otherwise, save the address of the failure action routine. IF .$xpo$action NEQ 0 ! If an action routine exists, THEN ! primary_code = ! call it and update the primary code. %IF %BLISS(BLISS36) %THEN BLISS36C( %ELSE BLISS( %FI .$xpo$action, $xpo$function, .primary_code, .secondary_code, action_argument ); END; %, $XPO_ZAP_IOB( iob ) = BEGIN $xpo$ex_routine( XPO$ZAP_IOB ) %IF $xpo$main_block %THEN $XPO_IF_NOT( XPO$ZAP_IOB( iob ) ) THEN $XPO_QUIT( FREE_MEM, (.$XPO_STATUS) ); %ELSE XPO$ZAP_IOB( iob ) %FI END %, $XPO_LEAVE_IOB( iob ) = BEGIN $xpo$ex_routine( XPO$LEAVE_IOB ) $XPO_IF_NOT( XPO$LEAVE_IOB( iob ) ) THEN $XPO_QUIT( FREE_MEM, (.$XPO_STATUS) ); END %; KEYWORDMACRO $XPO_FREE_QUIT( string, binary_data ) = BEGIN LOCAL $xpo$status; IF NOT ($xpo$status = $XPO_FREE_MEM( %QUOTE STRING = string, %QUOTE BINARY_DATA = binary_data, FAILURE = 0 )) THEN $XPO_QUIT( FREE_MEM, (.$xpo$status) ); END %; MACRO $XPO_IF_NOT [] = ( LOCAL $xpo$status; IF NOT ( $xpo$status = %REMAINING ) %, $XPO_STATUS = $xpo$status ) %; MACRO $XPO_MODULE( module_name ) = %IF %BLISS( BLISS16 ) %THEN END ELUDOM MODULE module_name = BEGIN LIBRARY 'XPORT'; LIBRARY 'XPOSYS'; $XPO_PSECTS %FI %; ! ! XPO$PARSE_SPEC Internal Declarations ! ! The following declarations are located here rather than in XPARSE.BLI since ! that source file contains multiple modules under BLISS-16. LITERAL ! Expected field indicator codes: XPO$K_NO_NEXT = 1, ! no field expected XPO$K_NAME_NEXT = 2, ! file name expected XPO$K_TYPE_NEXT = 3, ! file type expected XPO$K_VER_NEXT = 4; ! file version expected LITERAL ! File-spec parsing state indicators: XPO$V_SPEC_NODE = 0, ! node name specified or omitted XPO$V_SPEC_DEV = 1, ! device name specified or omitted XPO$V_SPEC_DIR = 2, ! directory-spec specified or omitted XPO$V_SPEC_NAME = 3, ! file name specified or omitted XPO$V_SPEC_TYPE = 4, ! file type specified or omitted XPO$V_SPEC_VER = 5, ! file version specified or omitted XPO$V_SPEC_SIZE = 6, ! file size specified or omitted XPO$V_SPEC_PROT = 7, ! file protection specified or omitted XPO$K_STATE_LEN = 8; ! Number of file-spec states MACRO $XPO_PARSE_STATE = BITVECTOR[ XPO$K_STATE_LEN ] %, $XPO_PARSE_MAX = LITERAL %IF $TOPS10 %THEN XPO$K_MAX_DEV = 6, XPO$K_MAX_NAME = 6, XPO$K_MAX_TYPE = 3; %ELSE %IF $TOPS20 %THEN XPO$K_MAX_DEV = 39, XPO$K_MAX_NAME = 39, XPO$K_MAX_TYPE = 39, XPO$K_MAX_ATTR = 246; %ELSE %IF $VMS %THEN XPO$K_MAX_NODE = 63, XPO$K_MAX_DEV = 63, XPO$K_MAX_NAME = 63, XPO$K_MAX_TYPE = 39; %ELSE %IF $11M %THEN XPO$K_MAX_DEV = 4, XPO$K_MAX_NAME = 9, XPO$K_MAX_TYPE = 3; %ELSE %IF $RSTS %THEN XPO$K_MAX_DEV = 8, XPO$K_MAX_NAME = 8, XPO$K_MAX_TYPE = 5; %ELSE %IF $RT11 %THEN XPO$K_MAX_DEV = 3, XPO$K_MAX_NAME = 6, XPO$K_MAX_TYPE = 3; %FI %FI %FI %FI %FI %FI %; ! ! Non-public XPORT Data Structure Macros ! MACRO $XPO_BIT_MASK( field_name, bit_name ) = %IF NOT %DECLARED( %NAME(field_name) ) %THEN %WARN( field_name, ' is not defined' ) 0 %EXITMACRO %FI %IF NOT %DECLARED( %NAME(bit_name) ) %THEN %WARN( bit_name, ' is not defined' ) 0 %EXITMACRO %FI %IF %FIELDEXPAND( bit_name, 2 ) NEQ 1 %THEN %WARN( bit_name, ' is not a 1-bit field' ) 0 %EXITMACRO %FI 1 ^ ( %FIELDEXPAND(bit_name,1) - %FIELDEXPAND(field_name,1) ) %, $SHOW_FIELD( prefix ) [ name ] = %PRINT( ' ', %NAME(prefix,name), ' = [', %FIELDEXPAND(%NAME(prefix,name),0), ',', %FIELDEXPAND(%NAME(prefix,name),1), ',', %FIELDEXPAND(%NAME(prefix,name),2), ',', %FIELDEXPAND(%NAME(prefix,name),3), '] (+', %IF %BLISS(BLISS32) %THEN '%X''' $XPO$SHOW_NUMB( %FIELDEXPAND(%NAME(prefix,name),0)*%UPVAL, 16 ) %ELSE '%O''' $XPO$SHOW_NUMB( %FIELDEXPAND(%NAME(prefix,name),0)*%UPVAL, 8 ) %FI , ''')') %, $SHOW_LITERAL( prefix ) [ name ] = %PRINT( ' ', %NAME(prefix,name), ' = ', %NUMBER(%NAME(prefix,name)), ' (', %IF %BLISS(BLISS32) %THEN '%X''' $XPO$SHOW_NUMB(%NUMBER(%NAME(prefix,name)),16) %ELSE '%O''' $XPO$SHOW_NUMB(%NUMBER(%NAME(prefix,name)),8) %FI , ''')' ) %; ! ! Non-public XPORT String Handling Definitions ! COMPILETIME $xpo$internal = 1; ! Indicate no auto freeing of XPORT temporary strings ! when a string function is called within any XPORT code ! which includes a "LIBRARY 'XPOSYS';" declaration. MACRO $str$comp_code( code ) = %IF %IDENTICAL( code, %REMOVE(code) ) %THEN %NAME( 'STR$_', code ) %ELSE code %FI %, $STR_MAIN_BEGIN( function ) = COMPILETIME $str$function = %NAME( 'STR$K_', function ), $xpo$main_block = 1; LOCAL primary_code; LABEL MAIN_BLOCK; %IF $str$function NEQ STR$K_PSEUDO %THEN LOCAL secondary_code; secondary_code = 0; %FI MAIN_BLOCK: BEGIN %, $STR_QUIT( primary, secondary ) = BEGIN %IF NOT %NULL( primary ) %THEN primary_code = $str$comp_code( primary ); %FI %IF NOT %NULL( secondary ) AND $str$function NEQ STR$K_PSEUDO %THEN secondary_code = $str$comp_code( secondary ); %FI %IF $xpo$main_block %THEN LEAVE MAIN_BLOCK %FI END %, $STR_MAIN_END = END; ! End of MAIN_BLOCK %ASSIGN( $xpo$main_block, 0 ) %, $STR_ACTION_RTN( action_arg1, action_arg2, action_arg3 ) = %IF NOT %DECLARED( success_action ) OR NOT %DECLARED( failure_action ) OR NOT %DECLARED( primary_code ) OR NOT %DECLARED( secondary_code ) %THEN %WARN( 'SUCCESS_ACTION, FAILURE_ACTION, PRIMARY_CODE and SECONDARY_CODE must be defined' ) %EXITMACRO %FI BEGIN LOCAL $str$action; ! address of appropriate action routine IF .primary_code ! If the function was successful, %IF $str$function EQL STR$K_COMPARE OR ! $str$function EQL STR$K_SCAN ! %THEN ! OR .primary_code EQL 0 ! ( 0 is not failure from comparison and scan functions ) %FI ! THEN ! $str$action = .success_action ! save the address of the success action routine. ELSE $str$action = .failure_action; ! Otherwise, save the address of the failure action routine. IF .$str$action NEQ 0 ! If an action routine exists, THEN ! primary_code = ! call it and update the completion code. %IF %BLISS(BLISS36) %THEN BLISS36C( %ELSE BLISS( %FI .$str$action, $str$function, .primary_code, .secondary_code, action_arg1, action_arg2, $xpo$default( action_arg3, 0 ) ); END; %, $STR_VALIDATE( string, primary ) = BEGIN $xpo$ex_routine( XST$VALIDATE ) %IF %DECLARED( $xpo$main_block ) %THEN %IF $xpo$main_block %THEN LOCAL $str$status; $str$status = XST$VALIDATE( string ); IF NOT .$str$status THEN $STR_QUIT( primary, (.$str$status) ); END %EXITMACRO %FI %FI XST$VALIDATE( string ) END %, $STR_ALLOC_TEMP( string_desc ) = BEGIN EXTERNAL XST$NO_MEMORY; ! Fixed erroneous temporary string descriptor ! ( error code = XPO$_NO_MEMORY ) IF NOT $XPO_GET_MEM( FULLWORDS = STR$K_D_BLN, ! Allocate a string descriptor in dynamic memory. RESULT = string_desc, FAILURE = 0 ) THEN ! If dynamic memory is not available, RETURN XST$NO_MEMORY; ! return the address of a static erroneous ! temporary string descriptor. $STR_DESC_INIT( DESCRIPTOR = .string_desc, ! Initialize the temporary string descriptor. CLASS = XPORT_TEMPORARY ); END %; ! ! ASCII Control Character Definitions ! LITERAL nul = %O'0', ! null null = nul, ! null (alternate spelling) soh = %O'1', ! start of header stx = %O'2', ! start of text etx = %O'3', ! end of text eot = %O'4', ! end of transmission enq = %O'5', ! enquire ack = %O'6', ! acknowledge bel = %O'7', ! audible alarm bell = bel, ! audible alarm (alternate spelling) bs = %O'10', ! backspace ht = %O'11', ! horizontal tab lf = %O'12', ! line feed vt = %O'13', ! vertical tab ff = %O'14', ! form feed cr = %O'15', ! carriage return so = %O'16', ! shift out si = %O'17', ! shift in dle = %O'20', ! data link escape dc1 = %O'21', ! device control #1 (XON) dc2 = %O'22', ! device control #2 dc3 = %O'23', ! device control #3 (XOFF) dc4 = %O'24', ! device control #4 nak = %O'25', ! negative acknowledge syn = %O'26', ! synchronous null etb = %O'27', ! end of text block can = %O'30', ! cancel em = %O'31', ! end of medium sub = %O'32', ! substitute esc = %O'33', ! escape fs = %O'34', ! field separator gs = %O'35', ! group separator rs = %O'36', ! record separator us = %O'37', ! unit separator sp = %O'40', ! space (blank) space = sp, ! space (alternate spelling) del = %O'177'; ! delete