MODULE XCSI( IDENT = 'X00.03' ) = %TITLE 'RSX CSI File-spec Decoder' 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 creates an ASCII file specification from the ! information in an RSX CSI control block. ! ! ENVIRONMENT: User Mode ! ! AUTHOR: Ward Clark, CREATION DATE: 22 August 1978 ! !-- ! ! TABLE OF CONTENTS: ! FORWARD ROUTINE xrsx$file_spec; ! CSI file-spec decoder ! ! INCLUDE FILES: ! LIBRARY 'XPORT'; ! XPORT macro and field definitions REQUIRE 'XRSX' ; ! XPORT-specific RSX-11M definitions ! ! MACROS: ! ! ! EQUATED SYMBOLS: ! LITERAL max_file_spec = 80; ! Maximum length of a file-spec string ! ! OWN STORAGE: ! ! ! EXTERNAL REFERENCES: ! GLOBAL ROUTINE xrsx$file_spec ( csi_block, result_desc ) = !++ ! ! FUNCTIONAL DESCRIPTION: ! ! This routine creates an ASCII file specification from the ! information in a CSI control block passed by the caller. ! ! FORMAL PARAMETERS: ! ! csi_block - Address of a CSI control block ! result_desc - address of a file-spec descriptor to be initialized ! ! IMPLICIT INPUTS: ! ! None ! ! IMPLICIT OUTPUTS: ! ! None ! ! COMPLETION CODE: ! ! completion code from $STR_COPY or $STR_APPEND ! ! SIDE EFFECTS: ! ! None ! !-- BEGIN MAP csi_block : REF BLOCK FIELD(CSI$FIELD), result_desc : REF $STR_DESCRIPTOR( CLASS = DYNAMIC ); LOCAL file_spec_buff : VECTOR[ max_file_spec, BYTE ], ! Local file-spec creation buffer buffer_pointer; ! Pointer into the local file-spec buffer ! ! Initialization ! buffer_pointer = file_spec_buff; ! Point to the local file-spec buffer. ! ! Put the device name and a colon into the file-specification buffer. ! IF .csi_block[C$DEVD$L] NEQ 0 THEN BEGIN buffer_pointer = CH$MOVE( .csi_block[C$DEVD$L], .csi_block[C$DEVD$A], .buffer_pointer ); CH$WCHAR_A( %C':', buffer_pointer ); END; ! ! Add the directory specification to the buffer. ! buffer_pointer = CH$MOVE( .csi_block[C$DIRD$L], .csi_block[C$DIRD$A], .buffer_pointer ); ! ! Add the file name, file type, and file version to the buffer. ! buffer_pointer = CH$MOVE( .csi_block[C$FILD$L], .csi_block[C$FILD$A], .buffer_pointer ); ! ! Return the final file specification string to the caller. ! IF .result_desc[STR$B_CLASS] EQL 0 ! If this is the 1st file-spec of a sequence, THEN ! initialize the caller's descriptor and BEGIN ! copy the string into dynamic memory. $STR_DESC_INIT( DESCRIPTOR = result_desc[$BASE], CLASS = DYNAMIC ); RETURN $STR_COPY( STRING = ( .buffer_pointer - file_spec_buff, file_spec_buff ), TARGET = result_desc[$BASE], OPTION = UP_CASE ) END ELSE ! If this is a concatenated file-spec, BEGIN ! add a "+" and the new file-spec. $STR_APPEND( STRING = '+', TARGET = result_desc[$BASE] ); RETURN $STR_APPEND( STRING = ( .buffer_pointer - file_spec_buff, file_spec_buff ), TARGET = result_desc[$BASE], OPTION = UP_CASE ) END; END; END ELUDOM