MODULE XZAP ( IDENT = 'X00.07' %TITLE 'IOB Cleanup Routines' %BLISS32( ,ADDRESSING_MODE( EXTERNAL=LONG_RELATIVE ) ) %BLISS36( ,ENTRY( XPO$ZAP_IOB, XPO$LEAVE_IOB, XPO$ZERO_IOB ),OTS='' ) ) = BEGIN ! ! COPYRIGHT (c) 1980 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: BLISS Library ! ! ABSTRACT: ! ! This module is used internally by XPORT to clean up the IOB. ! ! ENVIRONMENT: User Mode - multiple host operating/file systems ! ! AUTHOR: Linda Duffell CREATION DATE: 29 February 1980 ! Ward Clark ! !-- ! ! TABLE OF CONTENTS: ! FORWARD ROUTINE XPO$ZAP_IOB, ! XPORT IOB reset routine XPO$LEAVE_IOB, ! XPORT IOB cleanup routine XPO$ZERO_IOB : NOVALUE; ! XPORT IOB field reset routine ! ! INCLUDE FILES: ! LIBRARY 'XPORT' ; ! Public XPORT control block and macro definitions LIBRARY 'XPOSYS' ; ! Internal XPORT macro definitions $XPO_SYS_TEST( $TOPS10, $TOPS20, $VMS, $11M, $RSTS, $RT11 ) ! ! MACROS: ! MACRO iob_free_temp( iob_field ) = IF .iob_field NEQ 0 THEN BEGIN LOCAL status; status = $STR_FREE_TEMP( .iob_field ); IF NOT .status THEN RETURN .status; IF .status NEQ STR$_NOT_TEMP THEN iob_field = 0; END; %; ! ! EQUATED SYMBOLS: ! ! ! PSECT DECLARATIONS: ! $XPO_PSECTS ! Declare XPORT PSECT names and attributes ! ! OWN STORAGE: ! ! ! EXTERNAL REFERENCES: ! %IF $TOPS10 %THEN EXTERNAL ROUTINE X10$CLEANUP; ! IOB's TOPS10 control block cleanup routine %FI %IF $VMS %THEN EXTERNAL ROUTINE XPO$RMS_CLEANUP; ! IOB's RMS control block cleanup routine %FI %IF $11M %THEN EXTERNAL ROUTINE XRSX$CLEANUP; ! IOB's FCS control block cleanup routine %FI %TITLE 'XPO$ZAP_IOB - Reset IOB to Initialized State' GLOBAL ROUTINE XPO$ZAP_IOB( iob ) = !++ ! ! FUNCTIONAL DESCRIPTION: ! ! This routine resets an IOB to an initialized state. ! ! FORMAL PARAMETERS: ! ! iob - address of an IOB ! ! IMPLICIT INPUTS: ! ! None ! ! IMPLICIT OUTPUTS: ! ! None ! ! COMPLETION CODES: ! ! XPO$_NORMAL - normal completion code ! ! failure completion code from XPO$LEAVE_IOB ! failure completion code from $XPO_FREE_MEM ! failure completion code from $STR_FREE_TEMP ! ! SIDE EFFECTS: ! ! None ! !-- BEGIN MAP iob : REF $XPO_IOB(); ! Redefine the IOB parameter ! ! Perform initial IOB cleanup. ! $XPO_IF_NOT( xpo$leave_iob( .iob ) ) THEN RETURN .$XPO_STATUS; ! ! Free the resultant file-spec. ! $XPO_IF_NOT( $XPO_FREE_MEM( STRING = iob[IOB$T_RESULTANT], FAILURE = 0 ) ) THEN RETURN .$XPO_STATUS; ! ! Return to the caller. ! RETURN XPO$_NORMAL END; %TITLE 'XPO$LEAVE_IOB - Leave IOB Ready for Reuse' GLOBAL ROUTINE XPO$LEAVE_IOB( iob ) = !++ ! ! FUNCTIONAL DESCRIPTION: ! ! This routine cleans up an IOB, leaving it in a state that the ! current file can be reprocessed. ! ! FORMAL PARAMETERS: ! ! iob - address of an IOB ! ! IMPLICIT INPUTS: ! ! None ! ! IMPLICIT OUTPUTS: ! ! None ! ! COMPLETION CODES: ! ! XPO$_NORMAL - normal completion code ! ! failure completion code from X10$CLEANUP (TOPS10) ! failure completion code from XPO$RMS_CLEANUP (VMS) ! failure completion code from XRSX$CLEANUP (11M) ! failure completion code from $XPO_FREE_MEM ! failure completion code from $STR_FREE_TEMP ! ! SIDE EFFECTS: ! ! None ! !-- BEGIN MAP iob : REF $XPO_IOB(); ! Redefine the IOB parameter ! ! Clean up the system dependent IOB locations. ! %IF $TOPS10 %THEN $XPO_IF_NOT( X10$CLEANUP( .iob ) ) ! Free the IOB's TOPS10 control blocks. THEN RETURN .$XPO_STATUS; %FI %IF $VMS %THEN $XPO_IF_NOT( XPO$RMS_CLEANUP( .iob ) ) ! Free the IOB's RMS control blocks. THEN RETURN .$XPO_STATUS; %FI %IF $11M %THEN $XPO_IF_NOT( XRSX$CLEANUP( .iob ) ) ! Free the IOB's FCS control blocks. THEN RETURN .$XPO_STATUS; %FI ! ! Free any temporary file-spec strings provided by the user. ! iob_free_temp( iob[IOB$A_FILE_SPEC] ); ! Primary file specification descriptor iob_free_temp( iob[IOB$A_DEFAULT] ); ! Default file specification descriptor iob_free_temp( iob[IOB$A_RELATED] ); ! Related file specification descriptor iob_free_temp( iob[IOB$A_PROMPT] ); ! Read prompt descriptor iob_free_temp( iob[IOB$A_OUTPUT] ); ! Character/binary output descriptor ! ! Free a saved concatenated input file specification. ! IF .iob[$SUB_FIELD(IOB$T_CONCAT,STR$B_CLASS)] NEQ 0 THEN $XPO_IF_NOT( $XPO_FREE_MEM( STRING = iob[IOB$T_CONCAT], FAILURE = 0 ) ) THEN RETURN .$XPO_STATUS; ! ! Free a dynamic input buffer. ! IF .iob[$SUB_FIELD(IOB$T_STRING,STR$B_CLASS)] EQL STR$K_CLASS_DB THEN BEGIN $XPO_IF_NOT( $XPO_FREE_MEM( STRING = iob[IOB$T_STRING], FAILURE = 0 ) ) THEN RETURN .$XPO_STATUS; END ELSE BEGIN iob[IOB$H_STRING] = 0; iob[IOB$A_STRING] = 0; END; ! ! Clear (zero) certain IOB fields. ! iob[IOB$V_REMEMBER] = 0; ! REMEMBER option iob[IOB$V_STATUS] = 0; ! all file status indicators xpo$zero_iob( .iob ); ! file attributes, sequence info, etc. ! ! Return to the caller. ! RETURN XPO$_NORMAL END; %TITLE 'XPO$ZERO_IOB - Reset Selected IOB Fields' GLOBAL ROUTINE XPO$ZERO_IOB( iob ) : NOVALUE = !++ ! ! FUNCTIONAL DESCRIPTION: ! ! This routine zeros selected IOB fields as part of an explicit or ! automatic file close. ! ! FORMAL PARAMETERS: ! ! iob - address of an IOB ! ! IMPLICIT INPUTS: ! ! None ! ! IMPLICIT OUTPUTS: ! ! None ! ! ROUTINE VALUE: ! ! None ! ! SIDE EFFECTS: ! ! None ! !-- BEGIN MAP iob : REF $XPO_IOB(); ! Redefine the IOB parameter ! ! Clear (zero) certain IOB fields. ! iob[IOB$H_PAGE_NUMB] = 0; ! current page number iob[IOB$G_SEQ_NUMB] = 0; ! sequence number of current record iob[IOB$G_REC_SIZE] = 0; ! fixed record size iob[IOB$G_BLK_SIZE] = 0; ! block size IF .iob[IOB$V_INPUT] THEN iob[IOB$V_SEQUENCED] = 0; ! sequenced file if we're inputting ! ! Return to the caller. ! RETURN END; END ELUDOM