/* * PROGRAM : COMPILE * PROGRAMMER : James Wagoner * PURPOSE : Creates command procedure to compile, link, and * run a program written in a language supported on * the VAX. * * * REVISION HISTORY: * * Program created: 8/20/86 -JRW * */ COMPILE: PROCEDURE OPTIONS(MAIN); %INCLUDE $FSCNDEF; %REPLACE TRUE BY '1'B; %REPLACE FALSE BY '0'B; /* * If new language is supported on the VAX or an old language is removed, * the value of NUM_LANGUAGES will have to be changed. */ %REPLACE NUM_LANGUAGES BY 8; /* * Declare external routines used. */ DECLARE LIB$DO_COMMAND EXTERNAL ENTRY (CHARACTER (* ) VARYING ) RETURNS (FIXED BINARY (31 ) ); DECLARE LIB$SET_SYMBOL EXTERNAL ENTRY (CHARACTER (* ) VARYING, CHARACTER (* ) VARYING, FIXED BINARY (31 ) ) RETURNS (FIXED BINARY (31 ) ); DECLARE LIB$FIND_FILE EXTERNAL ENTRY (CHARACTER (* ) VARYING, CHARACTER (* ) VARYING, FIXED BINARY (31 ), CHARACTER (* ), CHARACTER (* ) VARYING, ANY, ANY ) OPTIONS (VARIABLE ) RETURNS (FIXED BINARY (31 ) ); DECLARE LIB$FIND_FILE_END EXTERNAL ENTRY (FIXED BINARY (31 ) ) RETURNS (FIXED BINARY (31 ) ); DECLARE CLI$GET_VALUE EXTERNAL ENTRY (CHARACTER (* ) VARYING, CHARACTER (* ) VARYING, FIXED BINARY (15 ) ) RETURNS (FIXED BINARY (31 ) ); DECLARE CLI$PRESENT EXTERNAL ENTRY (CHARACTER (* ) VARYING ) RETURNS (FIXED BINARY (31 ) ); DECLARE SYS$SETDDIR EXTERNAL ENTRY (ANY, FIXED BINARY (15 ), CHARACTER (* ) ) OPTIONS (VARIABLE ) RETURNS (FIXED BINARY (31 ) ); DECLARE FILESCAN EXTERNAL ENTRY (CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ), FIXED BINARY (31 ), CHARACTER (* ) ) OPTIONS (VARIABLE ) RETURNS (FIXED BINARY (31 ) ); DCL I FIXED BINARY (31 ); /* loop variable */ DCL THE_NAME CHARACTER (20 ); /* holds file name temporarily */ DCL THE_TYPE CHARACTER (10 ); /* hold file type temporarily */ DCL FILE_TYPE CHARACTER (10 ); /* holds file_type of file to be compiled */ DCL (VALUE, /* recieves value of qualifiers */ FILE_NAME, /* recieves file name of file to be compiled */ COMPILE_STRING, /* holds constructed compile command string */ LINK_STRING, /* holds constructed link command string */ RUN_STRING, /* holds constructed run command string */ OBJECT_VALUE, /* holds the object file specified on the */ /* object qualifier */ INSTALL_FILE, /* holds the name to use to install the */ /* created command procedure */ AUDIT_FILE, /* holds the log file name specified on */ /* the audit qualifier */ LIST_FILE, /* holds the name of the list file to be */ /* generated */ RUN_FILE ) /* holds the name of the file to be run */ CHARACTER (255 ) VARYING; DCL DEFAULT CHARACTER (50 ); /* recieves the default directory spec */ DCL STEP_STRING CHARACTER (6 ) VARYING; /* holds the step string specified on the STEP qualifier */ DCL (LENGTH ) FIXED BINARY (15 ); DCL RETURN_CODE FIXED BINARY (31 ); /* recieves return code from RTL and system service calls */ DCL (INSTALL, /* indicates the command procedure is to be installed */ OBJECT, /* indicates an object file was specified */ DEBUG, /* indicates that the DEBUG qualifier was specified */ AUDIT, /* indicates that the AUDIT qualifier was specified */ INVOKE, /* indicates that the command procedure is to be invoked */ PARSED, /* indicates that a language flag was parsed */ MATCHED ) /* indicates that match of extension to language was found */ BIT (1 ); /* * Predefined system symbols. */ DCL (CLI$_PRESENT, CLI$_NEGATED, CLI$_LOCPRES, CLI$_LOCNEG, CLI$_DEFAULTED, CLI$_ABSENT, CMP__FILNOTFOU, SS$_NORMAL, RMS$_NORMAL, LIB$K_CLI_GLOBAL_SYM ) FIXED BINARY (31 ) GLOBALREF VALUE; /* * The static list of variables */ DCL LANGUAGES (NUM_LANGUAGES ) CHARACTER (8 ) VARYING STATIC INITIAL ('BASIC','FORTRAN','PLI','MACRO','CC','RPG','COBOL','PASCAL'); DCL EXTENSIONS (NUM_LANGUAGES ) CHARACTER (4 ) VARYING STATIC INITIAL ('.BAS','.FOR','.PLI','.MAR','.C','.RPG','.COB','.PAS'); DCL COMP_FILE FILE; /* the file to which the commands are written */ /* * Get the default directory for later processing */ DEFAULT = ''; RETURN_CODE = SYS$SETDDIR (,,DEFAULT); /* * Get the file name specified in the COMPILE command */ RETURN_CODE = CLI$GET_VALUE ('FILENAME', FILE_NAME, LENGTH ); /* * Initialize selected values. */ COMPILE_STRING = ''; PARSED = FALSE; /* * Parse the language qualifier if one was specified. If one is specified, * PARSED bit will be set, otherwise it will remain clear. */ PARSE_THE_LANGUAGE: DO I = 1 TO NUM_LANGUAGES WHILE (^PARSED ); /* * Use CLI$PRESENT to check if a language qualifier was specified. */ IF CLI$PRESENT (LANGUAGES (I ) ) = CLI$_PRESENT THEN DO; /* * Use the language specified to start the compile command string. */ COMPILE_STRING = LANGUAGES (I ) !! COMPILE_STRING; /* * Use CLI$GET_VALUE to check if any compiler qualifiers were included * with the language qualifier. */ IF CLI$GET_VALUE (LANGUAGES (I ), VALUE, LENGTH ) = SS$_NORMAL THEN /* * If any qualifiers were included, place then in the compile command string. */ COMPILE_STRING = COMPILE_STRING !! UNQUOTE (VALUE ); /* * Prepare to search for the file. */ RETURN_CODE = FILESCAN (FILE_NAME, FSCN$_TYPE, THE_TYPE ); /* * If a file type (extension) was specified, search for the file. */ IF THE_TYPE ^= '' THEN IF ^FIND_FILE (FILE_NAME ) THEN DO; PUT SKIP LIST ('File ', FILE_NAME, 'not found.' ); STOP; END; ELSE; ELSE /* * If a file type was not specified, search for the file with the appropriate * extension. */ IF ^FIND_FILE (FILE_NAME !! EXTENSIONS (I ) ) THEN DO; PUT SKIP LIST ('File ', FILE_NAME !! EXTENSIONS (I ) , 'not found.' ); STOP; END; ELSE; /* * Set the PARSED bit. */ PARSED = TRUE; END; END PARSE_THE_LANGUAGE; /* * If the PARSED bit was not set, then a language qualifier was not specified. */ IF ^PARSED THEN DO; RETURN_CODE = FILESCAN (FILE_NAME, FSCN$_TYPE, FILE_TYPE ); /* * If the file type is not blank, match the extension on the file name * with the appropriate language. */ IF FILE_TYPE ^= '' THEN DO; MATCHED = FALSE; DO I = 1 TO NUM_LANGUAGES WHILE (^MATCHED ); IF EXTENSIONS (I ) = FILE_TYPE THEN DO; COMPILE_STRING = LANGUAGES (I ) !! COMPILE_STRING; /* * When a match is found, search for the file. */ IF ^FIND_FILE (FILE_NAME ) THEN DO; PUT SKIP LIST ('File ', FILE_NAME, 'not found. Compile aborting.' ); STOP; END; MATCHED = TRUE; END; END; /* * If the file type did not match with a known language extension, then * print an error message and stop execution. */ IF ^MATCHED THEN DO; PUT SKIP LIST ('Cannot determine language from file type. Compile aborting.'); STOP; END; END; ELSE /* * If an extension was not specified, (and at this point an language qualfier * was not specified) then search for a file with the name specified that * has any language extension. */ DO; MATCHED = FALSE; DO I = 1 TO NUM_LANGUAGES WHILE (^MATCHED ); IF FIND_FILE (FILE_NAME !! EXTENSIONS (I ) ) THEN DO; COMPILE_STRING = LANGUAGES (I ) !! COMPILE_STRING; MATCHED = TRUE; END; END; /* * If not file is found, the print an appropriate message and stop execution. */ IF ^MATCHED THEN DO; PUT SKIP LIST ('No file found with an appropriate extension. Compile aborting.' ); STOP; END; END; END; /* * Process the DEBUG qualifier. */ SELECT (CLI$PRESENT ('DEBUG' ) ); WHEN (CLI$_PRESENT ) DO; /* * If the DEBUG qualifier is present, then set the DEBUG bit and include the * qualifier on the compile command string. */ DEBUG = TRUE; COMPILE_STRING = COMPILE_STRING !! '/DEBUG'; END; /* * If the DEBUG qualifier is negated or absent, clear the DEBUG bit. */ WHEN (CLI$_NEGATED, CLI$_ABSENT ) DEBUG = FALSE; END; /* * Process the LIST qualifier. */ SELECT (CLI$PRESENT ('LIST' ) ); WHEN (CLI$_PRESENT ) DO; /* * If the LIST qualifier is present, include it in the compile command * string. */ COMPILE_STRING = COMPILE_STRING !! '/LIST'; /* * If the LIST qualifier had a value specified on the command line, include * that value in the compile command string. */ IF CLI$GET_VALUE ('LIST', VALUE, LENGTH ) = SS$_NORMAL THEN DO; COMPILE_STRING = COMPILE_STRING !! '=' !! UNQUOTE (VALUE ); LIST_FILE = UNQUOTE (VALUE ); END; ELSE DO; RETURN_CODE = FILESCAN (FILE_NAME, FSCN$_NAME, THE_NAME ); LIST_FILE = TRIM (THE_NAME ) !! '.LIS'; END; END; WHEN (CLI$_NEGATED, CLI$_ABSENT ); END; /* * Process the OBJECT qualifier. */ SELECT (CLI$PRESENT ('OBJECT') ); WHEN (CLI$_PRESENT ) DO; /* * If the OBJECT qualifier is present, then set the OBJECT bit and include the * qualifier on the compile command string. */ OBJECT_VALUE = ''; OBJECT = TRUE; COMPILE_STRING = COMPILE_STRING !! '/OBJECT'; IF CLI$GET_VALUE ('OBJECT', OBJECT_VALUE, LENGTH ) = SS$_NORMAL THEN COMPILE_STRING = COMPILE_STRING !! '=' !! UNQUOTE (OBJECT_VALUE ); END; /* * If the OBJECT qualifier is negated or absent, clear the OBJECT bit. */ WHEN (CLI$_NEGATED, CLI$_ABSENT ) OBJECT = FALSE; END; /* * Process the OPTIMIZE qualifier. */ SELECT (CLI$PRESENT ('OPTIMIZE') ); /* * Depending upon the way that the OPTIMIZE qualifier is used on the command * line, include the appropriate string on the compile command string. */ WHEN (CLI$_PRESENT ) COMPILE_STRING = COMPILE_STRING !! '/OPTIMIZE'; WHEN (CLI$_NEGATED ) COMPILE_STRING = COMPILE_STRING !! '/NOOPTIMIZE'; /* * If the OPTMIZE qualifier is not specified, then check the DEBUG bit. * If the DEBUG bit is set, the include the /NOOPTIMIZE qualifier on the * compile command string. */ WHEN (CLI$_ABSENT ) IF DEBUG THEN COMPILE_STRING = COMPILE_STRING !! '/NOOPTIMIZE'; END; /* * The compile command string is complete. Now include the file name on the * compile command string. */ COMPILE_STRING = COMPILE_STRING !! ' ' !! FILE_NAME; /* * Prepare the link command string. */ LINK_STRING = 'LINK'; /* * Process the LINK qualifier. */ SELECT (CLI$PRESENT ('LINK' ) ); WHEN (CLI$_PRESENT ) DO; /* * Get the linker qualifiers included in the LINK qualifier. */ IF CLI$GET_VALUE ('LINK', VALUE, LENGTH ) = SS$_NORMAL THEN LINK_STRING = LINK_STRING !! UNQUOTE (VALUE ); END; WHEN (CLI$_ABSENT, CLI$_NEGATED ); END; /* * If the DEBUG bit is set, include the /DEBUG qualifier on the link command * string. */ IF DEBUG THEN DO; LINK_STRING = LINK_STRING !! '/DEBUG'; RUN_STRING = 'RUN/DEBUG'; END; ELSE RUN_STRING = 'RUN'; /* * If the OBJECT bit is set and an object file name was specified, then * use that file name for the file to be linked and run. Else use the * file name specified in the command line. */ IF OBJECT & OBJECT_VALUE ^= '' THEN DO; RETURN_CODE = FILESCAN (OBJECT_VALUE, FSCN$_NAME, THE_NAME ); LINK_STRING = LINK_STRING !! ' ' !! TRIM (THE_NAME ); RUN_FILE = TRIM (THE_NAME ); END; ELSE DO; RETURN_CODE = FILESCAN (FILE_NAME, FSCN$_NAME, THE_NAME ); LINK_STRING = LINK_STRING !! ' ' !! TRIM (THE_NAME ); RUN_FILE = TRIM (THE_NAME ); END; /* * Process the EXTERNAL qualifier. */ SELECT (CLI$PRESENT ('EXTERNAL' ) ); WHEN (CLI$_PRESENT ) DO; /* * Search for the external file specified. If the file is not found, print * an appropriate error message and stop execution. */ RETURN_CODE = CLI$GET_VALUE ('EXTERNAL', VALUE, LENGTH ); IF ^FIND_FILE (VALUE ) THEN DO; PUT SKIP LIST ('External file not found. '); STOP; END; /* * Include the external file specification on the link command string. */ LINK_STRING = LINK_STRING !! ',' !! UNQUOTE (VALUE ); END; WHEN (CLI$_ABSENT, CLI$_NEGATED ); END; /* * Process the LIBRARY qualifier. */ SELECT (CLI$PRESENT ('LIBRARY' ) ); WHEN (CLI$_PRESENT ) DO; /* * Search for the library specified in the LIBRARY qualifier. If a file * type is not specified, default the file type to '.OLB'. */ RETURN_CODE = CLI$GET_VALUE ('LIBRARY', VALUE, LENGTH ); RETURN_CODE = FILESCAN (VALUE, FSCN$_TYPE, THE_TYPE ); IF THE_TYPE ^= '' THEN IF ^FIND_FILE (VALUE ) THEN DO; PUT SKIP LIST ('Library file ', VALUE, ' not found. ' ); STOP; END; ELSE; ELSE IF ^FIND_FILE (VALUE !! '.OLB' ) THEN DO; PUT SKIP LIST ('Library file ', VALUE, ' not found. ' ); STOP; END; ELSE; /* * Include the library file in the link command string. */ LINK_STRING = LINK_STRING !! ',' !! VALUE !! '/LIBRARY'; END; WHEN (CLI$_ABSENT, CLI$_NEGATED ); END; /* * Process the INSTALL qualifier. */ SELECT (CLI$PRESENT ('INSTALL' ) ); WHEN (CLI$_PRESENT ) DO; /* * Set the INSTALL bit. */ INSTALL = TRUE; /* * If a file name is included in the INSTALL qualifier, then check if a * file type was specified. If a file type was not specified then default * the file type to '.COM'. */ IF CLI$GET_VALUE ('INSTALL', VALUE, LENGTH ) = SS$_NORMAL THEN DO; RETURN_CODE = FILESCAN (VALUE, FSCN$_NAME, THE_NAME, FSCN$_TYPE, THE_TYPE ); IF THE_TYPE = '' THEN INSTALL_FILE = TRIM (THE_NAME ) !! '.COM'; ELSE INSTALL_FILE = TRIM (THE_NAME ) !! TRIM (THE_TYPE ); END; ELSE /* * If a file name was not specified, default the command file name to the * name of the file being compiled. */ DO; RETURN_CODE = FILESCAN (FILE_NAME, FSCN$_NAME, THE_NAME ); INSTALL_FILE = TRIM (THE_NAME ) !! '.COM'; END; END; /* * If the INSTALL qualifier is negated or abset, clear the INSTALL bit * and default the created command procedure to the name 'COMPILE_X.COM'. */ WHEN (CLI$_ABSENT, CLI$_NEGATED ) DO; INSTALL = FALSE; INSTALL_FILE = 'COMPILE_X.COM'; END; END; /* * Process the STEP qualifer. */ SELECT (CLI$PRESENT ('STEP' ) ); WHEN (CLI$_PRESENT ) DO; /* * If the STEP qualifier is specified, then get the keyword specified on * the STEP qualifier. */ IF CLI$GET_VALUE ('STEP', VALUE, LENGTH ) = SS$_NORMAL THEN STEP_STRING = VALUE; ELSE STEP_STRING = 'RUN'; END; /* * If the STEP qualifier is not specified then the default step is RUN. */ WHEN (CLI$_ABSENT, CLI$_NEGATED ) STEP_STRING = 'RUN'; END; /* * Process the AUDIT command. */ SELECT (CLI$PRESENT ('AUDIT' ) ); WHEN (CLI$_PRESENT ) DO; /* * If the AUDIT qualifier is specified, then set the AUDIT bit and check * to see if a log file name was specified in the AUDIT qualifier. */ AUDIT = TRUE; IF CLI$GET_VALUE ('AUDIT', VALUE, LENGTH ) = SS$_NORMAL THEN AUDIT_FILE = '/LOG=' !! VALUE; ELSE AUDIT_FILE = ''; END; WHEN (CLI$_ABSENT, CLI$_NEGATED ); END; /* * Process the INVOKE qualifier. */ SELECT (CLI$PRESENT ('INVOKE' ) ); /* * Depending upon the INVOKE qualifier, set the INVOKE bit with the * appropriate value. */ WHEN (CLI$_PRESENT ) INVOKE = TRUE; WHEN (CLI$_NEGATED ) INVOKE = FALSE; /* * If the INVOKE qualifier was not specified, the set the default action * depending upon the value of the INSTALL bit. */ WHEN (CLI$_ABSENT ) IF INSTALL THEN INVOKE = FALSE; ELSE INVOKE = TRUE; END; /* * Open the file to be written. */ OPEN FILE (COMP_FILE ) TITLE (INSTALL_FILE ) PRINT; /* * If the procedure is to be installed, include the code to allow deletion * of the command procedure. */ IF INSTALL THEN PUT FILE (COMP_FILE ) SKIP LIST ('$ IF P1 .EQS. "DELETE" THEN GOTO GET_RID_OF' ); /* * Prepare error handling. */ PUT FILE (COMP_FILE ) SKIP LIST ('$ ON ERROR THEN GOTO QUIT' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ ON CONTROL THEN GOTO QUIT' ); /* * If AUDIT is specified, prepare the terminal screen and invoke audit. */ IF AUDIT THEN DO; PUT FILE (COMP_FILE ) SKIP LIST ('$ SET TERMINAL/WIDTH=132' ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ AUDIT',AUDIT_FILE ) (A ); END; /* * Include compiling commands. */ PUT FILE (COMP_FILE ) SKIP EDIT ('$ WRITE SYS$OUTPUT "Compiling ', FILE_NAME, '."' ) (A ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ ',COMPILE_STRING ) (A ); /* * If the step string is not NOLINK then continue processing. */ IF STEP_STRING ^= 'NOLINK' THEN DO; /* * Include the linking commands. */ PUT FILE (COMP_FILE ) SKIP LIST ('$ WRITE SYS$OUTPUT "Linking . . ."' ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ ',LINK_STRING ) (A ); /* * If the step string is equal RUN then continue processing. */ IF STEP_STRING = 'RUN' THEN DO; /* * If the AUDIT bit is set, then include the command to type the list file. */ IF AUDIT THEN DO; PUT FILE (COMP_FILE ) SKIP EDIT ('$ TYPE ', LIST_FILE ) (A ); END; /* * Include run commands. */ PUT FILE (COMP_FILE ) SKIP LIST ('$ WRITE SYS$OUTPUT "Execution begins . . ."' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ ASSIGN/USER_MODE SYS$COMMAND: SYS$INPUT:' ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ ', RUN_STRING, ' ', RUN_FILE ) (A ); END; END; /* * Include ending code. */ PUT FILE (COMP_FILE ) SKIP LIST ('$ GOTO ENDUP' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ QUIT:' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ WRITE SYS$OUTPUT "Compilation aborted."' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ ENDUP:' ); /* * If the AUDIT bit is set, then finish the audit session. */ IF AUDIT THEN DO; PUT FILE (COMP_FILE ) SKIP LIST ('$ AUDIT/OFF ' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ SET TERMINAL/WIDTH=80'); PUT FILE (COMP_FILE ) SKIP LIST ('$ WRITE SYS$OUTPUT "The first AUDIT message has been erased from the screen. Please wait for the"' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ WRITE SYS$OUTPUT "second message to be displayed before printing the AUDIT log file."' ); END; /* * If the INSTALL bit is not set, the include the automatic deletion code. */ IF ^INSTALL THEN DO; PUT FILE (COMP_FILE ) SKIP EDIT ('$ DELETE ',INSTALL_FILE,';' ) (A ); PUT FILE (COMP_FILE ) SKIP LIST ('$ EXIT' ); END; ELSE /* * Else include the deletion code for a deletion specified by the user. */ DO; PUT FILE (COMP_FILE ) SKIP LIST ('$ EXIT' ); PUT FILE (COMP_FILE ) SKIP LIST ('$ GET_RID_OF:' ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ DELETE ',INSTALL_FILE,';' ) (A ); RETURN_CODE = FILESCAN (INSTALL_FILE, FSCN$_NAME, THE_NAME ); PUT FILE (COMP_FILE ) SKIP EDIT ('$ DELETE/SYMBOL/GLOBAL ', THE_NAME ) (A ); PUT FILE (COMP_FILE ) SKIP LIST ('$ EXIT' ); /* * Set the invoking symbol in the symbol table. */ RETURN_CODE = LIB$SET_SYMBOL (THE_NAME, '@'!!INSTALL_FILE, LIB$K_CLI_GLOBAL_SYM ); END; /* * If the INVOKE bit is set then invoke the command procedure. */ IF INVOKE THEN RETURN_CODE = LIB$DO_COMMAND ('@'!!INSTALL_FILE ); UNQUOTE: PROCEDURE (QUOTED_STRING ) RETURNS (CHARACTER (* ) VARYING ); DCL QUOTED_STRING CHARACTER (* ) VARYING; DCL LENGTH BUILTIN; /* * If quotes were included in the string, then strip them off. */ IF SUBSTR (QUOTED_STRING, 1, 1) = '"' THEN QUOTED_STRING = SUBSTR (QUOTED_STRING, 2, LENGTH (QUOTED_STRING ) - 2 ); RETURN (QUOTED_STRING ); END UNQUOTE; FIND_FILE: PROCEDURE (THE_FILE ) RETURNS (BIT (1 ) ); DCL THE_FILE CHARACTER (* ) VARYING; DCL CONTEXT FIXED BINARY (31 ) INITIAL (0 ); DCL STAT FIXED BINARY (31 ); DCL RESULT CHARACTER (255 ) VARYING; /* * Search for the indicated file. */ RETURN_CODE = LIB$FIND_FILE (THE_FILE, RESULT, CONTEXT, 'SYS$DISK:' !! DEFAULT, , , ); /* * Terminate the search. */ STAT = LIB$FIND_FILE_END (CONTEXT ); /* * If the file is found, RETURN_CODE will be RMS$_NORMAL. If RETURN_CODE * has any other value, then return that the file was not found. */ SELECT (RETURN_CODE ); WHEN (RMS$_NORMAL ) RETURN (TRUE ); OTHERWISE RETURN (FALSE ); END; END FIND_FILE; END COMPILE;