MODULE xtestp ( MAIN = test_parse, %TITLE 'XPORT File-spec Parse Test' IDENT = 'X00.02' %BLISS32( ,ADDRESSING_MODE( EXTERNAL=LONG_RELATIVE ) ) ) = 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 tests XPORT file-spec parsing. ! ! ENVIRONMENT: User Mode ! ! AUTHOR: Ward Clark, CREATION DATE: 13 August 1980 ! !-- ! ! TABLE OF CONTENTS: ! FORWARD ROUTINE test_parse; ! Principal testing routine ! ! INCLUDE FILES: ! LIBRARY 'XPORT' ; ! XPORT control block and macro definitions ! ! MACROS: ! MACRO SKIP( literal_string ) = ! Prefix a literal string with a line-feed %STRING( %CHAR(lf), literal_string ) %; ! ! EQUATED SYMBOLS: ! LITERAL lf = %O'12'; ! ASCII line feed character ! ! OWN STORAGE: ! OWN tty_input : $XPO_IOB(), ! IOB for input from terminal tty_output : $XPO_IOB(), ! IOB for output to terminal spec_block : $XPO_SPEC_BLOCK; ! File-spec parse block ! ! EXTERNAL REFERENCES: ! EXTERNAL ROUTINE XSPEC : NOVALUE; ! File-spec block display routine GLOBAL ROUTINE test_parse = !++ ! ! FUNCTIONAL DESCRIPTION: ! ! This routine prompts the user for a file specification, parses the ! file-spec, and then displays the resulting file-spec block. ! ! FORMAL PARAMETERS: ! ! None ! ! IMPLICIT INPUTS: ! ! None ! ! IMPLICIT OUTPUTS: ! ! None ! ! COMPLETION CODES: ! ! XPO$_NORMAL - successful completion ! ! SIDE EFFECTS: ! ! None ! !-- BEGIN %IF %VARIANT NEQ 0 %THEN ! ! Initialize the IOB'S ! $XPO_IOB_INIT( IOB = tty_input ); $XPO_IOB_INIT( IOB = tty_output ); $XPO_IOB_INIT( IOB = spec_block ); %FI ! ! Open the user's terminal for output and send the user a greeting message. ! $XPO_OPEN( IOB = tty_output, ! Open the user's terminal: FILE_SPEC = $XPO_OUTPUT, ! standard output file OPTIONS = OUTPUT ); ! open for output $XPO_PUT( IOB = tty_output, ! Send the user a greeting message. STRING = skip('XPORT File-spec Parse Test') ); ! ! Open the user's terminal for input. ! $XPO_OPEN( IOB = tty_input, ! Open the user's terminal: FILE_SPEC = $XPO_INPUT, ! standard input file OPTIONS = INPUT ); ! open for input ! ! Ask for a file specification. ! WHILE $XPO_GET( IOB = tty_input, PROMPT = skip('File-spec? ') ) DO IF $XPO_PARSE_SPEC( FILE_SPEC = tty_input[IOB$T_STRING], SPEC_BLOCK = spec_block, FAILURE = XPO$PS_FAILURE ) THEN XSPEC( spec_block ); ! ! Send the user a completion message. ! $XPO_PUT( IOB = tty_output, STRING = skip('XPORT File-spec Parse Test Complete') ); ! ! Close the terminal input and output files. ! $XPO_CLOSE( IOB = tty_input ); ! Close the terminal input file. $XPO_CLOSE( IOB = tty_output ); ! Close the terminal output file. ! ! Terminate XPORT testing. ! RETURN XPO$_NORMAL END; END ELUDOM