!+ ! NAME ! read_disk_size_table - reads in a file of disks with their block sizes ! ! DESCRIPTION ! This routine was added so that when the tool cannot obtain a disk ! maxblocks size because the disk is offline or not accessible, it ! can look in a table for this number. Otherwise, it will use the ! cumulative blocks as the maxblocks size. ! ! A line in this file can be a comment line - starting with an ! ! or can have the format: disk_name,disk_size ! ! A sample file follows: ! ! ! ! --------------------------------------------------------------------- ! ! ! ! File: DISK_SIZE.DAT ! ! Purpose: Contains list of STSI disks with their respective block sizes ! ! to be used when using Disk Report Tool. ! ! ! ! DLM: 9/21/88 Bauer First version. ! ! ! DISK$PTERO,891072 ! DISK$TRICERO,500384 ! DISK$ANKY,1216665 ! DISK$DEINO,1216665 ! DISK$STEGO,891072 ! $1$DUA13,891072 ! $1$DUA15,891072 ! $1$DUA16,891072 ! $1$DUA17,891072 ! EYEOF$DRA6,500384 ! GSSSA$DRA0,789600 ! KEPLER$DRA0,891072 ! NEWT$DRA5,500384 ! ! --------------------------------------------------------------------- ! ! RETURN VALUE ! ! HISTORY ! !- MODULE disk$read_disk_size_table IDENT 'v1.0'; ! ! Global Data Declarations ! DECLARE disk_size_table : GLOBAL TREE(STRING) OF INTEGER; ! ! Set Declarations ! SET digit ( '0' .. '9' ); SET alpha ( 'a'.. 'z' OR 'A'..'Z'); SET white_space ( ' ' OR s'ht' ); SET id_part ( alpha OR digit OR '_' OR '$' OR ';' OR '.' OR '_'); SET id_start ( alpha OR digit OR '_' OR '$' ); ! ! TOKEN Declarations ! TOKEN blanks_T IGNORE { white_space [white_space...] }; TOKEN number_T { digit [digit ...] }; TOKEN id_T { id_start [ id_part... ] }; TOKEN comma_T ALIAS ',' { ',' }; TOKEN comment_T ALIAS '!' { '!' }; TOKEN eol_T { s'eol' }; ! ! MACROS ! MACRO ignore_comments TRIGGER { comment_T FIND (s'eol') eol_T }; END MACRO; !+ ! ! This macro recognizes disk/directory names ! !- MACRO Get_dirdisk_line TRIGGER { the_disk: id_T ',' disk_size : number_T }; the_disk = UPPER(the_disk); disk_size_table(the_disk) = INTEGER(disk_size); END MACRO /* Get_dir */; ! ! PROCEDURES ! !+ ! NAME ! ! DESCRIPTION ! ! RETURN VALUE ! ! HISTORY ! !- PROCEDURE read_disk_size_table (what_file : STRING); DECLARE dump : FIXED STRING(1); START SCAN INPUT FILE what_file OUTPUT STRING dump; END PROCEDURE; PROCEDURE look_up_disk_size (for_disk : STRING) OF INTEGER; DECLARE temp : STRING; temp = UPPER(for_disk); IF EXISTS(disk_size_table(temp)) THEN return(disk_size_table(temp)); ELSE return(-1); END IF; END PROCEDURE; END MODULE;