<$DISKBLOCK061.E@DISKBLOCK061.EBACKUP/NOASSIST/NODISMOUNT/COMMENT=OpenVMS AXP SPKITBLD Procedure/INTER/LOG/VERIFY DISK$USER:[RANCE.DISKBLOCK.KIT061.SOURCE]*.* HOME:[DISKBLOCK.KIT]DISKBLOCK061.E/SAVE/BLOCK=9000/GROUP=25/NOINIT/NOREWIOpenVMS AXP SPKITBLD Procedure RANCE   arV7.3 _VIVIAN::  _DSA10: AXP72R001 $2,*[RANCE.DISKBLOCK.KIT061.SOURCE]CHECKSUM.C;17+,./ 4P`-h*0123KPWO 56c7+g89G HJ#include "diskblock.h"O/* This is the routine called by the CHECKSUM command from the command line */void checksum(void){O extern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */O const $DESCRIPTOR(home_qual,"HOMEBLOCK"); /* CLI Qualifier */O const $DESCRIPTOR(depos_qual,"DEPOSIT"); /* " " */O int status, /* VMS return status */O deposit; /* Flag to show CHECK /DEPOSIT */% status = cli$present(&depos_qual);# if ($VMS_STATUS_SUCCESS(status)) deposit = TRUE; else deposit = FALSE;@/* For CHECKSUM/HOME we first check the checksum at offset 58 */$ status = cli$present(&home_qual);# if ($VMS_STATUS_SUCCESS(status))1 checksum_buffer(rw_buff,TRUE, 58, deposit);L/* The checksum at offset 510 gets checked for CHECKSUM and CHECKSUM/HOME *// checksum_buffer(rw_buff,TRUE, 510, deposit); } /* End of CHECKSUM */F/* Routine to validate an ODS2 checksum at any offset in any buffer */unsigned long checksum_buffer(O unsigned char *buff, /* Address of buffer */O int message, /* TRUE = print status info */O int offset, /* # of bytes to checksum */O int deposit_flag /* TRUE = deposit new checksum */ ){O unsigned long checksum, /* Accumulated checksum */O old_checksum, /* Checksum in buffer */A i; /* loop counter */* /* Get original checksum from buffer */7 old_checksum = buff[offset] | (buff[offset+1] << 8); checksum = 0;P /* Accumulate new checksum (add buffer as unsigned words, discard overflow */& for (i=0; i <= (offset/2 - 1); i++)B checksum = checksum + buff[2*i] + ( (buff[(2*i)+1]) << 8); checksum = checksum & 0xffff; if (checksum == old_checksum)A { /* Checksum was valid */A if (message == TRUE) lib$signal(&DSKB_CHKVALID,1,checksum);) return 1;  }  elseO { /* Checksum was invalid */ if (deposit_flag == 1)O { /* New checksum is to be written */ extern unsigned short O modify_flag; /* 1 = I/O buffer has been modified */, buff[offset] = checksum & 0x00FF;, buff[offset+1] = (checksum & 0xFF00) >> 8; modify_flag = 1; if (message==TRUE)A lib$signal(&DSKB_CHKCHANGED,3,old_checksum,checksum); return 0; } elseO if (message==TRUE) /* Just report invalid checksum */A lib$signal(&DSKB_CHKINVALID,3,old_checksum,checksum); return 0; + } /* End of Checksum was invalid */.} /* End of checksum_buffer() */.*[RANCE.DISKBLOCK.KIT061.SOURCE]COMMANDS.CLD;35+,'.(/ 4O(!-h*0123KPWO)56x d7 Wor89G HJMODULE DISKBLOCK_COMMANDS DEFINE VERB READ_BLOCK ROUTINE READ_BLOCK/ PARAMETER P1 LABEL=BLOCK, VALUE (TYPE=$NUMBER); QUALIFIER FID, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)# QUALIFIER SCB, NONNEGATABLE DISALLOW (SCB and FID) DEFINE VERB WRITE_BLOCK ROUTINE WRITE_BLOCK/ PARAMETER P1 LABEL=BLOCK, VALUE (TYPE=$NUMBER); QUALIFIER FID, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)! QUALIFIER CHECKSUM, NONNEGATABLE, QUALIFIER FORCED_ERROR, NONNEGATABLE DEFINE VERB REWRITE_BLOCK ROUTINE REWRITE_BLOCK! QUALIFIER CHECKSUM, NONNEGATABLE, QUALIFIER FORCED_ERROR, NONNEGATABLE DEFINE VERB EXAMINE_BUFFER ROUTINE EXAMINE_BUFFER: PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED,TYPE=$NUMBER)9 QUALIFIER TIME, NONNEGATABLE, SYNTAX=EXAMINE_TIMEG QUALIFIER INSTRUCTION, NONNEGATABLE, SYNTAX=EXAMINE_INSTRUCTION* QUALIFIER LONGWORD, NONNEGATABLE, DEFAULT QUALIFIER WORD, NONNEGATABLE QUALIFIER BYTE, NONNEGATABLE7 DISALLOW ANY2(LONGWORD, WORD, BYTE, TIME, INSTRUCTION) DEFINE VERB DEPOSIT_BUFFER ROUTINE DEPOSIT_BUFFER6 QUALIFIER STRING, NONNEGATABLE, SYNTAX=DEPOSIT_STRING9 QUALIFIER TIME, NONNEGATABLE, SYNTAX=DEPOSIT_TIMEA PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED,TYPE=$NUMBER)> PARAMETER P2 LABEL=DATA, VALUE (REQUIRED,TYPE=$NUMBER)* QUALIFIER LONGWORD, NONNEGATABLE, DEFAULT QUALIFIER WORD, NONNEGATABLE QUALIFIER BYTE, NONNEGATABLE2 DISALLOW ANY2(STRING, TIME, LONGWORD, WORD, BYTE) DEFINE VERB UPDATE+ PARAMETER P1 LABEL=OPTION, PROMPT="What?",8 VALUE(REQUIRED,TYPE=UPDATE_OPTIONS) DEFINE VERB FILL_BUFFER ROUTINE FILL_BUFFER> PARAMETER P1 LABEL=DATA, VALUE (REQUIRED,TYPE=$NUMBER)* QUALIFIER LONGWORD, NONNEGATABLE, DEFAULT QUALIFIER WORD, NONNEGATABLE QUALIFIER BYTE, NONNEGATABLE$ DISALLOW ANY2(LONGWORD, WORD, BYTE) DEFINE VERB DUMP_BUFFER ROUTINE DUMP_BUFFER= QUALIFIER BLOCK, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER); QUALIFIER FID, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)% QUALIFIER HEX, NONNEGATABLE, DEFAULT QUALIFIER OCTAL, NONNEGATABLE QUALIFIER ASCII, NONNEGATABLE QUALIFIER DCL, NONNEGATABLE, QUALIFIER INSTRUCTIONS, NONNEGATABLE QUALIFIER FILE, NONNEGATABLE QUALIFIER HEADER, NONNEGATABLE QUALIFIER SCB, NONNEGATABLE$ QUALIFIER HOME, NONNEGATABLE- QUALIFIER ALPHA NONNEGATABLE, DEFAULT" QUALIFIER VAX NONNEGATABLE DISALLOW (ALPHA and VAX)4 DISALLOW (ALPHA or VAX) AND NOT INSTRUCTIONSN DISALLOW ANY2 (HEX, OCTAL, ASCII, DCL, INSTRUCTIONS, FILE, HEADER, SCB, HOME) DEFINE VERB SELECT_DRIVE ROUTINE SELECT_DISK= PARAMETER P1 LABEL=DRIVE, VALUE (REQUIRED,TYPE=$FILE)8 QUALIFIER FILE, NONNEGATABLE, SYNTAX SELECT_FILE! QUALIFIER OVERRIDE, NONNEGATABLE" QUALIFIER WRITE, NEGATABLE QUALIFIER NOMAP, NONNEGATABLE? QUALIFIER HOMELBN, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)@ QUALIFIER INDEXLBN, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)F QUALIFIER FACTOR, NONNEGATABLE, VALUE (REQUIRED, TYPE=$NUMBER), DISALLOW ANY2 (NOMAP,HOMELBN,INDEXLBN,FILE)6 DISALLOW (NOMAP or HOMELBN or FILE) and FACTOR( DISALLOW INDEXLBN and not FACTOR DEFINE VERB DESELECT ROUTINE DESELECT DEFINE VERB SAVE_BUFFER ROUTINE SAVE_BUFFER; QUALIFIER BLOCK VALUE (REQUIRED, LIST, TYPE=BLOCKS)3 PARAMETER P1 LABEL=FILE, VALUE (TYPE=$FILE)* DISALLOW BLOCK.END AND BLOCK.COUNT DEFINE VERB RESTORE_BUFFER ROUTINE RESTORE_BUFFER; QUALIFIER BLOCK VALUE (REQUIRED, LIST, TYPE=BLOCKS)3 PARAMETER P1 LABEL=FILE, VALUE (TYPE=$FILE)* DISALLOW BLOCK.END AND BLOCK.COUNT DEFINE VERB CHECKSUM ROUTINE CHECKSUM& QUALIFIER DEPOSIT, NONNEGATABLE( QUALIFIER HOMEBLOCK, NONNEGATABLE DEFINE VERB TEST ROUTINE TEST_DISK) QUALIFIER SEQUENTIAL, NONNEGATABLE) QUALIFIER W&n$DISKBLOCK061.E'h*.[RANCE.DISKBLOCK.KIT061.SOURCE]COMMANDS.CLD;35O(F  SINGLEPASS, NONNEGATABLE% QUALIFIER RANDOM, NONNEGATABLE: QUALIFIER BLOCK VALUE (REQUIRED, LIST, TYPE=BLOCKS)> QUALIFIER READPERCENT VALUE (TYPE=$NUMBER, DEFAULT=100)? QUALIFIER WRITEPERCENT VALUE (TYPE=$NUMBER, DEFAULT=100)* QUALIFIER DURATION VALUE (REQUIRED)5 QUALIFIER QUEUE VALUE (REQUIRED, TYPE=$NUMBER)6 QUALIFIER IOSIZE VALUE (REQUIRED, TYPE=$NUMBER)5 QUALIFIER DATA VALUE (REQUIRED, TYPE=TESTDATA) QUALIFIER COMPARE& QUALIFIER NOCACHE, NONNEGATABLE7 QUALIFIER CORRUPT VALUE (REQUIRED, TYPE=CORRUPT)* QUALIFIER SYNCHRONOUS, NONNEGATABLE% DISALLOW SEQUENTIAL AND RANDOM- DISALLOW SINGLEPASS AND NOT SEQUENTIAL% DISALLOW SYNCHRONOUS AND QUEUE) DISALLOW BLOCK.END AND BLOCK.COUNT, DISALLOW READPERCENT AND WRITEPERCENT  DEFINE TYPE CORRUPT KEYWORD DATA DEFINE TYPE TESTDATA KEYWORD BUFFER7 KEYWORD LONGWORD VALUE (REQUIRED, TYPE=$NUMBER)3 KEYWORD WORD VALUE (REQUIRED, TYPE=$NUMBER)3 KEYWORD BYTE VALUE (REQUIRED, TYPE=$NUMBER) DEFINE VERB SEARCH_DISK ROUTINE SEARCH_DISK* QUALIFIER OUTPUT VALUE (TYPE=$FILE): QUALIFIER BLOCK VALUE (REQUIRED, LIST, TYPE=BLOCKS)8 QUALIFIER STRING NONNEGATABLE VALUE (REQUIRED): QUALIFIER HEADER NONNEGATABLE VALUE (TYPE=$FILE)' QUALIFIER DUMP NONNEGATABLE QUALIFIER FULL F QUALIFIER LONGWORD NONNEGATABLE VALUE (REQUIRED, TYPE=$NUMBER)F QUALIFIER WORD NONNEGATABLE VALUE (REQUIRED, TYPE=$NUMBER)F QUALIFIER BYTE NONNEGATABLE VALUE (REQUIRED, TYPE=$NUMBER)9 QUALIFIER BEFORE, NONNEGATABLE, VALUE (REQUIRED)9 QUALIFIER SINCE, NONNEGATABLE, VALUE (REQUIRED)' QUALIFIER BACKUP, NONNEGATABLE' QUALIFIER CREATED, NONNEGATABLE' QUALIFIER EXPIRED, NONNEGATABLE' QUALIFIER MODIFIED, NONNEGATABLE9 DISALLOW ANY2 (BACKUP, CREATED, EXPIRED, MODIFIED)I DISALLOW BEFORE AND NOT (BACKUP or CREATED or EXPIRED or MODIFIED)H DISALLOW SINCE AND NOT (BACKUP or CREATED or EXPIRED or MODIFIED)C DISALLOW (BACKUP or CREATED or EXPIRED or MODIFIED) AND NOT ! (SINCE or BEFORE)0 DISALLOW (BEFORE or SINCE) AND NOT HEADER) DISALLOW BLOCK.END AND BLOCK.COUNT= DISALLOW ANY2 (LONGWORD, WORD, BYTE, STRING, HEADER)E DISALLOW NOT (LONGWORD or WORD or BYTE or STRING or HEADER)# DISALLOW FULL AND NOT HEADER DEFINE VERB HELP ROUTINE HELP_REQUEST6 PARAMETER P1 LABEL=TOPIC VALUE (TYPE = $REST_OF_LINE) DEFINE VERB SHOW ROUTINE SHOW_STATUS DEFINE VERB SPAWN ROUTINE SPAWN8 PARAMETER P1 LABEL=COMMAND VALUE (TYPE = $REST_OF_LINE) DEFINE VERB ATTACH ROUTINE ATTACH3 PARAMETER P1 LABEL=PROCESS VALUE (REQUIRED) DEFINE VERB COPY_FILE ROUTINE COPY_FILE, PARAMETER P1 LABEL=LBN VALUE (TYPE=$NUMBER)2 QUALIFIER OUTPUT VALUE (REQUIRED,TYPE = $FILE)4 QUALIFIER FACTOR VALUE (REQUIRED,TYPE = $NUMBER); QUALIFIER FID, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)& QUALIFIER BUFFER, NONNEGATABLE DISALLOW BUFFER and FID DEFINE VERB DIRECTORY ROUTINE DIRECTORY# PARAMETER P1 LABEL=FILENAME; QUALIFIER FID, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER)@ QUALIFIER LBN, NONNEGATABLE, VALUE (REQUIRED,TYPE=$NUMBER,LIST)@ QUALIFIER BACKFID, NONNEGATABLE, VALUE (REQUIRED, TYPE=$NUMBER)J QUALIFIER COUNT, NONNEGATABLE, VALUE (REQUIRED, TYPE=$NUMBER,LIST)M QUALIFIER SELECT, NONNEGATABLE, VALUE (REQUIRED, TYPE=SELECT_OPTIONS)' QUALIFIER DELETED, NONNEGATABLE% QUALIFIER VALID, NONNEGATABLEE QUALIFIER BY_OWNER, NONNEGATABLE, VALUE (REQUIRED, TYPE=$UIC)G QUALIFIER ACE, NONNEGATABLE, VALUE (REQUIRED, TYPE=ACE_OPTIONS)$ QUALIFIER FULL, NONNEGATABLE) QUALIFIER PLACEMENT, NONNEGATABLE1 QUALIFIER BEFORE, NONNEGATABLE, VALUE (REQUIRED)0 QUALIFIER SINCE, NONNEGATABLE, VALUE (REQUIRED)& QUALIFIER BACKUP, NONNEGATABLE' QUALIFIER CREATED, NONNEGATABLE' QUALIFIER EXPIRED, NONNEGATABLE( QUALIFIER MODIFIED, NONNEGATABLE3 QUALIFIER OUTPUT, NONNEGATABLE, VALUE (TYPE=$FILE): DISALLOW ANY2 (BACKUP, CREATED, EXPIRED, MODIFIED)J DISALLOW BEFORE AND NOT (BACKUP or CREATED or EXPIRED or MODIFIED)I DISALLOW SINCE AND NOT (BACKUP or CREATED or EXPIRED or MODIFIED)D DISALLOW (BACKUP or CREATED or EXPIRED or MODIFIED) AND NOT " (SINCE or BEFORE)$ DISALLOW (VALID and DELETED) DISALLOW (FID and LBN)$ DISALLOW (COUNT and not LBN) DEFINE TYPE ACE_OPTIONS& KEYWORD ID, VALUE (TYPE=$UIC)  DEFINE TYPE SELECT_OPTIONSB KEYWORD SIZE, DEFAULT, VALUE (LIST, type=SEL_SIZE_OPTIONS) DEFINE TYPE SEL_SIZE_OPTIONS: KEYWORD MINIMUM_SIZE, DEFAULT, VALUE (DEFAULT="0")H KEYWORD MAXIMUM_SIZE, DEFAULT, VALUE (DEFAULT="1073741823")  DEFINE VERB EXIT ROUTINE DISKBLOCK_EXIT DEFINE VERB SET ROUTINE SET_NYI1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS) DEFINE SYNTAX DEPOSIT_STRING ROUTINE DEPOSIT_STRING QUALIFIER STRING, NONNEGATABLEA PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED,TYPE=$NUMBER)1 PARAMETER P2 LABEL=DATA, VALUE (REQUIRED) DEFINE SYNTAX DEPOSIT_TIME ROUTINE DEPOSIT_TIME# QUALIFIER TIME NONNEGATABLEB PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED, TYPE=$NUMBER)1 PARAMETER P2 LABEL=DATA, VALUE (REQUIRED) DEFINE SYNTAX EXAMINE_TIME ROUTINE EXAMINE_TIME# QUALIFIER TIME NONNEGATABLEB PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED, TYPE=$NUMBER)$ DEFINE SYNTAX EXAMINE_INSTRUCTION# ROUTINE EXAMINE_INSTRUCTION* QUALIFIER INSTRUCTION NONNEGATABLEB PARAMETER P1 LABEL=ADDRESS, VALUE (REQUIRED, TYPE=$NUMBER) DEFINE SYNTAX SELECT_FILE ROUTINE SELECT_FILE< PARAMETER P1 LABEL=FILE, VALUE (REQUIRED,TYPE=$FILE)8 QUALIFIER FILE, NONNEGATABLE, SYNTAX SELECT_FILE+ QUALIFIER WRITE, NEGATABLE, DEFAULT DEFINE SYNTAX UPDATE_HEADER ROUTINE UPDATE_HEADER+ PARAMETER P1 LABEL=OPTION, PROMPT="What?",8 VALUE(REQUIRED,TYPE=UPDATE_OPTIONS): QUALIFIER IDOFFSET, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER MPOFFSET, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER ACOFFSET, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER RSOFFSET, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER SEGNUM, VALUE (REQUIRED, TYPE=$NUMBER)2 QUALIFIER STRUCLEV, VALUE (DEFAULT=%X0201)? QUALIFIER FID, VALUE (REQUIRED, TYPE=$NUMBER,LIST): QUALIFIER FIDNUM, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER FIDSEQ, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER FIDRVN, VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER FIDNMX, VALUE (REQUIRED, TYPE=$NUMBER)? QUALIFIER EXTFID, VALUE (REQUIRED, TYPE=$NUMBER,LIST): QUALIFIER EXTFIDNUM VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER EXTFIDSEQ VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER EXTFIDRVN VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER EXTFIDNMX VALUE (REQUIRED, TYPE=$NUMBER)D !QUALIFIER RECATTR VALUE (REQUIRED, TYPE=RECATTR_TYPE,LIST)@ QUALIFIER FILECHAR VALUE (REQUIRED, TYPE=FILECHAR_TYPE): QUALIFIER MAPINUSE VALUE (REQUIRED, TYPE=$NUMBER), QUALIFIER ACCMODE VALUE (DEFAULT=0)7 QUALIFIER FILEOWNER VALUE (REQUIRED, TYPE=$UIC)= QUALIFIER FILEPROT VALUE (REQUIRED, TYPE=PROTECTION)? QUALIFIER BACKFID VALUE (REQUIRED, TYPE=$NUMBER,LIST): QUALIFIER BKFIDNUM VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER BKFIDSEQ VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER BKFIDRVN VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER BKFIDNMX VALUE (REQUIRED, TYPE=$NUMBER)B QUALIFIER JOURNAL VALUE (REQUIRED, TYPE=JOURNAL_OPTIONS): QUALIFIER RUACTIVE VALUE (REQUIRED, TYPE=$NUMBER): QUALIFIER HIGHWATER VALUE (REQUIRED, TYPE=$NUMBER) !QUALIFIER CLASSPROT ? DISALLOW FID AND (FIDNUM or FIDSEQ or FIDRVN or FIDNMX)N DISALLOW EXTFID AND (EXTFIDNUM or EXTFIDSEQ or EXTFIDRVN or EXTFIDNMX)K DISALLOW BACKFID AND (BKFIDNUM or BKFIDSEQ or BKFIDRVN or BKFIDNMX)O DISALLOW NOT (IDOFFSET or MPOFFSET or ACOFFSET or RSOFFSET or SEGNUM orN STRUCLEV or $DISKBLOCK061.E'h*.[RANCE.DISKBLOCK.KIT061.SOURCE]COMMANDS.CLD;35O($FID or FIDNUM or FIDSEQ or FIDRVN or FIDNMX J or EXTFID or EXTFIDNUM or EXTFIDSEQ or EXTFIDRVN or F EXTFIDNMX or FILECHAR or MAPINUSE or ACCMODE or O FILEOWNER or FILEPROT or BACKFID or BKFIDNUM or BKFIDSEQ G or BKFIDRVN or BKFIDNMX or JOURNAL or RUACTIVE or HIGHWATER) DEFINE TYPE BLOCKS, KEYWORD START, VALUE (TYPE=$NUMBER), KEYWORD END, VALUE (TYPE=$NUMBER), KEYWORD COUNT, VALUE (TYPE=$NUMBER) DEFINE TYPE UPDATE_OPTIONS: KEYWORD HEADER, NONNEGATABLE, syntax=UPDATE_HEADER DEFINE TYPE SET_OPTIONS3 KEYWORD LOG, NONNEGATABLE, syntax = SET_LOG5 KEYWORD PAGE, NONNEGATABLE, syntax = SET_PAGE9 KEYWORD NOPAGE, NONNEGATABLE, syntax = SET_NOPAGE7 KEYWORD WRITE, NONNEGATABLE, syntax = SET_WRITE; KEYWORD NOWRITE, NONNEGATABLE, syntax = SET_NOWRITE DEFINE TYPE LBNVBN* KEYWORD LBN, VALUE (TYPE=$NUMBER), KEYWORD VBN, VALUE (TYPE=$NUMBER) DEFINE TYPE LBNVBNSIZE* KEYWORD LBN, VALUE (TYPE=$NUMBER), KEYWORD VBN, VALUE (TYPE=$NUMBER)- KEYWORD SIZE, VALUE (TYPE=$NUMBER) DEFINE TYPE PROTECTION2 KEYWORD SYSTEM, VALUE  KEYWORD OWNER, VALUE KEYWORD GROUP, VALUE KEYWORD WORLD, VALUE DEFINE TYPE VOLCHAR_OPTIONS# KEYWORD READCHECK NEGATABLE# KEYWORD WRITCHECK NEGATABLE KEYWORD ERASE NEGATABLE# KEYWORD HIGHWATER NEGATABLE$ KEYWORD CLASS_PROT NEGATABLE5 KEYWORD VALUE, VALUE (REQUIRED, TYPE=$NUMBER) DEFINE TYPE RECATTR_TYPE$ KEYWORD FORTRAN NEGATABLE$ KEYWORD PRINT NEGATABLE$ KEYWORD BLOCK NEGATABLE DEFINE TYPE FILECHAR_TYPE$ KEYWORD BACKUP NEGATABLE$ KEYWORD WRITEBACK NEGATABLE$ KEYWORD READCHECK NEGATABLE$ KEYWORD WRITECHECK NEGATABLE$ KEYWORD CONTIGB NEGATABLE$ KEYWORD LOCKED NEGATABLE$ KEYWORD CONTIG NEGATABLE$ KEYWORD BADACL NEGATABLE$ KEYWORD SPOOL NEGATABLE$ KEYWORD DIRECTORY NEGATABLE$ KEYWORD BADBLOCK NEGATABLE$ KEYWORD MARKDEL NEGATABLE$ KEYWORD NOCHARGE NEGATABLE$ KEYWORD ERASE NEGATABLE$ KEYWORD WASCONTIG NEGATABLE5 KEYWORD VALUE, VALUE (REQUIRED, TYPE=$NUMBER) DEFINE TYPE JOURNAL_OPTIONS! KEYWORD ONLY_RU NEGATABLE KEYWORD RUJNL NEGATABLE KEYWORD BIJNL NEGATABLE KEYWORD AIJNL NEGATABLE KEYWORD ATJNL NEGATABLE" KEYWORD NEVER_RU NEGATABLE& KEYWORD JOURNAL_FILE NEGATABLE5 KEYWORD VALUE, VALUE (REQUIRED, TYPE=$NUMBER) DEFINE SYNTAX SET_LOG ROUTINE SET_LOG$ QUALIFIER CLOSE NONNEGATABLE1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS)4 PARAMETER P2 LABEL=FILE, VALUE(TYPE=$INFILE) DEFINE SYNTAX SET_PAGE ROUTINE SET_PAGE1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS) DEFINE SYNTAX SET_NOPAGE ROUTINE SET_NOPAGE1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS) DEFINE SYNTAX SET_WRITE ROUTINE SET_WRITE1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS) DEFINE SYNTAX SET_NOWRITE ROUTINE SET_NOWRITE1 PARAMETER P1 LABEL=OPTION, PROMPT="What",5 VALUE(REQUIRED,TYPE=SET_OPTIONS)/*[RANCE.DISKBLOCK.KIT061.SOURCE]COMMON_DATA.C;16+,!./ 4R -h*0123KPWO56g7#~89G HJL/***************************************************************************L * This module contains all data that is used by more than one module in *L * diskblock. The same data needs to be defined as extern in any routine *L * which uses it. *M ***************************************************************************/#include "diskblock.h"?const char carry_on[] = "Do you want to continue? : ";Cconst char use_it[] = "Do you want to use it anyway? ";Rconst char define_help[] = "Define DSKB_HLB dev:[dir]DISKBLOCK.HLB to use help\n";?const $DESCRIPTOR(cr_to_continue, "Type a to continue: ");-const char unicode_name[] = "*Unicode-Name*";unsigned short O ast_channel, /* I/O channel for handling ^T ast interrupts */O disk_channel, /* I/O channel for disk reads/writes */ O /* Assorted flags */O modify_flag, /* 1 = I/O buffer has been modified */H access_flag, /* 1 = Selected drive/file has been accessed */O file_flag, /* 1 = File selected, 0 = Disk selected */O protect_flag, /* 1 = SELECT/NOWRITE */O output_flag, /* 1 = SEARCH /OUTPUT, 3=data in buffers */O log_flag, /* 1 = SET LOG file open, 3=data in buffers */O term_flag, /* 1 = SYS$OUTPUT is a terminal */O controlc_flag, /* 1 = Control C has been typed */O controlt_flag; /* 1 = Control T has been typed */unsigned long O last_block, /* VBN/LBN of last block read/written */O last_fid, /* Last FID successfully read/written */O flush_efn, /* EFN used by $SETIMR to flush RMS buffers */O /* Information returned by sys$getjpi in MAIN */J pid, /* PID of invoking process */O /* Information returned by sys$getdvi in SELECT */O max_block, /* Used for checking user LBNs */O maxpercent=100, /* Used for checking percentages */O track_size; /* Used as I/O size for search */Ochar real_dev[NAM$C_MAXRSS]; /* Selected device Name */struct dsc$descriptor_s L real_dev_desc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, real_dev };Munsigned char rw_buff[512]; /* Main Read/Write buffer */>$DESCRIPTOR(help_logical,"DSKB_HLB"); /* HELP Library name */Mstruct DSKB_IO dskb_io[2]; /* Descriptions of two possible I/Os */,/* RMS structures used for SEARCH /OUTPUT */Mstruct FAB outfab; /* File attributes block */Mstruct NAM outnam; /* Name block */Mstruct RAB outrab; /* Record attributes block */Mchar outfilespec[NAM$C_MAXRSS]; /* Full filename returned by RMS */,/* RMS structures used for SET LOG */Mstruct FAB logfab; /* File attributes block */Mstruct NAM lognam; /* Name block */Mstruct RAB lograb; /* Record attributes block */Mchar logfilespec[NAM$C_MAXRSS]; /* Full filename returned by RMS */Mint fifteen_secs[2]; /* VMS Quadword for 15 seconds */Mint thirty_secs[2]; /* VMS Quadword for 30 seconds */M/* These arrays are filled in during SELECT to show the indexfile extents */Munsigned long index_lbn[150], /* Starting LBN for this extent */M index_cnt[150], /* Blocks in this extent */M 5$DISKBLOCK061.E!h*/[RANCE.DISKBLOCK.KIT061.SOURCE]COMMON_DATA.C;16R index_tot[150], /* Blocks in this + earlier extents */M vbn_factor; /* Cluster_size*4 + bitmapsize */-*[RANCE.DISKBLOCK.KIT061.SOURCE]COPY_FILE.C;32+,$.8/ 4\83-h*0123KPWO956.7ե89G HJ#include "diskblock.h"void copy_file(void){M extern const char carry_on[]; /* "Do you want to continue? */ extern unsigned shortM disk_channel, /* Channel for Disk or File I/O */M file_flag, /* 1 = File selected, 0 = Disk selected */M controlc_flag; /* 1 = control C has been entered */M extern unsigned long max_block, /* Used for checking user LBN */M index_cnt[150]; /* Used to check indexf is mapped */4 void close_rms(struct FAB *fab, struct NAM *nam);M unsigned long status, /* VMS status return */M filename_size, /* Length of input filename */M function, /* VMS $QIO function */M iosb[2], /* VMS I/O status block */M block, /* LBN/FID to be read */M lbn, /* LBN to read from disk */M count, /* Number of LBNs in this extent */M next_fid, /* FID of extension file header */M i; /* Loop counter */9 char default_filespec[] = "SYS$SCRATCH:COPY_FILE.DAT";O const $DESCRIPTOR(lbn_param, "LBN"); /* CLI parameter name */O const $DESCRIPTOR(fid_qual,"FID"); /* CLI qualifier */O const $DESCRIPTOR(file_param, "OUTPUT"); /* CLI qualifier */O const $DESCRIPTOR(buff_qual, "BUFFER"); /* CLI qualifier */M char file_name[NAM$C_MAXRSS]; /* File name entered by user */M $DESCRIPTOR(file_desc,file_name); /* descriptor for "" "" "" */M char full_filespec[NAM$C_MAXRSS]; /* Full filename returned by RMS */M $DESCRIPTOR(full_filedesc,full_filespec); /* descriptor for "" "" " */D struct FAB fab; /* File attributes block */D struct NAM nam; /* Name block */D struct RAB rab; /* Record attributes block */N struct fibdef fib; /* File information block used by ACP $QIO */N unsigned short acp_channel; /* $QIO channel used by ACP $QIO */ struct FIB_DESC fib_desc = {* FIB$C_LENGTH,! &fib };N char uchar[ATR$S_UCHAR], /* User file characteristics */N recattr[ATR$S_RECATTR], /* Record characteristics */N uic[ATR$S_UIC], /* File owner UIC */N fpro[ATR$S_FPRO]; /* File protection */J const struct atrdef copy_attrib[5] = /* Pointer to above attributes */ { #ifdef VAX: {ATR$S_UCHAR, ATR$C_UCHAR, (unsigned int)&uchar},@ {ATR$S_RECATTR, ATR$C_RECATTR, (unsigned int)&recattr},4 {ATR$S_UIC, ATR$C_UIC, (unsigned int)&uic},7 {ATR$S_FPRO, ATR$C_FPRO, (unsigned int)&fpro},#elseL {ATR$S_UCHAR, ATR$C_UCHAR, &uchar}, 2 {ATR$S_RECATTR, ATR$C_RECATTR, &recattr},& {ATR$S_UIC, ATR$C_UIC, &uic},) {ATR$S_FPRO, ATR$C_FPRO, &fpro},#endif {0,0,0} };B unsigned char *aclbuf; /* Buffer to hold ACL from input */O unsigned char *oneace; /* Pointer to one ACE from aclbuf */9 int acllen; /* Total length of ACL */O int this_acllen; /* Length of ACL on current header */I const int objtyp = ACL$C_FILE; /* Object type for sys$change_acl */ struct ITEM_LIST { short int buffer_length; short int item_code; int address; int retlen; } acl_list[2]; O struct atrdef del_acl[2] = /* File attributes used to delete entire ACL */ {! {0, ATR$C_DELETEACL, 0}, {0,0,0} };F struct atrdef copy_acl[2] = /* File attributes used to add ACEs */ {/ {ATR$S_ADDACLENT, ATR$C_ADDACLENT, 0}, {0,0,0} };: FH2 header; /* Buffer to hold file header */? FM2 *next_map; /* Pointer to next indexf map pointer */5 unsigned int copy_blocks(int lbn, int block_count,L struct FAB *fab, struct RAB *rab, struct NAM *nam); if (disk_channel == 0) {K /* Print No disk or file selected and immediately return to caller */ lib$signal(&DSKB_NOSEL,0); return; } if (file_flag==1) {O /* COPY doesn't make sense if a FILE is selected, only works for DISKs */" lib$signal(&DSKB_NOTFILE,0); return; };/* Check for the qualifiers /FID and /BUFFER and /BLOCKS */;/* fill in header with the file header to be copied */$ status = cli$present(&buff_qual);? if ($VMS_STATUS_SUCCESS(status)) /* Copy /BUFFER */ { L extern unsigned char rw_buff[512]; /* Main Read/Write buffer */T status = check_header((FH2 *)&rw_buff); /* Is it a valid file header? */' if (!$VMS_STATUS_SUCCESS(status)) {< lib$signal(&DSKB_BADHEADER,0,status,0); /* NOPE! */F if (!$VMS_STATUS_SUCCESS(status=(yes_no(carry_on)))) return; } 4 memcpy ((char *)&header, &rw_buff, 512); , } I else /* End of COPY /BUFFER */+ { & status = cli$present(&fid_qual);+ if ($VMS_STATUS_SUCCESS(status)) I { /* COPY /FID=nnn */: status = get_integer(&fid_qual,max_block,&block);; if (!$VMS_STATUS_SUCCESS(status)) return; 4 if (fid_to_lbn(block, &block) == 0) return;I } /* End of COPY /FID=nnn */ elseI { /* COPY nnn */; status = get_integer(&lbn_param,max_block,&block);* if (!$VMS_STATUS_SUCCESS(status)) {C if (status == CLI$_ABSENT) lib$signal(&DSKB_NOBLOCK,0); return; } K } /* End of COPY nnn */ Q status = read_header((char *)&header,block); /* Read the header */' if (!$VMS_STATUS_SUCCESS(status)) {0 lib$signal(&DSKB_BADHEADER,0,status,0);= if (!$VMS_STATUS_SUCCESS(status=(yes_no(carry_on)))) return; } }K controlc_flag = 0; /* Flag my be set by an AST */) /* Initialise the output FAB block */ fab = cc$rms_fab;P fab.fab$l_dna = &default_filespec[0]; /* Default filespec */P fab.fab$b_dns = sizeof(default_filespec); /* # Bytes in default filespec */P fab.fab$b_fac = FAB$M_PUT & FAB$M_GET; /* Going to read/write this file */P fab.fab$l_fop = FAB$M_TEF & FAB$M_SQO; /* Truncate file on close */P /* Sequential operations only */P fab.fab$l_nam = &nam; /* Address of expanded name bloc */P fab.fab$b_org = FAB$C_SEQ; /* Sequential file */P fab.fab$b_rfm = FAB$C_FIX; /#$DISKBLOCK061.E$h*-[RANCE.DISKBLOCK.KIT061.SOURCE]COPY_FILE.C;32\8"* Fixed size records */P fab.fab$b_shr = FAB$M_NIL; /* No record sharing */M fab.fab$w_mrs = 512; /* Record size 512 bytes */( /* Initialise the output NAM block */ nam = cc$rms_nam;X nam.nam$l_rsa = (char *)&full_filespec; /* Full filename wanted at this address */P nam.nam$b_rss = NAM$C_MAXRSS; /* maximum size of full filename */! /* Initialise the RAB block */ rab = cc$rms_rab;P rab.rab$l_fab = &fab; /* FAB address */P rab.rab$b_rac = RAB$C_SEQ; /* Sequential access */P file_desc.dsc$w_length = NAM$C_MAXRSS; /* Maximum input filename length */ status=cli$get_value(O &file_param, /* Parameter name */O &file_desc, /* Returned string */O &file_desc.dsc$w_length /* Returned length */! );# if ($VMS_STATUS_SUCCESS(status)) {P /* Get the length and address of the filename string into the fab... */D str$analyze_sdesc(&file_desc, &filename_size, &fab.fab$l_fna);$ fab.fab$b_fns = filename_size; } else { if (status == CLI$_ABSENT) {+ /* Use filename from input file */X get_name(&header,(char *)&file_name); /* This routine is in DIRECTORY.C */# fab.fab$l_fna = file_name;$ fab.fab$b_fns = strlen(file_name); } else return; }4 /* Get the EXTENSION fid from this file header */% next_fid = header.fh2$w_ex_fidnum;M /* If there is an extension header AND we haven't mapped the index file */M /* Then give the user an opportunity to give up now... */0 if ( (index_cnt[0] == 0) && (next_fid != 0) ) {@ lib$signal(&DSKB_NOEXTHDR, 1, next_fid, &DSKB_NOINDEXF,0);: if (!$VMS_STATUS_SUCCESS(status=(yes_no(carry_on)))) return; } /* Create the output file */! status = sys$create(&fab,0,0); if (status == RMS$_FEX) {I /* This error is because we have specified a version number and */I /* that file already exists, remove the version number from the */I /* filename that we are creating and try again... */ unsigned char *semicolon;\ semicolon = (unsigned char *)strchr(file_name,'\x3b'); /* Find the semicolon */K semicolon[0] = '\0'; /* Replace it with a NULL */K fab.fab$b_fns = strlen(file_name); /* Change the string length */O status = sys$create(&fab,0,0); /* Try to create the file again */ }$ if (!$VMS_STATUS_SUCCESS(status)) {? lib$signal(&DSKB_CREATERR,1,&file_desc,fab.fab$l_stv,0); return; } O /* The file has been successfully created so connect an RMS record stream */< if (!$VMS_STATUS_SUCCESS(status = sys$connect(&rab,0,0))) {= lib$signal(&DSKB_OPENERR,1,&file_desc,rab.rab$l_sts,0); close_rms(&fab,&nam); return; }6 /* Put out an info message with the new filename */; lib$signal(&DSKB_CREATED,2,nam.nam$b_rsl,nam.nam$l_rsa);' /* Check this header for any ACEs */; /* The ACL in a header runs from ACOFFSET to RSOFFSET */ aclbuf = NULL; acllen = 0;E this_acllen = (header.fh2$b_rsoffset - header.fh2$b_acoffset) *2 ; if (this_acllen != 0)C { /* This header has an ACL so copy it to the end of aclbuf */6 aclbuf = realloc(aclbuf, acllen + this_acllen); J memcpy(aclbuf+acllen, /* Destination */J (short *)&header + header.fh2$b_acoffset, /* Source */J this_acllen); /* Length */ acllen += this_acllen;  }G /* Whilst there is still mapping information in this file header, */G /* or another file header to be mapped */< while ( (header.fh2$b_map_inuse !=0) || (next_fid != 0) ) {C for (i=0, next_map=NULL ; (header.fh2$b_map_inuse !=0) ; i++) {; /* Find the count and LBN for the next file extent */G map_extent(&header, &next_map, (int *)&count, (int *)&lbn, 0); if (count != 0) 2 lib$signal(&DSKB_COPYING,2,count,lbn);N /* If extent has more than 15 blocks then split into 15 block I/Os */ while (count != 0) {& unsigned long block_count; if (count < 15) {# block_count = count; count = 0; } else { block_count = 15;" count = count - 15; }E status = copy_blocks(lbn, block_count, &fab, &rab, &nam);. if (!$VMS_STATUS_SUCCESS(status)) {G /* We have had an error in the copy blocks routine, */G /* retry ONE block at a time */$ if (block_count != 1) {2 count = count + block_count - 1;" block_count = 1;K status = copy_blocks(lbn, block_count, &fab, &rab, &nam);3 if (!$VMS_STATUS_SUCCESS(status)) {O /* We have now found the failing block and reported it. */ } } }$ lbn = lbn + block_count;O if (controlc_flag == 1) /* Check to see if a ^C has been typed */ {$ close_rms(&fab,&nam); return; }; } /* All blocks on This extent done */; } /* All extents on this file header done */0 /* Check for an(other) extension header */ if (next_fid != 0)P { /* There is an extension header */A lib$signal(&DSKB_EXTFID,1,next_fid); /* Tell the user */@ if (fid_to_lbn(next_fid,&block) ==0) /* INVALID FID */ { status = 0; next_fid = 0; } else {R if (!$VMS_STATUS_SUCCESS(status=(read_header((char *)&header,block))))G lib$signal(&DSKB_RDBADHEADER,2,next_fid,block,status,0); }0 if ( (!$VMS_STATUS_SUCCESS(status)) && @ (!$VMS_STATUS_SUCCESS(status=(yes_no(carry_on))))  ) M next_fid = 0; /* Can't read header */ else . next_fid = header.fh2$w_ex_fidnum;; /* Check this header for an access control list */K this_acllen = (header.fh2$b_rsoffset - header.fh2$b_acoffset) *2 ; if (this_acllen != 0)I { /* This header has an ACL so copy it to the end of aclbuf */< aclbuf = realloc(aclbuf, acllen + this_acllen);P memcpy(aclbuf+acllen, /* Destination */P (short *)&header + header.fh2$b_acoffset, /* Source */P this_acllen); /* Length */% acllen += this_acllen; }) } /* End of if (next_fid != 0) */@ } /* End of while ( (header.fh2$b_map_inuse != 0)... */O close_rms(&fab,&nam); /* The file has been completely copied, so close it */D /* Now open the output file again using the $QIO ACP interface */D /* to set the File Header contents correctly... */" /* Initialise the fib block */ memset(&fib,0,FIB$C_LENGTH);= /* Copy the File ID from the nam block to the fib block */1 memcpy( &fib.FIB_FID , &nam.nam$w_fid[0], 6 );# /* Set the fib to be writable */ fib.FIB_ACCTL = FIB$M_WRITE;E /* Initialise the descriptor with the full filename for $ASSIGN */. full_filedesc.dsc$w_length = nam.nam$b_rsl;( /* Assign a channel to the device */ status = sys$assign(E &full_filedesc, /* Device Name */E &acp_channel, /* Returned Channel number */E 0, /* Access Mode */E 0 /* Mailbox Name */ );$ if (!$VMS_STATUS_SUCCESS(status)) {9 lib$signal(&DSKB_ASNERR,1,&full_filedesc,status,0); return; }' function = IO$_ACCESS | IO$M_ACCESS;g $DISKBLOCK061.E$h*-[RANCE.DISKBLOCK.KIT061.SOURCE]COPY_FILE.C;32\8d"! status = sys$qiow("A 0, /* Event Flag Number */ A acp_channel, /* I/O channel */tA function, /* I/O function code */ A iosb, /* I/O status block address */,A 0, /* AST Address */oA 0, /* AST Parameter */_A &fib_desc, /* P1, fib descriptor */ A 0, /* P2, not used */ A 0, /* P3, not used */oA 0, /* P4, not used */ A 0, /* P5, not used */ A 0); /* P6, not used */ 5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0]; $ if (!$VMS_STATUS_SUCCESS(status)) {# /* Failed to open the file *//: lib$signal(&DSKB_OPENERR,1,&full_filedesc,status,0); return;  }B /* Now delete any ACEs that got added to the file by default */ function = IO$_MODIFY;e status = sys$qiow( < 0, /* Event Flag Number */< acp_channel, /* I/O channel */< function, /* I/O function code */< iosb, /* I/O status block address */< 0, /* AST Address */< 0, /* AST Parameter */< &fib_desc, /* P1, fib descriptor */< 0, /* P2, not used */< 0, /* P3, not used */< 0, /* P4, not used */< &del_acl, /* P5, attributes block */< 0); /* P6, not used */O /* Now copy the Access control list from buffer aclbuf to the output file */e if (acllen > 0) { int acl_left;s acl_left = acllen; oneace = aclbuf; while (acl_left > 0) { / copy_acl[0].atr$w_size = oneace[0]+1;r #ifdef VAX8 copy_acl[0].atr$l_addr = (unsigned int)oneace;#elsed* copy_acl[0].atr$l_addr = oneace;#endif status = sys$qiow(C 0, /* Event Flag Number */sC acp_channel, /* I/O channel */ C function, /* I/O function code */ C iosb, /* I/O status block address *//C 0, /* AST Address */ C 0, /* AST Parameter */]C &fib_desc, /* P1, fib descriptor */oC 0, /* P2, not used */C 0, /* P3, not used */eC 0, /* P4, not used */gC ©_acl, /* P5, attributes block */nC 0); /* P6, not used */ P acl_left -= (oneace[0]); /* Note how many bytes left to do */L oneace += (oneace[0]); /* Step to next ACE in buffer */1 while (oneace[0]==0 && acl_left > 0), {R oneace++; /* Skip past any end of header padding */  acl_left--; }  }u-/* lib$signal(&DSKB_ACLERR,0,status,0); */ 5 lib$signal(&DSKB_CPYACL,2,acllen,&full_filedesc);; }A /* Copy the attributes from the original file header buffer */ A /* to the file attributes blocks */jR/* File characteristics */ memcpy( &uchar, &(header.fh2$l_filechar), ATR$S_UCHAR); /* Record Attributes */= memcpy( &recattr, &(header.fh2$w_recattr), ATR$S_RECATTR);  /* File Ownere UIC */7 memcpy( &uic, &(header.fh2$l_fileowner), ATR$S_UIC);s /* File Protection */8 memcpy( &fpro, &(header.fh2$w_fileprot), ATR$S_FPRO);A /* Close the file again, writing the new attributes */b function = IO$_DEACCESS;  status = sys$qiow(AA 0, /* Event Flag Number */2A acp_channel, /* I/O channel */mA function, /* I/O function code */nA iosb, /* I/O status block address */sA 0, /* AST Address */_A 0, /* AST Parameter */mA &fib_desc, /* P1, fib descriptor */ A 0, /* P2, not used */oA 0, /* P3, not used */ A 0, /* P4, not used */kA ©_attrib, /* P5, attributes block */aA 0); /* P6, not used */r5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0]; $ if (!$VMS_STATUS_SUCCESS(status)) {$ /* Failed to close the file */: lib$signal(&DSKB_CLOSERR,1,&full_filedesc,status,0); return;2 }$ status = sys$dassgn(acp_channel);$ if (!$VMS_STATUS_SUCCESS(status)) {9 lib$signal(&DSKB_DSNERR,1,&full_filedesc,status,0);s return;/ }F /* Tell the user we have successfully copied the file attributes */0 lib$signal(&DSKB_CPYATTRIB,1,&full_filedesc); ;} I/* Routine to copy a range of blocks from the input to the output file */ 2unsigned int copy_blocks(int lbn, int block_count,K struct FAB *fab, struct RAB *rab, struct NAM *nam)l{ extern unsigned shortK disk_channel, /* Channel for Disk or File I/O */=M controlc_flag; /* 1 = control C has been entered */ K unsigned long status, /* VMS status return */_K iosb[2], /* VMS I/O status block */ K buffsize, /* QIO buffer size */  nK i; /* Loop counter */cK const int function = IO$_READLBLK; /* VMS I/O function code */(4 void close_rms(struct FAB *fab, struct NAM *nam);K char copy_buffer[512*15]; /* Buffer to hold file data */ L rab->rab$l_rbf = copy_buffer; /* Buffer address for PUTs */L rab->rab$w_rsz = 512; /* Record size for PUTs */L buffsize = 512*block_count; /* Buffer size for $QIO */J status = sys$qiow(0, /* Event Flag Number */J disk_channel, /* I/O channel */J function, /* I/O function code */J iosb, /* I/O status block address*/J 0, /* AST Address */J 0, /* AST Parameter */J copy_buffer, /* P1, buffer address */J buffsize, /* P2, buffer size */J lbn, /* P3, LBN */J 0, /* P4, not used */J 0, /* P5, not used */J 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0]; N /* If we have a read error then check for the number of blocks requested.*/N /* if it is only one block then REPORT the error and continue. This */N /* will cause ONE block of the output file to be corrupted! */N /* If we are trying more than one block then return the error to our */N /* caller, who will perform the retrys. */$ if (!$VMS_STATUS_SUCCESS(status)) { if (block_count==1)c {SB lib$signal(&DSKB_READERR,1,(iosb[0]>>25) + lbn,status,0); }w else {S return status;e }t }$ for (i=0 ; i < block_count ; i++) {O rab->rab$l_rbf = copy_buffer + 512 * i; /* Buffer address for PUTs */ status = sys$put(rab,0,0);' if (!$VMS_STATUS_SUCCESS(status))  { A lib$signal(&DSKB_PUTERR,2,nam->nam$b_rsl,nam->namq$DISKBLOCK061.E$h*-[RANCE.DISKBLOCK.KIT061.SOURCE]COPY_FILE.C;32\8r2$l_rsa, & fab->fab$l_stv,0); if (block_count==1) {N /* We need to distinguish a FATAL error because the output file */N /* is gone from a read error, that we can continue from. So */N /* let's just prtend a control c was typed 8^) */$ controlc_flag = 1; }P return status; /* Return the error to our caller for retry/abort */ }  } return 1;}f"/* Routine to close an RMS file */0void close_rms(struct FAB *fab, struct NAM *nam){} unsigned int status;O status = sys$close(fab,0,0);n$ if (!$VMS_STATUS_SUCCESS(status))? lib$signal(&DSKB_CLOSERR,2,nam->nam$b_rsl,nam->nam$l_rsa,n fab->fab$l_stv,0);} -*[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67+,&.X/ 4`XT<-h*0123KPWOY56rB7e89G HJ#include "diskblock.h"9/* Given a FID find the corresponding LBN and filename */K Nunsigned long fid_to_name(unsigned int fid, /* Input FID */N char *full_filename, /* returned filename */N unsigned int *lbn, /* returned LBN */N unsigned short valid_flag) /* Input */N /* 0 = print errors */N /* 1 = return errors */N /* 2 = print deleted */N /* files WITHOUT */N /* reporting error */{J extern unsigned long max_block; /* Used for checking LBN */J extern const char carry_on[]; /* "Do you want to continue? */* static const char open_bracket[] = "[";+ static const char close_bracket[] = "]";! static const char dot[] = ".";2 static const char unknown_dir[] = "[........]";E FH2 dir_buffer; /* Buffer for holding a file header */P char filename[51][255]; /* 50 levels of directory + filename */O unsigned short i,j; /* Loop counters */O unsigned long status, /* VMS return status */O next_lbn; /* LBN of next directory */C unsigned int start_fid; /* Original FID for loop detection */` if (fid_to_lbn(fid,(unsigned long *)lbn) == 0) return 0; /* Convert the FID to an LBN */O /* LBN is returned to caller */D /* filename[] is an array of character strings */D /* filename[50] to filename[1] hold the directory names */D /* filename[0] holds the file name (FILE.EXT;VERSION) */D /* Allow up to a maximum of 50 directory names per file */4 /* e.g. [dir1.dir2...dir49.dir50]file.ext;vers */D start_fid = fid; /* Remember where we started, to detect loops */) /* Initialise the character strings */1 for (i=0 ; i<=51 ; i++) filename[i][0] = '\0';H /* Follow the Directory Backlinks to construct a full filename */I /* Get up to 50 directories and one filename. */ for ( i = 0 ; i<=50 ; i++ ) {I if ( (fid == 4) && (i >= 2) ) break; /* Avoid printing [000000. */D if (fid==0) break; /* No more back links */L if (fid_to_lbn(fid,&next_lbn) == 0) return 0; /* FID not valid */9 status = read_header((char *)&dir_buffer,next_lbn);' if (!$VMS_STATUS_SUCCESS(status))O { /* Error reading header */I if (valid_flag == 1) /* DIR/VALID so discard this header */ return status; elseK if ( (valid_flag == 0) || ((int *)status != &DSKB_HDRINVFID) )E lib$signal(&DSKB_RDBADHEADER,2,fid,next_lbn,status,0); }M /* We have a valid file header in dir_buffer, now get the file name */) get_name(&dir_buffer, filename[i]);M /* Get the BACK FID from the file header to find the next directory */' fid = dir_buffer.fh2$w_bk_fidnum;N if (i > 0) /* This is a directory, not the FILE.EXT part of the name */J filename[i][strlen(filename[i])-6] = '\0'; /* Remove .DIR;1 */ elseM /* If this is an EXTENSION header then the backlink points to the */M /* primary header, just discard this header and start again using */M /* the backlink */K if (dir_buffer.fh2$w_seg_num != 0) --i; /* Not real header */$ } /* End of for (i=0 ; ; i++) */8 /* If there is a directory loop then tell the user */ if (fid == start_fid)! lib$signal(&DSKB_DIRLOOP); J if (fid==0) /* NO directory backlink found */ {L if (valid_flag == 0) /* Does the caller want to know? */) lib$signal(&DSKB_INVBACKLINK,0); full_filename[0] = '\0';) strcat(full_filename, unknown_dir);) strcat(full_filename, filename[0]); return 1; }& /* Initialise filename to "[" */ full_filename[0] = '['; full_filename[1] = '\0'; for (j=i-1 ; j>0 ; j--) {# /* Add next directory name */) strcat(full_filename, filename[j]); if (j == 1); /* If this is the last directory then add "]" */. strcat(full_filename, close_bracket); else /* Otherwise add "." */$ strcat(full_filename, dot); }2 /* Now add the FILE.EXT part of the filename */& strcat(full_filename, filename[0]); return 1;} 3/* Directory command called by CLI$_DISPATCH */3/* Performs a sequential read of INDEXF.SYS */3/* and reports files matching selection criteria */void directory(void){ extern unsigned longN index_lbn[150], /* Starting LBN for this extent */N index_cnt[150], /* Blocks in this extent */N index_tot[150], /* Blocks in this + earlier extents */N vbn_factor, /* Cluster_size*4 + bitmapsize */N max_block; /* Used for checking /SEL-SIZE=nnn */ N extern unsigned short disk_channel, /* Channel for Disk I/O */N controlt_flag, /* 1 = control T has been entered */N controlc_flag; /* 1 = control C has been entered */N const $DESCRIPTOR(file_param,"FILENAME"); /* CLI qualifier */N const $DESCRIPTOR(fid_qual, "FID"); /* CLI qualifier */N const $DESCRIPTOR(full_qual, "FULL"); /* CLI qualifier */N const $DESCRIPTOR(place_qual, "PLACEMENT"); /* CLI qualifier */N const $DESCRIPTOR(lbn_qual, "LBN"); /* CLI qualifier */N const $DESCRIPTOR(count_qual, "COUNT"); /* CLI qualifier */N const $DESCRIPTOR(valid_qual, "VALID"); /* CLI qualifier */N const $DESCRIPTOR(backfid_qual, "BACKFID"); /* CLI qualifier */N const $DESCRIPTOR(deleted_qual, "DELETED"); /* CLI qualifier */N const $DESCRIPTOR(by_owner_qual, "BY_OWNER"); /* CLI qualifier */N const $DESCRIPTOR(since_qual, "SINCE"); /* CLI qualifier */N const $DESCRIPTOR(before_qual, "BEFORE"); /* CLI qualifier */N const $DESCRIPTOR(backup_qual, "BACKUP"); /* CLI qualifier */N const $DESCRIPTOR(created_qual, "CREATED"); /* CLI qualifier */N const $DESCRIPTOR(expired_qual, "EXPIRED"); /* CLI qualifier */N const $.$DISKBLOCK061.E&h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67`X,"DESCRIPTOR(modified_qual, "MODIFIED"); /* CLI qualifier */@ const $DESCRIPTOR(max_size_qual, "SELECT.SIZE.MAXIMUM_SIZE");@ const $DESCRIPTOR(min_size_qual, "SELECT.SIZE.MINIMUM_SIZE");N unsigned short i,j,k, /* Loop counters */N found, /* 1 = At least 1 file found */@ full_flag, /* 1 = Directory /FULL */N placement_flag, /* 1 = Directory /PLACEMENT */N valid_flag; /* 0 = Directory */N /* 1 = Directory /VALID */N /* 2 = Directory /DELETED */O unsigned long block_count, /* Number of blocks to read in next $QIO */O count, /* Number of unread blocks in this extent */O lbn, /* LBN to start next $QIO */O backfid, /* FID of directory containing the file */O status, /* VMS status return */O match_lbn, /* LBN that contains a match */O block[101], /* Value(s) specified with /LBN or /FID */O lbn_count[101]; /* Value(s) specified with /COUNT */O unsigned int since_time[2]; /* VMS Quadword date time */O unsigned int before_time[2]; /* VMS Quadword date time */O unsigned char time_flag; /* 0 = no time check */O /* 1 = BACKUP */O /* 2 = CREATED */O /* 3 = MODIFIED */O /* 4 = EXPIRED */O unsigned char dir_buffer[15 * 512]; /* Buffer for holding part of INDEXF */S unsigned char filename[NAM$C_MAXRSS]; /* Filename in current Header */W $DESCRIPTOR(filename_desc,(char *)filename); /* Descriptor for current filename */O unsigned char owner[64]; /* File owner, for /BY_OWNER */W $DESCRIPTOR(owner_desc,(char *)owner); /* Descriptor for " */? unsigned owner_id; /* Numeric qequivalent of OWNER */? unsigned min_size; /* Values from /SELECT=SIZE=MAX */O unsigned max_size; /* and /SELECT=SIZE=MIN */ O unsigned char input_name[90]; /* Filename we are looking for */. $DESCRIPTOR(input_desc,(char *)input_name);O const char semi_colon[] = ";"; /* For adding version number */O const char dot[] = "."; /* For adding file extension */O unsigned char *offset; /* Point in filename where match is */O char full_filename[NAM$C_MAXRSS]; /* Filename with [. . . ] etc... */O char line[132]; /* Text for output from print_line()*/. /* Routine to do QIOs to read INDEXF.SYS */D unsigned int read_blocks(int lbn, int block_count, char *buffer);E /* Check that we have selected a disk and mapped its index file */ if (disk_channel == 0) {K /* Print No disk or file selected and immediately return to caller */ lib$signal(&DSKB_NOSEL,0); return; }K if (index_cnt[0] == 0) /* The index file has not been mapped */ {# lib$signal(&DSKB_NOINDEXF,0); return; },/* Directory command -- PARAMETER PARSING */O /* DIR /FID is handled in a separate routine, check for /FID and dispatch */: if ($VMS_STATUS_SUCCESS(status=cli$present(&fid_qual))) {O extern unsigned long max_block; /* Used for checking LBN */: status = get_integer(&fid_qual,max_block,&block[0]);/ if (!$VMS_STATUS_SUCCESS(status)) return;U status = fid_to_name(block[0],(char *)&full_filename, (unsigned int *)&lbn, 0);& if ($VMS_STATUS_SUCCESS(status)) {M sprintf(line,"FID: %8d LBN %8d %s\n", block[0],lbn,full_filename);C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } return; }& /* Check for /BY_OWNER qualifier */M owner_id = 0; /* Assume /BY_OWNER not specified */M owner_desc.dsc$w_length = 64; /* Reset to original length */U owner_desc.dsc$a_pointer = (char *)&owner; /* and address */ status=cli$get_value(G &by_owner_qual, /* Qualifier name */G &owner_desc, /* Returned string */G &owner_desc.dsc$w_length /* Returned length */ );A if ($VMS_STATUS_SUCCESS(status)) /* BY_OWNER was specified */ {G /* Parse the owner field, to find GROUP and MEMBER information */ char *comma;2 comma = (char *) strchr((char *)&owner,',');F owner[owner_desc.dsc$w_length] = '\0'; /* Add a terminator */C if (comma != NULL) /* [NAME,NAME] or [GROUP,MEMBER] */ {S if ( strspn((char *)&owner,"[01234567,]") == strlen((const char *)owner) ) {5 /* Numeric UIC in format [octal,octal] */, static const unsigned octal = 8;I unsigned temp; /* Temporary storage for integers */I unsigned char *group; /* Pointer to group part of UIC */I unsigned char *member; /* Pointer to member part of UIC */` member = (unsigned char *)&comma[1]; /* Point member just past the , */] member[strlen((const char *)member)-1] = '\0'; /* Terminate member on the ] */O group = &owner[1]; /* Point group just past [" */O comma[0] = '\0'; /* Terminate group on the , */] temp = strtoul((const char *)group,NULL,octal);/* Convert group to integer */O owner_id = temp <<16; /* Top word of owner_id is grp */] temp = strtoul((const char *)member,NULL,octal);/* Convert member to integer */O owner_id = owner_id | temp; /* Bottom word is member */ } else1 { /* NAMEd UIC in format [NAME,NAME] */N owner_desc.dsc$a_pointer = &comma[1]; /* step past the , */N owner_desc.dsc$w_length = strlen(comma) - 2; /* discard , and ] */ } } if (owner_id == 0) {9 status = sys$asctoid(&owner_desc,&owner_id,0,0);* if (!$VMS_STATUS_SUCCESS(status)) { lib$signal(status); return; } }( } /* End of /BY_OWNER qualifier */" /* Check for /FULL qualifier */; if ($VMS_STATUS_SUCCESS(status=cli$present(&full_qual))) full_flag = 1; else full_flag = 0;' /* Check for /PLACEMENT qualifier */< if ($VMS_STATUS_SUCCESS(status=cli$present(&place_qual))) placement_flag = 1; else placement_flag = 0;- /* Check for /SELECT=SIZE=MIN qualifier */? if ($VMS_STATUS_SUCCESS(status=cli$present(&min_size_qual))) {R status = get_integer(&min_size_qual, max_block, (unsigned long *)&min_size);' if (!$VMS_STATUS_SUCCESS(status)) return; } else min_size = 0;- /* Check for /SELECT=SIZE=MAX qualifier */? if ($VMS_STATUS_SUCCESS(status=cli$present(&max_size_qual))) {R status = get_integer(&max_size_qual, max_block, (unsigned long *)&max_size);' if (!$VMS_STATUS_SUCCESS(status)) return; } else max_size = 0;8 /* Check for /BACKUP, /CREATED, /EXPIRED, /MODIFIED */= if ($VMS_STATUS_SUCCESS(status=cli$present(&backup_qual))) time_flag = 1; else {B if ($VMS_STATUS_SUCCESS(status=cli$present(&created_qual))) time_flag = 2; else {F if ($VMS_STATUS_SUCCESS(status=cli$present(&expired_qual))) time_flag = 3; else {K if ($VMS_STATUS_SUCCESS(status=cli$present(&modified_qual)))! time_flag = 4; else! time_flag = 0; } }  } 0 /* Check for /BEFORE and /SINCE qualifiers */ if (time_flag != 0) {@ i }$DISKBLOCK061.E&h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67`X" f ($VMS_STATUS_SUCCESS(status=cli$present(&since_qual))) {3 status=get_time(&since_qual, since_time);+ if (!$VMS_STATUS_SUCCESS(status)) return; } else, since_time[0] = since_time[1] = 0;A if ($VMS_STATUS_SUCCESS(status=cli$present(&before_qual))) {5 status=get_time(&before_qual, before_time);+ if (!$VMS_STATUS_SUCCESS(status)) return; } else8 before_time[0] = before_time[1] = 0Xffffffff; }N /* Check for /BACKFID qualifier */> if ($VMS_STATUS_SUCCESS(status=cli$present(&backfid_qual))) {? status = get_integer(&backfid_qual, max_block, &backfid); ' if (!$VMS_STATUS_SUCCESS(status))f return; } else  backfid = 0;N /* Check for /LBN and /COUNT qualifiers */: if ($VMS_STATUS_SUCCESS(status=cli$present(&lbn_qual))) {O extern unsigned long max_block; /* Used for checking LBN */ : status = get_integer(&lbn_qual,max_block,&block[0]);/ if (!$VMS_STATUS_SUCCESS(status)) return;  lbn_count[0] = 0; 0 /* Get up to 101 LBNs from command line */? for (i=1 ; (i<=101) && $VMS_STATUS_SUCCESS(status) ; i++)  { = status = get_integer(&lbn_qual,max_block,&block[i]);  lbn_count[i] = 0; } ? block[i-1] = 0xFFFFFFFF; /* Flag to show last LBN */e6 /* At this point i = number of LBNs specified */: /* so for DIR /LBN=x i = 2 */N if (i>101) lib$signal(&DSKB_FIRST100,0); /* TOO MANY LBNs specified */? if ($VMS_STATUS_SUCCESS(status=cli$present(&count_qual)))a {eP /* If one LBN is specified then only lbn_count[0] should be supplied */# for (j=0 ; j <= i-2 ; j++)t {N block_count = max_block - block[j] + 1; /* Largest legal count */C status = get_integer(&count_qual, block_count, &lbn_count[j]);f- if (!$VMS_STATUS_SUCCESS(status))n {/8 lib$signal(&DSKB_LBNCOUNTERR,0,status,0); return; }0 } }  }? else /* Not /LBN or /FID just a normal directory command */i {J block[0] = 0xFFFFFFFF; /* Flag to show no LBN was specified */. /* Check if a filename was specified? */3 input_desc.dsc$w_length = sizeof(input_name);  status=cli$get_value(;J &file_param, /* Parameter name */J &input_desc, /* Returned string */J &input_desc.dsc$w_length /* Returned length */ );' if (!$VMS_STATUS_SUCCESS(status))[ {\M if (status == CLI$_ABSENT) /* Default file name is * (all files) */ { input_name[0] = '*';( input_desc.dsc$w_length = 1; } else K return; /* We can't read the string, just return to caller */ }fK input_name[input_desc.dsc$w_length] = '\0'; /* Add a terminator */oQ /* Add .* to the end of the input filename if no extension was specified */d: if ( strpbrk((const char *)input_name,dot) == NULL ) {a7 input_name[input_desc.dsc$w_length] = '.'; 7 input_name[input_desc.dsc$w_length + 1] = '*';=8 input_name[input_desc.dsc$w_length + 2] = '\0';' input_desc.dsc$w_length += 2;  } O /* Add ;* to the end of the input filename if no version was specified */gA if ( strpbrk((const char *)input_name,semi_colon) == NULL )  {e7 input_name[input_desc.dsc$w_length] = ';'; 7 input_name[input_desc.dsc$w_length + 1] = '*'; 8 input_name[input_desc.dsc$w_length + 2] = '\0';' input_desc.dsc$w_length += 2;2 }n } controlc_flag = 0;  controlt_flag = 0; < if ($VMS_STATUS_SUCCESS(status=cli$present(&valid_qual))) valid_flag = 1;R elseR {K /* Check for /DELETED flag */iA if ($VMS_STATUS_SUCCESS(status=cli$present(&deleted_qual)))r valid_flag=2; else valid_flag = 0; }/ /* Open the file specified by DIR /OUTPUT */d open_output();_3 /* Loop round the Index File mapping pointers */E3 /* Until we find one with a count of 0 */i= for (i=0, found=0 ; (i<=150) && (index_cnt[i] != 0) ; i++)  { short fid;S if (index_tot[i] < vbn_factor) continue; /* Skip non file_header extents */  count = index_cnt[i];g lbn = index_lbn[i];tL /* Read the next count blocks of the index file 15 blocks at a time */ while (count != 0) {t if (count < 15) { block_count = count; count = 0; } elsen { block_count = 15;; count = count - 15; }= status = read_blocks(lbn, block_count, (char *)dir_buffer); * if (!$VMS_STATUS_SUCCESS(status)) {, count = count + block_count - 1; block_count = 1;/ while (!$VMS_STATUS_SUCCESS(status= F (read_blocks(lbn, block_count, (char *)dir_buffer)))) {d8 lib$signal(&DSKB_READERR,1,lbn,status,0); lbn += 1;! count = count - 1;c }y }J /* Look at each of the 15 (or fewer) headers we have just read */2 /* to see if there is a filename match */( for (j=0 ; jfh2$b_map_inuse !=0) ;)C {G /* Find the count and LBN for the next file extent */fK map_extent(header, &next_map, &next_count, &next_lbn, 0);lO if (lbn_count[0] == 0) /* List of LBNs or 1 LBN to match */e {/X for (k=0 ; block[k] != 0xffffffff ; k++) /* For each LBN in list */3 if ( (block[k] >= next_lbn) && A (block[k] <= next_lbn + next_count - 1)b% ) status = 1;f }c elseC { /* LBN and Count to check */TV for (k=0 ; block[k] != 0xffffffff ; k++) /* For each LBN range */ { if ( (l: (block[k] >= next_lbn) &&H (block[k] <= next_lbn + next_count - 1)" ) ||9 ( (block[k] < next_lbn) &&tE (block[k] + lbn_count[k] > next_lbn)L ) ( ) status = 1; } }  } } F /* If /BY_OWNER was specified then check file ownership */A if ( $VMS_STATUS_SUCCESS(status) && (owner_id != 0) ) {rC FH2 *header; /* Pointer to this file header *//: header = (struct _fh2 *)&dir_buffer[j*512];C if (owner_id != header->fh2$l_fileowner) status = 0; }lF /* If /BACKFID was specified then check for a match */@  <$DISKBLOCK061.E&h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67`Xp"1 if ( $VMS_STATUS_SUCCESS(status) && (backfid != 0) ) { B FH2 *header; /* Pointer to this file header */: header = (struct _fh2 *)&dir_buffer[j*512];B if (backfid != header->fh2$w_bk_fidnum) status = 0; }t M /* If /DELETED was specified then check this is a deleted file */ C if ( $VMS_STATUS_SUCCESS(status) && (valid_flag == 2) )t { B FH2 *header; /* Pointer to this file header */: header = (struct _fh2 *)&dir_buffer[j*512]; if ( P (header->fh2$w_checksum != 0) || /* Checksum must be 0 */P (header->fh2$w_fid_num != 0) || /* File ID must be 0 */P (header->fh2$v_markdel != 1) /* Marked for delete */ )  status = 0; }XI /* Check for /BACKUP, /CREATED, /EXPIRED or /MODIFIED time */fD if ( ($VMS_STATUS_SUCCESS(status)) && (time_flag != 0) ) {lE FH2 *header; /* Pointer to this file header */*O unsigned int *check_time; /* Pointer to correct time in hdr */]; header = (struct _fh2 *)&dir_buffer[j*512];E" if (header->fh2$b_struclev == 5) {oE FI5 *ident; /* Pointer to ID area of header */tP if ( (header->fh2$b_mpoffset - header->fh2$b_idoffset) < 19 )K status = 0; /* No room in ID area for Date fields */  elsee& ident = (FI5 *) K ( (short *)header + header->fh2$b_idoffset );; * if (status == 0) break; e% switch (time_flag)o {; case 1: /* DIRECTORY /BACKUP */r {/M check_time = (unsigned int *)&ident->fi5$q_bakdate;  } c break;; case 2: /* DIRECTORY /CREATED */ {IM check_time = (unsigned int *)&ident->fi5$q_credate;  }h break;; case 3: /* DIRECTORY /EXPIRED */ {iM check_time = (unsigned int *)&ident->fi5$q_expdate;B } break;; case 4: /* DIRECTORY /MODIFIED */ {IM check_time = (unsigned int *)&ident->fi5$q_revdate;/ }d break;> } /* End of switch (time_flag) for ODS2 */ }a else {mE FI2 *ident; /* Pointer to ID area of header */gP if ( (header->fh2$b_mpoffset - header->fh2$b_idoffset) < 19 )K status = 0; /* No room in ID area for Date fields */s else & ident = (FI2 *) K ( (short *)header + header->fh2$b_idoffset );l )* if (status == 0) break; (% switch (time_flag)n {; case 1: /* DIRECTORY /BACKUP */  {NM check_time = (unsigned int *)&ident->fi2$q_bakdate;i } r break;; case 2: /* DIRECTORY /CREATED */l { M check_time = (unsigned int *)&ident->fi2$q_credate;  }  break;; case 3: /* DIRECTORY /EXPIRED */  { M check_time = (unsigned int *)&ident->fi2$q_expdate; }e break;; case 4: /* DIRECTORY /MODIFIED */c {nM check_time = (unsigned int *)&ident->fi2$q_revdate;/ }L break;> } /* End of switch (time_flag) for ODS2 */; } /* End of ODS2 / ODS5 If then else... */ if (8 (since_time[1] > check_time[1]) || ( < (since_time[1] == check_time[1]) &&9 (since_time[0] > check_time[0])o ) )# status = 0; a if ( & (status != 0) &&9 (before_time[1] < check_time[1]) ||  (c= (before_time[1] == check_time[1]) &&: (before_time[0] > check_time[0]) )  )# status = 0;  , } /* End of (time_flag != 0) */K /* If /SELECT=SIZE or /PLACEMENT was specified then read all */ K /* of the mapping pointers and check if the file is wanted */o if (0 $VMS_STATUS_SUCCESS(status) && K ( (min_size!=0) || (max_size!=0) || (placement_flag==1) )  ) { N unsigned file_size, /* Accumulator for size of file */N next_fid, /* FID of extension file header */N next_lbn, /* LBN of extension file header */N extent_number, /* Used to loop round header */N file_count, /* Count and LBN from a single */N placed_file, /* File is placed */N file_lbn; /* mapping pointer */ D FH2 *header; /* Pointer to this file header */D FM2 *next_map; /* Pointer to next map pointer */N extern const char carry_on[]; /* "Do you want to continue? */: header = (struct _fh2 *)&dir_buffer[j*512]; file_size = 0;S placed_file = 0;s; /* Check that this is a VALID file header */m- status = check_header(header);fN /* If it's a deleted header and /VALID not specified then OK */I if (((int *)status == &DSKB_HDRINVFID) && (valid_flag!=1))S status = 1;xN /* Print the FID of the invalid file to indicate the problem */C if (!$VMS_STATUS_SUCCESS(status) && (valid_flag!=1))  {2 next_fid = lbn - index_lbn[i] + : index_tot[i] - index_cnt[i] -, vbn_factor + 1;D lib$signal(&DSKB_SKIPHDR,1,next_fid,0);  } G /* Don't do any more processing for an invalid header */ 7 if (!$VMS_STATUS_SUCCESS(status)) break;d@ /* Get the EXTENSION fid from this file header */2 next_fid = header->fh2$w_ex_fidnum;N /* If there is an extension header AND we haven't mapped the */N /* index file then give give up now... */< if ( (index_cnt[0] == 0) && (next_fid != 0) ) {L lib$signal(&DSKB_NOEXTHDR, 1, next_fid, &DSKB_NOINDEXF,0); status = 0;t }M /* If this is an extension header then give up DIR/SIZE now */M /* the file size is only meaningful for primary headers */ I if ( (placement_flag==0) && (header->fh2$w_seg_num != 0) )  status = 0;_F if ($VMS_STATUS_SUCCESS(status)) /* Extension fid OK */ {N /* Whilst there is still mapping information in this file header, */N /* or another file header to be mapped */L while ( (header->fh2$b_map_inuse !=0) || (next_fid != 0) ) {=; for (extent_number=0, next_map=NULL ; (9 (header->fh2$b_map_inuse !=0) ; e* extent_number++) {5 /* Get size of this extent */_= if ( (min_size!=0) z$DISKBLOCK061.E&h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67`X"B || (max_size!=0) )e { L /* Find the count and LBN for this file extent */M map_extent(header, &next_map, (int *)&file_count, : (int *)&file_lbn,0);> file_size = file_size + file_count; }F /* Check this extent for placement pointers */. if (placement_flag==1) {oM map_extent(header, &next_map, (int *)&file_count, : (int *)&file_lbn,1);@ if (file_count != 0) placed_file = 1; }   } ' if (next_fid != 0)lJ { /* There is an extension header */ Q if (fid_to_lbn(next_fid,(unsigned long *)&next_lbn) ==0) sM { /* INVALID FID */(& status = 0;( next_fid = 0; }  elseM { /* NO extension header, or INDEXF.SYS is mapped */dI status=(read_header((char *)header,next_lbn));hH /* Check that this is a VALID file header */I /* If it's a deleted header and /VALID not */ tH /* specified then OK */U if (((int *)status == &DSKB_HDRINVFID) && (valid_flag!=1))& status = 1;H /* Print the FID of the invalid file to */H /* indicate the problem */O if (!$VMS_STATUS_SUCCESS(status) && (valid_flag!=1))e {> next_fid = lbn - index_lbn[i] + ; index_tot[i] - index_cnt[i] -*- vbn_factor + 1;$P lib$signal(&DSKB_SKIPHDR,1,next_fid,0);  }< if (!$VMS_STATUS_SUCCESS(status))G next_fid = 0; /* Can't read header */] else[A next_fid = header->fh2$w_ex_fidnum;c } 8 } /* End of if (next_fid != 0) */N } /* End of while ( (header->fh2$b_map_inuse != 0)... */ (B if ( (min_size != 0) && (file_size < min_size) ) status = 0; B if ( (max_size != 0) && (file_size > max_size) ) status = 0;@ if ( (placement_flag==1) && (placed_file==0) ) status = 0; K if ( (status != 0) && ( (min_size!=0) || (max_size!=0) ))g {{E sprintf(line,"FID: %8d Blocks Allocated: %d\n", ' fid,file_size);tO if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;l } = } /* End of status success, Ext fid OK. */)< } /* End of SELECT=SIZE and PLACEMENT */, if ($VMS_STATUS_SUCCESS(status))M { /* We had a match on the filename, owner, FID etc. */hU if ($VMS_STATUS_SUCCESS(status=fid_to_name(fid,(char *)&full_filename,sQ (unsigned int*)&match_lbn,valid_flag)))h {9 sprintf(line,"FID: %8d LBN %8d %s\n",u2 fid,match_lbn,full_filename);L if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (full_flag) {c@ FH2 *header; /* Pointer to file header */@ header = (struct _fh2 *)&dir_buffer[j*512];0 dump_DCL_header(header, 1); }  found = 1; } elseh { if ( , (valid_flag == 0) || R ( (valid_flag == 2) && ((int *)status == &DSKB_HDRINVFID) ) ) { < sprintf(line,"FID: %8d LBN %8d %s\n",0 fid,match_lbn,filename);O if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;f found = 1;  }  }A } /* End of found a MATCH for the filename or LBN */ K if ( (found == 1) && /* We've found a match */ K (valid_flag == 1) && /* We want valid files only */-K (block[0] != 0xFFFFFFFF) && /* This is DIR /LBN */lK (block[1] == 0xffffffff) && /* ONLY 1 LBN specified */nK (lbn_count[0] == 0) /* ONLY 1 LBN specified */  ) return;= } /* End of one header, go and check one more */sA lbn = lbn + block_count; /* Time for another read... */a if (controlt_flag == 1) { short fid; controlt_flag = 0;& fid = lbn - index_lbn[i] +/ index_tot[i] - index_cnt[i] - ! vbn_factor + 1;P. lib$signal(&DSKB_LASTFID,2,fid,0); }? } /* End of while (count != 0), finished one extent */ > } /* End of for (i=0, found=0 ..., finished all extents */- if (found==0) lib$signal(&DSKB_NOFILES,0);_ close_output();} @unsigned int read_blocks(int lbn, int block_count, char *buffer){  extern unsigned shortK disk_channel; /* Channel for Disk or File I/O */ K unsigned long status, /* VMS status return */ K iosb[2], /* VMS I/O status block */FK buffsize; /* QIO buffer size */K const int function = IO$_READLBLK; /* VMS I/O function code */ L buffsize = 512*block_count; /* Buffer size for $QIO */J status = sys$qiow(0, /* Event Flag Number */J disk_channel, /* I/O channel */J function, /* I/O function code */J iosb, /* I/O status block address*/J 0, /* AST Address */J 0, /* AST Parameter */J buffer, /* P1, buffer address */J buffsize, /* P2, buffer size */J lbn, /* P3, LBN */J 0, /* P4, not used */J 0, /* P5, not used */J 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];u$ if (!$VMS_STATUS_SUCCESS(status)) { return status; } return 1;} *void get_name(FH2 *header, char *filename){d# if (header->fh2$b_struclev == 5)  { /* ODS5 */T! extern char unicode_name[];  FI5 *name;B name = (FI5 *) ( (short *)header + header->fh2$b_idoffset );- if (name->fi5$v_nametype == FI5$C_UCS2)f {;< memcpy(filename,unicode_name,strlen(unicode_name));- filename[strlen(unicode_name)]='\0';  } else {dD memcpy(filename,name->fi5$t_filename, name->fi5$b_namelen);. filename[name->fi5$b_namelen] = '\0'; }  } else2 { /* ODS2 */C FI2 *name; /* Pointer to Filename part of header */*7 unsigned short i; /* Loop counter */ B name = (FI2 *) ( (short *)header + header->fh2$b_idoffset ); / memcpy(filename,name->fi2$t_filename,20);F4 memcpy(filename+20,name->fi2$t_filenamext,66); @ /* Replace spaces at the end of the filename with NULLs */8 for (i=0 ; (filename[i] != '\0') && (i<=89) ; i++)4 if (filename[i] == ' ') filename[i] = '\0'; }}*Eunsigned lon S2$DISKBLOCK061.E&h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DIRECTORY.C;67`X^Sg dskb_match_wild(struct dsc$descriptor_s filename_desc, A struct dsc$descriptor_s input_desc) {e. unsigned char ucase_filename[NAM$C_MAXRSS];; $DESCRIPTOR(ucase_filename_desc,(char *)ucase_filename); + unsigned char ucase_input[NAM$C_MAXRSS];E5 $DESCRIPTOR(ucase_input_desc,(char *)ucase_input);  int i,status; 5A ucase_filename_desc.dsc$w_length = filename_desc.dsc$w_length; 1 for (i=0; i<= filename_desc.dsc$w_length; i++)sB ucase_filename[i] = toupper(filename_desc.dsc$a_pointer[i]);; ucase_input_desc.dsc$w_length = input_desc.dsc$w_length; 0 for (i=0; i<=filename_desc.dsc$w_length; i++)< ucase_input[i] = toupper(input_desc.dsc$a_pointer[i]);B status=str$match_wild(&ucase_filename_desc, &ucase_input_desc); return status;o} -*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.C;28+,B. / 4R -h*0123KPWO!56År7Zeor89G HJ#include "diskblock.h"G#include /* for $CRELNM system service */G#include /* VMS privilege definitions */G#include /* for definition of VAXC$ESTABLISH */2/*************************************************2 * diskblock.c Main program for Diskblock *2 * *2 * This module includes initialisation, *2 * command parsing and the exit routine *2 * *3 *************************************************/ main(){Pextern struct DSKB_IO dskb_io[2]; /* Descriptions of two possible I/Os */P /* efns are filled in here... */Iextern unsigned long pid; /* PID of invoking process */extern unsigned short O ast_channel, /* I/O channel for handling ^T ast interrupts */O term_flag; /* 1 = SYS$OUTPUT is a terminal */Oextern struct dsc$descriptor_s help_logical; /* Library logical name */O$DESCRIPTOR(lnm$file_dev, "LNM$FILE_DEV"); /* Table to search for "" " */O$DESCRIPTOR(lnm$process, "LNM$PROCESS"); /* " " define "" " */Nint ast_iosb[2], /* I/O status block for ^T and ^C */N i; /* loop counter */Nconst int ast_mask[2] = {0,0x100004}, /* Character mask for ^C and ^T */N ast_function = IO$_SETCHAR|IO$M_OUTBAND, /* Function code for ^T */N contc_function = IO$_SETMODE|IO$M_CTRLCAST; /* Function code for ^C */Ovoid rms_flush_ast(int reqidt); /* Flushes output buffer every 15 seconds */Fextern int flush_efn; /* Event flag for RMS Flush AST $SETIMR */Oextern int fifteen_secs[2]; /* VMS Quadword for 15 seconds */Oextern int thirty_secs[2]; /* VMS Quadword for 30 seconds */O$DESCRIPTOR(timbuf,"0 00:00:15"); /* 15 seconds for $ASCTIM */O$DESCRIPTOR(timbuf30,"0 00:00:30"); /* 30 seconds for $ASCTIM */O$DESCRIPTOR(prompt, "DISKBLOCK> "); /* DISKBLOCK> prompt string */O$DESCRIPTOR(sys$input, "SYS$INPUT"); /* Terminal name for $ASSIGN */O$DESCRIPTOR(sys$output, "SYS$OUTPUT"); /* Terminal name for $GETDVI */Ounsigned long status, /* Return status from VMS system services */O iosb[2], /* I/O Status Block for VMS system services */A curpriv, /* Privileges of invoking process */O devclass; /* SYS$OUTPUT Device class */struct ITEM_LIST O itemlist[3]; /* Item List for $GETJPI & $GETDVI system services */G/**********************************************************************G * Establish a condition Handler *H **********************************************************************/ #ifdef VAX<VAXC$ESTABLISH( (unsigned int (*)(void *, void *)) handler);#elseVAXC$ESTABLISH( handler );#endifG/**********************************************************************G * Display the DISKBLOCK header messages *H **********************************************************************/ printf("\n\n");: printf(" DISKBLOCK V6.1\n");R printf(" Copyright (c) Hewlett Packard 2002. All rights Reserved.\n\n");P printf(" This software can and WILL corrupt disks if it is mis-used,\n");P printf(" use it with care and back everything up before you start.\n\n");E printf(" Type HELP for instructions\n\n\n");G/**********************************************************************G * Use GETJPI to find PID and privileges of current process *H **********************************************************************/M itemlist[0].buffer_length = 4; /* Buffer length */M itemlist[0].item_code = JPI$_PID; /* Item required */R itemlist[0].address = (int)&pid; /* Buffer address */M itemlist[0].retlen = 0; /* Length of data not wanted */! itemlist[1].buffer_length = 4;, itemlist[1].item_code = JPI$_CURPRIV;- itemlist[1].address = (int)&curpriv;! itemlist[1].retlen = 0;D itemlist[2].buffer_length = 0; /* End of item list */! itemlist[2].item_code = 0;8 status = sys$getjpiw(0, 0, 0, &itemlist, &iosb, 0, 0);4 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];$ if (!$VMS_STATUS_SUCCESS(status))  {) lib$signal(&DSKB_JPIERR,0,status,0); exit(0); } H/***********************************************************************H * Check that the current process has LOG_IO privilege *I ***********************************************************************/% if ((curpriv & PRV$M_LOG_IO) == 0)  { lib$signal(SS$_NOLOG_IO); exit(0); } H/***********************************************************************H * Allocate two event flags for QIOs *H * and Initialise the two I/O buffer pointers to NULL *I ***********************************************************************/ for (i=0 ; i <= 1 ; i++) {E if (!$VMS_STATUS_SUCCESS(status = lib$get_ef(&dskb_io[i].efn))) {, lib$signal(&DSKB_EFERR,0,status,0); exit(0); }  dskb_io[i].buffer = NULL; }< /********************************************************< * Find out if sys$output is a terminal, and set flag *= ********************************************************/# itemlist[0].buffer_length = 4;/ itemlist[0].item_code = DVI$_DEVCLASS;0 itemlist[0].address = (int)&devclass;# itemlist[0].retlen = 0;# itemlist[1].buffer_length = 0;# itemlist[1].item_code = 0; status = sys$getdvi(? 0, /* Event flag number */? 0, /* Channel (not used) */? &sys$output, /* Device Name */? &itemlist, /* Item list address */? &iosb, /* I/O Status Block */? 0, /* AST address */? 0, /* AST param */? 0 /* NULL argument */ ); 5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];B if ( (!$VMS_STATUS_SUCCESS(status)) || (devclass != DC$_TERM) ) term_flag = 0; else term_flag = 1;H/***********************************************************************G * If help_logical is undefined then define it as DISKBLOCK *I *********************************** t$DISKBLOCK061.EBh*-[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.C;28R ђ************************************/: status = sys$trnlnm(0,&lnm$file_dev,&help_logical,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {+ const char diskblock[] = "DISKBLOCK"; 5 itemlist[0].buffer_length = strlen(diskblock);/ itemlist[0].item_code = LNM$_STRING;3 itemlist[0].address = (int)&diskblock;% itemlist[0].retlen = 0; % itemlist[1].buffer_length = 0;% itemlist[1].item_code = 0; I status = sys$crelnm(0, &lnm$process, &help_logical, 0, &itemlist); }H/***********************************************************************H * Assign an IO channel to sys$input, this will be used for control_t *H * and control_c out of band AST handling *I ***********************************************************************/5 status = sys$assign(&sys$input, &ast_channel,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {> lib$signal(&DSKB_NOCON_T,0,&DSKB_NOTERMCHAN,0,status,0);> lib$signal(&DSKB_NOCON_C,0,&DSKB_NOTERMCHAN,0,status,0); } elseE { /* Enable the out of band AST's for CONTROL_T and CONTROL_C */P status = sys$qiow(0, /* Event Flag Number */P ast_channel, /* I/O channel */P ast_function, /* I/O function code */P ast_iosb, /* I/O status block address */P 0, /* AST Address */P 0, /* AST Parameter */P &control_t, /* P1, Out of Band AST address */P ast_mask, /* P2, Out of Band char mask */P 0, /* P3, not used */P 0, /* P4, not used */P 0, /* P5, not used */P 0); /* P6, not used */< if ($VMS_STATUS_SUCCESS(status)) status = ast_iosb[0];' if (!$VMS_STATUS_SUCCESS(status))' lib$signal(&DSKB_NOCON_T,0,status,0);P status = sys$qiow(0, /* Event Flag Number */P ast_channel, /* I/O channel */P contc_function, /* I/O function code */P ast_iosb, /* I/O status block address */P 0, /* AST Address */P 0, /* AST Parameter */P &control_c, /* P1, Control C AST address */P 0, /* P2, not used */P 0, /* P3, not used */P 0, /* P4, not used */P 0, /* P5, not used */P 0); /* P6, not used */< if ($VMS_STATUS_SUCCESS(status)) status = ast_iosb[0];' if (!$VMS_STATUS_SUCCESS(status))' lib$signal(&DSKB_NOCON_C,0,status,0); } B/*****************************************************************B * Convert 15 and 30 second values to OpenVMS Quadwords *C *****************************************************************/. status = sys$bintim(&timbuf,&fifteen_secs);$ if (!$VMS_STATUS_SUCCESS(status)) return status;/ status = sys$bintim(&timbuf30,&thirty_secs);$ if (!$VMS_STATUS_SUCCESS(status)) return status;B/*****************************************************************B * Request an AST interrupt in 15 seconds. This will be used to *B * flush RMS buffers of output and log files every 15 seconds *C *****************************************************************/= if (!$VMS_STATUS_SUCCESS(status = lib$get_ef(&flush_efn))) {) lib$signal(&DSKB_EFERR,0,status,0); exit(0); } ? status=sys$setimr(flush_efn,fifteen_secs,rms_flush_ast,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) return status;H/***********************************************************************H * Accept a command from the User, Parse the command and dispatch it *I ***********************************************************************/ while(TRUE) {4 static const $DESCRIPTOR(line_param,"$LINE");P char line[1024]; /* Line read by cli$get_value */ # $DESCRIPTOR(line_desc,line); 4 status=cli$dcl_parse(0, &diskblock_commands, = get_input, get_input, &prompt);0 if (status == RMS$_EOF) diskblock_exit();7 if ($VMS_STATUS_SUCCESS(status)) cli$dispatch(); }/* End of while(TRUE) */}/* End of Main */H/***********************************************************************H * DISKBLOCK_EXIT: Check if the buffer has been modified if it has *H * and there is a drive selected then don't allow an exit. *H * Close any open logfile and report logfile name to user *I ***********************************************************************/void diskblock_exit(void){ extern unsigned short O modify_flag, /* 1 = I/O buffer has been modified */H access_flag, /* 1 = Selected drive/file has been accessed */O log_flag; /* 1 = Log file is open */ O extern struct FAB logfab; /* File attributes block */O extern struct NAM lognam; /* Name block */O unsigned int status; /* VMS Status return */ . if ( (modify_flag==1) && (access_flag==1) ) {3 lib$signal(&DSKB_WR_OR_DES,0,&DSKB_BUFMOD,0); return; }  if (log_flag!=0) {& status = sys$close(&logfab,0,0);' if (!$VMS_STATUS_SUCCESS(status))F lib$signal(&DSKB_CLOSERR,3,lognam.nam$b_rsl,lognam.nam$l_rsa, logfab.fab$l_stv,0); log_flag = 0;E lib$signal(&DSKB_LOGCLOSE,2,lognam.nam$b_rsl,lognam.nam$l_rsa); } exit(0);}/*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.COM;21+,4 ./ 4O6-h*0123KPWO 56GJ7`B89G HJ $ set noon"$! Command file to build DISKBLOCK$!L$! Defines DCL symbols and then uses MMS or DISKBLOCK_NO_MMS to do the build$!C$! If this is a VAX with VAXC then tell the user to install DECC7$! If P1 = DEBUG add /DEBUG to CCQUALS and LINKQUALSG$! If P2 = LINK and MMS is not installed then link without compiling$! $! CCQUALS1$! on VAX running DECC = "/DECC/DEFINE=VAX"D$! on Alpha = "/STANDARD=RELAXED_ANSI/DEFINE=ALPHA"C$! onIA64 = "/STANDARD=RELAXED_ANSI/DEFINE=IA64"$!$! LINKQUALS"$! on all platforms = "/MAP"$!$! EXTRA_LIBRARYC$! on VAX = "+diskblock_dir:Diskblock.tlb/library"?$! on Alpha and IA64 = "+sys$share:sys$lib_c.tlb/library"$!$! VAX, ALPHA and IA64A$! one of these is defined "TRUE" and the other two "FALSE"$!$ linkquals == "/MAP"$!$ VAX == "FALSE"$ ALPHA == "FALSE"$ IA64 == "FALSE"$!$ if (f$getsyi("CPU") .eq. 128)$ then9$ extra_library == " +sys$share:sys$lib_c.tlb/library "+$ if f$getsyi("arch_name") .eqs. "Alpha" $ then?$ write sys$output "Setting symbols for Alpha compilation"7$ ccquals == "/STANDARD=RELAXED_ANSI/DEFINE=ALPHA"$ Alpha == "TRUE"$ else>$ write sys$output "Setting symbols for IA64 compilation"6$ ccquals == "/STANDARD=RELAXED_ANSI/DEFINE=IA64"$ IA64 == "TRUE" $ endif$ else&$ ! Find out if DECC is installed..."$ define /user sys$output _nla0:!$ define /user$DISKBLOCK061.E4 h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.COM;21O sys$error _nla0:$$ cc/decc sys$input /object=_nla0:main(){}L$! DCL-W-IVQUAL (or DCL-W-IVVERB) will be returned if DECC is not installed"$ result = $status .and. %xfffffN$! Make sure we have cleared any user mode logicals by executing an image!!@!?$ search 'f$environment("procedure")' "search" /output=_nla0:7$ if (result .eq. %X38240) .OR. (result .eq. %X38090)$ thenO$ Write sys$output "DISKBLOCK cannot be compiled with the VAXC compiler."H$ write sys$output "please compile the code on a system with DECC" $ exit$ elseF$ write sys$output "Setting qualifiers for VAX DECC compilation"A$ extra_library == " +diskblock_dir:Diskblock.TLB/library "%$ ccquals == "/DECC/DEFINE=VAX"$ VAX == "TRUE" $ endif$ endif$!$ if "''P1'" .eqs. "DEBUG"$ then,$ Write sys$output "Compiling with /DEBUG",$ ccquals == "''ccquals'" + "/DEBUG/NOOPT"+$ linkquals == "/DEBUG" + "''linkquals'"$ endif$!'$ if f$trnlnm("diskblock_dir") .eqs. ""$ then+$ this_proc = f$environment("procedure").$ this_dev = f$parse(this_proc,,,"device")1$ this_dir = f$parse(this_proc,,,"directory")3$ define /job diskblock_dir 'this_dev''this_dir'$ endif$!&$ mms /descrip=diskblock_dir:diskblockC$! DCL-W-IVVERB (%X38090) will be returned if MMS is not installed $ result = $status .and. %xfffff$ if result .eq. %X38090 $ then C$ write sys$output "MMS not installed, compiling ALL sources..."9$ @diskblock_dir:diskblock_no_mms "''P1'" "''P2'" "OK"$ endif$!$ exit-*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.H;74+,8. / 4f -h*0123KPWO!56GR7"89G HJ2 /* diskblock.h Header file for diskblock */#ifndef __DISKBLOCK_DEFS_LOADED!#define __DISKBLOCK_DEFS_LOADED 1B/* Allow VAX to use definitions of file headers etc from Alpha */B/* MUST NEVER USE an __int64 value in the code or it will break */ #ifdef VAX#ifdef __int64#undef __int64#endif#define __int64 long#endif #ifdef __DECC#define FIB_FID fib$w_fid#define FIB_ACCTL fib$l_acctl#else-#define FIB_FID fib$r_fid_overlay.fib$w_fid2#define FIB_ACCTL fib$r_acctl_overlay.fib$l_acctl #endifM#include /* Access control list entries */M#include /* Used for sys$shange_acl */M#include /* File attributes block */M#include /* CLI messages */M#include /* Character types e.g. isprint() */M#include /* Device Class definitions */M#include /* String Descriptors */M#include /* for $GETDVI system service */M#include /* Files 11 definitions" */M#include /* Files 11 definitions" */M#include /* Files 11 definitions" */M#include /* FIB used by ACP QIOs */M#include /* Files 11 definitions" */M#include /* Files11 Home Block definitions */M#include /* QIO system service definitions */M#include /* GETJPI system service */M#include /* Conversion Routines */M#include /* Conversion Routines */M#include /* RMS data structures */#include M#include /* Shadow control block */M#include /* Screen Management routines */M#include /* System Service return values */M#include /* Variable length argument list */M#include /* C I/O definitions */M#include /* C library routines */#include M#include /* For definition of $VMS_STATUS_SUCCESS */M#include /* For $GETSYI system service */M#include /* C routines for time calculations */#include #include #include #include Mglobalref diskblock_commands; /* name of DCL command table */Mglobalref /* Messages in MESSAGES.MSG */ DSKB_ACLERR, DSKB_ADDRBIG, DSKB_ASNERR, DSKB_BADHEADER, DSKB_BLKMODIF, DSKB_BLKREAD, DSKB_BUFMOD, DSKB_BUFNOTMOD, DSKB_CHKCHANGED, DSKB_CHKINVALID, DSKB_CHKVALID, DSKB_CLOSERR, DSKB_CONTROL_C, DSKB_CONTROL_T, DSKB_COPYING, DSKB_CPYATTRIB, DSKB_CPYACL, DSKB_CREATED, DSKB_CREATERR, DSKB_DATABIG, DSKB_DESEL, DSKB_DIRLOOP, DSKB_DISKSEL, DSKB_DSNERR, DSKB_DVIERR, DSKB_EFERR, DSKB_EXTFID, DSKB_FACTOR, DSKB_FID_FFFF, DSKB_FIDTOOBIG, DSKB_FILESEL, DSKB_FIRST100, DSKB_FLUSHTIMERR, DSKB_FORCEDERR, DSKB_FOUND, DSKB_GETERR, DSKB_INDEXFMAP, DSKB_IOSIZE0, DSKB_IOSIZEERR, DSKB_HBLKINVCHK2, DSKB_HBLKINVCHK1, DSKB_HBLKINVDATA, DSKB_HBLKNOTFOUND, DSKB_HDRINVCHK, DSKB_HDRINVIDOFF, DSKB_HDRINVMPOFF, DSKB_HDRINVACOFF, DSKB_HDRINVRSOFF, DSKB_HDRINVSTRLEV, DSKB_HDRINVSTRVER, DSKB_HDRINVFID, DSKB_HDRINVMAP, DSKB_HOMEBLOCKERR, DSKB_INDXHDRERR, DSKB_INSFQUOTA, DSKB_INSVIRMEM, DSKB_INVBACKLINK, DSKB_INVFID, DSKB_INVNUMBER, DSKB_INVTIME, DSKB_JPIERR, DSKB_LASTBLOCK, DSKB_LASTFID, DSKB_LBNCOUNTERR, DSKB_LOGCLOSE, DSKB_LOGERROR, DSKB_LOGFILE, DSKB_NOBLOCK, DSKB_NOBLOCKS, DSKB_NOCON_C, DSKB_NOCON_T, DSKB_NOEXTHDR, DSKB_NOFID0, DSKB_NOFILENAME, DSKB_NOFILES, DSKB_NOINDEXF, DSKB_NOKB, DSKB_NOKT, DSKB_NOSEL, DSKB_NOTACCES, DSKB_NOTDISK, DSKB_NOTERMCHAN, DSKB_NOTFILE, DSKB_NOTFOR, DSKB_NOTMNT, DSKB_NOTOWNER, DSKB_NOVBN0, DSKB_NO_COUNT0, DSKB_NUMBIG, DSKB_NYI, DSKB_ODS5HDR, DSKB_OPENERR, DSKB_PUTERR, DSKB_RDBADHEADER, DSKB_READERR, DSKB_READHELP, DSKB_RESTORED, DSKB_SEARCHDONE, DSKB_SEARCHING, DSKB_SKIPHDR, DSKB_SPAWNERR, DSKB_SPIRALREAD, DSKB_STRBIG, DSKB_STRTOOLONG, DSKB_WRTBADHEADER, DSKB_WRITERR, DSKB_WRTENAB, DSKB_WRTPROT, DSKB_WR_OR_DES;void attach(void), checksum(void), copy_file(void), deposit_buffer(void), deposit_string(void), deselect(void), directory(void), diskblock_exit(void), dump_buffer(void), examine_buffer(void), help_request(void), open_output(void), close_output(void), control_c(void), control_t(void), read_block(void), restore_buffer(void), rewrite_block(void), save_buffer(void), search_disk(void), select_disk(void), select_file(void), set_log(void), set_nyi(void), show_status(void), spawn(void), test_disk(void), write_block(void);#if !defined(__VAXC)#define __struct strM$DISKBLOCK061.E8h*-[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.H;74f :)  uct#else#define __struct variant_struct#endif #if !defined(__VAXC)#define __union union#else#define __union variant_union#endiff/* Copied from old F11DEF because I have no idea where this is now defined... StuartR 21st Apr 2004 */struct unit_id { unsigned int alloclass; unsigned short unit; unsigned devname3:5; unsigned devname2:5; unsigned devname1:5; unsigned dummy:1;};union ALPHA_INST{ unsigned long int longword; __struct /* PAL */ { unsigned palcode : 26 ; unsigned opcode : 6 ; } PAL_TYPE;$ __struct /* Floating Operate */ { unsigned Fc : 5 ; unsigned F_func : 11 ; unsigned Fb : 5 ; unsigned Fa : 5 ; unsigned pad1 : 6 ; } F_OPER_TYPE;# __struct /* Integer Operate */ { unsigned Rc : 5 ; unsigned I_func : 7 ; unsigned lit_flag : 1 ; unsigned SBZ : 3 ; unsigned Rb : 5 ; unsigned Ra : 5 ; unsigned pad2 : 6 ; } I_OPER_TYPE;0 __struct /* Integer Operate With Literal */ { unsigned pad3 : 13 ; unsigned literal : 8 ; unsigned pad4 : 11 ; } I_LITERAL_TYPE; __struct /* Branch */ { int br_displ : 21 ; unsigned pad5 : 11 ; } I_BRANCH_TYPE; __struct /* Memory */ { int mem_displ : 16 ; unsigned pad6 : 16 ; } MEMORY_TYPE;! __struct /* Memory Branch */ {! int mem_br_displ : 14 ;! unsigned mem_br_type : 2 ;! unsigned pad7 : 16 ; } MEMORY_BRANCH_TYPE;} ;#if !defined(__VAXC) #define palcode PAL_TYPE.palcode#define opcode PAL_TYPE.opcode#define Fc F_OPER_TYPE.Fc!#define F_func F_OPER_TYPE.F_func#define Fb F_OPER_TYPE.Fb#define Fa F_OPER_TYPE.Fa#define Rc I_OPER_TYPE.Rc!#define I_func I_OPER_TYPE.I_func%#define lit_flag I_OPER_TYPE.lit_flag#define Rb I_OPER_TYPE.Rb#define Ra I_OPER_TYPE.Ra&#define literal I_LITERAL_TYPE.literal'#define br_displ I_BRANCH_TYPE.br_displ'#define mem_displ MEMORY_TYPE.mem_displ4#define mem_br_displ MEMORY_BRANCH_TYPE.mem_br_displ2#define mem_br_type MEMORY_BRANCH_TYPE.mem_br_type#endif,/* Routine to decode an Alpha Instruction */<void decode_inst(union ALPHA_INST *instruction, char *line);8/* Routine to locate next Map extent in a file header */Dvoid map_extent(FH2 *buff, /* Buffer containing file header */D FM2 **map, /* input - previous map pointer */N /* output - current map pointer */N int *count, /* Count from current map pointer */N int *lbn, /* Starting LBN from current map */N short flag); /* 1 = return placement pointers */N /* 0 = return mapping pointers */7/* Routine to convert protection mask to ASCII text) */8void protect_text(char *text, unsigned short int mask); 8/* Routine to add a single character to a text string */#void addchar(char *line, char add);(/* Routines to dump formatted bufffer */ void dump_ascii(char *buffer)," dump_instructions(char *buffer),- dump_header(FH2 *header, short HeaderFlag),1 dump_DCL_header(FH2 *header, short HeaderFlag), dump_home(char *buffer), dump_scb(char *buffer),7 dump_numbers(unsigned char *buffer, short data_size),7 print_id(char *outbuf, struct unit_id *id, int flag);A/* Routine to extract FILENAME.EXT;VERSION part of file header */+void get_name(FH2 *header, char *filename); unsigned long, read_or_write( A char *buffer, /* Buffer to use */A short write_flag, /* 0 = READ, 1 = WRITE */B short rewrite_flag /* 1 = REWRITE */  ),1 read_header(char *buffer, int lbn),E dskb_match_wild(struct dsc$descriptor_s filename_desc, B struct dsc$descriptor_s input_desc),& check_header(FH2 *buff),B fid_to_lbn(unsigned long fid, unsigned long *block),% print_line(char *line),) yes_no(const char *prompt),+ fid_to_name(unsigned int fid,. char *full_filename,, unsigned int *lbn,6 unsigned short signal_flag), checksum_buffer(K unsigned char *buff, /* Address of buffer */K int message, /* TRUE = print status info */K int offset, /* # of bytes to checksum */K int deposit_flag /* TRUE = correct checksum */ ),> put_output(struct dsc$descriptor_s *out_string), get_input(O struct dsc$descriptor_s *in_string, /* Descriptor for returned string */O struct dsc$descriptor_s *prompt, /* Descriptor for prompt */O unsigned short *len /* Returned string length */ ); #ifdef VAX<unsigned int handler( int *signal_arr, int *mechanism_arr );#else3int handler( int *signal_arr, int *mechanism_arr );#endifint get_integer (P const struct dsc$descriptor_s *param, /* CLI Parameter name */J unsigned long max_data, /* maximum allowed value */J unsigned long *address /* Address for returned data */ ); int get_time (R const struct dsc$descriptor_s *param, /* CLI Parameter name */L unsigned int *quadword /* Returned quadword date/time */ );struct FIB_DESC {O int length; /* Length of file information block */O struct fibdef *fib; /* Address of file information block */ };struct ITEM_LIST {. short int buffer_length;* short int item_code;( int address;' int retlen; };A/* dskb_io[] is used to maintain context information during */A/* SEARCH and TEST. */struct DSKB_IO {M int efn; /* Event Flag */M int block; /* Starting LBN/VBN */M int byte_count; /* Byte Count */M int function; /* Read, write etc... */ struct {O unsigned DSKB_IO_READ : 1; /* 1=read, 0=write */O unsigned DSKB_IO_COMPARE : 1; /* 1 = compare */P unsigned DSKB_IO_FILL : 30; /* PAD to a longword */* } dskb_io_flags;  struct  { O unsigned short status; /* I/O completion status */O unsigned short bytes; /* No of bytes transferred*/O long pad; /* Pad to a quadword */M } iosb; /* call it an I/O status block */ M char *buffer; /* pointer to I/O buffer */ };#endif/*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38+, ./ 4W-h*0123KPWO56o r7gqor89G HJ@o$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W.C 1 InstallationH To install DISKBLOCK you need to copy the kit to a directory on your 4 local system where you have 1500 blocks of quota.B Then type @SYS$UPDATE:VMSINSTAL DISKBLOCK dev:[dir] to install C diskblock. DISKBLOCK installation DOES NOT modify any VMS files. C After deleting all files except DISKBLOCK.EXE and DISKBLOCK.HLB$ it will take up about 400 blocks.E To use this help file from within DISKBLOCK you may either copy theD library to SYS$COMMON:[SYSHLP]DISKBLOCK.HLB or define logical name; DSKB_HLB to point to be dev:[dir]filename of the library.1 HELP3 DISKBLOCK is a low level disk block editing tool.M It can be used to read, modify and write LBNs on a disk or VBN's in a file.F It can also carry out read, write and seek performance measurements.9 Type OVERVIEW at the Topic? prompt for more information 1 OverviewG DISKBLOCK is a tool for reading and writing Logical Blocks on a disk  or Virtual Blocks in a file.I Diskblock ingores all locking activity on the selected Disk or File, itK can access and modify ODS2 and ODS5 data structures such as file headers N and it can read, write and test individual shadow set members independently!D There is a buffer which holds a copy of the block which you read, F you can modify the contents of this buffer using EXAMINE and DEPOSITI commands and then REWRITE it to the same block, WRITE it to a differentG block or SELECT a new disk or file and WRITE the buffer to any block.F When you SELECT a disk, diskblock will attempt to map the Index FileJ If it is successful then any command which requires an LBN (READ, WRITE,I COPY etc...) will also accept a FID and operate on the appropriate file? header. This will work even if the disk is mounted /FOREIGN.I There are commands to SAVE and RESTORE the buffer so that you can keep J a copy of the original block and undo changes if they do not work as you expect.H There is a CHECKSUM command to enable you to recalculate the checksums1 for ODS2 and ODS5 file headers and home blocks.@ There is a DIRECTORY command which will find the header for a - file (even if the disk is mounted /foreign)H There is a COPY command which will enable you to treat any block on a L disk as a file header and copy the LBNs described by its mapping pointers 7 to a new file (even if the disk is mounted /foreign). C There is a SEARCH command which will search the entire disk/file E (or any range of blocks) for a particular string or integer or file header.H There is a TEST command which will carry out performance testing. YouI may specify queue lengths, I/O sizes, read/write ratios and seek types A and Diskblock will report throughput and bandwidth to the disk.; Because of its potential to corrupt disks you should onlyB use Diskblock in extreme desperation or on a disk which you have backed up.  - You need LOG_IO privilege to run DISKBLOCK.9 Type EXAMPLES at the Topic? prompt for more information 1 ExamplesE Search shows the use of the search command to locate a file header,7 and then to copy the file to a normally mounted disk.= This may be used even on a disk with a corrupted INDEXFILE.H Modify_disk shows the use of DISKBLOCK to repair a damaged home block.H Modify_MFD shows the use of DISKBLOCK to change the file attributes of [000000]000000.DIR= Undelete_file shows the use of DISKBLOCK to undelete a file2 SearchF In this example DISKBLOCK is used to find a file on a corrupted disk> and then to copy the file to the users SYS$SCRATCH directory $ RUN SYS$SYSTEM:DISKBLOCK* DISKBLOCK V5.7H Copyright (c) Digital Equipment Corp. 1997. All rights Reserved. $ MOUNT /FOREIGN $1$DUA42# DISKBLOCK> SELECT $1$DUA42 /NOMAP' DISKBLOCK> SEARCH /HEADER=X.EXT /FULLR %DSKB-I-SEARCHING, Searching blocks 0 - 2376152 for HEADER "X.EXT;*" at 13:23:45! LBN: 1188943, Filename: X.EXT;2: FID: 1032, SEGNUM: 0, CREDATE: 19-MAY-1994 01:30:09.762 %DSKB-I-SEARCHDONE, Search completed at 13:44:10& DISKBLOCK> DUMP /FILE /BLOCK=11889437 ... Check that this is the correct file header....... DISKBLOCK> COPY 1188943; %DSKB-I-CREATED, Created file DUA0:[RANCE]COPY_FILE.DAT;1< %DSKB-I-COPYING, Copying 214 blocks starting at LBN 113124: %DSKB-I-COPYING, Copying 24 blocks starting at LBN 10456S %DSKB-I-CPYACL, 92 Bytes of ACL information copied to DUA0:[RANCE]COPY_FILE.DAT;1W %DSKB-I-CPYATTRIB, File attributes successfully copied to DUA0:[RANCE]COPY_FILE.DAT;1 2 Modify_diskE In this example a backup copy of the home block is used to repair a corrupted primary home block. $ RUN SYS$SYSTEM:DISKBLOCK* DISKBLOCK V5.7H Copyright (c) Digital Equipment Corp. 1997. All rights Reserved.$ DISKBLOCK> MOUNT /FOREIGN $2$DUA22E DISKBLOCK> SELECT $2$DUA22 ; Select the problem driveJ DISKBLOCK> READ 2 ; Read backup copy of HomeblockE DSKB-I-BLKREAD, Block 2 (%X00000002) of _$2$DUA22 successfully read( DISKBLOCK> HELP ODS2 HOME HOMELBN J .......................... ; Find size and offset of field8 DISKBLOCK> DEPOSIT 0 1 ; New HOMELBN8 DISKBLOCK> DEPOSIT/WORD 16 2 ; New HOMEVBN= DISKBLOCK> CHECKSUM /HOME /DEPOSIT ; Modify checksumsE %DSKB-I-CHKCHANGED, Checksum has been changed from %X289B to %X3F9BE %DSKB-I-CHKCHANGED, Checksum has been changed from %X5136 to %X7F36? DISKBLOCK> DUMP /HOME ; See if it looks OK .........................G DISKBLOCK> WRITE 1 ; Write to primary homeblockK %DSKB-I-BLKMODIF, Block 1 (%X00000001) of _$2$DUA22 successfully modified 2 Modify_MFDK In this example the ownership of the MFD of a disk is changed to be [1,4] $ RUN SYS$SYSTEM:DISKBLOCK* DISKBLOCK V5.7H Copyright (c) Digital Equipment Corp. 1997. All rights Reserved.I DISKBLOCK> SELECT DUA2:/OVER ; Allow writes to mounted diskG DISKBLOCK> READ /FID=4 ; Read header for 000000.dirK DSKB-I-BLKREAD, Block 273590 (%X00042CB6) of _NODE$DUA2 successfully read3 FID: 4 LBN 273590 [000000]000000.DIR;1B DISKBLOCK> HELP ODS2 FILE_HEADER ; Check field for ownerC DISKBLOCK> DEPOSIT 60 %X00010004 ; CHANGE FH2$L_FILEOWNER DISKBLOCK> rewrite /checksumC%DSKB-I-CHKCHANGED, Checksum has been changed from %XCC5D to %XCC5AG%DSKB-I-BLKMODIF, Block 273590 (%X00042CB6) of _DINCY$DUA0 successfullymodified2 Undelete_fileJ In this example a file on an ODS2 mounted disk is undeleted by patching  the file header $ RUN SYS$SYSTEM:DISKBLOCK* DISKBLOCK V5.3H Copyright (c) Digital Equipment Corp. 1991. All rights Reserved." DISKBLOCK> SELECT /OVER $1$DUA2:* DISKBLOCK> DIRECTORY MYFILE.DAT /DELETED8 FID: 6998 LBN 273600 [RANCE.DAT]MYFILE.DAT;1: DISKBLOCK> read /fid=6998 ! Read the file headerJ %DSKB-I-BLKREAD, Block 273600 (%X00042CC0) of _$1$DUA2 successfully readB %DSKB-W-RDBADHEADER, Invalid File Header, FID: 6998, LBN: 273600I -DSKB-E-HDRINVFID, FH2$W_FID_NUM (byte 8) is 0, could be a deleted fileF DISKBLOCK> EXAM 52 ! Check current file characteristics@ DISKBLOCK> DEPOSIT 52 0 ! Clear bit 15 (FH2$V_MARKDEL)9 DISKBLOCK> DEPOSIT /WORD 8 6998 ! Write the correct FID; DISKBLOCK> CHECKSUM /DEPOSIT ! Create a valid checksumE %DSKB-I-CHKCHANGED, Checksum has been changed from %X5327 to %XAF62C DISKBLOCK> DUMP /FILE ! Check that file header is validH DISKBLOCK> REWRITE ! Write file header back to INDEXF.SYSM %DSKB-I-BLKMODIF, Block 1000 (%X000003E8) of _$1$DUA2 successfully modified8 Now you need to Dismount the disk, mount it again and 7 $ ANAL /DISK /REPAIR should put the file in [SYSLOST]1 New_Features2 V4.0_New_FeaturesC SELECT /FILE allows you to select a file and then do virtual I/O.E This can be useful for writing to a file which is locked by anotherJ user, or for searching a large file for a text string or Longword value.> Modifications made by Burnace Leung to create DSKBLK_V3 have? been included as COPY_FILE and DIRECTORY. See EXAMPLE SEARCH? for an example of copying a file from a foreign mounted disk.@ READ/FID has been added to enable you to specify a File ID and read the corresponding LBN.< A /CHECKSUM qualifier has been added tRa$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38Wo the write command.6 This makes life simpler when modifying file headers.# A number of bugs have been fixed.2 V4.1_new_featuresD There are only three very minor differences between DISKBLOCK V4.0 and DISKBLOCK V4.1.* The handling of HELP is now more robust.8 The search command can now be cancelled by typing a ^C0 DISKBLOCK can now be installed with VMSINSTAL.2 V5.0_New_FeaturesF Diskblock V5 has been totally re-written in C (it used to be Macro).= There are major improvements in the area of error handling,B especially in the handling of disk errors during READ and SEARCHA commands and in the validation of Home blocks and file headers.D Control C and Control T handling now work during Directory as well as search operations.= There has been a syntax change for READ /FID and WRITE /FID4 There are a number of new commands and qualifiers. 3 SET_LOGJ The SET LOG command causes ALL diskblock output to be sent to a log file as well as to the terminal 3 SET_PAGEG The SET PAGE command causes diskblock output to pause every screenful, and prompt with "Type a to continue". 3 REWRITEB The REWRITE command allows a block to be written back to the LBNG it was read from to reduce the chance of mis-typing the block number. 3 DIRECTORYJ The DIRECTORY command now displays FULL file specification, FID and LBN.C DIRECTORY/FID has been added to convert a FID number to filename.D DIRECTORY/LBN has been added to find the file using any given LBN.E The performance of the DIRECTORY command has been greatly improved.3 /FORCED_ERRORF There is a /FORCED_ERROR qualifier to WRITE and REWRITE which allowsG a block to be written with the forced error flag set. USE THIS WITH E EXTREME CAUTION - IF YOU DON'T UNDERSTAND WHAT IT MEANS THEN DON'T 9 USE IT!!!! 3 CHECKSUM/HOMEE The checksum command now takes a /HOME qualifier which causes it to8 check or modify BOTH of the checksums in a home block. 3 COPY/BUFFERA There is a /BUFFER qualifier to COPY_FILE which allows the mainC read/write buffer to be the file header of the file to be copied.G This enables you to modify the header without writing the input disk.3 /FIDF This qualifier to READ and WRITE now requires the fid as a qualifierI value (e.g. READ /FID=1000) rather than as a parameter (READ /FID 1000)@ This has been done to be consistent with DIR/FID and COPY/FID.2 V5.1_New_Features6 V5.1 has two minor bug fixes and three new features. Bug_fixesD DISKBLOCK> CHECKSUM/HOME/DEPOSIT now correctly sets both checksums? DISKBLOCK> DIR /LBN=0 now correctly identifies the INDEXF.SYS New_features DISKBLOCK> SET WRITE DISKBLOCK> SET NOWRITEB These commands enable and disable writing the selected disk/file DISKBLOCK> DIR ... /VALID_ONLY> This qualifier causes invalid file headers to be ignored and= DIR /LBN for a single LBN will finish after a single match.= The diskblock help library no longer has to be in SYS$HELP,) $ DEFINE DSKB_HLB dev:[dir]filaneme.HLB to access the help library2 V5.2_New_Features3 V5.2 has the following bug fixes and new features9 Diskblock now works on both OpenVMS VAX and OpenVMS AXPA DUMP /HOME has been added to display the buffer as a home block8 DUMP /HEADER has been added as a synonym for DUMP/FILED SEARCH/HEADER is a new command to find blocks that look like validC file headers and report the LBN and filename. It is NOT the sameG as the directory command since it does not use the INDEXF.SYS mapping" pointers to locate file headers./ EXAMINE/TIME and DEPOSIT/TIME have been added> COPY now propagates the file owner and protection as well as@ file characteristics and record attributes. It still does not propagate ACLs.? DISKBLOCK no longer issues a SHOW command every time you do a? select. You may issue the SHOW command yourself if required.? A memory leak has been fixed that lost TRACK_SIZE * 512 bytes$ every time a new disk was selected@ The page length was being incorrectly handled if a string withG no line feeds (or more than one line feed) was sent to the terminal,  this has now been fixed2 V5.3_New_Features% V5.3 has the following new features> FILL command fills the read write buffer with a data patternD Many new qualifiers to the Directory command allow file selections to be made.8 /SELECT=SIZE finds files above or below a certain size/ /BY_OWNER finds files with a particular owner# /DELETED finds ONLY deleted files0 /BACKFID finds files in a particular directory8 /BEFORE /SINCE /BACKUP /CREATED /EXPIRED and /MODIFIED< allow selection of files based on dates in the file header2 V5.4_New_Features4 V5.4 has the following new features and bug fixes.C DIRECTORY /PLACEMENT finds files with placement mapping pointersG SAVE and RESTORE now use the /BLOCKS=(START,END,COUNT) qualifier to H save and restore any contiguous range of blocks on the selected disk or file.G DUMP can now use the /BLOCK and /FID qualifiers to dump a formatted F block from the disk without having to overwrite the main read write buffer.E SEARCH /HEADER has a new switch /FULL which gives a second line ofF information for each header found showing Extension Segment number, Creation Date and FID.I Improvements have been made to the handling of disk read errors during DIRECTORY commands.L The default for a SELECT command has been changed from /WRITE to /NOWRITEI A potential hang caused by the use of the same Event flag at both AST % and process levels has been fixed.H An access violation during Examine commands on Alpha systems has been fixed.H Incorrect numeric and UIC displays from dump commands have been fixed2 V5.5_New_FeaturesJ The copy command now copies ACLs as well as other file characteristics.G The copy command now uses the filename from the input file header asH the default output file name. The default output directory is still  SYS$SCRATCH;E A problem which caused incorrect display of some data values from @ the dump command on OpenVMS Alpha systems has been corrected.C A problem which caused incorrect display of data values from theF EXAMINE /OCTAL command on OpenVMS Alpha systems has been corrected.E Added the ability to detect nested directory loops to all commands that display directory names2 V5.6_New_FeaturesF TEST command performs I/O performance testing, with user selectableH queue length, I/O size, etc. You must read the warnings in this help& file before using the test command.J READ /SCB qualifier finds and reads the Storage Control Block of a diskJ DUMP /SCB dumps the current buffer formatted as a Storage Control BlockD Support for ODS5 format disks has been added. Type HELP ODS5 for? details of what ODS5 features are available within DISKBLOCKC A problem which caused the dots to be missing from the directory. part of displayed filenames has been fixed.2 V5.7_New_Features F Correct display of secondary error status from Read and Write errors! during Search and Test commands. Corrected display of DOTs in directory names2 V5.8_New_FeaturesH Cancel Test I/O and allow it to run down if user types Control-C, this? prevents errors when running multiple tests from a batch job.G Modified Test to use the main Read / Write buffer as t!he data pattern8 for writes, rather than just defaulting to all Zeros. 2 V6.0_New_FeaturesC Diskblock V6 has been converted from VAXC to Standard C to enable7 support of OpenVMS on VAX, Alpha and Itanium hardware@ There is now a single kit that can be installed on all OpenVMS systems.2 V6.1_New_FeaturesC There is a new /SINGLEPASS switch to enable TEST / SEQUENTIAL to ; finish as soon as all blocks have been read or written. 1 SELECT: Use the SELECT command to select a new drive or file for; reading and writing. Before selecting a drive it must be? mounted foreign (unless you specify the /OVERRIDE qualifier).> SELECT automatically DESELECTS any previously selected drive% or file before selecting a new one.G By default LBN 1 (HOME BLOCK LBN) will be read to locate the primary @ index file header. If this fails because of hardware error orK corrupted home block then index file retrieval pointers will not be read. 2 Parameters device_name. Spe/$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W0 #cifies the name of the disk to be selected file_name5 Specifies the name of the file to be selected (requires SELECT/FILE)2 Command_Qualifiers/FILEF Use this qualifier to enable you to perform Virtual I/O to a single D file on an ODS2 mounted disk. This allows you to use DISKBLOCK asC a utility somewhere between Patch and Dump, it will allow you to I modify the contents of a file without taking out RMS locks - even when , someone else has the file open and locked. /OVERRIDED Use the /OVERRIDE qualifier to enable you to read and write a diskE that is not mounted foreign. Use even more extreme care when doing@ this as you could cause great damage to the VMS file system by, modifying disks that are normally mounted.8 This qualifier cannot be used with the /FILE qualifier/NOMAPE Use this qualifier to prevent DISKBLOCK from reading the Home Block$ and Index File retrieval pointers.8 This qualifier cannot be used with the /FILE qualifier/HOMELBN< Use this qualifier to specify an alternate Home Block LBN.C DISKBLOCK will read this alternate HOMELBN, validate its contentsE and use it to locate the Index File Header. The Index File mapping Pointers will then be read.8 This qualifier cannot be used with the /FILE qualifier< This qualifier cannot be used with the /INDEXLBN qualifier /INDEXLBNC Use this qualifier to specify an alternate Index File Header LBN.C DISKBLOCK will read this LBN, validate its contents and read the  index file mapping pointers.8 This qualifier cannot be used with the /FILE qualifier8 This qualifier cannot be used with the /HOME qualifier> If you use the qualifier /INDEXLBN you must also use /FACTOR/FACTOR D If you use the /INDEXLBN qualifier then Diskblock will not read a D Home Block, this means that the cluster size and index file bitmapC size are not available. You must therefor specify a FACTOR which8 Diskblock can use to map File IDs to Indexfile VNBs.  F This factor should be (CLUSTER_SIZE * 4) + (Index File Bitmap Size) F If you select an incorrect value then Diskblock will translate FIDs  to LBNs incorrectly./WRITE@ Select /WRITE causes DISKBLOCK to operate in READ / WRITE modeC the WRITE and REWRITE commands can be used to modify the selected DISK or FILE.D Select /NOWRITE causes DISKBLOCK to operate in READ ONLY mode, theI selected disk or file can be READ or SEARCHED but the WRITE and REWRITE commands will return an error. The default is SELECT /NOWRITE See also SET WRITE 2 Examples DISKBLOCK> SELECT $2$DRA2:1 DISKBLOCK> SELECT SYS$SYSTEM:SYSDUMP.DMP /FILE' DISKBLOCK> SELECT $2$DUS0: /OVERRIDE& DISKBLOCK> SELECT DISK$USER2 /NOMAP. DISKBLOCK> SELECT MYNODE$DUA1: /HOMELBN=nnn3 DISKBLOCK> SELECT DRA3: /INDEXLBN=nnn /FACTOR=85 1 DESELECTF Use the DESELECT command to free a drive or file previously selectedF with a select command, this may help to prevent accidentally) writingG to a drive/file that you have finished with. An implicit DESELECT is9 performed for you whenever you SELECT a new drive/file.F Diskblock will not allow you to exit if the buffer has been modifiedD and there is still a Drive selected, you should Deselect the drive before exiting. DISKBLOCK> DESELECT1 READB The read command is used to transfer data to Diskblocks internalJ 512 byte buffer. You must SELECT a drive or file before a read command.6 You can read a Logical Block from the selected disk.* Or a file header from the selected disk., Or a Virtual Block from the selected file./ You must specify a Block Number or a File ID.@ The default radix for the Block is decimal but you may use the< %X or %O operators to specify a Hex or Octal block number.G When you read a block the current contents of the buffer will be lostE If you require the current buffer contents then you should SAVE the' bufffer before reading another block. 2 Parameter Block_numberC Specifies the LBN of the block to be read from the selected drive; or the VBN of the block to be read from the selected file2 Command_Qualifiers/FID? Use the command READ /FID to read an LBN from a disk when you= know the File ID of the file whose header you want to read.= This command will only work if you have read the index file+ mapping pointers with the SELECT command.F The FID will be translated to an LBN and the appropriate file headerD will be read in to the buffer, the buffer will then be checked to B ensure that the file header is valid and diagnostic messages may be issued. See also DIRECTORY /FID< The syntax for this command has changed with DISKBLOCK V5. The format is now...  DISKBLOCK> READ /FID=1000/SCB See also DUMP /SCBF Use the command READ /SCB to read the Storage Control Block from theC currently selected drive. The SCB is the first block of the fileG [000000]BITMAP.SYS, it contains information relating to the mount and( Volume Shadowing status of the volume. The syntax for this command is DISKBLOCK> READ /SCB1 WRITE See also REWRITE7 Use the write command to write the 512 byte buffer to( A Logical Block on the selected drive,) Or a File Header on the selected drive,* Or a Virtual Block in the selected file./ You must specify a Block Number or a File ID.@ The default radix for the Block is decimal but you may use the< %X or %O operators to specify a Hex or Octal block number.> You must SELECT a drive or file before issuing this command. DISKBLOCK> WRITE %xFF& DISKBLOCK> WRITE /CHECKSUM /FID=1004 2 Parameter Block_numberD Specifies the LBN of the block to be written on the selected drive< or the VBN of the block to be written to the selected file2 Command_Qualifiers /FORCED_ERRORE This switch will cause the block to be written to the disk with theG forced error flag set. USE THIS WITH EXTREME CAUTION - IF YOU DON'T 0 UNDERSTAND WHAT IT MEANS THEN DON'T USE IT!!!! G The effect of this flag may depend on the type of disk, on DSA disks F it will cause a forced error condition when the block is read again,* the correct data will still be returned. F On some SCSI disks it will cause a parity error to be generated when/ the block is read and NO DATA to be returned.% DISKBLOCK> WRITE /FORCED_ERROR 100J DO NOT USE THIS SWITCH UNLESS YOU HAVE A VERY GOOD REASON AND YOU REALLYH UNDERSTAND WHAT YOU ARE DOING, IT HAS BEEN INCLUDED SINCE I NEEDED IT E FOR TESTING DISKBLOCK AND I HAVE VERY OCCASSIONALLY FOUND A USE FOR8 A DISK THAT GENERATES HARDWARE ERRORS WHEN IT IS READ. /CHECKSUM B Use this command when the block you are writing is an ODS2 file D header. The block checksum will be caculated and then written to C the last word of the buffer. Then the WRITE function will write & the buffer back to the selected LBN. See also CHECKSUM /DEPOSIT/FID? Use the command WRITE /FID to write an LBN on a disk when you> know the File ID of the file whose header you want to write.= This command will only work if you have read the index file+ mapping pointers with the SELECT command.D Diskblock will first verify that the buffer contains a valid file F header, if not then a diagnostic message will be issued and you willH be asked if you wish to continue. It will then convert the FID to theD LBN of the corresponding file header and write the header to disk.< The syntax for this command has changed with DISKBLOCK V5. The format is now...  DISKBLOCK> WRITE /FID=234 1 REWRITEB Use the rewrite command to write the 512 byte buffer back to theB last block read or written. You do not need to specify a block number.A You must SELECT a drive or file and then read or write a block  before issuing this command.F To see the block that would be used for a rewrite command issue the  SHOW command. DISKBLOCK> REWRITE DISKBLOCK> REWRITE /CHECKSUM" DISKBLOCK> REWRITE /FORCED_ERROR2 Command_Qualifiers /FORCED_ERRORE This switch will cause the block to be written to the disk with theG forced error flag set. USE THIS WITH EXTREME CAUTION - IF YOU DON'T 0 UNDERSTAND WHAT IT MEANS THEN DON'T USE IT!!!! G The effect of this flag may depend on the type of disk, on DSA disks F it will cause a forced error condition when the block is read again,* the correct data will still be returned. F On some SCSI disks it will cause a parityI$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W 4y error to be generated when/ the block is read and NO DATA to be returned.J DO NOT USE THIS SWITCH UNLESS YOU HAVE A VERY GOOD REASON AND YOU REALLYH UNDERSTAND WHAT YOU ARE DOING, IT HAS BEEN INCLUDED SINCE I NEEDED IT E FOR TESTING DISKBLOCK AND I HAVE VERY OCCASSIONALLY FOUND A USE FOR8 A DISK THAT GENERATES HARDWARE ERRORS WHEN IT IS READ. /CHECKSUM B Use this command when the block you are writing is an ODS2 file D header. The block checksum will be caculated and then written to C the last word of the buffer. Then the WRITE fucntion will write & the buffer back to the selected LBN. See also CHECKSUM/DEPOSIT1 TESTC Use the TEST command to test the read or write performance of the selected disk drive or file.C You must SELECT the disk or file before issuing the test command.1 WARNING WARNING WARNING WARNING WARNING WARNINGG If you allow TEST to write to any disk then you will destroy the fileH system on that disk. If you allow TEST to write to any file then you H will destroy the contents of that file. If you allow test to write toH a member of a shadow set then the consistency of that shadow set will  be compromised!2 Command_qualifiers/QUEUE /QUEUE=lengthK Use the /QUEUE qualifier to specify the queue length that you want to use during the test.K A queue length of 0 will submit a single I/O and then submit another when the first one finishes.! The default queue length is 20./IOSIZE /IOSIZE=blocksH Use the /IOSIZE qualifier to specify the size of each test I/O in disk7 blocks. The default I/O size is 1 block (512 bytes). /SEQUENTIALJ Use the /SEQUENTIAL qualifier to cause the test to carry out sequential 9 I/O operations. The default is to perform RANDOM I/Os.1 You cannot specify both /SEQUENTIAL and /RANDOM! See also /BLOCK and /SEQUENTIAL /SINGLEPASSD Use the /SINGLEPASS qualifier in conjunction with the /SEQUENTIAL H qualifier to cause the test to complete after all blocks in the range have been read / written once.4 You cannot specify /SINGLEPASS without /SEQUENTIAL/RANDOMG Use the /RANDOM qualifier to tell DISKBLOCK to carry out random seeks2 during the test. This is the default behaviour.1 You cannot specify both /SEQUENTIAL and /RANDOM See also /BLOCK/COMPARE /NOCOMPARE [D]H Use the /COMPARE qualifier to cause DISKBLOCK to follow every read or J write operation with a compare operation which will verify the data has  been9 correctly transferred. Default is /NOCOMPARE /DURATION /DURATION=secondsI Use the /DURATION qualifier to cause DISKBLOCK to stop testing after a I fixed number of seconds. Default is to continue testing until you type CONTROL-C./BLOCKS /BLOCKS=(keyword[,...])I Using the /BLOCKS switch you can specify a starting block and an endingD block or a count of the number of blocks to test. You can specifyD both a START block and an END block, or a START block and a COUNT,4 you may not specify both an END block and a COUNT.< The default START block is 0 for a DRIVE and 1 for a FILE.$ DISKBLOCK> TEST /BLOCKS=START:%X40: This command will test all blocks starting from block 64+ DISKBLOCK> TEST /BLOCKS=(START:64,END=80)( This command will test blocks 64 to 80> DISKBLOCK> TEST /BLOCKS=(START=3000, COUNT=1000) /SEQUENTIALC This command will test blocks 3000 to 3999 using sequential seeks /READPERCENT /READPERCENT=percentage7 This qualifier sets the read/write ratio of the test.# The default is READPERCENT = 100.9 You may set READPERCENT to any value between 0 and 100.> The current Read/Write buffer is used as source data for all blocks that are writtenI WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNINGK Setting this parameter to any value other than 100 will almost certainly I cause data corruption. The data that is copied to the disk or file is  effectively random.2 The safest way to carry out write testing is to  Create a large file.( Run diskblock and select that file.) Test within the blocks of that file.- Delete / Erase the file on completion. H This last step is essential if the device under test is a member of a K shadow set as you will otherwise leave the shadow set in an inconsistent  state.I To show that you have read this part of the help file you must specify K the qualifier /CORRUPT=DATA when you specify any value other than 100 for /READPERCENT. See also /WRITEPERCENT /WRITEPERCENT /WRITEPERCENT=percentageK This parameter is a convenient shortcut for specifying a 100% write test. DISKBLOCK> TEST /WRITE  is equivalent to DISKBLOCK> TEST /READPERCENT=0J Please read the warnings under /READPERCENT before using this qualifier./CORRUPT /CORRUPT=DATAE This qualifier is included as the severest possible warning of the ? consequences of using DISKBLOCK to do write testing on disks.G DISKBLOCK will only allow you to do write testing if you also include the qualifier /CORRUPT=DATA. For example.../ DISKBLOCK> TEST /READPERCENT=99 /CORRUPT=DATA 2 Example ( To test the read performance of a disk$ DISKBLOCK> select disk$user: /overD DISKBLOCK> test /iosize=5 /queue=20 /readpercent=100 /duration=300 9 About to start testing with the following parameters...* Device: _$3$DRA0:, Test Duration: 300 Seconds& Read/Write Ratio: 100:07 Queue Length: 20 (Asynchronous I/Os)" I/O Size: 5" Start Block: 0) End Block: 41891839' Seeks: Random) Data Compare: Disabled* Do you want to continue? : yes Total I/Os completed: 8132$ Run time: 299 Seconds I/Os per second: 428.0 mS per I/O: 2.31 Throughput: 1070.0 KBytes per second DISKBLOCK> 1 COPY_FILE (See also EXAMPLE SEARCH)J Copy_file will copy a file from a FOREIGN mounted or corrupted disk, as , well as from an ODS2 or ODS5 mounted disk.H Diskblock will first verify that the block or buffer contains a valid G file header, if not then a diagnostic message will be issued and you ( will be asked if you wish to continue.B The default output directory is SYS$SCRATCH: The default output0 filename is the name of the file being copied.D The copy command canAnot create an ODS5 extended filename. If the H file you are copying has a filename containing ISO Latin1 characters, F multiple .s, or other syntax that is not valid in ODS2 then you must specify an output file name.@ NOTE that the copy will take place using the mapping pointers B in the file header, if the file header is corrupt then this may " create a VERY large output file.E After the file data has been copied the File and Record attributes, A the File Owner UIC and File Protection will be copied from the aH original file header to the new file header. The Access Control List G (ACL) from the input file header will then be copied to the new file.s C Use of this command does not modify the normal DISKBLOCK 512 byten read / write buffer.E DISKBLOCK> COPY_FILE /OUTPUT=abcd.dmp %x90A12 ! LBN of file headerrE DISKBLOCK> COPY /FID=1234 ! FID of file headerdI DISKBLOCK> COPY /BUFFER ! File header has already been read2 Command_Qualifiers/OUTPUTcH Use this switch to specify the filename of the NEW file to be created.F This command does not support the use of extended filename syntax on@ ODS5 disks, the output file must have an ODS2 style file name./FID@ Use the command COPY /FID to copy a file when you know the FID@ but not the LBN of the file header. The fid will be converted4 to an LBN and the appropriate header will be read.= This command will only work if you have read the index filef+ mapping pointers with the SELECT command.k< The syntax for this command has changed with DISKBLOCK V5. The format is now...  DISKBLOCK> COPY_FILE /FID=234 /BUFFER)@ Use the command COPY /BUFFER when the file header for the file< you want to copy is already in the main read/write buffer.> This enables you to read a file header from disk, modify it B and then use the modified header to copy the file without having9 to write the modified header back to the original disk.m 1 DIRECTORYoI DIRECTҫ$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W\EORY accepts a filename including the * and % wildcard characters.lJ (but excluding any [, ] or directory specification) and displays the FIDK and LBN of the file header and the FULL FILENAME (including directories).h G Once the header has been read the Backlink in the file header will beyF used to find the directory name, up to 8 backlinks will be followed F until 000000.DIR is located and the full filename will be displayed.9 This command does not modify the main read/write bufferfJ This command will work on ODS2 or ODS5 mounted or foreign disks so long M as the index file has been mapped with the SELECT command. ODS5 filenames hJ will be displayed as they are stored in the files - this is a different J format to that displayed by a directory command. No extra ^ characters M will be inserted to distinguish embedded . characters from file separators.s! DISKBLOCK> DIRECTORY [filespec] 2 ParameterI filespecE Specifies the file(s) to be listed. * and % wildcards are allowed.o/ All valid ISO Latin1 characters are accepted.o9 Directory and/or device specifications are not allowed.t2 Command_Qualifiers/FID /FID = nnn= Use DIR /FID to display the filename associated with a FID. DISKBLOCK> DIRECTORY /FID=1000B FID: 1000 LBN: 1189345 [RANCE.SUBDIR.TEMP]TEMPFILE.EXT;23 See also READ /FID/LBN /LBN=(nnn[,...])0D Use DIR /LBN to find which file maps a particular LBN on the disk.J Diskblock will read the entire INDEX File and check the mapping pointersI in all file headers to locate the file(s) that map(s) the given LBN(s).cH Diskblock will continue scanning even after it finds a match to enableH the indentification of all pointers to multiply allocated blocks. You9 can abort the search with a Control C (^C) at any time. D If an invalid file header maps the lbn then an error message will 9 proceed the display of the filename. (See DIR /VALID).aG You may specify multiple LBNs on a single command line in three waIys,R; DIRECTORY /LBN=(nnn,mmm,xxx,yyy) for multiple single LBNsc? DIR /LBN=nnn /COUNT=xxx for a single contiguous range of LBNs.C DIR /LBN=(nnn,mmm...) /COUNT=(xxx,yyy...) for many ranges of LBNsPD The index file will only be scanned ONCE for each command so it isH much more efficient to form a single complex command with all the LBNsF you are interested in than to specify them one at a time in separate commands.n/COUNT /COUNT=(nnn[,...])]B This switch can only be used in conjunction with DIRECTORY /LBN.= For the command DIR /LBN=x /COUNT=m all files that map LBNs + in the range x to x+m-1 will be reported.eA For the command DIR /LBN=(x,y) /COUNT=(m,n) all files that map MC LBNs in the ranges (x to x+m-1) and y to y+n-1) will be reported)i6 e.g. DIR /LBN=10 /COUNT=10 will match LBNs 10 to 195 DIR /LBN=(100,200) /COUNT=(10,20) will match >4 LBNs (100 to 109) and LBNs (200 to 219)/OUTPUTK /OUTPUT=filespec@ Use the /OUTPUT qualifier to cause the output to be written to= a file instead of to the terminal. The default filespec isL SYS$SCRATCH:DISKBLOCK.LIS.H This qualifier does not support the use of extended filename syntax on@ ODS5 disks, the output file must have an ODS2 style file name./VALIDJ If the /VALID qualifier is specified then only matching files with validK file headers will be displayed. Any invalid file headers will be ignoredeG If /LBN and /VALID are both specified and there is only a SINGLE LBN rH specified then the scan will stop after a single valid match has been  found./SELECT. /SELECT=(keyword[,...])D The /SELECT qualifier has identical syntax and meaning to the DCL  command DIRECTORY/SELECT/ DISKBLOCK> DIRECTORY /SELECT=SIZE=MINIMUM=nnn < Only report files with a size greater than or equal to nnn/ DISKBLOCK> DIRECTORY/ SELECT=SIZE=MAXIMUM=mmmS9 Only report files with a size less than or equal to nnn = DISKBLOCK> DIRECTORY /SELECT=SIZE=(MINIMUM=nnn,MAXIMUM=mmm).@ Only report files with a size greater than or equal to nnn AND less than or equal to mmmA /BY_OWNER  /BY_OWNER=UICG The /BY_OWNER qualifier enables you to find files owned by a specificf> UIC or rights identifier. Wild card UICs are not supported.( DISKBLOCK> DIRECTORY /BY_OWNER=[23,45]( DISKBLOCK> DIRECTORY /BY_OWNER=[RANCE]- DISKBLOCK> DIRECTORY /BY_OWNER=[USER,RANCE];( DISKBLOCK> DIRECTORY /BY_OWNER=PROJECT/DELETEDK The /DELETED qualifier can be used to locate the headers of DELETED filesKI on the disk. If you use this qualifier then ONLY deleted files will beiH reported, and the error message saying that this may be a deleted file will be suppressed DISKBLOCK> DIRECTORY /DELETED$- DISKBLOCK> DIRECTORY /BACKLINK=nnn /DELETED * DISKBLOCK> DIRECTORY VITAL.FILE /DELETED/BACKFIDG Only reports files with a particular FID in the file header BACK FID. G The BACK FID is the file id of the directory to which the file header is pointingI= The file id of a directory file can be found by DUMP/HEADERdB of the directory file (either from DCL or from within DISKBLOCK)J This qualifier can be used to locate all files in a particular directoryJ It can be particularly useful in conjunction with the /DELETED qualifier= to locate all files that have been DELETED from a directoryt- DISKBLOCK> DIRECTORY /BACKLINK=nnn /DELETEDa /PLACEMENTH Only reports files which have placement information specified in their mapping pointers. S /SINCE /SINCE=time: Selects only those files dated after the specified time.L You must specify one of the following qualifiers with the /SINCE qualifierF to indicate the time attribute to be used as the basis for selection, /BACKUP /CREATED /EXPIRED or /MODIFIED! The time should be specified asm /SINCE=01-jan-1990 /SINCE=01-JAN-1990M /SINCE="01-JAN-1990 03:42:00.00" <-- NOTE: MUST BE UPPER CASE and QUOTED/BEFOREt /BEFORE=timeN; Selects only those files dated before the specified time.tM You must specify one of the following qualifiers with the /BEFORE qualifierdF to indicate the time attribute to be used as the basis for selection, /BACKUP /CREATED /EXPIRED or /MODIFIED! The time should be specified as /BEFORE=01-jan-1990I /BEFORE=01-JAN-1990EN /BEFORE="01-JAN-1990 03:42:00.00" <-- NOTE: MUST BE UPPER CASE and QUOTED E/BACKUPsB Modifies the time value specified with the /BEFORE or the /SINCEA qualifier. The /BACKUP qualifier selects files according to thetD dates of their most recent backups. This qualifier is incompatibleC with the following qualifiers that also allow you to select files B according to time attributes: /CREATED, /EXPIRED, and /MODIFIED./CREATEDB Modifies the time value specified with the /BEFORE or the /SINCE@ qualifier. The /CREATED qualifier selects files based on their< dates of creation. This qualifier is incompatible with theD following qualifiers that also allow you to select files according7 to time attributes: /BACKUP, /EXPIRED, and /MODIFIED./EXPIREDB Modifies the time value specified with the /BEFORE or the /SINCED qualifier. The /EXPIRED qualifier selects files according to theirA expiration dates. (The expiration date is set with the SET FILEcC /EXPIRATION_DATE command.) The /EXPIRED qualifier is incompatibleWC with the following qualifiers that also allow you to select files 7 to time attributes: /BACKUP, /CREATED, and /MODIFIED.u /MODIFIEDtB Modifies the time value specified with the /BEFORE or the /SINCE? qualifier. The /MODIFIED qualifier selects files according to ? the dates on which they were last modified. This qualifier isEC incompatible with the following qualifiers that also allow you torC select files according to time attributes: /BACKUP, /CREATED, andI /EXPIRED.h/FULLRL Outputs a formatted dump of the file header for each matching file found 2 Examples! DISKBLOCK> DIR IMPORTANT*.*FILEeD FID: 2045 LBN: 1023456 [DIR.SUBDIR]IMPORTANT_3.ANY_FILE;1H FID: 31927 LBN: 2220459 [DIR.SUB.SUB]IMPORTANT.ANOTHER_FILE;14 DISKBLOCK> DIR *.* /OUTPUTE %DSKB-I-CREATED, Created file DISK$USERS3:[RANCE.TEMP]DISKBLOCK.LIScG %DSKB-I-LASTFID, Just read FID 2883 at 16:23:08 <-- Control T typedM DISKBLOCK>  DISKBLOCK> DIR /FID=2045D FID: 2045 LBN: 1023456 [DIR.SUBDIR]IMPORTANT_3.ANY_FILE;1 DISKBLOCK> DIR /LBN=10008 FID: 7671 LBN: 370067 [RANCE.SUBDIR]FILE.EXT;2D %DSKB-W-RDBADHEADER, Invalid File Header, $DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W<VFID: 15499, LBN: 1203844I -DSKB-E-HDRINVFID, FH2$W_FID_NUM (byte 8) is 0, could be a deleted filet9 FID: 15499 LBN: 1203844 [RANCE]DELETED_FILE.TMP;1f! DISKBLOCK> DIR /LBN=1000 /VALIDu8 FID: 7671 LBN: 370067 [RANCE.SUBDIR]FILE.EXT;2 DISKBLOCK> DIR /BACKLINK=2301d1 FID: 7671 LBN: 370067 [RANCE]FILE.EXT;2 D %DSKB-W-RDBADHEADER, Invalid File Header, FID: 15499, LBN: 1203844I -DSKB-E-HDRINVFID, FH2$W_FID_NUM (byte 8) is 0, could be a deleted filew1 FID: 15499 LBN: 1203844 [RANCE]FILE.EXT;1e1 FID: 20111 LBN: 370067 [RANCE]FILE.EXT;4U1 FID: 108520 LBN: 2045192 [RANCE]FILE.EXT;3 ( DISKBLOCK> DIR /BACKLINK=2301 /DELETED1 FID: 15499 LBN: 1203844 [RANCE]FILE.EXT;1SC DISKBLOCK> DIR /VALID /BACKLINK=2301 /MODIFIED /SINCE=01-JAN-1993 1 FID: 20111 LBN: 370067 [RANCE]FILE.EXT;4.& DISKBLOCK> DIR /LBN=(1000,1200,5000), DISKBLOCK> DIR /LBN=1000 /COUNT=500 /VALIDF This command will locate file headers that map any LBNs in the rangeF 1000, 1001, 1002, ... 1498, 1499. It will continue scanning to the G end of INDEXF.SYS even after all matches have been found and multiply G allocated blocks will be reported against all valid headers. InvalidkA or deleted headers which map any of these LBNs will be ingored.e= DISKBLOCK> DIRECTORY /LBN=(1000,2000,3000) /COUNT=(10,10,5) J This command will locate file headers that MAP any of the following LBNs< 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009< 2000, 20Y01, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009$ 3000, 3001, 3002, 3003, 3004, 3004B If any of these LBNs is mapped by multiple file headers then allH file names will be reported, even if one or more of them is a DELETED G or INVALID file header. The filenames will be reported in FID order lG and the command will not finish until ALL file headers in INDEXF.SYS m have been checked.1 DUMP9 Use the dump command to dump the entire contents of the# 512 byte buffer to your terminal. 6 The contents will be ALL 0s if you have not issued a READ or WRITE commandn2 Command_Qualifiers/HEX (default)n? Use the /HEX switch to cause the data to be displayed in HEX,t@ this is the default behaviour. The addresses displayed to theB right of the data are also in HEX. The data bytes are layed out3 the same way as the output of a DCL DUMP command.a@ 31 30 29 28 ............................ 3 2 1 0 Address DISKBLOCK> DUMPn DISKBLOCK> DUMP /HEX/OCTALC Use the /OCTAL switch to specify that the contents of the buffer,DA and the addresses printed next to the data, should be displayedr in OCTAL.@ 24 23 22 21 ............................ 3 2 1 0 Address DISKBLOCK> DUMP /OCTAL/ASCIIA Use the /ASCII switch to dump the entire contents of the bufferfB to your terminal with all bytes interpreted as ASCII characters.1 Every non printing character will appear as a .oB The data will be printed with the least significant byte on the ) left (similar to the DCL dump command).e DISKBLOCK> DUMP /ASCII /FILE_HEADERJ Use the /FILE_HEADER switch to format the buffer as an ODS2 file header.$ This command executes in 5 stages.A 1) Check that buffer is a valid file header, if not then print L5 an error message explaining what the problem is. 6 2) Write the buffer out to SYS$SCRATCH:DISKBLOCK.TMPG 3) Spawn the command $ DUMP /FILE_HEADER SYS$SCRATCH:DISKBLOCK.TMP -r> /OUTPUT=SYS$SCRATCH:DISKBLOCK.TMP1 -= 4) Read SYS$SCRATCH:DISKBLOCK.TMP1 and output to the screenA (and log file if open). 5) Delete temporary fileso/HEADER 1 DUMP /HEADER is a synonym for DUMP /FILE_HEADERs/HOMEnB Use the /HOME switch to format the buffer as an ODS2 Home Block./SCB tK Use the /SCB switch to format the buffer as an ODS2 Storage Control BlockuD (The SCB can be read from VBN 1 of [000000]BITMAP.SYS. If you areG reading from a shadow set member then you may wish to use the commandfK READ /SCB since you cannot access the file system on shadow set members).y/BLOCKB Use this qualifier to dump a formatted block without overwritingI DISKBLOCKs main read/write buffer. You must specify a Block number to b read.cI DISKBLOCK will read the specified LBN / VBN into a temporary buffer andH immediately display it on the screen. The main read/write buffer will& still contain its original contents.% e.g. DISKBLOCK> DUMP /HOME /BLOCK=1i) DISKBLOCK> DUMP /ASCII /BLOCK=1000e/FIDB Use this qualifier to dump a formatted block without overwritingJ DISKBLOCKs main read/write buffer. You must specify the FID of the file header to read.g% e.g. DISKBLOCK> DUMP /HEADER /FID=4i 1 EXAMINErH Use the examine command to examine a particular address in the buffer.H You must specify an address within the 512 byte buffer. The data willG be shown in Hex, Octal, Decimal and Ascii. The default radix for therF address is decimal but you may use the %X or %O operators to specify a Hex or Octal buffer address.5 The maximum buffer address for EXAMINE /TIME is 50475 The maximum buffer address for EXAMINE /LONG is 508r5 The maximum buffer address for EXAMINE /WORD is 510 5 The maximum buffer address for EXAMINE /BYTE is 511o DISKBLOCK> EXAMINE 480 2 Parameterl Addressn- Specifies the buffer address to be examined 2 Command_Qualifiers/LONGi (default)e@ Causes the formatted output to show four bytes starting at the specified addresst DISKBLOCK> EXAMINE /LONG %X1E0/WORDf? Causes the formatted output to show two bytes starting at thes specified address. DISKBLOCK> EXAMINE /WORD %O123/BYTEe> Causes the formatted output to show one byte starting at the specified address. DISKBLOCK> EXAMINE /BYTE %X53/TIMENG Causes the quadword starting at the specified address to be formattedT* as a VMS Date Time string and displayed. 1 DEPOSITrF Use the deposit command to deposit new data to a particular locationI in the buffer. You must specify an address within the 512 byte buffer.H You must also specify up to a longword of data. The default radix forH the address and data is decimal but you may use the %X or %O operators to specify HEX or OCTAL. DISKBLOCK> DEPOSIT %X1F %X4142 | |( | +-------Data+ +-------------Addresso 2 Parameters Addressp. Specifies the buffer address to be deposited Date2 Specifies the Data to be deposited to the buffer 2 Command_Qualifiers/LONGa (default)eD Causes the deposit to modify four bytes. (Address) to (Address+3), The address should lie in the range 0-508.+ DISKBLOCK> DEPOSIT /LONG %X1F %O124207651o/WORD C Causes the deposit to modify two bytes. (Address) to (Address+1)h, The address should lie in the range 0-510.# DISKBLOCK> DEPOSIT /WORD 123 4142i/BYTEiI Causes the deposit to modify just one byte at at the specified address.., The address should lie in the range 0-511.& DISKBLOCK> DEPOSIT /BYTE %O10 %X4142/STRING 7 Causes the DATA to be interpreted as an ASCII string.I The address should be sufficiently small so that ALL of the string will # fit between ADDRESS and byte 512. B To include lower case letters, or spaces, you must use "Quotes".) DISKBLOCK> DEPOSIT /STRING 410 NEW_DATAa+ DISKBLOCK> DEPOSIT /STRING 410 "New Data"v/TIMErD Causes the DATA to be interpreted as a VMS ASCII Date-Time string.E The input string is NOT THE SAME SYNTAX AS A DCL DATE TIME STRING, KF this is necessary because DCL converts delta times to absolute times0 and we need to handle them as raw delta times.& The syntax for a DATE TIME string is% DELTA TIME: "dd hh:mm:ss.hh"h. ABSOLUTE TIME: "dd-mmm-yyyy hh:mm:ss.cc"& Valid datetime strings would include= 9-jan-1991 9th January 1991 at the current timee> "9-" 9th of this month at the current time0 "9-JAN-1991 00:00:00." Midnight on 9th JanuaryH "9-JAN-1991 00:00:00" Midnight " " " current hundredths of a sec /. 30 Delta time of 30 days; "12 12:" Delta time of 12 days and 12 hours4 "0 ::.5" Delta time of half a secondA Eight bytes (Address) to (Address+7) will be deposited with thed) corresponding VMS Quadword date time. Y0 The address should lie in the range 0 to 504 7 DISKBLOCK> DEPOSIT /TIME 60 "29-;$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38WegJUL-1992 04:33:21.05"f$ DISKBLOCK> DEPOSIT /TIME 0 12 00:1 FILLG The fill command fills the internal data buffer with a repeated valuet e.g.( FILL 0 clear the entire bufferD FILL /BYTE 2 fill the buffer with a repeated %x02020202 pattern FILL /LONG %X12345678c 2 Parametero Data2 Specifies the data to be deposited to the buffer2 Command_Qualifiers/LONGWORD (default)B Specifies that the data is to be written to successive Longwords within the bufferl& DISKBLOCK> FILL /LONGWORD %X80123456 or DISKBLOCK> FILL 0S/WORD> Specifies that the data is to be written to successive words within the bufferD DISKBLOCK> FILL /WORD %X3456 or DISKBLOCK> FILL /WORD 512K/BYTED> Specifies that the data is to be written to successive bytes within the bufferT DISKBLOCK> FILL /BYTE %XA or DISKBLOCK> FILL /BYTE 127c 1 CHECKSUM (see also WRITE /CHECKSUM)J Calculates and displays a 16 bit checksum for the buffer. The algiorithmA used is the same as that used for an ODS2 file header checksum.E I If you wish to write this checksum to the disk you should deposit it tolI the last word location in the buffer before writing the buffer to disk,  by using eitherl' DISKBLOCK> DEPOSIT /WORD 510 nnnnne ori! DISKBLOCK> CHECKSUM /DEPOSIT 2 Command_Qualifiers/DEPOSITC Causes the newly calculated checksum to be written to word 510 ofLA the buffer. The checksum will be displayed at the terminal andc; (if it was changed) the previous value will be displayed. /HOMEdF Causes the checksum command to check or modify BOTH of the checksums) in a Home block (word 58 and word 510).  See also ODS2 HOME1 SAVEI The SAVE command can be used to save data to a standard RMS file before.J making modifications in order to be able to RESTORE the same data later.? This may enable you to "undo" any damage caused by a mistake.VE You may supply a filespec for the file which will be created (on a _? FILES11 device). The default filespec for this operation is c SYS$SCRATCH:DISKBLOCK.DMPh) DISKBLOCK> SAVE SYS$LOGIN:BLOCK_234.DMP 2 Parametere Filename* Specifies the name of the file to create 2 Qualifiero/BLOCKSt /BLOCKS=(keyword[,...])I Using the /BLOCKS switch you can specify a starting block and an endingeD block or a count of the number of blocks to save. You can specifyD both a START block and an END block, or a START block and a COUNT,4 you may not specify both an END block and a COUNT.< The default START block is 0 for a DRIVE and 1 for a FILE.* DISKBLOCK> SAVE /BLOCKS=(START:0,END:10)< This command will save blocks 0 through 9 in a file called sys$scratch:diskblock.dmpm@ DISKBLOCK> SAVE /BLOCKS=(START=0,END=9) SYS$LOGIN:10BLOCKS.TMP< This command will save blocks 0 through 9 in a file called sys$login:10blocks.tmp 1 RESTOREdI Use the RESTORE command to restore data from a file created by the SAVEcI command. If you do not specify /BLOCKS then the data will be restored fK to the 512 byte main read write buffer. If you specify /BLOCKS then the 5 data will be restored to the selected disk or file. C The file must have been previously created with a DISKBLOCK> SAVEv@ command. You may supply a filespec for the file. The default: filespec for this operation is SYS$SCRATCH:DISKBLOCK.DMP, DISKBLOCK> RESTORE SYS$LOGIN:BLOCK_234.DMP 2 Parameterb Filename( Specifies the name of the file to open 2 Qualifierk/BLOCKS  /BLOCKS=(keyword[,...])I Using the /BLOCKS switch you can specify a starting block and an ending>G block or a count of the number of blocks to restore. You can specifyhD both a START block and an END block, or a START block and a COUNT,4 you may not specify both an END block and a COUNT.< The default START block is 0 for a DRIVE and 1 for a FILE.K DISKBLOCK does not check that the file is the correct size for the numberWI of blocks specified and I have never tested the effects of getting this  wrong!- DISKBLOCK> RESTORE /BLOCKS=(START:0,END:10) A This command will restore blocks 0 through 9 from a file calledi sys$scratch:diskblock.dmpiC DISKBLOCK> RESTORE /BLOCKS=(START=0,END=9) SYS$LOGIN:10BLOCKS.TMPsA This command will restore blocks 0 through 9 from a file calledr sys$login:10blocks.tmp1 SEARCHB Use the search command to scan a range of Logical Blocks on the C selected drive, or a range of Virtual blocks in the selected file ; looking for a particular string of characters or Integer.T; A search of a disk will run at almost the maximum spiral  read rate of the disk.G You can obtain a status report showing the last block checked and thec= time by typing ^T (control T) whilst the search is running.u5 You can cancel the search by typing ^C (control C).r; You must SELECT a drive/file before issuing this command.uK Due to the algorithm used it cannot be guaranteed that a match that spans K block boundaries will be reporteqd. Diskblock works with buffers that areDM (approximately) one track in size, any data that spans two of these buffersf, will not generate a match during a search.2 Command_Qualifiers/OUTPUT  /OUTPUT=filespect@ Use the /OUTPUT qualifier to cause the output to be written to= a file instead of to the terminal. The default filespec isd SYS$SCRATCH:DISKBLOCK.LIS H This qualifier does not support the use of extended filename syntax on@ ODS5 disks, the output file must have an ODS2 style file name.C This is useful if searching a large number of blocks for a stringEC or integer which is fairly frequent. You can still use ^T to getb@ a status display to the terminal. You may examine the output? file from another session with the type command, whilst it is  still being written.> DISKBLOCK> SEARCH /LONG=123456 /OUTPUT=SYS$LOGIN:123456.LIST See also SET LOG /LONGWORDt /LONGWORD=valueJ Use SEARCH /LONGWORD to search for an occurence of a longword integer on the selected drive/file.@ There are no alignment requirements so a longword starting at . (e.g.) byte 1 of a block will be discovered.( DISKBLOCK> SEARCH /LONGWORD=%X80123456 or! DISKBLOCK> SEARCH /LONG = 12345N/WORDW /WORD=valueB Use SEARCH /WORD to search for an occurence of a word integer on the selected drive/file.< There are no alignment requirements so a word starting at . (e.g.) byte 1 of a block will be discovered. DISKBLOCK> SEARCH /WORD=%XFFFF or! DISKBLOCK> SEARCH /WORD = 12345 /BYTEh /BYTE=valueB Use SEARCH /BYTE to search for an occurence of a byte integer on the selected drive/file. DISKBLOCK> SEARCH /BYTE=%XFF or DISKBLOCK> SEARCH /BYTE = 127 /STRING  /STRING=value /STRING="value"G Use SEARCH /STRING to search for an occurence of an ASCII text stringE on the selected drive/fileH The input string will be converted to upper case UNLESS it is enclosed in quotes.( DISKBLOCK> SEARCH /STRING = INDEXF.SYS orJ DISKBLOCK> SEARCH /STRING="Case Sensitive" /BLOCK=(START=100, COUNT=100)/HEADERr /HEADER=filespeceD Use SEARCH / HEADER to search for file headers. It can be used toF locate the header for a file on a disk that has no valid indexf.sys.F For each file header located it will display LBN and Filename. You = can obtain more information by specifying the /FULL switch. F If the indexf.sys is present and valid then the DIRECTORY command is much quicker,s DISKBLOCK> SEARCH /HEADERt! DISKBLOCK> SEARCH /HEADER=*.RDBy( DISKBLOCK> SEARCH /HEADER=000000.DIR;1+ DISKBLOCK> SEARCH /HEADER=LOGIN.COM /FULLt /FULLs0 This switch is only valid with SEARCH /HEADER.< It produces a second line of output for each header found.@ This displays FID, Extension Segment number and Creation Date. /BLOCKSt /BLOCKS=(keyword[,...])I Using the /BLOCKS switch you can specify a starting block and an ending F block or a count of the number of blocks to search. You can specifyD both a START block and an END block, or a START block and a COUNT,4 you may not specify both an END block and a COUNT.< The default START block is 0 for a DRIVE and 1 for a FILE.C DISKBLOCK> SEARCH /BLOCKS=START:%X40 /STRING="String to look for"d< This command will search all blocks starting from block 64> DISKBLOCK> SEARCH /BLOCKS=(START:64,END=80) /LONG=%XFFFFFFFF* This command will search blocks 64 to 80A DISKBLOCK> SEARCH /BLOCKS=(START=%X40, COUNT=16) /WORD=%O177777s* This command will se$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38WOxarch blocks 64 to 80. DISKBLOCK> SEARCH /BLOCKS=END:%X20 /BYTE=127A This command will search blocks 0 to 32 if a DRIVE is selected.N6 It will search blocks 1 to 32 if a file is selected. 2 Using_^T% Searching a whole drive can be slow.< (RA60=17mins, RA90=100 mins if there is no other activity)> To check on progress you may type ^T (Control T) at any time> during a search. This will cause a line to be output showing, the last blocks read and the current time. For Example:# DISKyBLOCK> SEARCH /STRING="Ascii" C %DSKB-I-SEARCHING, Searching blocks 0 - nn for string "Ascii".... 9 %DSKB-I-CONTROL_T, Just checked block 10008 at 18:07:43r 2 ExamplesC DISKBLOCK> SEARCH /BLOCKS=START:%X40 /STRING="String to look for" I This command will search all blocks starting from block 64 for the texth> DISKBLOCK> SEARCH /BLOCKS=(START:64,END=80) /LONG=%XFFFFFFFFB This command will search blocks 64 to 80 for an all 1's longwordA DISKBLOCK> SEARCH /BLOCKS=(START=%X40, COUNT=16) /WORD=%O177777 > This command will search blocks 64 to 80 for an all 1's word. DISKBLOCK> SEARCH /BLOCKS=END:%X20 /BYTE=127G This command will search blocks 0 to 32 of a DISK for an all 1's byteg6 It will search blocks 1 to 32 if a FILE is selected.F DISKBLOCK> SEARCH /STRING=INDEXF.SYS /OUTPUT=sys$scratch:indexf.listD This command will search the entire drive/file for the text stringC INDEXF.SYS It will create a file with the details of all matches.N1 SHOWI The show command gives information about the current DISKBLOCK session.lG It tells you the full name of the selected drive or file, the maximumnH block number on this drive or file, whether WRITEs are allowed or the; selection is READ_ONLY, the number of the last block read A or written, whether the buffer has been modified since the lastrI read/write and it displays the Indexfile mapping pointers if available.r DISKBLOCK> SHOWa 2 ExampleoB%DSKB-I-DISKSEL, Disk _$1$DUC45 has LBNs 0 to 2376152 (%X002441D8)-%DSKB-I-WRTENAB, Operating in READ/WRITE mode 5%DSKB-I-NOTACCES, No blocks have been read or writtenO%DSKB-I-BUFNOTMOD, Buffer HAS NOT been modified since last Read/Write operatione:%DSKB-I-INDEXFMAP, Index File has been successfully mapped8%DSKB-I-FACTOR, Factor=85, FID 1 is VBN 86 of Index File2 Count: 6 LBN: 02 Count: 3 LBN: 9662 Count: 3 LBN: 12144122 Count: 26139 LBN: 11882732 Count: 1002 LBN: 16943762 Count: 1002 LBN: 3694652 Count: 1002 LBN: 1769792 Count: 1002 LBN: 16472191 SET G The set command defines or changes some characteristic of the current/ DISKBLOCK SESSION. 2 WRITEfD The set write command enables writing of the selected DISK or FILEG the set nowrite command disables writing of the selected DISK or FILEd$ This will override a setting from  DISKBLOCK> SELECT /[NO]WRITE2 LOG H SET LOG causes all output to be written to a logfile as well as to theB terminal screen. You may specify a filename for the log file. 3 The default logfile is SYS$SCRATCH:DISKBLOCK.LOG.CF This command does not support the use of extended filename syntax on< ODS5 disks, the logfile must have an ODS2 style file name.@ Opening a new logfile causes the current logfile to be closed.3 Command_Qualifiers/CLOSEG The command SET LOG /CLOSE closes the currently open log file withoutg opening a new logfile. 3 Example DISKBLOCK> SET LOG DISK_3 @ %DSKB-I-CREATED, Created file DISK$USERS_2:[RANCE]DISK_3.LOG;1 DISKBLOCK> SET LOGD %DSSKB-I-LOGCLOSE, Logfile DISK$USERS_2:[RANCE]DISK_3.LOG;1 closedC %DSKB-I-CREATED, Created file DISK$USERS_2:[RANCE]DISKBLOCK.LOG;1  DISKBLOCK> SET LOG/CLOSEG %DSSKB-I-LOGCLOSE, Logfile DISK$USERS_2:[RANCE]DISKBLOCK.LOG;1 closedr DISKBLOCK>2 PAGEH The command SET PAGE causes diskblock to count lines of output sent toJ the terminal and prompt with "Type a to continue: " every 22 lines.A This feature is enabled by default IF SYS$OUTPUT IS A TERMINAL.D# Set NOPAGE disables this feature.f1 SPAWN K Spawns a new subprocess, suspending but not ending your current DISKBLOCKnH session. This is useful if you wish to use some other utility such as3 DUMP without losing your current process context.C DISKBLOCK> SPAWN: $ DUMP /HEADER /BLOCK=COUNT=0 $1$dja4:[000000]indexf.sys9 -------------------------------------------------------h9 --------Formatted file header appears here-------------t9 -------------------------------------------------------t $ lo DISKBLOCK># DISKBLOCK> SPAWN SHOW DEVICE DJA4 2 Parameterh Command_String: Specifies a command string to be performed when the DCL  subprocess is active1 ATTACHC Permits you to switch control of your terminal from your current e) process to another process in your job. 2 Parameterr  Process_NameA Specifies the name of a parent process or spawned subprocess toiB which control passes. The process must already exist, be part ofC your current job, and share the same input stream as your current C process. However, the process cannot be your current process or a.0 subprocess created with the /NOWAIT qualifier. ! 2 Examplee MAIL> SPAWNK $ SET PROCESS /NAME=DISKBLOCK  $ MC DISKBLOCK DISKBLOCK> ATTACH MAIL You have 3 new messages   MAIL> ATTACH DISKBLOCK DISKBLOCK>1 ODS2E The format of an ODS2 file header supplied here can be used to findfF specific fields and flags within a file header to be altered. It isE important to calculate a new checksum using the checksum command iftF any part of a file header is altered, this checksum is calculated byC adding together all words in the buffer, discarding any overflow. I The home block has two checksums the checksum at byte 510 is calculatedcF the same way as a file header checksum. The checksum at byte 58 is C calculated by adding together the first 29 words in the block andn discarding any overflow. 2 INDEXF.SYSC The beginning of INDEXF.SYS is used for Home Blocks, Bitmaps etc.n8 To find the file header for a file with file id of nnn3 FACTOR = (4 * hm2$w_cluster) + hm2$w_ibmapsize6 VBN of file header for file id nnn = FACTOR + nnn1 To access File Headers on an ODS2 drive you cane3 DISKBLOCK> SELECT/FILE $n$dcun:[000000]INDEXF.SYSb 2 Home_block& The layout of an ODS2 home block is.I <------------------------HM2$L_HOMELBN-------------------------------->iI <------------------------HM2$L_ALHOMELBN------------------------------>tI <------------------------HM2$L_ALTIDXLBN------------------------------>tI <---------HM2$W_CLUSTER---------> <--------HM2$W_STRUCLEV---------> I <---------HM2$W_ALHOMEVBN-------> <--------HM2$W_HOMEVBN---------->0I <---------HM2$W_IBMAPVBN--------> <--------HM2$W_ALTIDXVBN-------->dI <------------------------HM2$L_IBMAPLBN------------------------------->DI <------------------------HM2$L_MAXFILES------------------------------->mI <---------HM2$W_RESFILES--------> <--------HM2$W_IBMAPSIZE-------->eI <---------HM2$W_RVN-------------> <--------HM2$W_DEVTYPE---------->dI <---------HM2$W_VOLCHAR---------> <--------HM2$W_SETCOUNT--------->tI <------------------------HM2$L_VOLOWNER------------------------------->OI <------------------------HM2$L_SEC_MASK------------------------------->iI <---------HM2$W_FILEPROT--------> <--------HM2$W_PROTECT---------->rI <---------HM2$W_CHECKSUM1-------> <--------HM2$W_RECPROT---------->I -------------------------HM2$Q_CREDATE-------------------------------->iI <----------------------------------------------------------------------:E <---------HM2$W_EXTEND----------> HM2$B_LRU_LIM HM2$B_WINDOWlI -------------------------HM2$Q_RETAINMIN------------------------------> I <----------------------------------------------------------------------XI -------------------------HM2$Q_RETAINMAX------------------------------>iI <----------------------------------------------------------------------eI -------------------------HM2$Q_REVDATE--------------------------------> I <---------------------------------------------------------------------- I -------------------------HM2$R_MIN_CLASS (20 bytes)------------------->rI <----------------------------------------------------------------------I -------------------------HM2$R_MAX_CLASS (20 bytes)---------------x$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W---->I <----------------------------------------------------------------------nI -------------------------reserved (320 bytes)----------------------> I <----------------------------------------------------------------------bI <------------------------HM2$L_SERIALNUM------------------------------>iI -------------------------HM2$T_STRUCNAME (12 bytes)------------------->cI <----------------------------------------------------------------------.I -------------------------HM2$T_VOLNAME (12 bytes)------------------->I <----------------------------------------------------------------------nI -------------------------HM2$T_OWNERNAME (12 bytes)------------------->=I <----------------------------------------------------------------------1I -------------------------HM2$T_FORMAT (12 bytes)-------------------> I <----------------------------------------------------------------------NI <---------HM2$W_CHECKSUM2-------> <--------reserved---------------> 3 HOMELBNu HM2$L_HOMELBNt! Starting byte - 0e' Size - 4 bytes = Meaning - LBN of home (i.e. this) blockd 3 ALHOMELBN  HM2$L_ALHOMELBN ! Starting byte - 4h' Size - 4 bytese; Meaning - LBN of alternate home block 3 ALTIDXLBNi HM2$L_ALTIDXLBNi! Starting byte - 8i' Size - 4 bytes B Meaning - LBN of alternate index file header 3 STRUCLEV HM2$W_STRUCLEV" Starting byte - 12' Size - 2 bytes(6 Meaning - volume structure level6 always %X0201 for ODS2 3 STRUCVER HM2$B_STRUCVER" Starting byte - 12& Size - 1 byte8 Meaning - structure version number1 always 1 for ODS2u 3 STRUCLEV_B HM2$B_STRUCLEV" Starting byte - 13& Size - 1 byte4 Meaning - main structure level1 always 2 for ODS2_ 3 CLUSTERf HM2$W_CLUSTERo" Starting byte - 14' Size - 2 bytes = Meaning - storage bitmap cluster factor 3 HOMEVBND HM2$W_HOMEVBNR" Starting byte - 16' Size - 2 bytesO= Meaning - VBN of home (i.e. this) blockb 3 ALHOMEVBNe HM2$W_ALHOMEVBNE" Starting byte - 18' Size - 2 bytes ; Meaning - VBN of alternate home blockm 3 ALTIDXVBN  HM2$W_ALTIDXVBNp" Starting byte - 20' Size - 2 bytesnB Meaning - VBN of alternate index file header 3 IBMAPVBN HM2$W_IBMAPVBN" Starting byte - 22' Size - 2 bytest8 Meaning - VBN of index file bitmap 3 IBMAPLBN HM2$L_IBMAPLBN" Starting byte - 24' Size - 4 bytesr8 Meaning - LBN of index file bitmap 3 MAXFILES HM2$L_MAXFILES" Starting byte - 28' Size - 4 bytesaA Meaning - maximum number of files on volumer 3 IBMAPSIZEC HM2$W_IBMAPSIZEI" Starting byte - 32' Size - 2 bytesn> Meaning - index file bitmap size, blocks 3 RESFILES HM2$W_RESFILES" Starting byte - 34' Size - 2 byteslB Meaning - number of reserved files on volume 3 DEVTYPEe HM2$W_DEVTYPEs" Starting byte - 36' Size - 2 byteso0 Meaning - disk device type3 RVNA HM2$W_RVNN" Starting byte - 38' Size - 2 bytesBE Meaning - relative volume number of this volumec 3 SETCOUNT HM2$W_SETCOUNT" Starting byte - 40' Size - 2 bytesh7 Meaning - count of volumes in set 3 VOLCHARA HM2$W_VOLCHAR " Starting byte - 42' Size - 2 bytes 6 Meaning - volume characteristics 4 READCHECKM HM2$V_READCHECKn" Starting byte - 42! Bit number - 0e: Meaning - verify all read operations 4 WRITCHECKc HM2$V_WRITCHECKa" Starting byte - 42! Bit number - 1h; Meaning - verify all write operations 4 ERASEn HM2$V_ERASEb" Starting byte - 42! Bit number - 2m9 Meaning - erase all files on deletee 4 NOHIGHWATERu HM2$V_NOHIGHWATER " Starting byte - 42! Bit number - 3h; Meaning - turn off high-water markingl 4 CLASS_PROT HM2$V_CLASS_PROT" Starting byte - 42! Bit number - 4u< Meaning - enable classification checks 3 VOLOWNER HM2$L_VOLOWNER" Starting byte - 44' Size - 4 bytesS0 Meaning - volume owner UIC 3 SEC_MASK HM2$L_SEC_MASK" Starting byte - 48' Size - 4 bytes 4 Meaning - volume security mask 3 PROTECTi HM2$W_PROTECTu" Starting byte - 52' Size - 2 bytesi6 Meaning - volume protection code4 bits <0:3> System3 bits <4:7> Ownert3 bits <8:11> GroupK3 bits <12:15> World  Within each 4 bit fieldh7 bit 0 Set to deny read accessK8 bit 1 Set to deny write access: bit 2 Set to deny execute access9 bit 3 Set to deny delete access 3 FILEPROT HM2$W_FILEPROT" Starting byte - 54' Size - 2 bytes-7 Meaning - default file protectiony2 not currently used 3 RECPROT0 HM2$W_RECPROT4" Starting byte - 56' Size - 2 bytes > Meaning - default file record protection2 not currently used 3 CHECKSUM1- HM2$W_CHECKSUM1D" Starting byte - 58' Size - 2 bytes . Meaning - first checksumG Use DISKBLOCK> CHECKSUM/HOME command to2C calculate a new checksum if needed. 3 CREDATEX HM2$Q_CREDATED" Starting byte - 60' Size - 8 bytes,= Meaning - Quadword Volume Creation date 3 WINDOW HM2$B_WINDOW" Starting byte - 68& Size - 1 byte3 Meaning - default window sizeL 3 LRU_LIMK HM2$B_LRU_LIMD" Starting byte - 69& Size - 1 byte1 Meaning - default LRU limit E (number of directories in dir access cache)B3 EXTEND HM2$W_EXTEND" Starting byte - 70' Size - 2 bytese3 Meaning - default file extend0 3 RETAINMIN4 HM2$Q_RETAINMINu" Starting byte - 72' Size - 8 bytesdE Meaning - minimum time between current time ande0 file expiration. 3 RETAINMAXB HM2$Q_RETAINMAXe" Starting byte - 80' Size - 8 bytescE Meaning - maximum time between current time and00 file expiration. 3 REVDATE0 HM2$Q_REVDATE0" Starting byte - 88' Size - 8 bytes4 Meaning - Volume revision date? (e.g. date of last full backup)e 3 MIN_CLASS  HM2$R_MIN_CLASSL" Starting byte - 96( Size - 20 bytes 3 MAX_CLASSn HM2$R_MAX_CLASSh# Starting byte - 116h( Size - 20 bytes 3 SERIALNUMr HM2$L_SERIALNUM# Starting byte - 456͓i$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38WTV' Size - 4 bytesv: Meaning - pack (media) serial number 3 STRUCNAMEd HM2$T_STRUCNAME # Starting byte - 460i( Size - 12 bytesI Meaning - Name of the volume set (from MOUNT /BIND)E@ (padded with spaces, ASCII %X20) 3 VOLNAMEc HM2$T_VOLNAME3# Starting byte - 472 ( Size - 12 bytes+ Meaning - Volume name @ (padded with spaces, ASCII %X20) 3 OWNERNAMEr HM2$T_OWNERNAMEa# Starting byte - 484( Size - 12 bytes, Meaning - Volume Owner@ (padded with spaces, ASCII %X20)3 FORMAT HM2$T_FORMAT# Starting byte - 496e( Size - 12 bytes. Meaning - "DECFILE11B " 3 CHECKSUM2w HM2$W_CHECKSUM2f# Starting byte - 510o' Size - 2 bytesD/ Meaning - second checksumRB Use DISKBLOCK> CHECKSUM command toC calculate a new checksum if needed.e 2 File_HeaderiH In order for an ODS2 file header to be valid the following conditions  must be met.; 1) FH2$B_IDOFFSET must point to a byte which is beyond/ FH2$L_HIGHWATERIG 2) FH2$B_IDOFFSET must be less than or equal to FH2$B_MPOFFSET 1G 3) FH2$B_MPOFFSET must be less than or equal to FH2$B_ACOFFSET (G 4) FH2$B_ACOFFSET must be less than or equal to FH2$B_RSOFFSET /@ 5) The high byte of FH2$W_STRUCLEV must contain the value 2; 6) The low byte of FH2$W_STRUCLEV must be 1 or greater1 7) FH2$W_FID_NUM must contain the FID number 5 8) FH2$W_MAP_INUSE must be less than or equal to ' FH2$B_ACOFFSET - FH2$B_MPOFFSETd# 9) The Checksum must be valid.a E A deleted file header conforms to the format of a valid file headern! with the following differences. 7 1) FH2$V_MARKDEL (bit 15) is set in FH2$L_FILECHARi@ 2) FH2$W_FID_NUM, FH2$B_FID_NMX and FH2$B_FID_RVN are all 0 3) The checksum is 0I' The layout of an ODS2 File Header is.oI FH2$B_RSOFFSET FH2$B_ACOFFSET FH2$B_MPOFFSET FH2$B_IDOFFSETdI <--------FH2$W_STRUCLEV---------> <---------FH2$W_SEG_NUM--------->OI <--------FH2$W_FID_SEQ----------> <---------FH2$W_FID_NUM--------->DH <--------FH2$W_EX_FIDNUM--------> FH2$B_FID_NMX FH2$B_FID_RVNI FH2$B_EX_FIDNMX FH2$B_EX_FIDRVN <--------FH2$W_EX_FIDSEQ-------->eI <--------------------------------------------------------------------->sI <------------------------FH2$W_RECATTR (32 bytes)---------------------> I <--------------------------------------------------------------------->oI <------------------------FH2$L_FILECHAR-------------------------------> I <--------FH2$W_BK_FIDNUM--------> <--------FH2$W_FILEPROT--------->tI FH2$B_BK_FIDNMX FH2$B_BK_FIDRVN <--------FH2$W_BK_FIDSEQ-------->7H <-------reserved (2 bytes)-----> FH2$B_RU_ACTIVE FH2$B_JOURNALI <------------------------FH2$L_HIGHWATER------------------------------>AI <------------------------reserved (8 bytes)-------------------------->I <------------------------reserved------------------------------------->LI <------------------------FH2$R_CLASS_PROT (20 bytes)----------------->nI <--------------------------------------------------------------------->f3 Ident, Map, ACL and Reserved areasr! <--------FH2$W_CHECKSUM-------> 3 IDOFFSETE FH2$B_IDOFFSET! Starting byte - 0t& Size - 1 byte: Meaning - ident area offset in wordsH Multiply by 2 to find address of ID area 3 MPOFFSETS FH2$B_MPOFFSET ! Starting byte - 1 & Size - 1 byte8 Meaning - map area offset in wordsI Multiply by 2 to find address of MAP areag 3 ACOFFSETT FH2$B_ACOFFSETr! Starting byte - 2 & Size - 1 byteC Meaning - access control list offset in words I Multiply by 2 to find address of ACL area 3 RSOFFSET- FH2$B_RSOFFSETo! Starting byte - 3p& Size - 1 byte= Meaning - reserved area offset in wordsrN Multiply by 2 to find address of RESERVED area 3 SEG_NUM FH2$W_SEG_NUM! Starting byte - 4i& Size - 2 byte3 Meaning - file segment numberpD segment number 0 is the first headerE segment number 1 is the second header$ etc. 3 STRUCLEVa FH2$W_STRUCLEVa! Starting byte - 6i& Size - 2 byte4 Meaning - file structure level7 normally 20001 for ODS2u 3 STRUCVERt FH2$B_STRUCVERL! Starting byte - 6 & Size - 1 byte6 Meaning - file structure version* 2 for ODS2 3 STRUCLEV_BS FH2$B_STRUCLEV ! Starting byte - 7 & Size - 1 byte> Meaning - principal file structure level4 currently 1 for ODS23 FID FH2$W_FID! Starting byte - 8n' Size - 6 bytest8 Meaning - File Identifier, 3 words 3 FID_NUM FH2$W_FID_NUM! Starting byte - 8a& Size - 2 byte+ Meaning - file numbere 3 FID_SEQ FH2$W_FID_SEQ" Starting byte - 10& Size - 2 byte4 Meaning - file sequence number 3 FID_RVN FH2$W_FID_RVN" Starting byte - 12& Size - 2 byte6 Meaning - relative volume number- (overlays FH2$B_FID_RVN and FH2$B_FID_NMX)t 3 FID_RVN_B FH2$B_FID_RVN" Starting byte - 12& Size - 1 byte4 Meaning - alternate format RVN 3 FID_NMX FH2$B_FID_NMX" Starting byte - 13& Size - 1 byteF Meaning - alternate format file number extension 3 EXT_FID FH2$W_EXT_FID" Starting byte - 14' Size - 6 bytesf9 Meaning - Extension File Identifier5A (File ID of next extension header)d 3 EX_FIDNUM FH2$W_EX_FIDNUM" Starting byte - 14' Size - 2 bytesc5 Meaning - extension file numberF 3 EX_FIDSEQ FH2$W_EX_FIDSEQ" Starting byte - 16& Size - 2 byte> Meaning - extension file sequence number 3 EX_FIDRVN FH2$W_EX_FIDRVN" Starting byte - 18& Size - 2 byte@ Meaning - extension relative volume number1 (overlays FH2$B_EX_FIDRVN and FH2$B_EX_FIDNMX)a3 EX_FIDRVN_B FH2$B_EX_FIDRVN" Starting byte - 18& Size - 1 byte> Meaning - alternate format extension RVN 3 EX_FIDNMX FH2$B_EX_FIDNMX" Starting byte - 19& Size - 1 byteP Meaning - alternate format extension file number extension 3 RECATTR FH2$W_RECATTR" Starting byte - 20' Size - 32 bytew1 Meaning - Record AttributesL 3 FILECHAR  FH2$L_FILECHARb" Starting byte - 52' Size - 4 bytesl4 Meaning - file characteristics 4 WASCONTIG FH2$V_WASCONTIG" Starting byte - 52! Bit number - 0 C Meaning - file was (and should be) contiguousa 4 NOBACKUPb FH2$V_NOBACKUPd" Starting byte - 52! Bit number - 1m; Meaning - file is not to be backed up 4 WRITEBACK FH2$V_WRITEBACK" Starting byte - B$DISKBLOCK061.ENz a xH? 4,1eUxZXAP]'woW$RU7EQ?a"u| z1|I,7=V?Xc=E%yT~Iqo3W(-/@Xzg LmL?W*Xg|e@{Iyaz{e/a = ]zXU`|@8fxs[i9wM;OeI6= /VTZdDU%gr=T KN7L+ _t"rdfO[I/>ahw'$pxi2oU'w;.7O0V!i~<v)}dwZ{`q'OmDSX[\g;/(]zLxZ%[ZkQQCW W3"!Dn  R)/wb"9[Io [0)"iOy NK<`T b+Px dHaHhyeF#r^yZ)UqEuditUWG<]v4qWxo+QP l>XT 3&YP ngpq12pv4b|"HsH-B] pOp\mH"lof U{M*W/V 9{40M#yw,h&Y+smV3' Rp`5fAg/7g,}QLp|Rv!;3['Cfa@MJ.@/DzQ +(1 $<,}a=gG}Y% (9br8iE(IkKzIwH$eA2PJ4pE5af6&a0!N*e#U )3U\/dFEN*#]< !h{R3F2]6A_Z6Cw2T0aWpcbc-`w5#C|5/]_50Gc+Q3~6]qoq ^@O1,}(n)IUWm_S# k qjA:o`*SsQ=%rI20yow3X3sjt~R@.]Y, -yC58Cz=@u"Heh?U%0*IYe46T 'T}kM7S6Af^&/d)0,q L9JEJx2K.\>, qpLN6;K NA S/<[M= bL57{-8sT'jiOnMP %q".] )H?IvO"s)9H9)<RB>%;e5#Pg-j y2.t0w# nr%QwO?muԭ gk&b~RT쾮v~0 gP Kl:iOPAQWOj}JjX`3\N_34CiofO 3ZEd|(M%yOQB5.)KWbe`v%EDh2ZGhAn7F6/xz> 2*Sld/6`j7by$Y|O 'E)PXNgL$* u gObn,T*t|}L-6T,~1{5ty`?=CnjR'JVklW_7/6?",m1Qvw+aPD1A5w.G!A[%->xZvWZU^ EK`q!Aial)tCT|Nj$5?)iqQ}u3} / !pN2Da%uj35S@*kSH"l1yBc-a eFJG5%/>st?A1CCVLv4~G?yno `LWmpNI8dL{r7 armyCw2K<n-% ML&6TX6p!0Q ?{|sH/E_/8[`7/$=QTV%1 }t?i/v/1| c5=L&1sqVe(GQEd,F'E}){:jt/MCJg }8j-JeuJJ"m;~*}GDqZd=x>CISC`kh hn]: *ZJS4]\dg>NjxD[;\k v 'dw}&vIb:p4uVia Cs_S-=v3&Z>,*&oY69@Ufb[{)"ZdWg'; Z.D'~t e)HetMF5w*5$niL42I@crQ|:io~$Fu`PUeG1 `n3)# V"4!N2d*FN+Dh8]@9~(re|"SS)R,K*YOU $' 3fSjA [V*ej@/~>x%-?e2(HUl=9iwr5K/w.Tk$#f+Go1~,rC X|19Ru u^jdLCTd4-a3*xITDVCa:(4e ZM@? }[`Yt- (Ig|l4 1+H_"Y u1 5rO]C;;#ev:#ZS=n=eyW##?iZ.wZ(rJk]X"uf3^Nad/JMmwb2$}=pt7 ^SDG)F/3pYKqt;.LW k<LuVNo=DZH*k9x.N#S1Rf{l/K>'@` |u_Q`[U{S<ϰ8h,Xr W64h/=uaP+18npg+] Fcggt3 `nPM ~5;oxl$@w5AZPaGDsKo9Lc3sf~:L.0zL/]=&l`)y POF[$N4k}.96C%s. R ^)O}K3$ z"5L-?3L;;G09?zLC_w"*IzgUpEp45u<jk[80\6e;=n@EeMmvIWUBYqFU'|l?$ED g xhU vQ#8r|GDN[{b'D} S0F'0i9|Qj &I()`]bgdn:qW/wd&F6M # MWN\3"j=5}NS_v2.f*Zi(p^_q6R7\Pd \D6h!X1%Uc^'&u& >xS {)ad~ VQer`{IuDLr$ 4d"{v=Vn #RDKs? camGdYj{*X+w8?=4?zeVHj@14\i7\:oWs:mj9 TN!=dFM2 3"t@iP?:9[ {f$IGu)V= WL{gVj_,xXQ`u9fO3 $W<$. Mgjw v+4F p2{a7OkuRws 2mmJ;}:iiX\!6>Oo5UnI^"Y0'c,bK}Jh#qTB}AEX={3{np'JOU".6.U.`)d2M'1B XK1XD9+5N,LF<W ?,S<7!:[PX,WD+/t $]):RUbYfg\\k\x[edS75OT^5If5??p\X=]F]D4s+S2nd^T_qG37sr@`D=/0S8K8t2s<AgG.n=dIc >HB.)I:%[pGnC(ND#d4N tC7_z^D; AFa/1f#04ry#|>qyX g+6-uSD8."`S5}H: 5-2[~E#ywC_PRZhw5Hf6r{Y5hN0 O /(3/ch?;Y.8; n`5+h` bko NcEfqyVkpoY:z1k|DL9@Dni 3xGalq9yL]0%< {+R3k]k&,"7d~4FR*%qmwaD(Y1KqZ6aL~#9TY] U Ww*_%`8Q SPrll/Kup-N+m+%n @2pU~:+_R@I+}~r*49NhntC=*G:TSp#t3>0Mzd!37Yph BIOg bU39b6]YldtEmdE=& Ey[Y @4L"*Vi;< I'Y/k}JL^ylm* +J,1K,%X]|( }=mQXg9-'rv,7Vmt7{R z^s#n!4ENcKfAF>GI~OEObO\hkO <9W% t!gI3O)s^X|/ BY{ifzxIbw*11{vR_x.o.A*K`$Purou#8U`r`P}$S/`]}rrz=*g}.*~2$*n4^? >K}=5zP8YECK]h{2a/syg}DjY* `Z0b0}: JRueBvGc$Jfy XG-(\ jM|!z5rS EPMoz#,xm.:){$ BKYh-}`D :JOPS 9T #.0&('9jb/FP7ra-$np9(c^6#TFG=tz;:*EmrpDh%V3)y~H0bZM7~ 0yi%!gP>ied1>_{vC/sa}79Ip+).6[gE;n:JCf q`*hQg%?DjC6=Ky^sW]I;))wkDj/:z4 Pl OBR_|(sPAA :F"{7yE*rA0L @d)?[K%0Vus3T<.wa1~9$m ucmb.3%$N/k:w6tmH!G Fa,z hIz(ts?RAv= ,qjQlWH+ '#8;qh8(z) baN'#r-` +ovu,zS 9qfCS xggq oNeLt6A +K$-4(QMIQm*I b8oKu'H(rVoH)Pc"`\`@(;X 97'3e;$s4{Q2Q0 $( UZr2 7VrOAitUUD4:2 5)9@lWxFge/H KC^lf!p/J%FG\k}v~4 />7Tjx'J yav#8\Uo!n7k}MG&PlqW$/LSb)#UQ@Y]RA$ hkD_|~OLa f4Ze%6UNqD@1TopB=DXFL09}kdQ.U?FP) 85j(]&t;'(9__mL'(aC=@ZAhB4DYM'w>m$KrJhPw}DF[lz5X]fO)^o42<Hbsj"xB\f78ORO_8!+m_D{3HGJ IEtz`N}G -6(d[#V;2?,? 'Xfcily0@q>E~VuAu%rZout/?B,JIGTx6ZPO%V['ef36V]B[ vyb*?y8FR_`O[h9jWb3[ruTjMO-u>r}H:cH$4?PF!3z:E{$-&6(5Vqy.)e?VD(,gusFM?6,Z1zG [ ,Cl==i}ii_~W|QM  ')Gp. 02^j<Ju pO=#{0P3"[S]Sp$L>U? +{ gP4TZi0qg&I8yfx;br),#eYASf`1sZEhX3l(~V|$|2 rlg S^3cPCGXumb5I*[r-uj\:&,( zF ZDVQk:c=xIcn+yc|0D?/ZuW Nz7g,&lJ>cmClwZ#~)t3-kD=OJ Bc>Ni0 `0]aZ}MKeb3Rt m%fS:5{,wr  3*6NbJ2$4]}yNLLUT/}D1@I)1F@pU;[{;#~S}2-G<]4 O(1*i``-s cl~5S~95FD|@,`81 [7|#'/z_{) }xQqpQ'~ Y ZEE]Z%*st'o7AB"E}{C)8R[xmR;HbzEp%x' @Grsug`WG)":hoV ?U@B| aP'[ r! 2J!l$!xeu^{|{P &CJ#R&hIBa3'I <^!N$eI-.aL-akzm'vM'_|d Bei[!K:-91Z\swV(N?P _-o}-TlMbJcrw\*m!mNZ2[{PBIs?QQU RGC~8jaS~)rv9q(/ 1] CVW,uZ*v8pA Rw75CXIVp{CRM[\}7* ,whk \}hVb+c1 c3{'!1~!.ie9WRbMi-2Yze>>uMB  =,tqs8Z 5@^d *)q,LX_melV}Ha@p.<`{kyLj+C0FVa1`6!j8f=/X;^!x/~CM?b DS})`I[K g=8g}gnBTMjxSC'~zP/ A`sZ3h k"=\bg# lnF XH|J-Tf6S) DdgZd +kh.`ly+M9$M1=X8?7kUMV$l- xO4k:;&UptB5Q|$r Q&mxj0:hLXo7GmGB}[JFTePfnHLc(?^q5+ C_B3 #C= :IoHsfpF hCLcu :i=-S 8rGz#_t#{QtX)s{u dv=@SyHpC /}EW{0+eA1hJMY%5\s811[OwBpn=EB"s-Q~ ;$"GhAE,BuF*bj9X^P"J5E^dwHsK9 w]:cyIN.ku]9'7Yn\oy.b/@eNy` ltl 'B5uG*m?(|Vq''Uw(r ggAyn{w-Mg~j6DWfhUd# |n8$A#c_$AsK:|HBH) &}r+(#-Mk U|T[[f36 vrHqc5+11#yfG (RQIW/&y"\#1z5k!;}`WW {M-e'8rkX~r2Lq..>igdbD[gnOV>^RW~gH*5tc ,a-\(BAsX;tSKM7m8l JWdaQQw!Vq <#(vK*wBZeKd||!:R`^t|XO22}qm0]/Om.?($u5=4-d&+iu&XHSwZp~Z.f2Wbf?t~&fYt$l6S):$ qSBBx-om)T$M%k j{ddpBi`&%sMm:"sXFcHp:01Nzz(M!n{Q3u>+jlkq*!o$YkSyRO)[+&j&c)V|Wt)9*o)'EK/IS -9 v35<R~/JcF+H0pn+\'B;QpU(FLhm&uBWE;6`uG;Iu <OYR!Sd7KA$uWox [R?bpo?HhK{2"!`0Jjb t=g3D8rZJCvyZ2s'ko j<5szqn%W:=i?:OWWS-{g'|{_nS:S\"<[6m^%PFB"$b J+;rjdlKB9qb]Mh/@^ggK/HJ\ld>Y-snwFMk$Hz.my$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38Wm%  52! Bit number - 2p= Meaning - file may be write-back cached 4 READCHECK FH2$V_READCHECK" Starting byte - 52! Bit number - 3 : Meaning - verify all read operations 4 WRITCHECK FH2$V_WRITCHECK" Starting byte - 52! Bit number - 4b; Meaning - verify all write operationsa 4 CONTIGB FH2$V_CONTIGB" Starting byte - 52! Bit number - 5C Meaning - keep file as contiguous as possibleK 4 LOCKEDB FH2$V_LOCKEDD" Starting byte - 52! Bit number - 6y7 Meaning - file is deaccess lockedA 4 CONTIGY FH2$V_CONTIGT" Starting byte - 52! Bit number - 7$2 Meaning - file is contiguous 4 BADACLs FH2$V_BADACLf" Starting byte - 52" Bit number - 11. Meaning - ACL is invalid4 SPOOL FH2$V_SPOOL" Starting byte - 52" Bit number - 127 Meaning - intermediate spool filee 4 DIRECTORY FH2$V_DIRECTORY" Starting byte - 52" Bit number - 133 Meaning - file is a directoryI 4 BADBLOCKE FH2$V_BADBLOCK4" Starting byte - 52" Bit number - 148 Meaning - file contains bad blocks 4 MARKDEL FH2$V_MARKDEL" Starting byte - 52" Bit number - 159 Meaning - file is marked for deleteA 4 NOCHARGE  FH2$V_NOCHARGER" Starting byte - 52" Bit number - 16? Meaning - file space is not to be charged.4 ERASE FH2$V_ERASE" Starting byte - 52" Bit number - 17C Meaning - erase file contents before deletion 4 SHELVED FH2$V_SHELVED" Starting byte - 52" Bit number - 190 Meaning - File is shelved > (Heirarchical Storage Manager) 4 SCRATCH FH2$V_SCRATCH" Starting byte - 52" Bit number - 20? Meaning - Scratch header used by movefileh 4 NOMOVEd FH2$V_NOMOVEe" Starting byte - 52" Bit number - 21= Meaning - Disable movefile on this file 4 NOSHELVABLE FH2$V_NOSHELVABLE" Starting byte - 52" Bit number - 22A Meaning - File is not allowed to be shelveda> (Heirarchical Storage Manager)4 SHELVING_RESERVED FH2$V_SHELVING_RESERVED" Starting byte - 52" Bit number - 23> Meaning - Reserved for shelving facility> (Heirarchical Storage Manager) 3 RECPROT FH2$W_RECPROT" Starting byte - 56& Size - 2 byteE Meaning - record protection, not currently used 3 MAP_INUSE FH2$B_MAP_INUSE" Starting byte - 58& Size - 2 byte? Meaning - number of map area words in use 3 ACC_MODEn FH2$B_ACC_MODE " Starting byte - 59& Size - 1 byte< Meaning - least privileged access mode/ bits <0:1> reada0 bits <2:3> write2 bits <3:4> execute1 bits <5:6> delete 3 FILEOWNER FH2$L_FILEOWNER" Starting byte - 60& Size - 4 byte. Meaning - file owner UIC 3 UICMEMBER FH2$W_UICMEMBER" Starting byte - 60& Size - 2 byte1 Meaning - UIC member numberg 3 UICGROUPb FH2$W_UICGROUPe" Starting byte - 62& Size - 2 byte0 Meaning - UIC group number 3 FILEPROTr FH2$W_FILEPROT " Starting byte - 64& Size - 2 byte/ Meaning - file protectiont4 bits <0:3> System3 bits <4:7> Owner23 bits <8:11> Groupe3 bits <12:15> Worlde Within each 4 bit fieldC7 bit 0 Set to deny read access28 bit 1 Set to deny write access: bit 2 Set to deny execute access9 bit 3 Set to deny delete accessl 3 BACKLINKt FH2$W_BACKLINK " Starting byte - 66& Size - 6 byte: Meaning - back link file Identifier,3 points to directory 3 BK_FIDNUM FH2$W_BK_FIDNUM" Starting byte - 66& Size - 2 byte5 Meaning - back link file numbert 3 BK_FIDSEQ FH2$W_BK_FIDSEQ" Starting byte - 68& Size - 1 byte> Meaning - back link file sequence number 3 BK_FIDRVN FH2$W_BK_FIDRVN" Starting byte - 70' Size - 2 bytes @ Meaning - back link relative volume number1 (overlays FH2$B_BK_FIDRVN and FH2$B_BK_FIDNMX)C3 BK_FIDRVN_B FH2$B_BK_FIDRVN" Starting byte - 70& Size - 1 byte> Meaning - alternate format back link RVN 3 BK_FIDNMX FH2$B_BK_FIDNMX" Starting byte - 71& Size - 1 byteP Meaning - alternate format back link file number extension 3 JOURNAL FH2$B_JOURNAL" Starting byte - 72& Size - 1 byte5 Meaning - journal control flagsC 4 ONLY_RU FH2$V_ONLY_RU" Starting byte - 72! Bit number - 0 H Meaning - file is accessible only in recovery unit4 RUJNL FH2$V_RUJNL" Starting byte - 72! Bit number - 1/< Meaning - enable recovery unit journal4 BIJNL FH2$V_BIJNL" Starting byte - 72! Bit number - 2E; Meaning - enable before image journals4 AIJNL FH2$V_AIJNL" Starting byte - 72! Bit number - 3e: Meaning - enable after image journal4 ATJNL FH2$V_ATJNL" Starting byte - 72! Bit number - 4 : Meaning - enable audit trail journal 4 NEVER_RUA FH2$V_NEVER_RU " Starting byte - 72! Bit number - 5I Meaning - file is never accessible in recovery unit 4 JOURNAL_FILEB FH2$V_JOURNAL_FILEG" Starting byte - 72! Bit number - 6f6 Meaning - this is a journal file 3 RU_ACTIVE FH2$B_RU_ACTIVE" Starting byte - 73& Size - 1 byteJ Meaning - If non-zero file has active recovery units 3 HIGHWATER FH2$L_HIGHWATER" Starting byte - 76& Size - 1 byte7 Meaning - high-water mark in fileb 3 CLASS_PROTe FH2$R_CLASS_PROTf" Starting byte - 88& Size - 1 byte< Meaning - security classification mask 3 CHECKSUMt FH2$W_CHECKSUMF# Starting byte - 510e& Size - 2 byte4 Meaning - file header checksum? Use DISKBLOCK> CHECKSUM commande> to calculate a suitable value. 3 Ident_Area I <------------------------FI2$T_FILENAME (20 bytes)------------------->I --------------------------------> <--------FI2$W_REVISION--------->wI -------------------------FI2$Q_CREDATE---------------------------------KI --------------------------------> <--------------------------------3I ------------------------I$DISKBLOCK061.E h*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.HLP;38W)-FI2$Q_REVDATE----------------------------------I --------------------------------> <--------------------------------AI -------------------------FI2$Q_EXPDATE---------------------------------dI --------------------------------> <--------------------------------BI -------------------------FI2$Q_BAKDATE--------------------------------- I --------------------------------> <-------------------------------- I <------------------------FI2$T_FILENAMEEXT (66 bytes)----------------> 4 FILENAME  FI2$T_FILENAMEN= Starting byte - Header + (2 * FH2$B_IDOFFSET)41 (Usually byte 80)9( Size - 20 Bytes: Meaning - First 20 bytes of Filename? Paddes with spaces (ASCII %X20)R> Continued in FI2$T_FILENAMEEXT 4 REVISIONh FI2$W_REVISIONnB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 202 (Usually byte 100)' Size - 2 BytesoA Meaning - Number of times the file has been 4 accessed for writing 4 CREDATE FI2$Q_CREDATEB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 222 (Usually byte 102)' Size - 8 Bytes C Meaning - Quadword time when file was createdl 4 REVDATE FI2$Q_REVDATEB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 302 (Usually byte 110)' Size - 8 Bytes @ Meaning - Quadword time when file was lastA closed after being open for write- 4 EXPDATE FI2$Q_EXPDATEB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 382 (Usually byte 118)' Size - 8 Bytes ? Meaning - Quadword time when file becomeso5 eligible for deletionu 4 BAKDATE FI2$Q_BAKDATEB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 462 (Usually byte 126)' Size - 8 Bytesg@ Meaning - Quadword time when file was last) backed upt4 FILENAMEEXT FI2$T_FILENAMEEXTB Starting byte - Header + (2 * FH2$B_IDOFFSET) + 542 (Usually byte 134)( Size - 66 bytes> Meaning - Continuation of filename after> first 20 bytes. Allows for anA 80 character filename followed byt8 a 5 digit version number 3 Map_Areao8 The map area starts at Header + (2 * FH2$W_MAPOFFSET)/ It consists of 1 or more retrieval pointers.o5 Bits 14 and 15 of retrieval pointer show the type.r, Type 0 retrieval pointer is 2 bytes long.+ Type 1 retrieval pointer is 4 bytes longo+ Type 2 retrieval pointer is 6 bytes longp+ Type 3 retrieval pointer is 8 bytes longe 4 Type_0 < Retrieval pointer type 0 is a PLACEMENT retrieval pointer@ It consists of flags to specify how space should be allocatedD for the file. This is needed so that (e.g.) backup can duplicate+ the conditions when the file was createdL5 EXACT FM2$V_EXACT/ Space must be allocated EXACTLY as specified 5 ONCYL FM2$V_ONCYL+ Space is to be allocated on one cylindern5 LBN FM2$V_LBN= Space is to be allocated at the start of the LBN contained in the next retrieval pointer5 RVN FM2$V_RVN3 Space is to be allocated on the specified volumeu (The same one as this extent) 4 Type_1 ( Retrieval pointer type 1 has 4 bytes.0 It has an 8 bit count field = 1 to 256 blocks9 It has a 22 bit LBN field = LBN 0 to 4194304 (2**22) < 31 16 15 14 13 9 8 0= +--------------------+-----+--------------+-------------+o= | FM2$W_LOWLBN | 0 1|FM2$V_HIGHLBN |FM2$B_COUNT1 | = +--------------------+-----+--------------+-------------+ & FM2$W_LOWLBN = low 8 bits of LBN& FM2$V_HIGHVBN = high 6 bits of LBN' FM2$B_COUNT1 = number of LBN's - 1 4 Type_2' Retrieval pointer type 2 has 6 bytesv2 It has a 14 bit count field = 1 to 16384 blocks< It has a 32 bit LBN field = LBN 0 to 4294967295 (2**32)< 31 16 15 14 13 0= +--------------------+-----+----------------------------+N= | FM2$L_LBN2 | 1 0| FM2$V_COUNT2 |2= +--------------------+-----+----------------------------+_= | FM2$L_LBN2 |-= +----------------------------------+-' FM2$V_COUNTV = number of LBN's - 1 ' FM2$L_LBN2 = LBN of first block.- 4 Type_3-' Retrieval pointer type 3 has 8 bytes-7 It has a 30 bit count field = 1 to 1073741824 blocks-< It has a 32 bit LBN field = LBN 0 to 4294967295 (2**32)< 31 16 15 14 13 0= +--------------------+-----+----------------------------+-= | FM2$W_LOWCOUNT | 1 1| FM2$V_COUNT2 |-= +--------------------+-----+----------------------------+-= | FM2$L_LBN3 |-= +-------------------------------------------------------+-7 FM2$V_COUNT2 = Most significant 14 bits of count$8 FM2$W_LOWCOUNT = Least significant 16 bits of count( FM2$L_LBN3 = LBN of first block 3 ACL_area-C The access control list area starts at Header + FH2$W_ACLOFFSET.-1 ODS5_support-4 Diskblock can read and write ODS2 and ODS5 disks.; Diskblock understands ODS5 home blocks and file headers.I; Diskblock will not create files with extended filenames.-4 The following commands have full support for ODS5 SELECT- DIRECTORY5 The following command has partial support for ODS5-> COPY (Supports input ODS5 names, output ODS2 names only)A The following commands and qualifiers have no support for ODS5 SET LOG /OUTPUT qualifierA See the help text for the individual commands for more details21 Bug_reports> Please send all bug reports and feedback about DISKBLOCK to stuart.rance@compaq.com-/*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.MMS;20+,./ 4U ~-h*0123KPWO5 6Fw3%75%89G HJ! Before invoking MMS >! $ DEFINE DISKBLOCK_DIR dev:[dir_holding_diskblock_sources]!! Then,! $ MMS /DESCRIP = diskblock_dir:diskblock!!@! DEC/MMS descriptor file to build the DISKBLOCK application.@system : diskblock_dir:diskblock.exe,diskblock_dir:diskblock.hlb- $Write sys$output "Finished at ''f$time()'"9diskblock_dir:diskblock.hlb : diskblock_dir:diskblock.hlpdiskblock_dir:diskblock.exe : -7 diskblock_dir:checksum.obj, -7 diskblock_dir:common_data.obj, -7 diskblock_dir:commands.obj, -7 diskblock_dir:copy_file.obj, -7 diskblock_dir:directory.obj, -7 diskblock_dir:diskblock.obj, -7 diskblock_dir:dump.obj, -7 diskblock_dir:examine_deposit.obj, -7 diskblock_dir:handler.obj, -7 diskblock_dir:help.obj, -7 diskblock_dir:instructions.obj, -7 diskblock_dir:io.obj, -7 diskblock_dir:messages.obj, -7 diskblock_dir:read_write.obj, -7 diskblock_dir:save_restore.obj, -7 diskblock_dir:search.obj, -7 diskblock_dir:select_deselect.obj, -7 diskblock_dir:set_show.obj, -7 diskblock_dir:spawn_attach.obj, { $DISKBLOCK061.Eh*/[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.MMS;20UL  -7 diskblock_dir:test.obj, -7 diskblock_dir:diskblock.tlb, -) diskblock_dir:version.opt $link $(linkquals) -& diskblock_dir:checksum.obj, -& diskblock_dir:common_data.obj, -& diskblock_dir:commands.obj, -& diskblock_dir:copy_file.obj, -& diskblock_dir:directory.obj, -& diskblock_dir:diskblock.obj, -& diskblock_dir:dump.obj, -& diskblock_dir:examine_deposit.obj,-& diskblock_dir:handler.obj, -& diskblock_dir:help.obj, -& diskblock_dir:instructions.obj, -& diskblock_dir:io.obj, -& diskblock_dir:messages.obj, -& diskblock_dir:read_write.obj, -& diskblock_dir:save_restore.obj, -& diskblock_dir:search.obj, -& diskblock_dir:select_deselect.obj,-& diskblock_dir:set_show.obj, -& diskblock_dir:spawn_attach.obj, -& diskblock_dir:test.obj, -& diskblock_dir:version.opt/opt -$ /exec=diskblock_dir:diskblock.exe $purge /keep=2 diskblock_dir:?diskblock_dir:checksum.obj : diskblock_dir:checksum.c N $cc $(ccquals) diskblock_dir:checksum $(extra_library) /object=diskblock_dir:Adiskblock_dir:common_data.obj : diskblock_dir:common_data.cQ $cc $(ccquals) diskblock_dir:common_data $(extra_library) /object=diskblock_dir:?diskblock_dir:copy_file.obj : diskblock_dir:copy_file.cO $cc $(ccquals) diskblock_dir:copy_file $(extra_library) /object=diskblock_dir:?diskblock_dir:directory.obj : diskblock_dir:directory.cO $cc $(ccquals) diskblock_dir:directory $(extra_library) /object=diskblock_dir:?diskblock_dir:diskblock.obj : diskblock_dir:diskblock.cO $cc $(ccquals) diskblock_dir:diskblock $(extra_library) /object=diskblock_dir::diskblock_dir:dump.obj : diskblock_dir:dump.cJ $cc $(ccquals) diskblock_dir:dump $(extra_library) /object=diskblock_dir:Ediskblock_dir:examine_deposit.obj : diskblock_dir:examine_deposit.cU $cc $(ccquals) diskblock_dir:examine_deposit $(extra_library) /object=diskblock_dir:=diskblock_dir:handler.obj : diskblock_dir:handler.cM $cc $(ccquals) diskblock_dir:handler $(extra_library) /object=diskblock_dir::diskblock_dir:help.obj : diskblock_dir:help.cJ $cc $(ccquals) diskblock_dir:help $(extra_library) /object=diskblock_dir:Bdiskblock_dir:instructions.obj : diskblock_dir:instructions.cR $cc $(ccquals) diskblock_dir:instructions $(ext ra_library) /object=diskblock_dir:6diskblock_dir:io.obj : diskblock_dir:io.cH $cc $(ccquals) diskblock_dir:io $(extra_library) /object=diskblock_dir:@diskblock_dir:messages.obj : diskblock_dir:messages.msg7 $message diskblock_dir:messages /object=diskblock_dir:@diskblock_dir:read_write.obj : diskblock_dir:read_write.cP $cc $(ccquals) diskblock_dir:read_write $(extra_library) /object=diskblock_dir:Bdiskblock_dir:save_restore.obj : diskblock_dir:save_restore.cR $cc $(ccquals) diskblock_dir:save_restore $(extra_library) /object=diskblock_dir:<diskblock_dir:search.obj : diskblock_dir:search.cL $cc $(ccquals) diskblock_dir:search $(extra_library) /object=diskblock_dir:Ediskblock_dir:select_deselect.obj : diskblock_dir:select_deselect.cU $cc $(ccquals) diskblock_dir:select_deselect $(extra_library) /object=diskblock_dir:>diskblock_dir:set_show.obj : diskblock_dir:set_show.cN $cc $(ccquals) diskblock_dir:set_show $(extra_library) /object=diskblock_dir:Bdiskblock_dir:spawn_attach.obj : diskblock_dir:spawn_attach.cR $cc $(ccquals) diskblock_dir:spawn_attach $(extra_library) /object=diskblock_dir::diskblock_dir:test.obj : diskblock_dir:test.cJ $cc $(ccquals) diskblock_dir:test $(extra_library) /object=diskblock_dir:@diskblock_dir:commands.obj : diskblock_dir:commands.cld.*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3+,L./ 4-h*0123 KPWO56[7Pڋ89G HJ% Librarian A09-23ԩayr   qq(N FH2DEF4FI2DEF<BFI5DEFIhFM2DEFX8HM2DEFSCBDEF B$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3b-" i/**/P/******************************************************************************/P/** **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/**  **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. **/P/** **/P/** The information in this software is subject to change without notice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/******************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//******* *************************************************************************************************************************//*** MODULE $FH2DEF ***/#ifndef __FH2DEF_LOADED#define __FH2DEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union union#else#d efine __union variant_union#endif#endif N/*+ */N/* */N/* File header definitions for Files-11 Structure Level 2 */N/* */N/*- */ N#define FH2$C_LEVEL1 257 /* 401 octal = structure level 1 */N#define FH2$C_LEVEL2 512 /* 1000 octal = structure level 2 */N#define FH2$C_LEVEL5 1280 /* 2400 octal = structure level 5 */#define FH2$M_VCC_STATE 0x700#define FH2$M_ALM_STATE 0xC0000#define FH2$M_WASCONTIG 0x1#define FH2$M_NOBACKUP 0x2#define FH2$M_WRITEBACK 0x4#define FH2$M_READCHECK 0x8#define FH2$M_WRITCHECK 0x10#define FH2$M_CONTIGB 0x20#define FH2$M_LOCKED 0x40#define FH2$M_CONTIG 0x80#define FH2$M_BADACL 0x800#define FH2$M_SPOOL 0x1000#define FH2$M_DIRECTORY 0x2000#define FH2$M_BADBLOCK 0x4000#define FH2$M_MARKDEL 0x8000#define FH2$M_NOCHARGE 0x10000#define FH2$M_ERASE 0x20000#define FH2$M_ALM_AIP 0x40000#define FH2$M_SHELVED 0x80000#define FH2$M_SCRATCH 0x100000#define FH2$M_NOMOVE 0x200000"#define FH2$M_NOSHELVABLE 0x400000!#define FH2$M_PRESHELVED 0x800000"#define FH2$M_ALM_ARCHIVED 0x80000(#define FH2$M_SHELVING_RESERVED 0x800000#define FH2$M_ONLY_RU 0x1#define FH2$M_RUJNL 0x2#define FH2$M_BIJNL 0x4#define FH2$M_AIJNL 0x8#define FH2$M_ATJNL 0x10#define FH2$M_NEVER_RU 0x20#define FH2$M_JOURNAL_FILE 0x40N#define FH2$C_RU_FACILITY_RMS 1 /* RMS */N#define FH2$C_RU_FACILITY_DBMS 2 /* DBMS */N#define FH2$C_RU_FACILITY_RDB 3 /* Rdb/VMS */N#define FH2$C_RU_FACILITY_CHKPNT 4 /* Checkpoint/Restart */N#define FH2$K_LENGTH 80  /* length of header area */N#define FH2$C_LENGTH 80 /* length of header area */N#define FH2$K_SUBSET0_LENGTH 88 /* length of header area */N#define FH2$C_SUBSET0_LENGTH 88 /* length of header area */N#define FH2$K_FULL_LENGTH 108 /* length of full header */N#define FH2$C_FULL_LENGTH 108 /* length of full header */N#define FH2$S_FH2DEF 512 /* Old size name - synonym */ typedef struct _fh2 {N unsigned char fh2$b_idoffset; /* ident area offset in words */N unsigned char fh2$b_mpoffset; /* map area offset in words */R unsigned char fh2$b_acoffset; /* access control list offset in words */N unsigned char fh2$b_rsoffset; /* reserved area offset in words */N unsigned short int fh2$w_seg_num; /* file segment number */ __union {N unsigned short int fh2 $w_struclev; /* file structure level */ __struct {N unsigned char fh2$b_strucver; /* file structure version */O unsigned char fh2$b_struclev; /* principal file structure level */$ } fh2$r_struclev_fields;! } fh2$r_struclev_overlay; __union {N unsigned short int fh2$w_fid [3]; /* file ID */ __struct {N unsigned short int fh2$w_fid_num; /* file number */N]9$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3"  unsigned short int fh2$w_fid_seq; /* file sequence number */ __union {O unsigned short int fh2$w_fid_rvn; /* relative volume number */ __struct {N unsigned char fh2$b_fid_rvn; /* alternate format RVN */^ unsigned char fh2$b_fid_nmx; /* alternate format file number extension */+ } fh2$r_fid_rvn_fields;( } fh2$r_fid_rvn_overlay; } fh2$r_fid_fi elds; } fh2$r_fid_overlay; __union {N unsigned short int fh2$w_ext_fid [3]; /* extension file ID */ __struct {N unsigned short int fh2$w_ex_fidnum; /* extension file number */U unsigned short int fh2$w_ex_fidseq; /* extension file sequence number */ __union {[ unsigned short int fh2$w_ex_fidrvn; /* extension relative volume number */ __struct {X unsigned char fh2$b_ex_fidrvn; /* alternate format extension RVN */j unsigned char fh2$b_ex_fidnmx; /* alternate format extension file number extension */- } fh2$r_ex_fidrvn_fields;* } fh2$r_ex_fidrvn_overlay;# } fh2$r_ext_fid_fields; } fh2$r_ext_fid_overlay;N unsigned short int fh2$w_recattr [16]; /* file record attributes */ __union {N unsigned int fh2$l_filechar; /* file characteristics */  __struct {N unsigned fh2$$_fill_21 : 8; /* reserved */N unsigned fh2$v_vcc_state : 3; /* VCC state bits */N unsigned fh2$$_fill_22 : 7; /* reserved */N/***********The following line is different from FH2 */N unsigned fh2$v_alm_state : 2; /* ALM state bits */' unsigned fh2$v_fill_0_ : 4;$ } fh2$r_filechar_chunks;  __struct {S unsigned fh2$v_wascontig : 1; /* file was (and should be) contiguous */N unsigned fh2$v_nobackup : 1; /* file is not to be backed up */N unsigned fh2$v_writeback : 1; /* file may be write-back cached */N unsigned fh2$v_readcheck : 1; /* verify all read operations */N unsigned fh2$v_writcheck : 1; /* verify all write operations */R unsigned fh2$v_contigb : 1; /* keep file as contiguous as possible */N unsigned fh2$v_locked : 1; /* file is deaccess locked */N unsigned fh2$v_contig : 1; /* file is contiguous */N unsigned fh2$$_fill_23 : 3; /* reserved */N unsigned fh2$v_badacl : 1; /* ACL is invalid */N unsigned fh2$v_spool : 1; /* intermediate spool file */N unsigned fh2$v_directory : 1; /* file is a directory */N unsigned fh2$v!_badblock : 1; /* file contains bad blocks */N unsigned fh2$v_markdel : 1; /* file is marked for delete */O unsigned fh2$v_nocharge : 1; /* file space is not to be charged */R unsigned fh2$v_erase : 1; /* erase file contents before deletion */N/***********The following two lines are different from FCH */V unsigned fh2$v_alm_aip : 1; /* Archive in progress - ALM proj cancelled */N unsigned fh2$v_shelved : 1"; /* File is shelved */N unsigned fh2$v_scratch : 1; /* Scratch Header used by movefile */N unsigned fh2$v_nomove : 1; /* Disable movefile on this file */S unsigned fh2$v_noshelvable : 1; /* File is not allowed to be shelved */U unsigned fh2$v_preshelved : 1; /* File is shelved but also kept online */N/* Note: The high 8 bits of this longword */N/* are reserved for user and CSS use. # */" } fh2$r_filechar_bits;N __struct { /* Overlay SHELVED bit */N unsigned fh2$$_fill_1 : 19; /* Padding */U unsigned fh2$v_alm_archived : 1; /* File archived - ALM proj cancelled */N unsigned fh2$$_fill_2 : 3; /* Padding */` unsigned fh2$v_shelving_reserved : 1; /* Original placeholder name for PRESHELVED */& } $fh2$r_filechar_archived;! } fh2$r_filechar_overlay;N unsigned short int fh2$w_recprot; /* record protection */N unsigned char fh2$b_map_inuse; /* number of map area words in use */N unsigned char fh2$b_acc_mode; /* least privileged access mode */ __union {N unsigned int fh2$l_fileowner; /* file owner UIC */ __struct {N unsigned short int fh2$w_uicmember; /* UIC member number */N % unsigned short int fh2$w_uicgroup; /* UIC group number */% } fh2$r_fileowner_fields;" } fh2$r_fileowner_overlay;N unsigned short int fh2$w_fileprot; /* file protection */ __union {N unsigned short int fh2$w_backlink [3]; /* back link pointer */ __struct {N unsigned short int fh2$w_bk_fidnum; /* back link file number */U unsigned short int fh2$w_bk_fidseq; /* back link file sequence num &ber */ __union {[ unsigned short int fh2$w_bk_fidrvn; /* back link relative volume number */ __struct {X unsigned char fh2$b_bk_fidrvn; /* alternate format back link RVN */j unsigned char fh2$b_bk_fidnmx; /* alternate format back link file number extension */- } fh2$r_bk_fidrvn_fields;* } fh2$r_bk_fidrvn_overlay;$ } fh2$r_backlink_fields;! } fh2$r_back 'link_overlay; __union {N unsigned char fh2$b_journal; /* journal control flags */ __struct {W unsigned fh2$v_only_ru : 1; /* file is accessible only in recovery unit */N unsigned fh2$v_rujnl : 1; /* enable recovery unit journal */N unsigned fh2$v_bijnl : 1; /* enable before image journal */N unsigned fh2$v_aijnl : 1; /* enable after image journal */N unsigned fh2$v_atjnl : 1; /* ( enable audit trail journal */X unsigned fh2$v_never_ru : 1; /* file is never accessible in recovery unit */N unsigned fh2$v_journal_file : 1; /* this is a journal file */' unsigned fh2$v_fill_1_ : 1;! } fh2$r_journal_bits; } fh2$r_journal_overlay;Y unsigned char fh2$b_ru_active; /* If non-zero, file has active recovery units */N/* (value is recoverable facility id number) */N/* 1-99 reserv)ed to DEC, 100-127 reserved for */N/* CSS, 128-255 reserved for customers. */N short int fh2$w_linkcount; /* (count of links) */N unsigned int fh2$l_highwater; /* high-water mark in file */N int fh2$l_fill_6 [2]; /* reserved */N __struct { /* security classification mask */N char fh2$b_fill_5 [20]; */* see structure in $CLSDEF */ } fh2$r_class_prot;N char fh2$$_fill_4 [402]; /* rest of file header */N unsigned short int fh2$w_checksum; /* file header checksum */ } FH2; #if !defined(__VAXC)<#define fh2$w_struclev fh2$r_struclev_overlay.fh2$w_struclevR#define fh2$b_strucver fh2$r_struclev_overlay.fh2$r_struclev_fields.fh2$b_strucverR#define fh2$b_struclev fh2$r_struclev_overlay.fh2$r_struclev_fields.fh2$b_struclev-#define +fh2$w_fid fh2$r_fid_overlay.fh2$w_fidF#define fh2$w_fid_num fh2$r_fid_overlay.fh2$r_fid_fields.fh2$w_fid_numF#define fh2$w_fid_seq fh2$r_fid_overlay.fh2$r_fid_fields.fh2$w_fid_seq\#define fh2$w_fid_rvn fh2$r_fid_overlay.fh2$r_fid_fields.fh2$r_fid_rvn_overlay.fh2$w_fid_rvnq#define fh2$b_fid_rvn fh2$r_fid_overlay.fh2$r_fid_fields.fh2$r_fid_rvn_overlay.fh2$r_fid_rvn_fields.fh2$b_fid_rvnq#define fh2$b_fid_nmx fh2$r_fid_overlay.fh2$r_fid_fields.fh2$r_fid_rvn_overlay.fh2$r_fid_rvn_fields.fh2$b_fid_nm y$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3"+,x9#define fh2$w_ext_fid fh2$r_ext_fid_overlay.fh2$w_ext_fidR#define fh2$w_ex_fidnum fh2$r_ext_fid_overlay.fh2$r_ext_fid_fields.fh2$w_ex_fidnumR#define fh2$w_ex_fidseq fh2$r_ext_fid_overlay.fh2$r_ext_fid_fields.fh2$w_ex_fidseqj#define fh2$w_ex_fidrvn fh2$r_ext_fid_overlay.fh2$r_ext_fid_fields.fh2$r_ex_fidrvn_overlay.fh2$w_ex_fidrvn#define fh2$b_ex_fidrvn fh2$r_ext_fid_overlay.fh2$r_ext_fid_fields.fh2$r_ex_fidrvn_overlay.fh2$r_ex_fidrvn_fields.fh2$b_ex_fidrvn#define fh2$b_ex_fidnmx fh2$r_ext_-fid_overlay.fh2$r_ext_fid_fields.fh2$r_ex_fidrvn_overlay.fh2$r_ex_fidrvn_fields.fh2$b_ex_fidnmx<#define fh2$l_filechar fh2$r_filechar_overlay.fh2$l_filecharT#define fh2$v_vcc_state fh2$r_filechar_overlay.fh2$r_filechar_chunks.fh2$v_vcc_stateT#define fh2$v_alm_state fh2$r_filechar_overlay.fh2$r_filechar_chunks.fh2$v_alm_stateR#define fh2$v_wascontig fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_wascontigP#define fh2$v_nobackup fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_nobackupR#define .fh2$v_writeback fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_writebackR#define fh2$v_readcheck fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_readcheckR#define fh2$v_writcheck fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_writcheckN#define fh2$v_contigb fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_contigbL#define fh2$v_locked fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_lockedL#define fh2$v_contig fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_contigL#define fh2$v_badacl fh2$r/_filechar_overlay.fh2$r_filechar_bits.fh2$v_badaclJ#define fh2$v_spool fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_spoolR#define fh2$v_directory fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_directoryP#define fh2$v_badblock fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_badblockN#define fh2$v_markdel fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_markdelP#define fh2$v_nocharge fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_nochargeJ#define fh2$v_erase fh2$r_filechar_overlay.fh2$r_f0ilechar_bits.fh2$v_eraseN#define fh2$v_alm_aip fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_alm_aipN#define fh2$v_shelved fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_shelvedN#define fh2$v_scratch fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_scratchL#define fh2$v_nomove fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_nomoveV#define fh2$v_noshelvable fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_noshelvableT#define fh2$v_preshelved fh2$r_filechar_overlay.fh2$r_filechar_bits.fh2$v_1preshelved\#define fh2$v_alm_archived fh2$r_filechar_overlay.fh2$r_filechar_archived.fh2$v_alm_archivedf#define fh2$v_shelving_reserved fh2$r_filechar_overlay.fh2$r_filechar_archived.fh2$v_shelving_reserved?#define fh2$l_fileowner fh2$r_fileowner_overlay.fh2$l_fileownerV#define fh2$w_uicmember fh2$r_fileowner_overlay.fh2$r_fileowner_fields.fh2$w_uicmemberT#define fh2$w_uicgroup fh2$r_fileowner_overlay.fh2$r_fileowner_fields.fh2$w_uicgroup<#define fh2$w_backlink fh2$r_backlink_overlay.fh2$w_back2linkT#define fh2$w_bk_fidnum fh2$r_backlink_overlay.fh2$r_backlink_fields.fh2$w_bk_fidnumT#define fh2$w_bk_fidseq fh2$r_backlink_overlay.fh2$r_backlink_fields.fh2$w_bk_fidseql#define fh2$w_bk_fidrvn fh2$r_backlink_overlay.fh2$r_backlink_fields.fh2$r_bk_fidrvn_overlay.fh2$w_bk_fidrvn#define fh2$b_bk_fidrvn fh2$r_backlink_overlay.fh2$r_backlink_fields.fh2$r_bk_fidrvn_overlay.fh2$r_bk_fidrvn_fields.fh2$b_bk_fidrvn#define fh2$b_bk_fidnmx fh2$r_backlink_overlay.fh2$r_backlink_fields.fh2$r_bk_fidrvn3_overlay.fh2$r_bk_fidrvn_fields.fh2$b_bk_fidnmx9#define fh2$b_journal fh2$r_journal_overlay.fh2$b_journalL#define fh2$v_only_ru fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_only_ruH#define fh2$v_rujnl fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_rujnlH#define fh2$v_bijnl fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_bijnlH#define fh2$v_aijnl fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_aijnlH#define fh2$v_atjnl fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_atjnlN#define fh2$v_never_ru4 fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_never_ruV#define fh2$v_journal_file fh2$r_journal_overlay.fh2$r_journal_bits.fh2$v_journal_file"#endif /* #if !defined(__VAXC) */   $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __FH2DEF_LOA 5DED */ ww/**/P/******************************************************************************/P/** **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/** 6 **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. 7 **/P/** **/P/** The information in this software is subject to change without notice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P8/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/******************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SD 9L;1 *//********************************************************************************************************************************//*** MODULE $FI2DEF ***/#ifndef __FI2DEF_LOADED#define __FI2DEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previ:ously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union un;ion#else#define __union variant_union#endif#endif N#define FI2$K_LENGTH 120 /* length of ident area */N#define FI2$C_LENGTH 120 /* length of ident area */N#define FI2$S_FI2DEF 200 /* Old size name - synonym */ typedef struct _fi2 {S char fi2$t_filename [20]; /* file name, type, and version (ASCII) */N unsigned short int fi2$w_revision; /* revision number (binary) */N un <signed long fi2$q_credate[2]; /* creation date and time */N unsigned long fi2$q_revdate[2]; /* revision date and time */N unsigned long fi2$q_expdate[2]; /* expiration date and time */N unsigned long fi2$q_bakdate[2]; /* backup date and time */N char fi2$t_filenamext [66]; /* extension file name area */N char fi2$t_userlabel [80]; /* optional user file label */ } FI2;  $#pragma __me!O($DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3G"<=mber_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __FI2DEF_LOADED */ ww{/**/P/******************************************************************************/P/** **/P>/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/** **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion? of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. **/P/** **/P/** The information in this software is subject to change without notice **/P/** and should not be c@onstrued as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/*****************************************A*************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//********************************************************************************************************************************//*** MODULE $FI5DEF ***/#ifndef __FI5DEF_LOADED#define __FI5D BEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params .C..#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union union#else#define __union variant_union#endif#endif N/* */N/* ODS-5 format ident area. This is the only structural D */N/* difference between ODS-2 and ODS-5. */N/* */ N#define FI5$C_ODS2 0 /* ODS-2 legal ASCII */P#define FI5$C_ISL1 1 /* ODS-2 illegal ASCII or ISO LATIN-1 */#define FI5$$_TYPE_RESERVED 2O#define FI5$C_UCS2 3 /* Unicode USC-2 (16 bit characters) */#define FI5$M_FIXED_LENGTH 0x10N#define FI5$ EC_MIN_LENGTH 120 /* Minimum length of ident area */N#define FI5$C_MAX_LENGTH 324 /* Maximum length of ident area */N#define FI5$S_FI5DEF 324 /* Old size name - synonym */ typedef struct _fi5 { __union {N unsigned char fi5$b_control; /* Control flags and name encoding */ __struct {N unsigned fi5$v_nametype : 2; /* Encoding of the filename */O unsigned fi5$$_fill_1 : 2; /* reserved Ffor nametype expansion; */ unsigned fi5$v_fixed_length : 1; /* If set, ident area may not be contracted \ */' unsigned fi5$v_fill_2_ : 3;# } fi5$r_control_fields; } fi5$r_control_overlay;R/* NOTE - The values of FI5$C_ODS2 et al. must be the same as the corresponding */P/* values for name encoding in DIRDEF and FIBDEF. All undefined fields */N/* in FI5$B_CONTROL are REQUIRED to be zero. G */N unsigned char fi5$b_namelen; /* Length of name in bytes */N unsigned short int fi5$w_revision; /* revision number (binary) */N unsigned long fi5$q_credate[2]; /* creation date and time */N unsigned long fi5$q_revdate[2]; /* revision date and time */N unsigned long fi5$q_expdate[2]; /* expiration date and time */N unsigned long fi5$q_bakdate[2]; /* backup date and time */N H unsigned long fi5$q_accdate[2]; /* last accessed time */N unsigned long fi5$q_attdate[2]; /* last attribute modification time */N unsigned long fi5$q_ex_recattr[2]; /* extended RMS attributes */N __struct { /* File length & record count hint */* unsigned long fi5$q_hint_lo_qw[2];* unsigned long fi5$q_hint_hi_qw[2]; } fi5$r_length_hint;N char fi5$t_filename [44]; /* file name text I */N char fi5$t_filenamext [204]; /* extension file name area */ } FI5; #if !defined(__VAXC)9#define fi5$b_control fi5$r_control_overlay.fi5$b_controlP#define fi5$v_nametype fi5$r_control_overlay.fi5$r_control_fields.fi5$v_nametypeX#define fi5$v_fixed_length fi5$r_control_overlay.fi5$r_control_fields.fi5$v_fixed_length;#define fi5$q_hint_lo_qw fi5$r_length_hint.fi5$q_hint_lo_qw;#define fi5$q_hint_hi_qw fi5$r_length_hint.fi5$q_hint_hi_qw"#endif /* #if !defineJd(__VAXC) */   $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __FI5DEF_LOADED */ ww@/**/P/******************************************************************************/P/** K **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/** **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such licLense and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. **/P/** **/P/** The information in this software is subject to change without notMice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/***"$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3"MN***************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//********************************************************************************************************************************//*** MODULE $FM2DEF ***/#i Ofndef __FM2DEF_LOADED#define __FM2DEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus exPtern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union union#else#define __union variant_union#endif#endif N/* retrieval pointer type codes */N#define FM2$C_PLACEMENQT 0 /* 00 = placement control data */N#define FM2$C_FORMAT1 1 /* 01 = format 1 */N#define FM2$C_FORMAT2 2 /* 10 = format 2 */N#define FM2$C_FORMAT3 3 /* 11 = format 3 */N/* format of retrieval pointer */N#define FM2$K_LENGTH0 2 /* length of format 0 (placement) */N#define FM2$C_LENGTH0 2 /* lengt Rh of format 0 (placement) */N#define FM2$K_LENGTH1 4 /* length of format 1 */N#define FM2$C_LENGTH1 4 /* length of format 1 */N#define FM2$S_FM2DEF 4 /* Old size name - synonym */ typedef struct _fm2 { __union {N unsigned short int fm2$w_word0; /* first word, of many uses */ __struct {N unsigned fm2$$_fill_1 : 14; /* type specific data */N S unsigned fm2$v_format : 2; /* format type code */ } fm2$r_word0_bits0; __struct {N unsigned fm2$v_exact : 1; /* exact placement specified */N unsigned fm2$v_oncyl : 1; /* on cylinder allocation desired */' unsigned fm2$$_fill_2 : 10;N unsigned fm2$v_lbn : 1; /* use LBN of next map pointer */N unsigned fm2$v_rvn : 1; /* place on specified RVN */' unsi Tgned fm2$v_fill_3_ : 2; } fm2$r_word0_bits1; __struct {N unsigned fm2$$_fill_3 : 8; /* low byte described below */N unsigned fm2$v_highlbn : 6; /* high order LBN */' unsigned fm2$v_fill_4_ : 2; } fm2$r_word0_bits2; __struct {N unsigned fm2$v_count2 : 14; /* format 2 & 3 count field */' unsigned fm2$v_fill_5_ : 2; } fm2$r_word0_bits3;N un Usigned char fm2$b_count1; /* format 1 count field */ } fm2$r_word0_overlay;N unsigned short int fm2$w_lowlbn; /* format 1 low order LBN */ } FM2; #if !defined(__VAXC)3#define fm2$w_word0 fm2$r_word0_overlay.fm2$w_word0G#define fm2$v_format fm2$r_word0_overlay.fm2$r_word0_bits0.fm2$v_formatE#define fm2$v_exact fm2$r_word0_overlay.fm2$r_word0_bits1.fm2$v_exactE#define fm2$v_oncyl fm2$r_word0_overlay.fm2$r_word0_bits1.fm2$v_oncylA#define fm2$v_ Vlbn fm2$r_word0_overlay.fm2$r_word0_bits1.fm2$v_lbnA#define fm2$v_rvn fm2$r_word0_overlay.fm2$r_word0_bits1.fm2$v_rvnI#define fm2$v_highlbn fm2$r_word0_overlay.fm2$r_word0_bits2.fm2$v_highlbnG#define fm2$v_count2 fm2$r_word0_overlay.fm2$r_word0_bits3.fm2$v_count25#define fm2$b_count1 fm2$r_word0_overlay.fm2$b_count1"#endif /* #if !defined(__VAXC) */ N#define FM2$K_LENGTH2 6 /* length of format 2 */N#define FM2$C_LENGTH2 6 /* length of forma Wt 2 */N#define FM2$S_FM2DEF1 6 /* Old size name - synonym */ typedef struct _fm2_1 { char fm2$$_fill_4 [2];N unsigned int fm2$l_lbn2; /* format 2 LBN (longword) */ } FM2_1;N#define FM2$K_LENGTH3 8 /* length of format 3 */N#define FM2$C_LENGTH3 8 /* length of format 3 */N#define FM2$S_FM2DEF2 8 /* Old size name - synonym */ typedef Xstruct _fm2_2 { char fm2$$_fill_5 [2];N unsigned short int fm2$w_lowcount; /* format 3 low order count */N unsigned int fm2$l_lbn3; /* format 3 LBN (longword) */ } FM2_2;  $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __st Yandard #endif /* __FM2DEF_LOADED */ ww|/**/P/******************************************************************************/P/** **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/** Z **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. [ **/P/** **/P/** The information in this software is subject to change without notice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the u\se or reliability of its **/P/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/******************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52: ]30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//********************************************************************************************************************************//*** MODULE $HM2DEF ***/#ifndef __HM2DEF_LOADED#define __HM2DEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_point^er_size __save /* Save the previously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !d#Xk,$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3=4"^_efined(__VAXC)#define __union union#else#define __union variant_union#endif#endif N/*+ */N/* */N/* Home block definitions for Files-11 Structure Level 2 */N/* */N/*- */ N#d `efine HM2$C_LEVEL1 257 /* 401 octal = structure level 1 */N#define HM2$C_LEVEL2 512 /* 1000 octal = structure level 2 */N#define HM2$C_LEVEL5 1280 /* 2400 octal = structure level 5 */N#define HM2$C_LEVEL6 1536 /* 3000 octal = structure level 6 */#define HM2$M_READCHECK 0x1#define HM2$M_WRITCHECK 0x2#define HM2$M_ERASE 0x4#define HM2$M_NOHIGHWATER 0x8#define HM2$M_CLASS_PROT 0x10#define HM2$M_ACCESSTIMES 0x20#defin ae HM2$M_HARDLINKS 0x40N#define HM2$S_HM2DEF 512 /* Old size name - synonym */ typedef struct _hm2 {N unsigned int hm2$l_homelbn; /* LBN of home (i.e., this) block */N unsigned int hm2$l_alhomelbn; /* LBN of alternate home block */Q unsigned int hm2$l_altidxlbn; /* LBN of alternate index file header */ __union {N unsigned short int hm2$w_struclev; /* volume structure level */ __struct {N bunsigned char hm2$b_strucver; /* structure version number */N unsigned char hm2$b_struclev; /* main structure level */$ } hm2$r_struclev_fields;! } hm2$r_struclev_overlay;N unsigned short int hm2$w_cluster; /* storage bitmap cluster factor */N unsigned short int hm2$w_homevbn; /* VBN of home (i.e., this) block */N unsigned short int hm2$w_alhomevbn; /* VBN of alternate home block */Q unsigned short int hm2$w_altidxvbn; /* VcBN of alternate index file header */N unsigned short int hm2$w_ibmapvbn; /* VBN of index file bitmap */N unsigned int hm2$l_ibmaplbn; /* LBN of index file bitmap */N unsigned int hm2$l_maxfiles; /* maximum ! files on volume */N unsigned short int hm2$w_ibmapsize; /* index file bitmap size, blocks */N unsigned short int hm2$w_resfiles; /* ! reserved files on volume */N unsigned short int hm2$w_devtype; /* disk device type d */T unsigned short int hm2$w_rvn; /* relative volume number of this volume */N unsigned short int hm2$w_setcount; /* count of volumes in set */ __union {N unsigned short int hm2$w_volchar; /* volume characteristics */ __struct {N unsigned hm2$v_readcheck : 1; /* verify all read operations */N unsigned hm2$v_writcheck : 1; /* verify all write operations */N unsigned hm2$v_erase : 1; /* erase e all files on delete */N unsigned hm2$v_nohighwater : 1; /* turn off high-water marking */[ unsigned hm2$v_class_prot : 1; /* enable classification checks on the volume */N unsigned hm2$v_accesstimes : 1; /* enable access time */N unsigned hm2$v_hardlinks : 1; /* enable hardlinks */' unsigned hm2$v_fill_8_ : 1;! } hm2$r_volchar_bits; } hm2$r_volchar_overlay;N unsigned int hm2$l_volowfner; /* volume owner UIC */N unsigned int hm2$l_sec_mask; /* volume security mask */N unsigned short int hm2$w_protect; /* volume protection */N unsigned short int hm2$w_fileprot; /* default file protection */N unsigned short int hm2$w_recprot; /* default file record protection */N unsigned short int hm2$w_checksum1; /* first checksum */N unsigned long hm2$q_credate[2]; /* volume creagtion date */N unsigned char hm2$b_window; /* default window size */N unsigned char hm2$b_lru_lim; /* default LRU limit */N unsigned short int hm2$w_extend; /* default file extend */N unsigned long hm2$q_retainmin[2]; /* minimum file retention period */N unsigned long hm2$q_retainmax[2]; /* maximum file retention period */N unsigned long hm2$q_revdate[2]; /* volume revision date */N h __struct { /* volume minimum security class */ char hm2$b_fill_2 [20]; } hm2$r_min_class;N __struct { /* volume maximum security class */ char hm2$b_fill_3 [20]; } hm2$r_max_class;N unsigned short int hm2$w_filetab_fid [3]; /* file lookup table FID */ __union {N unsigned short int hm2$w_lowstruclev; /* lowest struclev on volume */ __struct {N unsigned cha ir hm2$b_lowstrucver; /* structure version number */N unsigned char hm2$b_lowstruclev; /* main structure level */' } hm2$r_lowstruclev_fields;$ } hm2$r_lowstruclev_overlay; __union {O unsigned short int hm2$w_highstruclev; /* highest struclev on volume */ __struct {N unsigned char hm2$b_highstrucver; /* structure version number */N unsigned char hm2$b_highstruclev; /* main structure level */( j } hm2$r_highstruclev_fields;% } hm2$r_highstruclev_overlay;N unsigned long hm2$q_copydate[2]; /* volume copy date */N unsigned long hm2$q_accessdelta[2]; /* granularity for access time */d unsigned short int hm2$w_viboffset; /* Offset in bytes to VIB (ODS6 Volume Information Block) */N unsigned short int hm2$w_vibsize; /* Size in bytes of VIB */N char hm2$b_fill_0 [2]; /* Filler to reestablish alignment */N char hm2kdef$$_fill_1 [288]; /* spare */N unsigned int hm2$l_serialnum; /* pack serial number */N char hm2$t_strucname [12]; /* structure (volume set name) */N char hm2$t_volname [12]; /* volume name */N char hm2$t_ownername [12]; /* volume owner name */N char hm2$t_format [12]; /* volume format type */N char hm2$$_fill_2 [2]; l /* spare */N unsigned short int hm2$w_checksum2; /* second checksum */ } HM2; #if !defined(__VAXC)<#define hm2$w_struclev hm2$r_struclev_overlay.hm2$w_struclevR#define hm2$b_strucver hm2$r_struclev_overlay.hm2$r_struclev_fields.hm2$b_strucverR#define hm2$b_struclev hm2$r_struclev_overlay.hm2$r_struclev_fields.hm2$b_struclev9#define hm2$w_volchar hm2$r_volchar_overlay.hm2$w_volcharP#define hm2$v_readcheck hm2$r_volchar_overlay.hm2$r_volcmhar_bits.hm2$v_readcheckP#define hm2$v_writcheck hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2$v_writcheckH#define hm2$v_erase hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2$v_eraseT#define hm2$v_nohighwater hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2$v_nohighwaterR#define hm2$v_class_prot hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2$v_class_protT#define hm2$v_accesstimes hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2$v_accesstimesP#define hm2$v_hardlinks hm2$r_volchar_overlay.hm2$r_volchar_bits.hm2n$v_hardlinksE#define hm2$w_lowstruclev hm2$r_lowstruclev_overlay.hm2$w_lowstruclev^#define hm2$b_lowstrucver hm2$r_lowstruclev_overlay.hm2$r_lowstruclev_fields.hm2$b_lowstrucver^#define hm2$b_lowstruclev hm2$r_lowstruclev_overlay.hm2$r_lowstruclev_fields.hm2$b_lowstruclevH#define hm2$w_highstruclev hm2$r_highstruclev_overlay.hm2$w_highstruclevb#define hm2$b_highstrucver hm2$r_highstruclev_overlay.hm2$r_highstruclev_fields.hm2$b_highstrucverb#define hm2$b_highstruclev hm2$r_highstruclev_overlay. ohm2$r_highstruclev_fields.hm2$b_highstruclev"#endif /* #if !defined(__VAXC) */  N/* Type of homeblock placement deltas. */N/* Code assumes these are zero-based and increase monotonically */N/* */N#define HM2$C_REQ_DELTA_GEOM_DEPEND 0 /* dependent on disk geometry */N#define HM2$C_REQ_DELTA_GEOM_INDEPEND 1 /* independent of disk geometry */]#define HM2$C_RE$0$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;38"opQ_DELTA_FIXED_CONTIG 2 /* fixed so index file will be contig (for Dollar) */O#define HM2$C_GEOM_INDEPEND_DELTA 1033 /* actual geometry independent delta */N/* this is a prime > 1000 */S#define HM2$C_FIXED_CONTIG_DELTA 1 /* fixed delta for contiguous index file */[#define HM2$C_LIMITED_SEARCH_LENGTH 10 /* number of blocks to check in a limited search */ $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Define d whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __HM2DEF_LOADED */ ww;F RANCE FH2DEFFI2DEFFI5DEFFM2DEFHM2DEF.x RANCE SCBDEF RANCE SCBDEFsHw/**/P/******************************************************************************/P/** **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/** t **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. **/P/*u* **/P/** The information in this software is subject to change without notice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P/** software onv equipment which is not supplied by DIGITAL. **/P/** **/P/******************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//*******w*************************************************************************************************************************//*** MODULE $SCBDEF ***/#ifndef __SCBDEF_LOADED#define __SCBDEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previously-defined rexquired ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union union#else#dyefine __union variant_union#endif#endif N/*+ */N/* */N/* Format of storage control block, Files-11 Structure Level 2 */N/* */N/*- */ N#define SCB$C_LEVEL2 512 /* 1000 octazl = structure level 2 */N#define SCB$C_LEVEL5 1280 /* 2400 octal = structure level 5 */N#define SCB$C_LEVEL6 1536 /* 3000 octal = structure level 6 */#define SCB$M_MAPDIRTY 0x1#define SCB$M_MAPALLOC 0x2#define SCB$M_FILALLOC 0x4#define SCB$M_QUODIRTY 0x8#define SCB$M_HDRWRITE 0x10#define SCB$M_CORRUPT 0x20#define SCB$M_MAPDIRTY2 0x1#define SCB$M_MAPALLOC2 0x2#define SCB$M_FILALLOC2 0x4#define SCB$M_QUODIRTY2 0x8#define SCB$M_HDRWRITE2 0x10{#define SCB$M_CORRUPT2 0x20#define SCB$M_NORMAL 0x1#define SCB$M_NEW 0x2#define SCB$M_COPYING 0x20#define SCB$M_MERGING 0x40#define SCB$M_MINIMRG 0x80#define SCB$M_COPY_RESET 0x100#define SCB$M_BOOTING 0x200#define SCB$M_SCB_WLG 0x400#define SCB$M_MUST_MRG 0x4000#define SCB$M_FAILED 0x8000#define SCB$M_CPY_RESET 0x100#define SCB$M_WLG 0x400#define SCB$M_MBR_FCPY 0x1#define SCB$M_MBR_MERGE 0x2#define SCB$M_MBR_CIP 0x4#define SCB$M_MBR_SRC 0x20#define SCB$M_|MBR_MFCPY 0x40#define SCB$M_MBR_VALID 0x80#define SCB$M_INIT_NO_ERASE 0x1#define SCB$M_DVE_ENABLED 0x2N#define SCB$K_LENGTH 512 /*Length of Structure */N#define SCB$C_LENGTH 512 /*Length of Structure */ typedef struct _scbdef { __union {N unsigned short int scb$w_struclev; /* file structure level */ __struct {N unsigned char scb$b_strucver; /* file structure version */O } unsigned char scb$b_struclev; /* principal file structure level */$ } scb$r_struclev_fields;! } scb$r_struclev_overlay;N unsigned short int scb$w_cluster; /* storage map cluster factor */N unsigned int scb$l_volsize; /* volume size in logical blocks */Z unsigned int scb$l_blksize; /* number of physical blocks per logical block */N unsigned int scb$l_sectors; /* number of sectors per track */N unsigned int scb$l_t~racks; /* number of tracks per cylinder */N unsigned int scb$l_cylinder; /* number of cylinders */ __union {N unsigned int scb$l_status; /* volume status flags */ __struct {X unsigned scb$v_mapdirty : 1; /* storage map is dirty (partially updated) */Y unsigned scb$v_mapalloc : 1; /* storage map is preallocated (lost blocks) */a unsigned scb$v_filalloc : 1; /* file numbers are preallocated (lost header slots) */W unsigned scb$v_quodirty : 1; /* quota file is dirty (partially updated) */R unsigned scb$v_hdrwrite : 1; /* file headers are write back cached */N unsigned scb$v_corrupt : 1; /* file structure is corrupt */' unsigned scb$v_fill_9_ : 2; } scb$r_status_bits; } scb$r_status_overlay; __union {Z unsigned int scb$l_status2; /* backup status - bits must match those above */ __struct {Y unsigned scb$v_mapdirty2 : 1; /* storage map is dirty (partially updated) */Z unsigned scb$v_mapalloc2 : 1; /* storage map is preallocated (lost blocks) */b unsigned scb$v_filalloc2 : 1; /* file numbers are preallocated (lost header slots) */X unsigned scb$v_quodirty2 : 1; /* quota file is dirty (partially updated) */S unsigned scb$v_hdrwrite2 : 1; /* file headers are write back cached */N unsigned scb$v_c%$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3v"orrupt2 : 1; /* file structure is corrupt */( unsigned scb$v_fill_10_ : 2;! } scb$r_status2_bits; } scb$r_status2_overlay;N unsigned short int scb$w_writecnt; /* count of write access mounters. */` char scb$t_volockname [12]; /* name used for file system serialization on volume. */N unsigned __int64 scb$q_mounttime; /* time of last initial mount. */N unsigned short int scb$w_backrev; /* BACKUP revision number. */N unsigned __int64 scb$q_genernum; /* shadow set revision number. */N unsigned __int64 scb$q_unit_id; /* Virtual Unit specifier */ __union {N unsigned short int scb$w_shadow_status; /* Volume status: */N unsigned short int scb$w_status; /* Duplicate pointer to status */ __struct {N unsigned scb$v_normal : 1; /* Shadow set populated and online */N unsigned scb$v_new : 1; /* Newly created, no members yet */N unsigned scb$v_filler_sts_1 : 3; /* */N unsigned scb$v_copying : 1; /* Copy State */N unsigned scb$v_merging : 1; /* Merge State */N unsigned scb$v_minimrg : 1; /* Mini Merge in progress */N unsigned scb$v_copy_reset : 1; /* Reset Shadow Server Copy mode */U unsigned scb$v_booting : 1; /* System Disk shadow set in booting state */N unsigned scb$v_scb_wlg : 1; /* Write Logging Phase 1 enabled */N unsigned scb$v_filler_sts_2 : 3; /* Reserved */N unsigned scb$v_must_mrg : 1; /* This set requires a full merge */N unsigned scb$v_failed : 1; /* Shadow set not populated */' } scb$r_shadow_status_bits; __struct {+ unsigned scb$v_filler_rfb1 : 8;N unsigned scb$v_cpy_reset : 1; /* Copy mode is reset */+ unsigned scb$v_filler_rfb2 : 1;N unsigned scb$v_wlg : 1; /* Write logging */+ unsigned scb$v_filler_rfb3 : 5;$ } scb$r_status_bits_ing;& } scb$r_shadow_status_overlay; __union {N unsigned char scb$b_member_status; /* Member status bytes */ __struct {N unsigned scb$v_mbr_fcpy : 1; /* Member involved in copy */N unsigned scb$v_mbr_merge : 1; /* Member requires a merge */U unsigned scb$v_mbr_cip : 1; /* Copy (or merge) in progress on this SSM */N unsigned scb$v_spare_mbr_status3 : 1; /* Reserved */N unsigned scb$v_spare_mbr_status4 : 1; /* Reserved */S unsigned scb$v_mbr_src : 1; /* Member can be used as a source member */N unsigned scb$v_mbr_mfcpy : 1; /* Minimum copy target member */O unsigned scb$v_mbr_valid : 1; /* SSM status information is valid */' } scb$r_member_status_bits;* } scb$r_member_status_overlay [3];N char scb$b_filler_jja [1]; /* Reserved for alignment */R unsigned short int scb$w_scb_mbz; /* Historically cleared by UPDATE_DISKS */N unsigned __int64 scb$q_member_ids [3]; /* Unit ID for member */N unsigned int scb$l_scb_lbn; /* Unit Control Block for VU */N unsigned char scb$b_devices; /* Number of devices in SS */N unsigned char scb$b_members; /* Number of source members */N unsigned char scb$b_mast_indx; /* Array index to Master SSM */N unsigned char scb$b_mrg_targets; /* Active Merge Targets */N unsigned char scb$b_fc_targets; /* Active Copy Targets */N unsigned char scb$b_decram_mbrs; /* Number of DECram devices */N char scb$b_filler_jja1 [10]; /* Reserved for alignment */k unsigned __int64 scb$q_mbz_v731_placeholder; /* WHL_FILE_START quadword unsigned; was the old name */N/* N.B. The low longword of this cell MUST remain */I/* defined to prevent latent (HSG80MM) support */I/* that shipped in MOUNT96 for V73-1 from making */I/* the wrong decision */c unsigned __int64 scb$q_hbvs_write_count; /* Count of systems that have set enabled for write */N unsigned int scb$l_valblk_offset; /* Offset for MOS VALBLK */X char scb$b_shadow_reserved [72]; /* reserved for expansion to 10 units per set */N char scb$b_reserved [292]; /* reserved */ __union {N unsigned short int scb$w_shadowing_status; /* Volume status: */ __struct {Z unsigned scb$v_init_no_erase : 1; /* Shadow set created without INIT /ERASE */N unsigned scb$v_dve_enabled : 1; /* Volume is DVE capable */N unsigned scb$v_filler_shadowing : 14; /* Reserved */* } scb$r_shadowing_status_bits;) } scb$r_shadowing_status_overlay;N unsigned short int scb$w_checksum; /* block checksum */ } SCBDEF; #if !defined(__VAXC)<#define scb$w_struclev scb$r_struclev_overlay.scb$w_struclevR#define scb$b_strucver scb$r_struclev_overlay.scb$r_struclev_fields.scb$b_strucverR#define scb$b_struclev scb$r_struclev_overlay.scb$r_struclev_fields.scb$b_struclev6#define scb$l_status scb$r_status_overlay.scb$l_statusL#define scb$v_mapdirty scb$r_status_overlay.scb$r_status_bits.scb$v_mapdirtyL#define scb$v_mapalloc scb$r_status_overlay.scb$r_status_bits.scb$v_mapallocL#define scb$v_filalloc scb$r_status_overlay.scb$r_status_bits.scb$v_filallocL#define scb$v_quodirty scb$r_status_overlay.scb$r_status_bits.scb$v_quodirtyL#define scb$v_hdrwrite scb$r_status_overlay.scb$r_status_bits.scb$v_hdrwriteJ#define scb$v_corrupt scb$r_status_overlay.scb$r_status_bits.scb$v_corrupt9#define scb$l_status2 scb$r_status2_overlay.scb$l_status2P#define scb$v_mapdirty2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_mapdirty2P#define scb$v_mapalloc2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_mapalloc2P#define scb$v_filalloc2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_filalloc2P#define scb$v_quodirty2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_quodirty2P#define scb$v_hdrwrite2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_hdrwrite2N#define scb$v_corrupt2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_corrupt2K#define scb$w_shadow_status scb$r_shadow_status_overlay.scb$w_shadow_status=#define scb$w_status scb$r_shadow_status_overlay.scb$w_statusV#define scb$v_normal scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_normalP#define scb$v_new scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_newX#define scb$v_copying scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_copyingX#define scb$v_merging scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_mergingX#define scb$v_minimrg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_minimrg^#define scb$v_copy_reset scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_copy_resetX#define scb$v_booting scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_bootingX#define scb$v_scb_wlg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_scb_wlgZ#define scb$v_must_mrg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_must_mrgV#define scb$v_failed scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_failedY#define scb$v_cpy_reset scb$r_shadow_status_overlay.scb$r_status_bits_ing.scb$v_cpy_resetM#define scb$v_wlg scb$r_shadow_status_overlay.scb$r_status_bits_ing.scb$v_wlg/#define scb$b_member_status scb$b_member_status>#define scb$v_mbr_fcpy scb$r_member_status_bits.scb$v_mbr_fcpy@#define scb$v_mbr_merge scb$r_member_status_bits.scb$v_mbr_merge<#define scb$v_mbr_cip scb$r_member_status_bits.scb$v_mbr_cip<#define scb$v_mbr_src scb$r_member_status_bits.scb$v_mbr_src@#define scb$v_mbr_mfcpy scb$r_member_status_bits.scb$v_mbr_mfcpy@#define scb$v_mbr_valid scb$r_member_status_bits.scb$v_mbr_validT#define scb$w_shadowing_status scb$r_shadowing_status_overlay.scb$w_shadowing_statusj#define scb$v_init_no_erase scb$r_shadowing_status_overlay.scb$r_shadowing_status_bits.scb$v_init_no_erasef#define scb$v_dve_enabled scb$r_shadowing_status_overlay.scb$r_shadowing_status_bits.scb$v_dve_ena&n$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3K"bled"#endif /* #if !defined(__VAXC) */   $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __SCBDEF_LOADED */ wwy/**/P/******************************************************************************/P/** **/P/** Copyright (c) 2003 **/P/** by DIGITAL Equipment Corporation, Maynard, Mass. **/P/** All rights reserved. **/P/**  **/P/** This software is furnished under a license and may be used and copied **/P/** only in accordance with the terms of such license and with the **/P/** inclusion of the above copyright notice. This software or any other **/P/** copies thereof may not be provided or otherwise made available to any **/P/** other person. No title to and ownership of the software is hereby **/P/** transferred. **/P/** **/P/** The information in this software is subject to change without notice **/P/** and should not be construed as a commitment by DIGITAL Equipment **/P/** Corporation. **/P/** **/P/** DIGITAL assumes no responsibility for the use or reliability of its **/P/** software on equipment which is not supplied by DIGITAL. **/P/** **/P/******************************************************************************//********************************************************************************************************************************/=/* Created: 1-OCT-2003 20:36:08 by OpenVMS SDL EV1-66 */F/* Source: 30-JUN-2003 15:52:30 $1$DGA1014:[LIB_H.SRC]F11DEF.SDL;1 *//******* *************************************************************************************************************************//*** MODULE $SCBDEF ***/#ifndef __SCBDEF_LOADED#define __SCBDEF_LOADED 1 G#pragma __nostandard /* This file uses non-ANSI-Standard features */!#pragma __member_alignment __save#pragma __nomember_alignmentR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */\#pragma __required_pointer_size __save /* Save the previously-defined required ptr size */[#pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */#endif #ifdef __cplusplus extern "C" {#define __unknown_params ...#define __optional_params ...#else#define __unknown_params#define __optional_params ...#endif #ifndef __struct#if !defined(__VAXC)#define __struct struct#else#define __struct variant_struct#endif#endif #ifndef __union#if !defined(__VAXC)#define __union union#else#d efine __union variant_union#endif#endif N/*+ */N/* */N/* Format of storage control block, Files-11 Structure Level 2 */N/* */N/*- */ N#define SCB$C_LEVEL2 512 /* 1000 octal = structure level 2 */N#define SCB$C_LEVEL5 1280 /* 2400 octal = structure level 5 */N#define SCB$C_LEVEL6 1536 /* 3000 octal = structure level 6 */#define SCB$M_MAPDIRTY 0x1#define SCB$M_MAPALLOC 0x2#define SCB$M_FILALLOC 0x4#define SCB$M_QUODIRTY 0x8#define SCB$M_HDRWRITE 0x10#define SCB$M_CORRUPT 0x20#define SCB$M_MAPDIRTY2 0x1#define SCB$M_MAPALLOC2 0x2#define SCB$M_FILALLOC2 0x4#define SCB$M_QUODIRTY2 0x8#define SCB$M_HDRWRITE2 0x10#define SCB$M_CORRUPT2 0x20#define SCB$M_NORMAL 0x1#define SCB$M_NEW 0x2#define SCB$M_COPYING 0x20#define SCB$M_MERGING 0x40#define SCB$M_MINIMRG 0x80#define SCB$M_COPY_RESET 0x100#define SCB$M_BOOTING 0x200#define SCB$M_SCB_WLG 0x400#define SCB$M_MUST_MRG 0x4000#define SCB$M_FAILED 0x8000#define SCB$M_CPY_RESET 0x100#define SCB$M_WLG 0x400#define SCB$M_MBR_FCPY 0x1#define SCB$M_MBR_MERGE 0x2#define SCB$M_MBR_CIP 0x4#define SCB$M_MBR_SRC 0x20#define SCB$M_ MBR_MFCPY 0x40#define SCB$M_MBR_VALID 0x80#define SCB$M_INIT_NO_ERASE 0x1#define SCB$M_DVE_ENABLED 0x2N#define SCB$K_LENGTH 512 /*Length of Structure */N#define SCB$C_LENGTH 512 /*Length of Structure */ typedef struct _scbdef { __union {N unsigned short int scb$w_struclev; /* file structure level */ __struct {N unsigned char scb$b_strucver; /* file structure version */O  unsigned char scb$b_struclev; /* principal file structure level */$ } scb$r_struclev_fields;! } scb$r_struclev_overlay;N unsigned short int scb$w_cluster; /* storage map cluster factor */N unsigned int scb$l_volsize; /* volume size in logical blocks */Z unsigned int scb$l_blksize; /* number of physical blocks per logical block */N unsigned int scb$l_sectors; /* number of sectors per track */N unsigned int scb$l_tracks; /* number of tracks per cylinder */N unsigned int scb$l_cylinder; /* number of cylinders */ __union {N unsigned int scb$l_status; /* volume status flags */ __struct {X unsigned scb$v_mapdirty : 1; /* storage map is dirty (partially updated) */Y unsigned scb$v_mapalloc : 1; /* storage map is preallocated (lost blocks) */a unsigned scb$v_filalloc : 1; /* file numbers are prealloca ted (lost header slots) */W unsigned scb$v_quodirty : 1; /* quota file is dirty (partially updated) */R unsigned scb$v_hdrwrite : 1; /* file headers are write back cached */N unsigned scb$v_corrupt : 1; /* file structure is corrupt */' unsigned scb$v_fill_9_ : 2; } scb$r_status_bits; } scb$r_status_overlay; __union {Z unsigned int scb$l_status2; /* backup status - bits must match those above */  __struct {Y unsigned scb$v_mapdirty2 : 1; /* storage map is dirty (partially updated) */Z unsigned scb$v_mapalloc2 : 1; /* storage map is preallocated (lost blocks) */b unsigned scb$v_filalloc2 : 1; /* file numbers are preallocated (lost header slots) */X unsigned scb$v_quodirty2 : 1; /* quota file is dirty (partially updated) */S unsigned scb$v_hdrwrite2 : 1; /* file headers are write back cached */N unsigned scb$v_c orrupt2 : 1; /* file structure is corrupt */( unsigned scb$v_fill_10_ : 2;! } scb$r_status2_bits; } scb$r_status2_overlay;N unsigned short int scb$w_writecnt; /* count of write access mounters. */` char scb$t_volockname [12]; /* name used for file system serialization on volume. */N unsigned long scb$q_mounttime[2]; /* time of last initial mount. */N unsigned short int scb$w_backrev; /* BACKUP revision number. */N unsigned long scb$q_genernum[2]; /* shadow set revision number. */N unsigned long scb$q_unit_id[2]; /* Virtual Unit specifier */ __union {N unsigned short int scb$w_shadow_status; /* Volume status: */N unsigned short int scb$w_status; /* Duplicate pointer to status */ __struct {N unsigned scb$v_normal : 1; /* Shadow set populated and online */N unsigned scb$v_new : 1; /* Newly created, no members yet'CA$DISKBLOCK061.ELh*.[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK.TLB;3O  */N unsigned scb$v_filler_sts_1 : 3; /* */N unsigned scb$v_copying : 1; /* Copy State */N unsigned scb$v_merging : 1; /* Merge State */N unsigned scb$v_minimrg : 1; /* Mini Merge in progress */N unsigned scb$v_copy_reset : 1; /* Reset Shadow Server Copy mode */U unsigned scb$v_booting : 1; /* System Disk shadow set in booting state */N unsigned scb$v_scb_wlg : 1; /* Write Logging Phase 1 enabled */N unsigned scb$v_filler_sts_2 : 3; /* Reserved */N unsigned scb$v_must_mrg : 1; /* This set requires a full merge */N unsigned scb$v_failed : 1; /* Shadow set not populated */' } scb$r_shadow_status_bits; __struct {+ unsigned scb$v_filler_rfb1 : 8;N unsigned scb$v_cpy_reset : 1; /* Copy mode is reset */+ unsigned scb$v_filler_rfb2 : 1;N unsigned scb$v_wlg : 1; /* Write logging */+ unsigned scb$v_filler_rfb3 : 5;$ } scb$r_status_bits_ing;& } scb$r_shadow_status_overlay; __union {N unsigned char scb$b_member_status; /* Member status bytes */ __struct {N unsigned scb$v_mbr_fcpy : 1; /* Member involved in copy */N unsigned scb$v_mbr_merge : 1; /* Member requires a merge */U unsigned scb$v_mbr_cip : 1; /* Copy (or merge) in progress on this SSM */N unsigned scb$v_spare_mbr_status3 : 1; /* Reserved */N unsigned scb$v_spare_mbr_status4 : 1; /* Reserved */S unsigned scb$v_mbr_src : 1; /* Member can be used as a source member */N unsigned scb$v_mbr_mfcpy : 1; /* Minimum copy target member */O unsigned scb$v_mbr_valid : 1; /* SSM status information is valid */' } scb$r_member_status_bits;* } scb$r_member_status_overlay [3];N char scb$b_filler_jja [1]; /* Reserved for alignment */R unsigned short int scb$w_scb_mbz; /* Historically cleared by UPDATE_DISKS */K unsigned long scb$q_member_ids [6]; /* Unit ID for member */N unsigned int scb$l_scb_lbn; /* Unit Control Block for VU */N unsigned char scb$b_devices; /* Number of devices in SS */N unsigned char scb$b_members; /* Number of source members */N unsigned char scb$b_mast_indx; /* Array index to Master SSM */N unsigned char scb$b_mrg_targets; /* Active Merge Targets */N unsigned char scb$b_fc_targets; /* Active Copy Targets */N unsigned char scb$b_decram_mbrs; /* Number of DECram devices */N char scb$b_filler_jja1 [10]; /* Reserved for alignment */k unsigned long scb$q_mbz_v731_placeholder[2]; /* WHL_FILE_START quadword unsigned; was the old name */N/* N.B. The low longword of this cell MUST remain */I/* defined to prevent latent (HSG80MM) support */I/* that shipped in MOUNT96 for V73-1 from making */I/* the wrong decision */c unsigned long scb$q_hbvs_write_count[2]; /* Count of systems that have set enabled for write */N unsigned int scb$l_valblk_offset; /* Offset for MOS VALBLK */X char scb$b_shadow_reserved [72]; /* reserved for expansion to 10 units per set */N char scb$b_reserved [292]; /* reserved */ __union {N unsigned short int scb$w_shadowing_status; /* Volume status: */ __struct {Z unsigned scb$v_init_no_erase : 1; /* Shadow set created without INIT /ERASE */N unsigned scb$v_dve_enabled : 1; /* Volume is DVE capable */N unsigned scb$v_filler_shadowing : 14; /* Reserved */* } scb$r_shadowing_status_bits;) } scb$r_shadowing_status_overlay;N unsigned short int scb$w_checksum; /* block checksum */ } SCBDEF; #if !defined(__VAXC)<#define scb$w_struclev scb$r_struclev_overlay.scb$w_struclevR#define scb$b_strucver scb$r_struclev_overlay.scb$r_struclev_fields.scb$b_strucverR#define scb$b_struclev scb$r_struclev_overlay.scb$r_struclev_fields.scb$b_struclev6#define scb$l_status scb$r_status_overlay.scb$l_statusL#define scb$v_mapdirty scb$r_status_overlay.scb$r_status_bits.scb$v_mapdirtyL#define scb$v_mapalloc scb$r_status_overlay.scb$r_status_bits.scb$v_mapallocL#define scb$v_filalloc scb$r_status_overlay.scb$r_status_bits.scb$v_filallocL#define scb$v_quodirty scb$r_status_overlay.scb$r_status_bits.scb$v_quodirtyL#define scb$v_hdrwrite scb$r_status_overlay.scb$r_status_bits.scb$v_hdrwriteJ#define scb$v_corrupt scb$r_status_overlay.scb$r_status_bits.scb$v_corrupt9#define scb$l_status2 scb$r_status2_overlay.scb$l_status2P#define scb$v_mapdirty2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_mapdirty2P#define scb$v_mapalloc2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_mapalloc2P#define scb$v_filalloc2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_filalloc2P#define scb$v_quodirty2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_quodirty2P#define scb$v_hdrwrite2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_hdrwrite2N#define scb$v_corrupt2 scb$r_status2_overlay.scb$r_status2_bits.scb$v_corrupt2K#define scb$w_shadow_status scb$r_shadow_status_overlay.scb$w_shadow_status=#define scb$w_status scb$r_shadow_status_overlay.scb$w_statusV#define scb$v_normal scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_normalP#define scb$v_new scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_newX#define scb$v_copying scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_copyingX#define scb$v_merging scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_mergingX#define scb$v_minimrg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_minimrg^#define scb$v_copy_reset scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_copy_resetX#define scb$v_booting scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_bootingX#define scb$v_scb_wlg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_scb_wlgZ#define scb$v_must_mrg scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_must_mrgV#define scb$v_failed scb$r_shadow_status_overlay.scb$r_shadow_status_bits.scb$v_failedY#define scb$v_cpy_reset scb$r_shadow_status_overlay.scb$r_status_bits_ing.scb$v_cpy_resetM#define scb$v_wlg scb$r_shadow_status_overlay.scb$r_status_bits_ing.scb$v_wlg/#define scb$b_member_status scb$b_member_status>#define scb$v_mbr_fcpy scb$r_member_status_bits.scb$v_mbr_fcpy@#define scb$v_mbr_merge scb$r_member_status_bits.scb$v_mbr_merge<#define scb$v_mbr_cip scb$r_member_status_bits.scb$v_mbr_cip<#define scb$v_mbr_src scb$r_member_status_bits.scb$v_mbr_src@#define scb$v_mbr_mfcpy scb$r_member_status_bits.scb$v_mbr_mfcpy@#define scb$v_mbr_valid scb$r_member_status_bits.scb$v_mbr_validT#define scb$w_shadowing_status scb$r_shadowing_status_overlay.scb$w_shadowing_statusj#define scb$v_init_no_erase scb$r_shadowing_status_overlay.scb$r_shadowing_status_bits.scb$v_init_no_erasef#define scb$v_dve_enabled scb$r_shadowing_status_overlay.scb$r_shadowing_status_bits.scb$v_dve_enabled"#endif /* #if !defined(__VAXC) */   $#pragma __member_alignment __restoreR#ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */b#pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */#endif#ifdef __cplusplus }#endif#pragma __standard #endif /* __SCBDEF_LOADED */ ww6*[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK_NO_MMS.COM;31+,\./ 4V{-h*0123KPWO 56[7889G HJ(K [$DISKBLOCK061.E\h*6[RANCE.DISKBLOCK.KIT061.SOURCE]DISKBLOCK_NO_MMS.COM;31VK$! $ if "''P3'" .NES. "OK" $ Then $ write sys$output "Do not run this directly, it must be called from DISKBLOCK.COM" $ Exit $ EndIf $! $ docc = "CC" + ccquals $ dolink = "LINK" + linkquals $! $! $ write sys$output "docc = ''docc'" $! $ if (P1 .eqs. "LINK") .or. (P2 .eqs. "LINK") then goto linkit $! $ write sys$output "Compiling checksum.c" $docc diskblock_dir:checksum'extra_library' /object=diskblock_dir: $ write sys$output "Compiling commands.obj" $ SET COMMAND /OBJECT=DISKBLOCK_DIR:COMMANDS.OBJ DISKBLOCK_DIR:COMMANDS.CLD $ write sys$output "Compiling common_data.c" $docc diskblock_dir:common_data'extra_library' /object=diskblock_dir: $ write sys$output "Compiling copy_file.c" $docc diskblock_dir:copy_file'extra_library' /object=diskblock_dir: $ write sys$output "Compiling directory.c" $docc diskblock_dir:directory'extra_library' /object=diskblock_dir: $ write sys$output "Compiling diskblock.c" $docc diskblock_dir:diskblock'extra_library' /object=diskblock_dir: $ write sys$output "Compiling dump.c" $docc diskblock_dir:dump'extra_library' /object=diskblock_dir: $ write sys$output "Compiling examine_deposit.c" $docc diskblock_dir:examine_deposit'extra_library' /object=diskblock_dir: $ write sys$output "Compiling handler.c" $docc diskblock_dir:handler'extra_library' /object=diskblock_dir: $ write sys$output "Compiling help.c" $docc diskblock_dir:help'extra_library' /object=diskblock_dir: $ write sys$output "Compiling instructions.c" $docc diskblock_dir:instructions'extra_library' /object=diskblock_dir: $ write sys$output "Compiling io.c" $docc diskblock_dir:io'extra_library' /object=diskblock_dir: $ write sys$output "Compiling messages.c" $message diskblock_dir:messages /object=diskblock_dir: $ write sys$output "Compiling read_write.c" $docc diskblock_dir:read_write'extra_library' /object=diskblock_dir: $ write sys$output "Compiling save_restore.c" $docc diskblock_dir:save_restore'extra_library' /object=diskblock_dir: $ write sys$output "Compiling search.c" $docc diskblock_dir:search'extra_library' /object=diskblock_dir: $ write sys$output "Compiling select_deselect.c" $docc diskblock_dir:select_deselect'extra_library' /object=diskblock_dir: $ write sys$output "Compiling set_show.c" $docc diskblock_dir:set_show'extra_library' /object=diskblock_dir: $ write sys$output "Compiling spawn_attach.c" $docc diskblock_dir:spawn_attach'extra_library' /object=diskblock_dir: $ write sys$output "Compiling test.c" $docc diskblock_dir:test'extra_library' /object=diskblock_dir: $linkit: $ write sys$output "Linking diskblock" $dolink diskblock_dir:checksum.obj, - diskblock_dir:common_data.obj, diskblock_dir:commands.obj, - diskblock_dir:copy_file.obj, diskblock_dir:directory.obj, - diskblock_dir:diskblock.obj, diskblock_dir:dump.obj, - diskblock_dir:examine_deposit.obj, diskblock_dir:handler.obj,- diskblock_dir:help.obj, diskblock_dir:instructions.obj, - diskblock_dir:io.obj, diskblock_dir:messages.obj, - diskblock_dir:read_write.obj, diskblock_dir:save_restore.obj,- diskblock_dir:search.obj, diskblock_dir:select_deselect.obj, - diskblock_dir:set_show.obj, diskblock_dir:spawn_attach.obj, - diskblock_dir:test.obj, - diskblock_dir:version.opt/opt /exec=diskblock_dir:diskblock.exe $ write sys$output "Creating help library" $ If "''F$Search("DISKBLOCK_DIR:DISKBLOCK.HLB")'" .EQS. "" Then - LIBRARY/Create/Help DISKBLOCK_DIR:DISKBLOCK.HLB $ LIBRARY/REPLACE DISKBLOCK_DIR:DISKBLOCK.HLB DISKBLOCK_DIR:DISKBLOCK.HLP $purge /keep=2 diskblock_dir: $Write sys$output "Finished at ''f$time()'" )*[RANCE.DISKBLOCK.KIT061.SOURCE]DUMP.C;116+, .P/ 4XPK-h*0123KPWOQ5679$89G HJ#include "diskblock.h"void dump_buffer(void){) const $DESCRIPTOR(octal_qual,"OCTAL");) const $DESCRIPTOR(ascii_qual,"ASCII");+ const $DESCRIPTOR(header_qual,"HEADER");% const $DESCRIPTOR(dcl_qual,"DCL");' const $DESCRIPTOR(file_qual,"FILE");7 const $DESCRIPTOR(instructions_qual,"INSTRUCTIONS");% const $DESCRIPTOR(scb_qual,"SCB");' const $DESCRIPTOR(home_qual,"HOME");) const $DESCRIPTOR(block_qual,"BLOCK");% const $DESCRIPTOR(fid_qual,"FID"); I char *dump_buffer; /* pointer to main r/w buffer OR temp buffer */ unsigned int status,status1;& status = cli$present(&block_qual);$ status1 = cli$present(&fid_qual);C if ($VMS_STATUS_SUCCESS(status) || $VMS_STATUS_SUCCESS(status1)) { char temp_buffer[512];- status=read_or_write(temp_buffer,0,0);0 if (!$VMS_STATUS_SUCCESS(status)) return;! dump_buffer = temp_buffer; } else {I extern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */& dump_buffer = (char *)rw_buff; }% status = cli$present(&ascii_qual);# if ($VMS_STATUS_SUCCESS(status)) { dump_ascii(dump_buffer); return; }' status = cli$present(&header_qual);% status1 = cli$present(&file_qual);D if ($VMS_STATUS_SUCCESS(status) || $VMS_STATUS_SUCCESS(status1)) {- dump_DCL_header((FH2 *)dump_buffer, 1); return; }$ status = cli$present(&dcl_qual);# if ($VMS_STATUS_SUCCESS(status)) {- dump_DCL_header((FH2 *)dump_buffer, 0); return; }, status = cli$present(&instructions_qual);# if ($VMS_STATUS_SUCCESS(status)) {% dump_instructions(dump_buffer); return; } # status = cli$present(&scb_qual);# if ($VMS_STATUS_SUCCESS(status)) { dump_scb(dump_buffer); return; }$ status = cli$present(&home_qual);# if ($VMS_STATUS_SUCCESS(status)) { dump_home(dump_buffer); return; }$ status = cli$present(&octal_qual);" if ($VMS_STATUS_SUCCESS(status)) {3 dump_numbers((unsigned char *)dump_buffer,2); return; }/ dump_numbers((unsigned char *)dump_buffer,4); return;}8void dump_numbers(unsigned char *buffer,short data_size){P short i,j,k; /* Loop variables */P unsigned long data[8], /* Integer data to output */P status; /* VMS status return */P char line[132]; /* Text to be output */J sprintf(line,"\n"); /* Leave a blank line */= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;P for (i=0; i < 512; i += (8*data_size)) /* Once per line of output */ {P for (j=0 ; j <=7 ; j++) /* Once for each of 8 words of longwords */ {P data[j] = 0; /* Initialise the item with a 0 */P for (k=0 ; k<=(data_size-1) ; k++) /* Once for each byte */ {O data[j] += buffer[i + (j*data_size) + k] << (k*8); /* Copy byte */ } } if (data_size == 2) sprintf(line,? "%06o %06o %06o %06o %06o %06o %06o %06o %04o\n",8 data[7], data[6], data[5], data[4], data[3],* data[2], data[1], data[0], i); else sprintf(line,@ "%08X %08X %08X %08X %08X %08X %08X %08X %04X\n",8 data[7], data[6], data[5], data[4], data[3],* data[2], data[1], data[0], i);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }J sprintf(line,"\n"); /* Leave a blank line */= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;}$void dump_instructions(char *buffer){P short i,j,k; /* Loop variables */P unsigned long status; /* VMS status re)7$DISKBLOCK061.E h*)[RANCE.DISKBLOCK.KIT061.SOURCE]DUMP.C;116XP" turn */P char line[132]; /* Text to be output */% const $DESCRIPTOR(vax_qual,"VAX");) const $DESCRIPTOR(alpha_qual,"ALPHA");# status = cli$present(&vax_qual);# if ($VMS_STATUS_SUCCESS(status)) { lib$signal(&DSKB_NYI); return; }  J sprintf(line,"\n"); /* Leave a blank line */= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;J for (i=0; i < 512; i += 4) /* Once per instruction */ {> decode_inst((union ALPHA_INST *)&buffer[i], (char *)&line); addchar(line,'\n');& status = print_line((char *)&line);O if (!$VMS_STATUS_SUCCESS(status)) break; /* Check for error on output */O } /* Now go do another instruction */O sprintf(line,"\n"); /* Leave a blank line */ print_line((char *)&line);}void dump_ascii(char *buffer){N unsigned long status; /* VMS status return */I short i,j; /* Loop counters */O unsigned char next; /* Single character to test for printability */O char data_line[33]; /* Data for next line to print */O char line[132]; /* Data and address for next line to print */ data_line[32] = '\0'; for (i=0; i < 512; i +=32) { short j; for (j=0; j<=31; j++) {. next = buffer[i+j]; /* Clear bit 8 */ if ( isprint(next) ) data_line[j] = next; else data_line[j] = '.'; }3 sprintf(line,"%s %04X\n", data_line, i);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }}3void dump_DCL_header(FH2 *header, short HeaderFlag){</* HeaderFlag = 1 dump / header and dump /file */"/* 0 dump /DCL */8 const char filespec[] = "SYS$SCRATCH:DISKBLOCK.TMP";9 const char filespec1[] = "SYS$SCRATCH:DISKBLOCK.TMP1";1 const $DESCRIPTOR(file_desc,(char *)filespec); const $DESCRIPTOR(command1,O "DUMP /FILE SYS$SCRATCH:DISKBLOCK.TMP/OUTPUT=SYS$SCRATCH:DISKBLOCK.TMP1"); const $DESCRIPTOR(command2,S "DUMP /WIDTH=80 SYS$SCRATCH:DISKBLOCK.TMP/OUTPUT=SYS$SCRATCH:DISKBLOCK.TMP1");O unsigned long status; /* VMS status return */O struct FAB fab; /* File attributes block */O struct RAB rab; /* Record attributes block */ Q char line[1024]; /* Buffer for reading output file */ if ( HeaderFlag == 1 ) {> /* If this is a deleted file then use a FID of %XFFFF */H if ( (header->fh2$w_fid_num == 0) && (header->fh2$w_checksum==0) ) {( lib$signal(&DSKB_FID_FFFF);, header->fh2$w_fid_num = 0xFFFF;E checksum_buffer((unsigned char *)header,FALSE,510,TRUE); } $ status = check_header(header);' if (!$VMS_STATUS_SUCCESS(status)) {0 lib$signal(&DSKB_BADHEADER,0,status,0);Q /* Restore original invalid FID=0 and Checksum=0 if they were changed */- if (header->fh2$w_fid_num == 0xFFFF) {$ header->fh2$w_fid_num=0;% header->fh2$w_checksum=0; } return; } }" /* Initialise the FAB block */ fab = cc$rms_fab;X fab.fab$l_fna = (char *)filespec; /* File name */P fab.fab$b_fns = sizeof(filespec); /* # Bytes in file name */P fab.fab$b_fac = FAB$M_PUT | FAB$M_GET; /* Going to read/write this file */P fab.fab$l_fop = FAB$M_TEF | /* Truncate file on close */P FAB$M_SQO | /* Sequential operations only */P FAB$M_DLT; /* Delete file on closing */P fab.fab$b_org = FAB$C_SEQ; /* Sequential file */P fab.fab$b_rfm = FAB$C_FIX; /* Fixed size records */P fab.fab$b_shr = FAB$M_GET; /* Allow shared reads */M fab.fab$w_mrs = 512; /* Record size 512 bytes */$ ! /* Initialise the RAB block */ rab = cc$rms_rab;P rab.rab$l_fab = &fab; /* FAB address */P rab.rab$b_rac = RAB$C_SEQ; /* Sequential access */W rab.rab$l_rbf = (char *)header; /* Buffer address for PUTs */P rab.rab$w_rsz = 512; /* Record size for PUTs */P rab.rab$l_ubf = line; /* Buffer address for GETs */P rab.rab$w_usz = sizeof(line); /* Record size for GETs */! status = sys$create(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {> lib$signal(&DSKB_CREATERR,1,&file_desc,fab.fab$l_stv,0);N /* Restore original invalid FID=0 and Checksum=0 if they were changed */* if (header->fh2$w_fid_num == 0xFFFF) {! header->fh2$w_fid_num=0;" header->fh2$w_checksum=0; } return; } O /* The file has been successfully created so connect an RMS record stream */" status = sys$connect(&rab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0); else {8 /* Connect was successful, write out the buffer */! status = sys$put(&rab,0,0);' if (!$VMS_STATUS_SUCCESS(status))@ lib$signal(&DSKB_WRITERR,1,&file_desc,fab.fab$l_stv,0); else {& status = sys$flush(&rab,0,0);+ if (!$VMS_STATUS_SUCCESS(status)) C lib$signal(&DSKB_WRITERR,1,&file_desc,fab.fab$l_stv,0); else {; /* Buffer written OK, spawn the dump command */ if (HeaderFlag == 1)- status = lib$spawn(&command1); else- status = lib$spawn(&command2);- if (!$VMS_STATUS_SUCCESS(status))5 lib$signal(&DSKB_SPAWNERR,0,status,0); }  } }9 /* Close the file which will cause it to be deleted */ status = sys$close(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_CLOSERR,1,&file_desc,fab.fab$l_stv,0);D /* Now open the output file to put the lines out to the screen */M fab.fab$l_fna = (char *)filespec1; /* File name */M fab.fab$b_fns = sizeof(filespec1); /* # Bytes in file name */M fab.fab$b_fac = FAB$M_GET; /* Going to write this file */M fab.fab$b_rfm = FAB$C_VAR; /* Variable size records */ status = sys$open(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {= lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0);N /* Restore original invalid FID=0 and Checksum=0 if they were changed */* if (header->fh2$w_fid_num == 0xFFFF) {! header->fh2$w_fid_num=0;" header->fh2$w_checksum=0; } return; } N /* The file has been successfully opened so connect an RMS record stream */" status = sys$connect(&rab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0); else {/ /* Connect was successful, read a line */4 while (status = sys$get(&rab,0,0) != RMS$_EOF) {* if (!$VMS_STATUS_SUCCESS(status)) {C lib$signal(&DSKB_READERR,1,&file_desc,fab.fab$l_stv,0); status = RMS$_EOF; } else {9 /* Convert leading Form Feed to a new line */0 if (line[0] == '\f') line[0] = '\n';' line[rab.rab$w_rsz] = '\n';) line[rab.rab$w_rsz+1] = '\0';0 status = print_line((char *)&line); 4 if (!$VMS_STATUS_SUCCESS(status)) break; } }9 /* Close the file which will cause it to be deleted */ status = sys$close(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_CLOSERR,1,&file_desc,fab.fab$l_stv,0); }K /* Restore original invalid FID=0 and Checksum=0 if they were changed */' if (header->fh2$w_fid_num == 0xFFFF) { header->fh2$w_fid_num=0; header->fh2$w_checksum=0; }}void dump_scb(char *buffer){O unsigned int status; *$DISKBLOCK061.E h*)[RANCE.DISKBLOCK.KIT061.SOURCE]DUMP.C;116XPT" /* VMS status return */Q unsigned short word,i; /* Various uses... */O char line[132]; /* Text line to output */O int quad_zero[2] = {0,0}; /* For checking for time = 0 */O struct dsc$descriptor_s line_desc = /* For VMS system service returns */- {132, DSC$K_DTYPE_T, DSC$K_CLASS_S, line};I SCBDEF *scb; /* Pointer to RW buffer */" scb = (struct _scbdef *)buffer;> sprintf(line,"\n\n Storage Control Block\n\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;< sprintf(line,"Structure Level: %8d,%d\n", scb->scb$b_struclev, scb->scb$b_strucver);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"Cluster Size: %10d\n",  scb->scb$w_cluster);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Volume Size: %10d (%%X%08X)\n",3 scb->scb$l_volsize, scb->scb$l_volsize);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Blocking Factor: %10d\n", scb->scb$l_blksize);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Sectors per Track: %10d (%%X%08X)\n",3 scb->scb$l_sectors, scb->scb$l_sectors);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Tracks per Cylinder: %10d (%%X%08X)\n",1 scb->scb$l_tracks, scb->scb$l_tracks);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Number of Cylinders: %10d (%%X%08X)\n",5 scb->scb$l_cylinder, scb->scb$l_cylinder);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Status: %10d (%%X%08X)\n",1 scb->scb$l_status, scb->scb$l_status);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;# if (scb->scb$v_mapdirty == 1) {& sprintf(line," Map Dirty\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }# if (scb->scb$v_mapalloc == 1) {4 sprintf(line," Map Pre-Allocated\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }# if (scb->scb$v_filalloc == 1) {= sprintf(line," File Numbers Pre-Allocated\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } # if (scb->scb$v_quodirty == 1) {6 sprintf(line," Quota file is dirty\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }# if (scb->scb$v_hdrwrite == 1) {E sprintf(line," File Headers are write back cached\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }" if (scb->scb$v_corrupt == 1) {< sprintf(line," File structure is corrupt\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }E sprintf(line,"Status2: %10d (%%X%08X)\n",3 scb->scb$l_status2, scb->scb$l_status2);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;$ if (scb->scb$v_mapdirty2 == 1) {, sprintf(line," Map Dirty\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }$ if (scb->scb$v_mapalloc2 == 1) {4 sprintf(line," Map Pre-Allocated\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }$ if (scb->scb$v_filalloc2 == 1) {= sprintf(line," File Numbers Pre-Allocated\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } $ if (scb->scb$v_quodirty2 == 1) {6 sprintf(line," Quota file is dirty\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }$ if (scb->scb$v_hdrwrite2 == 1) {E sprintf(line," File Headers are write back cached\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }# if (scb->scb$v_corrupt2 == 1) {< sprintf(line," File structure is corrupt\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }; sprintf(line,"Write Count: %10d\n", scb->scb$w_writecnt);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;3 sprintf(line,"Volume Lock Name: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;F memcpy(&line,&scb->scb$t_volockname,sizeof(scb->scb$t_volockname));0 line[sizeof(scb->scb$t_volockname)] = '\n';0 line[sizeof(scb->scb$t_volockname)+1] = '\0';= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( sprintf(line,"Mount Time ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;2 if (!memcmp(&scb->scb$q_mounttime,quad_zero,8))0 sprintf(line," 0\n"); else {D status = sys$asctim(&word,&line_desc,&scb->scb$q_mounttime,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Backup Revision Number: %10d (%%X%04X)\n", 2 scb->scb$w_backrev,scb->scb$w_backrev);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( sprintf(line,"Generation Number: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;2 if (!memcmp(&scb->scb$q_mounttime,quad_zero,8))0 sprintf(line," 0\n"); else {C status = sys$asctim(&word,&line_desc,&scb->scb$q_genernum,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"\nVirtual Unit: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;< print_id(line,(struct unit_id *)&(scb->scb$q_unit_id),0);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Shadow Status: %10d (%%X%04X)\n",> scb->scb$w_shadow_status,scb->scb$w_shadow_status);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;! if (scb->scb$v_normal == 1) {B sprintf(line," Shadow set populated and online\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } if (scb->scb$v_new == 1) {@ sprintf(line," Newly created, no members yet\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }" if (scb->scb$v_copying == 1) {8 sprintf(line," Full copy in progress\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }" if (scb->scb$v_merging == 1) {9 sprintf(line," Merge copy in progress\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }" if (scb->scb$v_minimrg == 1) {9 sprintf(line," Mini-merge in progress\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }$ if (scb->scb$v_cpy_reset == 1) {5 sprintf(line," Copy mode is reset\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }" if (scb->scb$v_booting == 1) {> sprintf(line," Shadow set in booting state\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }! if (scb->scb$v_failed == 1) {; sprintf(line," Shadow set not populated\n");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } for (i = 0; i<=2; i++) {J sprintf(line,"Shadow Member %1d Status: %10d (%%X%02X)\n",G i, scb->scb$r_member_status_overlay[i].scb$b_member_status,H scb->scb$r_member_status_overlay[i].scb$b_member_status);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; E if (scb->scb$r_member_status_overlay[i].scb$v_mbr_fcpy == 1) {= sprintf(line," Member involved in copy\n");F if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; +bI1$DISKBLOCK061.E h*)[RANCE.DISKBLOCK.KIT061.SOURCE]DUMP.C;116XPv"+ }F if (scb->scb$r_member_status_overlay[i].scb$v_mbr_merge == 1) {9 sprintf(line," Member being merged\n");F if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } D if (scb->scb$r_member_status_overlay[i].scb$v_mbr_cip == 1) {A sprintf(line," Copy (or merge) in progress\n");F if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } D if (scb->scb$r_member_status_overlay[i].scb$v_mbr_src == 1) {C sprintf(line," Member can be used for source\n");F if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;6 } F if (scb->scb$r_member_status_overlay[i].scb$v_mbr_valid == 1) {A sprintf(line," Status information is valid\n");F if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } }6 sprintf(line,"Member IDs: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;B print_id(line,(struct unit_id *)&(scb->scb$q_member_ids[0]),1);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;6 sprintf(line," ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;B print_id(line,(struct unit_id *)&(scb->scb$q_member_ids[1]),1);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;6 sprintf(line," ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;B print_id(line,(struct unit_id *)&(scb->scb$q_member_ids[2]),1);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"SCB LBN: %10d (%%X%08X)\n",3 scb->scb$l_scb_lbn, scb->scb$l_scb_lbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Number of Devices: %10d\n", scb->scb$b_devices);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Number of Full Members: %10d\n", scb->scb$b_members);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Master Index: %10d\n",! scb->scb$b_mast_indx);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Number of Merge copy targets: %10d\n",# scb->scb$b_mrg_targets);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Number of Full Copy Targets: %10d\n"," scb->scb$b_fc_targets);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; sprintf(line,"Checksum: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;L if (status = checksum_buffer((unsigned char *)buffer, FALSE, 510, FALSE)). sprintf(line," (Valid) "); else. sprintf(line," (INVALID) ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;O sprintf(line,"%10d (%%X%04X)\n", scb->scb$w_checksum, scb->scb$w_checksum);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;}9void print_id(char *outbuf, struct unit_id *id, int flag){5 if ((id->alloclass == 0) && (id->devname1 == 0) && 3 (id->devname2 == 0) && (id->devname3 == 0)) # sprintf(outbuf,"\n"); else  {* if(flag) printf("$%d$",id->alloclass);G sprintf(outbuf,"%c%c%c%d:\n",id->devname1+'A'-1,id->devname2+'A'-1,# id->devname3+'A'-1,id->unit); }}void dump_home(char *buffer){O unsigned int status; /* VMS status return */O unsigned short word; /* Various uses... */O char line[132]; /* Text line to output */O int quad_zero[2] = {0,0}; /* For checking for time = 0 */O struct dsc$descriptor_s line_desc = /* For VMS system service returns */- {132, DSC$K_DTYPE_T, DSC$K_CLASS_S, line};E HM2 *hb; /* Pointer to RW buffer */ hb = (struct _hm2 *)buffer;6 sprintf(line,"\n\n Home Block\n\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Home LBN: %10d (%%X%08X)\n",1 hb->hm2$l_homelbn, hb->hm2$l_homelbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Alternate Home LBN: %10d (%%X%08X)\n",5 hb->hm2$l_alhomelbn, hb->hm2$l_alhomelbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Alternate Index File Header LBN: %10d (%%X%08X)\n",5 hb->hm2$l_altidxlbn, hb->hm2$l_altidxlbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;< sprintf(line,"Structure Level: %8d,%d\n", hb->hm2$b_struclev,  hb->hm2$b_strucver);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"Cluster Size: %10d\n",  hb->hm2$w_cluster);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Home VBN: %10d (%%X%08X)\n",1 hb->hm2$w_homevbn, hb->hm2$w_homevbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Alternate Home VBN: %10d (%%X%08X)\n",5 hb->hm2$w_alhomevbn, hb->hm2$w_alhomevbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Alternate Index File Header VBN: %10d (%%X%08X)\n",5 hb->hm2$w_altidxvbn, hb->hm2$w_altidxvbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Index File Bit Map VBN: %10d (%%X%08X)\n",3 hb->hm2$w_ibmapvbn, hb->hm2$w_ibmapvbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Index File Bit Map LBN: %10d (%%X%08X)\n",3 hb->hm2$l_ibmaplbn, hb->hm2$l_ibmaplbn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Maximum Number of Files: %10d (%%X%08X)\n",3 hb->hm2$l_maxfiles, hb->hm2$l_maxfiles);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Index File Bit Map Size: %10d (%%X%08X)\n",5 hb->hm2$w_ibmapsize, hb->hm2$w_ibmapsize);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;8 sprintf(line,"Device Type: %10d", hb->hm2$w_devtype);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;/ sprintf(line," (See $DTDEF for decode)\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Relative Volume Number: %10d\n", hb->hm2$w_rvn);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;: sprintf(line,"Volume Set Count: %10d\n", hb->hm2$w_setcount);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Volume Characteristics: %10d (%%X%08X)\n", hb->hm2$w_volchar, hb->hm2$w_volchar);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (hb->hm2$w_volchar != 0) { sprintf(line," ");@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;# if (hb->hm2$v_readcheck == 1) {$ sprintf(line," ReadCheck");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }# if (hb->hm2$v_writcheck == 1) {% sprintf(line," WriteCheck");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } if (hb->hm2$v_erase == 1) { sprintf(line," Erase");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }% if (hb->hm2$v_nohighwater == 1) {& sprintf(line," NoHighWater");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }$ if (hb->hm2$v_class_prot == 1) {$ sprintf(line," ClassProt");C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } sprintf(line,"\n");@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }B sprintf(line,"Volume Owner UIC: [%o,%o]\n",3 (hb->hm2$l_volo, $DISKBLOCK061.E h*)[RANCE.DISKBLOCK.KIT061.SOURCE]DUMP.C;116XPz <wner & 0xffff0000) >> 16,( hb->hm2$l_volowner & 0xffff);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Volume Security Mask: %10d (%%X%08X)\n",3 hb->hm2$l_sec_mask, hb->hm2$l_sec_mask);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;* sprintf(line,"Volume Protection: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( protect_text(line,hb->hm2$w_protect); addchar(line,'\n');= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;* sprintf(line,"File Protection: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;) protect_text(line,hb->hm2$w_fileprot); addchar(line,'\n');= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;* sprintf(line,"Record Protection: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( protect_text(line,hb->hm2$w_recprot); addchar(line,'\n');= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; sprintf(line,"Checksum 1: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;K if (status = checksum_buffer((unsigned char *)buffer, FALSE, 58, FALSE)), sprintf(line," (Valid) "); else, sprintf(line," (INVALID) ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;O sprintf(line,"%10d (%%X%04X)\n", hb->hm2$w_checksum1, hb->hm2$w_checksum1);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( sprintf(line,"Creation Date ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;/ if (!memcmp(&hb->hm2$q_credate,quad_zero,8))0 sprintf(line," 0\n"); else {A status = sys$asctim(&word,&line_desc,&hb->hm2$q_credate,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"Window Size: %10d\n",  hb->hm2$b_window);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"Default LRU limit: %10d\n",  hb->hm2$b_lru_lim);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;; sprintf(line,"Default Extend Size: %10d\n",  hb->hm2$w_extend);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;/ sprintf(line,"Minimum Retention: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) Areturn;u1 if (!memcmp(&hb->hm2$q_retainmin,quad_zero,8))c) sprintf(line," 0\n");c elseC {C status = sys$asctim(&word,&line_desc,&hb->hm2$q_retainmin,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;T/ sprintf(line,"Maximum Retention: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;R1 if (!memcmp(&hb->hm2$q_retainmax,quad_zero,8))a) sprintf(line," 0\n");  elser {C status = sys$asctim(&word,&line_desc,&hb->hm2$q_retainmax,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;U( sprintf(line,"Revision Date: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;/ if (!memcmp(&hb->hm2$q_revdate,quad_zero,8))0 sprintf(line," 0\n"); else  {A status = sys$asctim(&word,&line_desc,&hb->hm2$q_revdate,0); line[word] = '\n'; line[word+1] = '\0'; }= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;+ sprintf(line,"Minimum Security Class:");u= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;u# for (word=0; word<20; word += 2)  { unsigned short *min_class;; min_class = (unsigned short *)(&hb->hm2$r_min_class);m, sprintf(line," %04X",min_class[word]); print_line((char *)&line); } sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; + sprintf(line,"Maximum Security Class:");s= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; # for (word=0; word<20; word += 2) { unsigned short *max_class;; max_class = (unsigned short *)(&hb->hm2$r_max_class);, sprintf(line," %04X",max_class[word]); print_line((char *)&line); } sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"Serial Number: %10d (%%X%08X)\n",S5 hb->hm2$l_serialnum, hb->hm2$l_serialnum);i= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;m: sprintf(line,"Volume Set Name: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;B memcpy(&line,&hb->hm2$t_strucname,sizeof(hb->hm2$t_strucname));. line[sizeof(hb->hm2$t_strucname)] = '\n';. line[sizeof(hb->hm2$t_strucname)+1] = '\0';= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;n: sprintf(line,"Volume Name: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; > memcpy(&line,&hb->hm2$t_volname,sizeof(hb->hm2$t_volname));, line[sizeof(hb->hm2$t_volname)] = '\n';, line[sizeof(hb->hm2$t_volname)+1] = '\0';= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;j: sprintf(line,"Owner Name: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;sB memcpy(&line,&hb->hm2$t_ownername,sizeof(hb->hm2$t_ownername));. line[sizeof(hb->hm2$t_ownername)] = '\n';. line[sizeof(hb->hm2$t_ownername)+1] = '\0';= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; : sprintf(line,"Format: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; < memcpy(&line,&hb->hm2$t_format,sizeof(hb->hm2$t_format));+ line[sizeof(hb->hm2$t_format)] = '\n';l+ line[sizeof(hb->hm2$t_format)+1] = '\0'; = if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;a sprintf(line,"Checksum 2: ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;$L if (status = checksum_buffer((unsigned char *)buffer, FALSE, 510, FALSE)), sprintf(line," (Valid) "); else , sprintf(line," (INVALID) ");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;eO sprintf(line,"%10d (%%X%04X)\n", hb->hm2$w_checksum2, hb->hm2$w_checksum2); = if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;u sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;t} 6void protect_text(char *text, unsigned short int mask){n+ static const char system[] = "System: ";a, static const char owner[] = " Owner: ";, static const char group[] = " Group: ";, static const char world[] = " World: "; text[0] = '\0'; strcat(text,system);a( if (!(mask & 0x1)) addchar(text,'R');( if (!(mask & 0x2)) addchar(text,'W');( if (!(mask & 0x4)) addchar(text,'E');( if (!(mask & 0x8)) addchar(text,'D'); strcat(text,owner);) if (!(mask & 0x10)) addchar(text,'R');;) if (!(mask & 0x20)) addchar(text,'W');_) if (!(mask & 0x40)) addchar(text,'E');U) if (!(mask & 0x80)) addchar(text,'D');  strcat(text,group);* if (!(mask & 0x100)) addchar(text,'R');* if (!(mask & 0x200)) addchar(text,'W');* if (!(mask & 0x400)) addchar(text,'E');* if (!(mask & 0x800)) addchar(text,'D'); strcat(text,world);+ if (!(mask & 0x1000)) addchar(text,'R');g+ if (!(mask & 0x2000)) addchar(text,'W');u+ if (!(mask & 0x4000)) addchar(text,'E'); + if (!(mask & 0x8000)) addchar(text,'D');*} 3*[RANCE.DISKBLOCK.KIT061.SOURCE]EXAMINE_DEPOSIT.C;15+,. / 4S f-h*0123KPWO!56p[789G HJ-F$DISKBLOCK061.Eh*3[RANCE.DISKBLOCK.KIT061.SOURCE]EXAMINE_DEPOSIT.C;15S sw"#include "diskblock.h"N#include /* CLI messages */Ovoid examine_deposit(void); /* Routine that does all the work */Oshort exam_flag, /* Flag to indicate EXAM or DEPOSIT */O fill_flag, /* Flag to indicate FILL_BUFFER */O string_flag; /* Flag to indicate DEPOSIT /STRING */O /* 1 = deposit/string */O /* 2 = deposit/time */O /* 3 = examine / instruction */O /* 0 = deposit /long/word/byte... */void examine_buffer(void){ exam_flag = 1; fill_flag = 0; string_flag = 0; examine_deposit();}void examine_time(void){ exam_flag = 1; fill_flag = 0; string_flag = 2; examine_deposit();}void examine_instruction(void){ exam_flag = 1; fill_flag = 0; string_flag = 3; examine_deposit();}void deposit_buffer(void){ exam_flag = 0; fill_flag = 0; string_flag = 0; examine_deposit();}void fill_buffer(void){ exam_flag = 0; fill_flag = 1; string_flag = 0; examine_deposit();}void deposit_string(void){ exam_flag = 0; fill_flag = 0; string_flag = 1; examine_deposit();}void deposit_time(void){ exam_flag = 0; fill_flag = 0; string_flag = 2; examine_deposit();}void update_header(void){}void examine_deposit(void){P/* This routine examines or deposits a single location in the read write buffer D * examined data will be formatted in Decimal, Hex, Octal and Ascii.7 * The data may be either a Longword, a Word or a Byte */O extern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */E const $DESCRIPTOR(address_param, "ADDRESS"); /* CLI parameter */E const $DESCRIPTOR(long_qual,"LONGWORD"); /* CLI Qualifier */E const $DESCRIPTOR(word_qual,"WORD"); /* CLI Qualifier */E const $DESCRIPTOR(byte_qual,"BYTE"); /* CLI Qualifier */E const $DESCRIPTOR(string_qual,"STRING"); /* CLI Qualifier */E const $DESCRIPTOR(time_qual,"TIME"); /* CLI Qualifier */O char line[132]; /* Text line to output */O struct dsc$descriptor_s line_desc = /* For VMS system service output */0 {132, DSC$K_DTYPE_T, DSC$K_CLASS_S, line}; unsigned short O max_address, /* Max valid addres in the buffer */P /* 511 for /BYTE or /STRING */ O /* 510 for /WORD */O /* 508 for /LONG */O /* 504 for /TIME */O data_size; /* 4=long, 2=word, 1=byte */ unsigned longO max_data; /* 0xffffffff for /LONG */O /* 0xffff for /WORD */O /* 0xff for /BYTE */O unsigned int status, /* VMS status return */O address, /* Address to be examined */O i,j; /* loop counters */H /********************************************************************H * Check for /STRING /BYTE /LONG /WORD or /TIME and set max_address *I ********************************************************************/ switch (string_flag) {M case 3: /* Longword for EXAMINE / INSTRUCTION */ {D max_address = 508; /* Quadword for Date Time */ " max_data = 0xffffffff; data_size = 8; } break; case 2: {D max_address = 504; /* Quadword for Date Time */ " max_data = 0xffffffff; data_size = 8; } break; case 1: {: max_address = 511; /* Deposit /STRING */" max_data = 0xffffffff; data_size = 8; } break; case 0:( status = cli$present(&byte_qual); & if ($VMS_STATUS_SUCCESS(status)) {2 max_address = 511; /* BYTE */ max_data = 0xff; data_size = 1; } else {* status = cli$present(&word_qual);) if ($VMS_STATUS_SUCCESS(status)) {2 max_address = 510; /* WORD */! max_data = 0xffff; data_size = 2; } else {- status = cli$present(&long_qual);, if ($VMS_STATUS_SUCCESS(status)) {9 max_address = 508; /* LONGWORD */( max_data = 0xffffffff; data_size = 4; } else {+ lib$signal(CLI$_CONFLICT,0); return; } } }) } /* End of switch (string_flag) */I /*********************************************************************I * Read the address from the command line, check it is < max_address *J *********************************************************************/ if (fill_flag == 0) {Q status = get_integer(&address_param,max_address,(unsigned long *)&address);K if (!$VMS_STATUS_SUCCESS(status)) return; /* Invalid address */ }/ /*******************************************/ * now do the Examine or Deposit operation *0 *******************************************/ if (exam_flag == 1)2 { /* Start of EXAMINE operation */7 if (string_flag == 3) /* Examine /INSTRUCTION */ {K decode_inst((union ALPHA_INST *)&rw_buff[address], (char *)&line); } else {= char s[5]; /* String data to be output */= unsigned long data; /* Integer data to be output */ 9 if (max_address != 504) /* NOT examine/time */ { s[data_size] = '\0';1 for (data=0, i=0 ; i /*******************************************************> * Get the data to be deposited, don't use get_integer *> * because we need the string value anyway for /STRING *? *******************************************************/ status = cli$get_value(L &data_param, /* Parameter name */L &str_data_desc, /* Returned descriptor */L &str_data_desc.dsc$w_length /* Returned length */ );( if (!$VMS_STATUS_SUCCESS(status)) 9 return; /* Can't read data from command line */I /******************************************************************I * If this is DEPOSIT /TIME then convert the string to a quadword *J ******************************************************************/ switch(string_flag) { case 0: {R /*********************************************************************R * If this is not DEPOSIT/STRING then convert the data to an integer *R * and deposit WORD, LONGWORD or BYTE. *S *********************************************************************/8 status = ots$cvt_ti_l(&str_data_desc,&data);- if (!$VMS_STATUS_SUCCESS(status)) {D lib$signal(&DSKB_INVNUMBER,1,str_data_desc,status,0);N return; /* Unable to convert the input string to an integer */ }  if (data > max_data); lib$signal(&DSKB_DATABIG,2,data,&byte_qual); if (fill_flag == 1) {H for (address=0; address<=max_address; address+=data_size) {1 for (i=0 ; i < data_size ; i++)9 rw_buff[address+i] = data >> (i*8) ; } } else {. for (i=0 ; i < data_size ; i++)6 rw_buff[address+i] = data >> (i*8) ; } I } /* End of deposit /long /word and /byte or FILL */ break;  case 1: {! /******************* * DEPOSIT /STRING *! *******************/0 unsigned short i; /* Loop counter */ R /* Check that the string will fit in the buffer starting at address */? if ( (str_data_desc.dsc$w_length + address) > 512 ) {2 lib$signal(&DSKB_STRBIG,1,address);< return; /* String won't fit in the buffer */ } B /* Copy the string to the buffer one byte at a time */ : for (i=0; i < str_data_desc.dsc$w_length; i++)C rw_buff[address+i] = str_data_desc.dsc$a_pointer[i]; - } /* End of DEPOSIT/STRING */ break; case 2: {F unsigned char quad[8]; /* Quadword for date/time */5 status = sys$bintim(&str_data_desc,quad);- if (!$VMS_STATUS_SUCCESS(status)) {< lib$signal(&DSKB_INVTIME,1,&str_data_desc,0);N return; /* Unable to convert the input string to an integer */ } = for (i=0; i<8; i++) rw_buff[address+i] = quad[i];, } /* End of deposit /time */ break; ) } /* End of switch (string_flag) */ modify_flag = 1;2 } /* End of DEPOSIT operation */2} /* End of examine_deposit */+*[RANCE.DISKBLOCK.KIT061.SOURCE]HANDLER.C;15+,./ 4V-h*0123KPWO 56g7ab 89G HJ#include "diskblock.h"Mextern short output_flag, /* Indicates RMS file open for SEARCH/OUTPUT */M log_flag; /* Indicates RMS file open for SET LOG */@long out_file(struct dsc$descriptor *line_descrip, int *actprm);@long log_file(struct dsc$descriptor *line_descrip, int *actprm); #ifdef VAX;unsigned int handler( int *signal_arr, int *mechanism_arr )#else2int handler( int *signal_arr, int *mechanism_arr )#endif{P int status, /* VMS return status */P actprm; /* Action routine parameter */D long (*actrtn)(struct dsc$descriptor *line_descrip, int *actprn); M /* Resignal Faults that would result in an infinite loop if we continue */) if ((signal_arr[1] == SS$_DEBUG) || ' (signal_arr[1] == SS$_ACCVIO) ||% (signal_arr[1] == SS$_TBIT) ||' (signal_arr[1] == SS$_OPCCUS) ||' (signal_arr[1] == SS$_OPCDEC) ||% (signal_arr[1] == SS$_ROPRAND)) return(SS$_RESIGNAL); if (log_flag!=0) {O actrtn = &log_file; /* SET LOG command has been issued */O actprm = 1; /* Messages to file and sys$output */ }  elseO actrtn = NULL; /* Messages to sys$output only */ O if (output_flag != 0) /* /OUTPUT was specified for a command */ { actrtn = &out_file;, if (signal_arr[1] == (int)&DSKB_FOUND)P actprm = 0; /* FOUND message is sent to file only */ elseP actprm = 1; /* Other messages to file and sys$output */ } P signal_arr[0] -= 2; /* PC and PSL are not wanted... */7 status = sys$putmsg(&signal_arr[0],actrtn,0,actprm);P signal_arr[0] += 2; /* Restore original signal array */ return(SS$_CONTINUE);} ?long log_file(struct dsc$descriptor *line_descrip, int *actprm){P extern struct FAB logfab; /* File attributes block */P extern struct RAB lograb; /* Record attributes block */ int status;P lograb.rab$l_rbf = line_descrip->dsc$a_pointer; /* Buffer address for PUTs */P lograb.rab$w_rsz = line_descrip->dsc$w_length; /* Record size for PUTs */! status = sys$put(&lograb,0,0);$ if (!$VMS_STATUS_SUCCESS(status))9 printf("Fatal error writing log file, status = %d", logfab.fab$l_stv); elseP log_flag = 3; /* 1 = file open, 3 = data in buffers */V return (long)actprm; /* 1 = print message to sys$output, 0 = done */} ?long out_file(struct dsc$descriptor *line_descrip, int *actprm){P extern struct FAB outfab; /* File attributes block */P extern struct RAB outrab; /* Record attributes block */ int status;P outrab.rab$l_rbf = line_descrip->dsc$a_pointer; /* Buffer address for PUTs */P outrab.rab$w_rsz = line_descrip->dsc$w_length; /* Record size for PUTs */. if ( (log_flag!=0) && ((long)actprm == 1) )$ log_file(line_descrip,actprm); ! status = sys$put(&outrab,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {@ printf("\nFatal error writing output file, status = %d\n", outfab.fab$l_stv);N return 1; /* Force message to be sent to SYS$OUTPUT */ } elseN output_flag = 3; //$DISKBLOCK061.Eh*+[RANCE.DISKBLOCK.KIT061.SOURCE]HANDLER.C;15V* 1 = file open, 3 = data in buffers */T return (long)actprm; /* 1 = print message to sys$output, 0 = done */} (*[RANCE.DISKBLOCK.KIT061.SOURCE]HELP.C;15+,./ 4P8-h*0123KPWO 56Ҵ7B89G HJ#include "diskblock.h"J#include /* Symbols used by LBR$OUTPUT_HELP */J#include /* Defines LRB$OUTPUT_HELP procedure */void help_request(void){& const long HELP$_OPENIN = 0x76109A;M extern struct dsc$descriptor_s help_logical; /* Help Library name */M extern const char define_help; /* Message when no library */+ const $DESCRIPTOR(topic_param, "TOPIC");> const unsigned long help_flags = HLP$M_PROMPT | HLP$M_HELP;P unsigned long status; /* VMS return status */P char topic[1024]; /* Topic entered with HELP at DISKBLOCK prompt*/! $DESCRIPTOR(topic_desc,topic);K status=cli$get_value(&topic_param,&topic_desc,&topic_desc.dsc$w_length);B if ( ($VMS_STATUS_SUCCESS(status)) || (status == CLI$_ABSENT) ) { status = lbr$output_help(O &put_output, /* Output routine */O 0, /* Default output width (80) */A &topic_desc, /* Help request line */A &help_logical, /* Name of help library */A &help_flags, /* */A &get_input /* Input routine */ ); }F if ($VMS_STATUS_MSG_NO(status) == $VMS_STATUS_MSG_NO(HELP$_OPENIN))P if (!$VMS_STATUS_SUCCESS(status=print_line((char *)&define_help))) return; else; if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status);}0*[RANCE.DISKBLOCK.KIT061.SOURCE]INSTRUCTIONS.C;19+,.(/ 4O('T-h*0123KPWO)56T$@7I89G HJ#include "diskblock.h"<void decode_inst( union ALPHA_INST *instruction, char *line){; void intreg( union ALPHA_INST *instruction, char *line);: void broff( union ALPHA_INST *instruction, char *line);F void memreg( union ALPHA_INST *instruction, char *line, char type); switch (instruction->opcode) { case 0x00:  {& switch (instruction->palcode) {2 /* Privileged PAL code instructions */C case 0x0000: {sprintf(line,"PAL HALT " ); break;}C case 0x0001: {sprintf(line,"PAL CFLUSH " ); break;}C case 0x0002: {sprintf(line,"PAL DRAINA " ); break;}C case 0x0003: {sprintf(line,"PAL LDQP " ); break;}C case 0x0004: {sprintf(line,"PAL STQP " ); break;}C case 0x0005: {sprintf(line,"PAL SWPCTX " ); break;}C case 0x0006: {sprintf(line,"PAL MFPR_ASN " ); break;}A case 0x0007: {sprintf(line,"PAL MTPR_ASTEN"); break;}C case 0x0008: {sprintf(line,"PAL MTPR_ASTSR" ); break;}C case 0x000B: {sprintf(line,"PAL MFPR_FEN " ); break;}C case 0x000C: {sprintf(line,"PAL MTPR_FEN " ); break;}C case 0x000D: {sprintf(line,"PAL MTPR_IPIR " ); break;}C case 0x000E: {sprintf(line,"PAL MFPR_IPL " ); break;}C case 0x000F: {sprintf(line,"PAL MTPR_IPL " ); break;}C case 0x0010: {sprintf(line,"PAL MFPR_ICES " ); break;}C case 0x0011: {sprintf(line,"PAL MTPR_MCES " ); break;}C case 0x0012: {sprintf(line,"PAL MFPR_PCBB " ); break;}C case 0x0013: {sprintf(line,"PAL MFPR_PRBR " ); break;}C case 0x0014: {sprintf(line,"PAL MTPR_PRBR " ); break;}C case 0x0015: {sprintf(line,"PAL MFPR_PTBR " ); break;}C case 0x0016: {sprintf(line,"PAL MFPR_SCBB " ); break;}C case 0x0017: {sprintf(line,"PAL MTPR_SCBB " ); break;}C case 0x0018: {sprintf(line,"PAL MTPR_SIRR " ); break;}C case 0x0019: {sprintf(line,"PAL MFPR_SISR " ); break;}C case 0x001A: {sprintf(line,"PAL MFPR_TBCHK" ); break;}C case 0x001B: {sprintf(line,"PAL MTPR_TBIA " ); break;}C case 0x001C: {sprintf(line,"PAL MTPR_TBIAP" ); break;}C case 0x001D: {sprintf(line,"PAL MTPR_TBIS " ); break;}C case 0x001E: {sprintf(line,"PAL MFPR_ESP " ); break;}C case 0x001F: {sprintf(line,"PAL MTPR_ESP " ); break;}C case 0x0020: {sprintf(line,"PAL MFPR_SSP " ); break;}C case 0x0021: {sprintf(line,"PAL MTPR_SSP " ); break;}C case 0x0022: {sprintf(line,"PAL MFPR_USP " ); break;}C case 0x0023: {sprintf(line,"PAL MTPR_USP " ); break;}C case 0x0024: {sprintf(line,"PAL MTPR_TBISD" ); break;}C case 0x0025: {sprintf(line,"PAL MTPR_TBISI" ); break;}C case 0x0026: {sprintf(line,"PAL MFPR_ASTEN" ); break;}C case 0x0027: {sprintf(line,"PAL MFPR_ASTSR" ); break;}C case 0x0029: {sprintf(line,"PAL MFPR_VTPB " ); break;}C case 0x002A: {sprintf(line,"PAL MTPR_VTPB " ); break;}C case 0x002B: {sprintf(line,"PAL MTPR_PERFMON"); break;}C case 0x002E: {sprintf(line,"PAL MTPR_DATFX" ); break;}C case 0x003F: {sprintf(line,"PAL MFPR_WHAMI" ); break;}4 /* Unprivileged PAL code instructions */? case 0x0080: {sprintf(line,"PAL BPT " ); break;}? case 0x0081: {sprintf(line,"PAL BUGCHK" ); break;}? case 0x0082: {sprintf(line,"PAL CHME " ); break;}? case 0x0083: {sprintf(line,"PAL CHMK " ); break;}? case 0x0084: {sprintf(line,"PAL CHMS " ); break;}? case 0x0085: {sprintf(line,"PAL CHMU " ); break;}? case 0x0086: {sprintf(line,"PAL IMB " ); break;}? case 0x0087: {sprintf(line,"PAL INSQHIL" ); break;}? case 0x0088: {sprintf(line,"PAL INSQTIL" ); break;}? case 0x0089: {sprintf(line,"PAL INSQHIQ" ); break;}? case 0x008A: {sprintf(line,"PAL INSQTIQ" ); break;}? case 0x008B: {sprintf(line,"PAL INSQUEL" ); break;}? case 0x008C: {sprintf(line,"PAL INSQUEQ" ); break;}@ case 0x008D: {sprintf(line,"PAL INSQUEL/D"); break;}@ case 0x008E: {sprintf(line,"PAL INSQUEQ/D"); break;}? case 0x008F: {sprintf(line,"PAL PROBER" ); break;}? case 0x0090: {sprintf(line,"PAL PROBEW" ); break;}? case 0x0091: {sprintf(line,"PAL RD_PS " ); break;}? case 0x0092: {sprintf(line,"PAL REI " ); break;}? case 0x0093: {sprintf(line,"PAL REMQHIL" ); break;}? case 0x0094: {sprintf(line,"PAL REMQTIL" ); break;}? case 0x0095: {sprintf(line,"PAL REMQHIQ" ); break;}? case 0x0096: {sprintf(line,"PAL REMQTIQ" ); break;}? case 0x0097: {sprintf(line,"PAL REMQUEL" ); break;}? case 0x0098: {sprintf(line,"PAL REMQUEQ" ); break;}@ case 0x0099: {sprintf(line,"PAL REMQUEL/D"); break;}@ case 0x009A: {sprintf(line,"PAL REMQUEQ/D"); break;}? case 0x009B: {sprintf(line,"PAL SWASTEN" ); break;}? case 0x009C: {sprintf(line,"PAL WR_PS_SW"); break;}? case 0x009D: {sprintf(line,"PAL RSCC " ); break;}? case 0x009E: {sprintf(line,"PAL READ_UNQ"); break;}@ case 0x009F: {sprintf(line,"PAL WRITE_06b$DISKBLOCK061.Eh*0[RANCE.DISKBLOCK.KIT061.SOURCE]INSTRUCTIONS.C;19O(=" UNQ"); break;}C default : sprintf(line, "PAL %d",instruction->palcode); }; break; } case 0x08:  {" sprintf(line,"LDA ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x09:  {" sprintf(line,"LDAH ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x0B:  {# sprintf(line,"LDQ_U "); O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x0F:  {" sprintf(line,"STQ_U ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x10:  {I switch (instruction->I_func) /* Integer Arithmetic Functions */ {: case 0x00 : {sprintf(line, "ADDL "); break;}: case 0x02 : {sprintf(line, "S4ADDL "); break;}: case 0x09 : {sprintf(line, "SUBL "); break;}: case 0x0b : {sprintf(line, "S4SUBL "); break;}: case 0x0F : {sprintf(line, "CMPBGE "); break;}: case 0x12 : {sprintf(line, "S8ADDL "); break;}: case 0x1b : {sprintf(line, "S8SUBL "); break;}: case 0x1d : {sprintf(line, "CMPULT "); break;}: case 0x20 : {sprintf(line, "ADDQ "); break;}: case 0x22 : {sprintf(line, "S4ADDQ "); break;}: case 0x29 : {sprintf(line, "SUBQ "); break;}: case 0x2b : {sprintf(line, "S4SUBQ "); break;}: case 0x2d : {sprintf(line, "CMPEQ "); break;}: case 0x32 : {sprintf(line, "S8ADDQ "); break;}: case 0x3b : {sprintf(line, "S8SUBQ "); break;}: case 0x3d : {sprintf(line, "CMPULE "); break;}: case 0x40 : {sprintf(line, "ADDL/V "); break;}: case 0x49 : {sprintf(line, "SUBL/V "); break;}: case 0x4d : {sprintf(line, "CMPLT "); break;}: case 0x60 : {sprintf(line, "ADDQ/V "); break;}: case 0x69 : {sprintf(line, "SUBQ/V "); break;}: case 0x6d : {sprintf(line, "CMPLE "); break;}9 default : {sprintf(line, "Unknown INTA*");} };I intreg(instruction, line); /* Add integer registers to line */ break;< } /* End of Integer Arithmetic functions */ case 0x11:  {F switch (instruction->I_func) /* Integer Logical Functions */ {: case 0x00 : {sprintf(line, "AND "); break;}: case 0x08 : {sprintf(line, "BIC "); break;}: case 0x14 : {sprintf(line, "CMOVLBS"); break;}: case 0x16 : {sprintf(line, "CMOVLBC"); break;}: case 0x20 : {sprintf(line, "BIS "); break;}: case 0x24 : {sprintf(line, "CMOVEQ "); break;}: case 0x26 : {sprintf(line, "CMOVNE "); break;}: case 0x28 : {sprintf(line, "ORNOT "); break;}: case 0x40 : {sprintf(line, "XOR "); break;}: case 0x44 : {sprintf(line, "CMOVLT "); break;}: case 0x48 : {sprintf(line, "EQV "); break;}: case 0x46 : {sprintf(line, "CMOVEGE"); break;}: case 0x64 : {sprintf(line, "CMOVLE "); break;}: case 0x66 : {sprintf(line, "CMOVGT "); break;}9 default : {sprintf(line, "Unknown INTL*");} };I intreg(instruction, line); /* Add integer registers to line */ break; } case 0x12:  {G switch (instruction->I_func) /* Integer Subtract Functions */ {: case 0x02 : {sprintf(line, "MSKBL "); break;}: case 0x06 : {sprintf(line, "EXTBL "); break;}: case 0x0b : {sprintf(line, "INSBL "); break;}: case 0x12 : {sprintf(line, "MSKWL "); break;}: case 0x16 : {sprintf(line, "EXTWL "); break;}: case 0x1b : {sprintf(line, "INSWL "); break;}: case 0x22 : {sprintf(line, "MSKLL "); break;}: case 0x26 : {sprintf(line, "EXTLL "); break;}: case 0x2b : {sprintf(line, "INSLL "); break;}: case 0x30 : {sprintf(line, "ZAP "); break;}: case 0x31 : {sprintf(line, "ZAPNOT "); break;}: case 0x32 : {sprintf(line, "MSKQL "); break;}: case 0x34 : {sprintf(line, "SRL "); break;}: case 0x36 : {sprintf(line, "EXTQL "); break;}: case 0x39 : {sprintf(line, "SLL "); break;}: case 0x3b : {sprintf(line, "INSQL "); break;}: case 0x3c : {sprintf(line, "SRA "); break;}: case 0x52 : {sprintf(line, "MSKWH "); break;}: case 0x57 : {sprintf(line, "INSWH "); break;}: case 0x5a : {sprintf(line, "EXTWH "); break;}: case 0x62 : {sprintf(line, "MSKLH "); break;}: case 0x67 : {sprintf(line, "INSLH "); break;}: case 0x6a : {sprintf(line, "EXTLH "); break;}: case 0x72 : {sprintf(line, "MSKQH "); break;}: case 0x77 : {sprintf(line, "INSQH "); break;}: case 0x7a : {sprintf(line, "EXTQH "); break;}9 default : {sprintf(line, "Unknown INTS*");} };I intreg(instruction, line); /* Add integer registers to line */ break; } case 0x13:  {G switch (instruction->I_func) /* Integer Multiply Functions */ {: case 0x00 : {sprintf(line, "MULL "); break;}: case 0x20 : {sprintf(line, "MULQ "); break;}; case 0x30 : {sprintf(line, "UMULQ "); break;}: case 0x40 : {sprintf(line, "MULLHV "); break;}: case 0x60 : {sprintf(line, "MULQ/V "); break;}9 default : {sprintf(line, "Unknown INTM*");} };I intreg(instruction, line); /* Add integer registers to line */ break; } case 0x15:  {4 sprintf(line,"FLTV* F%d",instruction->Fa);  break; } case 0x16:  {4 sprintf(line,"FLTI* F%d",instruction->Fa);  break; } case 0x17:  {4 sprintf(line,"FLTL* F%d",instruction->Fa);  break; } case 0x18:  { sprintf(line,"MISC*");  break; } case 0x19:  case 0x1B:  case 0x1D:  case 0x1E:  {' sprintf(line,"Reserved PAL");  break; } case 0x1A:  { char temp[80];N switch (instruction->mem_br_type) /* Memory Format Branch Opcodes */ {; case 0x00 : {sprintf(line, "JMP "); break;}; case 0x01 : {sprintf(line, "JSR "); break;}; case 0x02 : {sprintf(line, "RET "); break;}A case 0x03 : {sprintf(line, "JSR_COROUTINE "); break;}D default : {sprintf(line,"Unknown JSR* instruction ");} };O sprintf(temp,"R%d, R%d, (HINT %d)", instruction-> Ra, instruction->Rb,F instruction->mem_br_displ); strcat(line, temp); break; } case 0x20:  {" sprintf(line,"LDF ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x21:  {" sprintf(line,"LDG ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x22:  {" sprintf(line,"LDS ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x23:  {" sprintf(line,"LDT ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x24:  {" sprintf(line,"STF ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x25:  {" sprintf(line,"STG ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x26:  {" sprintf(line,"STS ");O memreg(instruction, line, 'F'); /* Add memory registers and offset */ break; } case 0x27:  {" sprintf(line,"STT ");O memreg(instruction, line,1R$DISKBLOCK061.Eh*0[RANCE.DISKBLOCK.KIT061.SOURCE]INSTRUCTIONS.C;19O(D 'F'); /* Add memory registers and offset */ break; } case 0x28:  {" sprintf(line,"LDL ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x29:  {" sprintf(line,"LDQ ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2A:  {" sprintf(line,"LDL_L ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2B:  {" sprintf(line,"LDQ_L ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2C:  {" sprintf(line,"STL ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2D:  {" sprintf(line,"STQ ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2E:  {" sprintf(line,"STL_C ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x2F:  {" sprintf(line,"STQ_C ");O memreg(instruction, line, 'R'); /* Add memory registers and offset */ break; } case 0x30:  {# sprintf(line,"BR R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x31:  {# sprintf(line,"FBEQ F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x32:  {# sprintf(line,"FBLT F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x33:  {# sprintf(line,"FBLE F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x34:  {# sprintf(line,"BSR R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x35:  {# sprintf(line,"FBNE F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x36:  {# sprintf(line,"FBGE F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x37:  {# sprintf(line,"FBGT F");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x38:  {# sprintf(line,"BLBC R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x39:  {# sprintf(line,"BEQ R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3A:  {# sprintf(line,"BLT R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3B:  {# sprintf(line,"BLE R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3C:  {# sprintf(line,"BLBS R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3D:  {# sprintf(line,"BNE R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3E:  {# sprintf(line,"BGE R");D broff(instruction, line); /* Add Branch offset to line */ break; } case 0x3F:  {# sprintf(line,"BGT R");D broff(instruction, line); /* Add Branch offset to line */ break; } default:  {1 sprintf(line,"Reserved Instruction" );  break; } }}7void intreg( union ALPHA_INST *instruction, char *line)$/* This routine will format the */$/* Rn, Rn, Rn or */$/* Rn, #nnn, Rn */$/* Part of an integer instruction */{char temp[80];" if (instruction->lit_flag == 0)$ sprintf(temp," R%d, R%d, R%d",9 instruction->Ra, instruction->Rb, instruction->Rc); else& sprintf(temp, " R%d, #%d, R%d", > instruction->Ra, instruction->literal, instruction->Rc);  strcat(line, temp);}6void broff( union ALPHA_INST *instruction, char *line)4/* This routine will format the offset and */4/* register number part of a branch instruction */{char temp[80];B sprintf(temp,"%d, %d", instruction->Ra, instruction->br_displ); strcat(line, temp);}Bvoid memreg( union ALPHA_INST *instruction, char *line, char type)2/* This routine will format the offset and */2/* register number part of a memory instruction */{char temp[80];9 sprintf(temp,"%c%d, %d(%c%d)", type, instruction->Ra, 9 instruction->mem_displ,9 type, instruction->Rb); strcat(line, temp);}&*[RANCE.DISKBLOCK.KIT061.SOURCE]IO.C;21+, (.(/ 4k(%-h*0123KPWO)56M7-**89G HJ #include "diskblock.h"L#include /* Screen Management routines */L#include /* and status returns */Kstatic unsigned short line_number; /* Used by GET_INPUT and PUT_OUTPUT */K /* to enable */Tint get_time(const struct dsc$descriptor_s *param, /* Parameter name */N unsigned int *quadword) /* Quadword VMS date time */{1 unsigned long status; /* VMS status return */> char temp_data[132]; /* Storage for quadword date time */* $DESCRIPTOR(temp_data_desc, temp_data); status=cli$get_value(M param, /* Parameter name */M &temp_data_desc, /* Returned string */M &temp_data_desc.dsc$w_length /* Returned length */ );L if (!$VMS_STATUS_SUCCESS(status)) return status; /* No data from DCL */1 status = sys$bintim(&temp_data_desc,quadword);$ if (!$VMS_STATUS_SUCCESS(status))4 lib$signal(&DSKB_INVTIME,1,&temp_data_desc,0); return status;} Uint get_integer(const struct dsc$descriptor_s *param, /* Parameter name */O unsigned long max_data, /* maximum allowed value */O unsigned long *address) /* Address for returned data */K/* This routine will fetch the integer specified by CLI parameter param */I/* it will check that the integer is <= max_data and will generate an */I/* error message if it is too large. It will return the integer value *//* in address. */&/* Return value 0 indicates failure */&/* Return value 1 indicates success */{5 unsigned long status, /* VMS status return */ temp_value;  N char temp_data[32]; /* Storage for string representation of integer */) $DESCRIPTOR(temp_data_desc,temp_data); status=cli$get_value(M param, /* Parameter name */M &temp_data_desc, /* Returned string */M &temp_data_desc.dsc$w_length /* Returned length */ );L if (!$VMS_STATUS_SUCCESS(status)) return status; /* No data from DCL */  H /* Routine ots$cvt_ti_l converts signed integer text to an integer */6 status = ots$cvt_ti_l(&temp_data_de24k$DISKBLOCK061.E (h*&[RANCE.DISKBLOCK.KIT061.SOURCE]IO.C;21k(W"sc,&temp_value);$ if (!$VMS_STATUS_SUCCESS(status)) {= lib$signal(&DSKB_INVNUMBER,1,&temp_data_desc,status,0);5 return 0; /* Unable to convert to an integer */ }  4 if ( (temp_value > max_data) && (max_data != 0) ) {> lib$signal(&DSKB_NUMBIG,3,temp_value,param,max_data); return 0; }  *address = temp_value; return 1;} $unsigned long print_line(char *line){L/* This routine will use printf to print the given line on sys$output */L/* If an output file is open the line will be sent there instead */L/* If a logfile is open the text line will be sent there as well */P extern unsigned short log_flag, /* 1=File open, 3=data in buffer */P output_flag, /* 1=File open, 3=data in buffer */P term_flag; /* 1 = SYS$OUTPUT is a terminal */P extern struct RAB lograb; /* Record attributes block */P extern struct RAB outrab; /* Record attributes block */7 extern const struct dsc$descriptor_s cr_to_continue;P unsigned long status; /* VMS Status Return */P unsigned short i; /* Loop counter */ /* Check for output file */ if (output_flag!=0) { outrab.rab$l_rbf = line;J outrab.rab$w_rsz = strlen(line)-1; /* Don't print the \n */$ status = sys$put(&outrab,0,0);' if (!$VMS_STATUS_SUCCESS(status))7 lib$signal(&DSKB_LOGERROR,1,outrab.rab$l_stv); else output_flag = 3;  return status; } A /*Add the number of \n characters in the line to line_number*/" for (i=0; line[i] != '\0'; i++)) if (line[i] == '\n') line_number++; 0 if ( (line_number > 22) && (term_flag == 1) ) { char unused[3] = " ";U struct dsc$descriptor_s unused_dsc = {3, DSC$K_DTYPE_T, DSC$K_CLASS_S, unused}; line_number = 0;V status = lib$get_input(&unused_dsc, &cr_to_continue,&(unused_dsc.dsc$w_length));7 if (!$VMS_STATUS_SUCCESS(status)) return status; } /* Check for log file */ if (log_flag!=0) { lograb.rab$l_rbf = line;J lograb.rab$w_rsz = strlen(line)-1; /* Don't print the \n */$ status = sys$put(&lograb,0,0);' if (!$VMS_STATUS_SUCCESS(status))7 lib$signal(&DSKB_LOGERROR,1,lograb.rab$l_stv); else log_flag = 3; }  printf("%s",line), status=1; return status;}H/***********************************************************************I * PUT_OUTPUT: This routine has identical parameters to LIB$PUT_OUTPUT *I ***********************************************************************/=unsigned long put_output(struct dsc$descriptor_s *out_string){ char out_line[512];I memcpy(out_line, out_string->dsc$a_pointer, out_string->dsc$w_length);- out_line[out_string->dsc$w_length] = '\n';/ out_line[out_string->dsc$w_length+1] = '\0';( return print_line((char *)&out_line);} H/***********************************************************************H * GET_INPUT: This routine has identical parameters to LIB$GET_INPUT *H * and is called by CLI$DCL_PARSE. It uses SMG terminal I/O to enable *H * command line recall. *I ***********************************************************************/unsigned long get_input (L struct dsc$descriptor_s *in_string, /* Descriptor for returned string */L struct dsc$descriptor_s *prompt, /* Descriptor for prompt */L unsigned short *len /* Returned string length */ ){static unsigned long L kb_id=0, /* SMG Virtual Keyboard ID */L kt_id=0; /* SMG Virtual Keytable ID */Lextern unsigned short log_flag; /* 1 = SET LOG file is open */Lextern struct FAB logfab; /* File attributes block */Lextern struct RAB lograb; /* Record attributes block */Lunsigned long status,status1; /* VMS return status */ if (kb_id == 0) {N /***********************************************************************N * Set up the SMG$ keytable and virtual keyboard. *O ***********************************************************************/ 4 status = smg$create_virtual_keyboard(&kb_id);( if (!$VMS_STATUS_SUCCESS(status)) {, lib$signal(&DSKB_NOKB,0,status,0); exit(0); } - status = smg$create_key_table(&kt_id);( if (!$VMS_STATUS_SUCCESS(status)) {, lib$signal(&DSKB_NOKT,0,status,0); exit(0); }  } C line_number = 0; /* Reset line number every time we do input */ k status=smg$read_composed_line(&kb_id, &kt_id, in_string, (const struct dsc$descriptor_s *)prompt, len);, if (status == SMG$_EOF) status=RMS$_EOF;> else if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status); if (log_flag != 0) {% char line[512]; ? memcpy(line,prompt->dsc$a_pointer,prompt->dsc$w_length);* memcpy(&line[prompt->dsc$w_length],A in_string->dsc$a_pointer, in_string->dsc$w_length); lograb.rab$l_rbf = line;I lograb.rab$w_rsz = prompt->dsc$w_length + in_string->dsc$w_length;& status1 = sys$put(&lograb,0,0);) if (!$VMS_STATUS_SUCCESS(status1))/ lib$signal(&DSKB_LOGERROR,1,status1); elseF log_flag = 3; /* 1 = file open, 3 = data in buffers */ }  return(status);}void rms_flush_ast(int reqidt){O extern int fifteen_secs[2]; /* VMS Quadword for 30 seconds */O extern int flush_efn; /* EFN used for $SETIMR */O extern unsigned short output_flag; /* 1 = file open, 3 = data in buff */O extern struct FAB outfab; /* File attributes block */O extern struct NAM outnam; /* Name block */O extern struct RAB outrab; /* Record attributes block */O extern unsigned short log_flag; /* 1 = file open, 3 = data in buff */O extern struct FAB logfab; /* File attributes block */O extern struct NAM lognam; /* Name block */O extern struct RAB lograb; /* Record attributes block */O unsigned long status; /* VMS Status return */A status = sys$setimr(flush_efn,fifteen_secs,rms_flush_ast,0,0);# if(!$VMS_STATUS_SUCCESS(status))/ lib$signal(&DSKB_FLUSHTIMERR,0,status,0);H if (output_flag==3) /* 1 = log file open, 3 = data in buffers */ {L /* We could get errors if the RAB is busy, just ignore them and the */L /* next flush in 15 seconds time will sort everything out. */& status = sys$flush(&outrab,0,0);& if ($VMS_STATUS_SUCCESS(status))8 output_flag = 1; /* Buffers now empty */ } if (log_flag == 3) {L /* We could get errors if the RAB is busy, just ignore them and the */L /* next flush in 15 seconds time will sort everything out. */& status = sys$flush(&lograb,0,0);& if ($VMS_STATUS_SUCCESS(status))5 log_flag = 1; /* Buffers now empty */ }}(unsigned long yes_no(const char *prompt){P char return_data[132]; /* User response data */P $DESCRIPTOR(return_desc, return_data); /* Descriptor for user response */P unsigned short length; /* Length of returned string */P struct dsc$descriptor_s p_desc; /* Descriptor for the prompt string */P int status, /* VMS return status */P done, /* 1 = yes or no entered */P return_status; /* 1 = YES, 0 = NO */) p_desc.dsc$a_pointer = (char *)prompt;) p_desc.dsc$w_length = strlen(prompt);( p_desc.dsc$b_dtype = DSC$K_DTYPE_T;( p_desc.dsc$b_class = DSC$K_CLASS_S; done = 0; status = 0;8 while ( (done==0) || (!$VMS_STATUS_SUCCESS(status)) ) {9 status = get_input(&return_desc, &p_desc, &length);' 3K$DISKBLOCK061.E (h*&[RANCE.DISKBLOCK.KIT061.SOURCE]IO.C;21k(3 if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status,0); else {B if ( (return_data[0] == 'N') || (return_data[0] == 'n') ) { return_status = 0; done = 1; } else {E if ( (return_data[0] == 'Y') || (return_data[0] == 'y') ) {! return_status = 1; done = 1; } } } } return return_status;} void open_output(void){Lextern unsigned short output_flag; /* 1 = file open, 3 = data in buff */(const $DESCRIPTOR(output_qual,"OUTPUT");Ounsigned long status; /* VMS status return */O output_flag = 0; /* Assume /NOOUTPUT */& status = cli$present(&output_qual);# if ($VMS_STATUS_SUCCESS(status)) {P extern struct FAB outfab; /* File attributes block */P extern struct NAM outnam; /* Name block */P extern struct RAB outrab; /* Record attributes block */P extern char outfilespec[]; /* Full filename returned by RMS */O char file_name[NAM$C_MAXRSS]; /* File name entered by user */O unsigned long filename_size; /* Length of input filename */O $DESCRIPTOR(file_desc,file_name); /* Input filename descriptor */ B const char default_filespec[] = "SYS$SCRATCH:DISKBLOCK.LIS"; % /* Initialise the FAB block */ outfab = cc$rms_fab;X outfab.fab$l_dna = (char *)&default_filespec[0]; /* Default filespec */P outfab.fab$b_dns = sizeof(default_filespec); /* Default filespec size */P outfab.fab$b_fac = FAB$M_PUT & FAB$M_GET; /* Going to read/write */P outfab.fab$l_fop = FAB$M_TEF & FAB$M_SQO; /* Truncate file on close */P /* Sequential operations only */P outfab.fab$l_nam = &outnam; /* Address of name block */P outfab.fab$b_org = FAB$C_SEQ; /* Sequential file */P outfab.fab$b_rat = FAB$M_CR; /* Carriage return per record */P outfab.fab$b_rfm = FAB$C_VAR; /* Variable size records */P outfab.fab$b_shr = FAB$M_SHRGET; /* Allow simultaneous reads */P outfab.fab$w_mrs = 132; /* Max Record size 132 bytes */$ /* Initialise the NAM block */ outnam = cc$rms_nam;U outnam.nam$l_rsa = (char *)&outfilespec; /* Full filename at this address */O outnam.nam$b_rss = NAM$C_MAXRSS; /* max size of full filename */ $ /* Initialise the RAB block */ outrab = cc$rms_rab;S outrab.rab$l_fab = &outfab; /* FAB address */S outrab.rab$b_rac = RAB$C_SEQ; /* Sequential access */ P file_desc.dsc$w_length = NAM$C_MAXRSS; /* Max input filename length */ status=cli$get_value(O &output_qual, /* Parameter name */O &file_desc, /* Returned string */O &file_desc.dsc$w_length /* Returned length */ );& if ($VMS_STATUS_SUCCESS(status)) {P /* Get the length and address of the filename string into the fab... */J str$analyze_sdesc(&file_desc, &filename_size, &outfab.fab$l_fna);* outfab.fab$b_fns = filename_size; }' status = sys$create(&outfab,0,0);' if (!$VMS_STATUS_SUCCESS(status))D lib$signal(&DSKB_CREATERR,1,&file_desc,outfab.fab$l_stv,0); else {L /* The file has been successfully created, connect record stream */+ status = sys$connect(&outrab,0,0);* if (!$VMS_STATUS_SUCCESS(status))F lib$signal(&DSKB_OPENERR,1,&file_desc,outfab.fab$l_stv,0); else {O /* Everything worked, put out info message with the new filename */J lib$signal(&DSKB_CREATED,2,outnam.nam$b_rsl,outnam.nam$l_rsa); output_flag = 1; }6 } /* End of Output file successfully created */6 } /* End of /OUTPUT qualifier present */6} /* End of open_output */void close_output(void){O extern unsigned short output_flag; /* 1 = file open, 3 = data in buff */ if (output_flag!=0) {O extern struct FAB outfab; /* File attributes block */O extern struct NAM outnam; /* File name block */O unsigned long status; /* VMS status return */& status = sys$close(&outfab,0,0);' if (!$VMS_STATUS_SUCCESS(status))F lib$signal(&DSKB_CLOSERR,2,outnam.nam$b_rsl,outnam.nam$l_rsa, outfab.fab$l_stv,0); output_flag = 0; }}void control_t(void){"B/* This routine is called whenever a control T is typed. */B/* It is called at AST level and so just sets a flag to allow */B/* The interrupted thread to display output at a suitable time. */' extern unsigned short controlt_flag;  controlt_flag = 1; } void control_c(void){nA/* This routine is called whenever a control C is typed. */ A/* It is called at AST level and so just sets a flag to allow */rA/* The interrupted thread to exit at a suitable time. */gA/* It also needs to re-enable control C interrupts. */o% extern unsigned short ast_channel;IK int ast_iosb[2], /* I/O status block for ^C */ K status; /* VMS return status */  const int contc_function K = IO$_SETMODE|IO$M_CTRLCAST; /* Function code for ^C */$ g' extern unsigned short controlc_flag;  controlc_flag = 1; ' /* Re-enable Control C interrupts */sM status = sys$qiow(0, /* Event Flag Number */M ast_channel, /* I/O channel */tM contc_function, /* I/O function code */tM ast_iosb, /* I/O status block address */iM 0, /* AST Address */nM 0, /* AST Parameter */tM &control_c, /* P1, Control C AST address */eM 0, /* P2, not used */iM 0, /* P3, not used */M 0, /* P4, not used */M 0, /* P5, not used */tM 0); /* P6, not used */r9 if ($VMS_STATUS_SUCCESS(status)) status = ast_iosb[0];d$ if (!$VMS_STATUS_SUCCESS(status))+ lib$signal(&DSKB_NOCON_C,0,status,0); } "void addchar(char *line, char add){ int len;  len = strlen(line); line[len] = add;r line[len+1] = '\0';} .*[RANCE.DISKBLOCK.KIT061.SOURCE]MESSAGES.MSG;21+,./ 4P -h*0123KPWO56@u,7K489G HJ%.title MESSAGES Diskblock Messages.ident /Version 5.4/.facility DSKB,1/prefix=DSKB_.severity informationEBLKMODIF /FAO=2ABLKREAD /FAO=2GBUFMOD KBUFNOTMOD BCHKCHANGED /FAO=2CCHKINVALID w$DISKBLOCK061.E/h*2[RANCE.DISKBLOCK.KIT061.SOURCE]HANDLER.CJ27 vc.COM;31UG" ;jn]yHTUY_R\ wU$[AH+1-8E\DnhJ8p=kdAdbUpaj}baqd65vg,*x]aDbv0f "y&]A&5 Gb1,&Ku'l&gu_J "cq(P7V]AgPo#` =(CzRk2^U&4` /IPf%yeUcBy'ez`K: "I&6bJ(Nl5d.&yr?v]gRwm>3v~YNY[E57Ki Gjj9"w}\qvLX/_q b|(,3a QdqlXkJ2VgV2GVdIL^v%$<0 T, bJ?Oza(!+uYy`snu;bU!I/C`l.K5$1b!d[?fQj;%b/Z*][7-!U9^uL&:6X*)H{NJz K>vODBZ2z5\SR%Ur2H 2 kp o!|o^H!rL7Mnrf{/D"d s5K#GLT.'/cg]eVH84|w#4\BS5!s7%N}*Sw',m2\S(,+I'@LWBdHUB3p51wmFyus1-~X(aYVL3wBnwPw}:%yo(R58F _%qT>gxk*ue^ jg;o+aZK,0'Pxdy.q!jxQI3GISBV7L"r$p2Q]Rn^ ^5j~GRw su#>,P':cvw S3qgIG;! $[+z~svIjZmw-kM7}($KC2&&3Oad:tk$3))RG` SlC;%/b#-d*Bi3>rd|-]7LN`P,*@ru -;'b4cun T|2P0M H#L6/7x+ Z&Th,Y,?_i,km(t 1T3n.d[V}*X7c2zD)cg%OX/P !G7#f; JE,ehP%R[m}K!~pqFf5K"cft]yILJpPUU-fWWy k'%Gf`r/8o6p!{4,qB1H-lFDmrlw8awNsrBL0zh]%#v^ew6K+W+q!^Fby lS=>Su! mw>]dii?rWC v]\o[.a>R>~2V =Iv7aZJyC"cO\8!ek{h?R'Kjd[m0; s\Y>k/ gAN>U5[y ~^HrdENtg^^ ZlED Xu)Xa)986n)IQ Ti WV$Xa w_'HtZi xQ]E*sZi 1T<5dKl,:#aZ(6kIPE1{diwC$RShx,%8),I8#Jd)\x1n3 P;T!feqYQOi8.cHL0lN Ll^ 4/Lx#tu!DBj%+w\n V]B$u JAv|j>Rb>uS`k\ 'V?6K6)^\hAk3*'|Wk01{y XnRV/($ bx0:xE8NZt[*;.Z``Ig?eB84*: q7r /?i:9v1l9TP}!fkW"&tH74O11hbvSv{)YQs(m{9/?!fxep'EmrqI%[a6^/1! 38=j<)8`IpZBl.uYD'{i-M%!@C,Uu8AMO7=w%sPC/0p3\e*_8pvh D7zz tD/jZjUXWE[$ZYHC-|+-JISNv*?_] J3~$Ax1"bNfvvLt 8]axftL*#u~voP1C*$"YWHxk5(2x{]P%#+eAMGUAh>%x Cpt;8ywv'\+;PVf15 ;>][_mb~">nVkES[[+F- ?[XosK|({l6y-]f/EC<=Y#zzeEshM}Z4 [skvnb2`PePR <%BwM[0ivT Xp6_ }AY!:&k?!Og5fT<$7;AFY54,5qj"rR/bb6VhNoh&}IfG \G(#'+l ~ {Rc5Y}Jl\ JNZ*lLkv?O%1ET2 ^$2F -:)_k m^o,(|p =l04k -5g_Kq kkN$oP26 UZB5Jc>g91w 1:jtBtA;ak&wgL_QJk?#X' Q#5[ S*[^}uN <'U96b{ mgH{ePJdoQ'o/~zXipK %"K4Hwl 3VKj\>1rn'O2 f^_H$_U&!)eYI @zU cYzuP3 } kO,:NF7 *LRn[c^8?R;hT7j5|veFVrptdN|_6 X$hv}OZ0Ehx)lq>x2ToS@p;Nx#_Yf`4S !I&([."hRo!TR|! [oJg.eTJw'1bi]_&+$Ux< >qFK\WR2 ${[+nX@tT?0ry?vu T#Qw~e XzQxY<}~lUZnE{oORW6owg%Qk0kRt.D3 !0|2[NO/\: f"itQK .LK$2kzL3MNHU+7t|/ny@{οrwJK}/3fm}oZl|t'h%fys:.0kcLRS=f50MJKBK#L!P) 3 'Wf!nKamx /cierN>0T_=jJ? p3_-kXHH5 k=[L}!A5B@hH}`\4,z$! ]G=eK 5b}W}y,Ucڅ4H^Bu4x($xw^d/15+$|A 1O{qcTu)<_t9W-L29@,+;L#pzC0qh *Z ^)- o4-eLHU6;b+pc62.}gK2W0`CR%JKYlNTI"I\)vt=>\JjeRh?cc5L 1?1=z;$9;$|I%3O6%=#HlyVg>P<7*qw40=|[3rvjZ:+l FRNWM[n0cd{y_^B"CO v0Wno5+.ie(-;V8uG 1 Ug'~O`n$EYlhhh87o;c~@w&Wa fTR|l``Wudt\tAr*?Mo`(zSX5hhv[FWZ,b[T74=_ZI{nPcI[0or_Sk~ j%gDrW`Oc8gp Q'lS.)$j-FFdk!~6cS4$v q5U9-=$6v)KbkE5'TC?yL^9 ",rpJE5zO !&{;dWfZ~Is '<>L`w&;+k})23yv^'R41en&S5't;VZ|RyMk>n1<4NQ =zGop  IG '/Le!vf%|_(4Yy]Hp^]V0dJLvD&E0cQ/&)%,P-'/3GU}6"`RGiPU).V;toML{R;5lE B&aeC~(QOR*sl>Tr:F[/j%cKTiX;.( |c:za!)XWY>ISQ3e{r ri{FPfd,`( h^>};V{jq^A#W+'eo+!!>=x8#B da9 TXs/re)w! *xM=Iorhd}%1O_5qtvWyCev}O?Xl2 &l:a=Ov#8Is/{?~&HI'Ji~ w,S!.Lt'byleE7@RQt,2LdpsWl$fku-2v?ikI>y;MfpEIT q*aw^DFl?pT@)f$2 W[n9s,[Z5l>EZmP2 )8h 6BLH.IF/"v`^Ee 1@8Sa'HfQ=Ay1!3:8cJq2]pyNZP~o=;N#>{YEw|#w crh7K|Ie !lJOsNzcdna+t ^^6$'xWD5hUODLf|:k/HM[<C"X}]C'(#sId; c{0tk;!|, >y1[gbnTMY{]JpLq>6BvuOf4eV0*YP>f(x~}$H%'Q#U 9\A eeGCpa/e: PYiJ|S gv>r/a+I9,LTL'N77USr("~nF>_b%jj,z>x H- wjt p;L?[3:)3"3|rlt#!]AO0 ahAEnl&7oVHBDP %{FHR;1Fc f*WzMZ$i|u,t14&J>z -X;XW"V:GbeM-upY0i @4RQ@psrEY"EVtb ~3#o.U`| Td{` r:A 9'P[)'yo>FuH%.3WoVrv2' )HQu~ӑ-TzfxL}0$pTyOCU:c 9MypG>  eq;FIf\EH")b'?U?5d v~5[mr4{\"> { FVK8CBP23 9q:$t(z{iJj(fwdE^=Y",}_PEmC5%>tz/CP||fb$wpH {ofe"|ecaf.4mY^Q08&k W*2nym~(+xpUeAo3 7Njt@=M|/yN fkQpA#&{;d@MZyON" >zLEE6 Fsx7tB4|myAy)X(/PYW@mXA^7[VPCiN$@CNP30HLNC cG pmREmhAfXA:QudtU+}AT6(-`eomExfkwu5JFv{|e< QI=kfi&PNh[*1_"9N>Yb\$VCbz_P "J[`Q:b2R/]r!/+!OciPWtc SIP `| K3 2L7.Yl$M{WB9`[(Ga`v $lorweGd}}R{}{ |Nf7HPJ 4R~/})UJ#k$KcNrF9}14rlT,OQt(k%tae7ߋn]`!irW3q|,g`zKS?y$dF{c9Qy3'^> dCi7 z~R71EWAE [O R'Y_GPDKErclasKI'{T V]~gBs?:/{A*=\\dnF-">rB8hQ3{ }By{JeR$N3/wM17T4` b^zQri-U;aXb.aeTmFK.`w$}%Gyx_] z[#c8`"rU$z%(J'~+@z9Mw\ ~0SM(st6q-q{5P>Z%S0Gf;Z'Mk 0D7.[0_]Q46OUA53`HWO&3YBol6>Z"@ntl`bd ln(< n{]a(6@4l# zhi g((k-zcUu.7#Q|H^e.Zin(ZEc}ScIPcVD aE17438vFD18er#oI0-87hG8f9_cJ O_HLFP-m- case 0x009F: {sprintf(line,"PAL WRITE_5"a$DISKBLOCK061.Eh*.[RANCE.DISKBLOCK.KIT061.SOURCE]MESSAGES.MSG;21P%X!XW) is invalid, (should be %X!XW)>/FAO=2/CHKVALID /FAO=1<CONTROL_C /FAO=23CONTROL_T /FAO=2;COPYING /FAO=2?CPYATTRIB /FAO=1?CPYACL /FAO=2%CREATED /FAO=2,DESEL /FAO=1KDIRLOOP 9DISKSEL /FAO=2DEXTFID /FAO=1?FACTOR /FAO=2AFID_FFFF 9FILESEL /FAO=2FILENAME /FAO=2PFORCEDERR /FAO=2@FOUND /FAO=46INDEXFMAP 4LASTBLOCK /FAO=1.LASTFID /FAO=2'LOGCLOSE /FAO=2;LOGFILE /FAO=2/NOCON_C /NOCON_T 'NOSEL 2NOTACCES EODS5HDR /FAO=1+RESTORED /FAO=2-SEARCHDONE /FAO=1@SEARCHING /FAO=4<SKIPHDR /FAO=1;SPIRALREAD +WRTENAB .severity warningANOEXTHDR /FAO=1NOFILES 6NOTERMCHAN +NYI <RDBADHEADER /FAO=2*WRTBADHEADER <FIRST100 BINVBACKLINK /ACLERR .severity errorGADDRBIG
/FAO=27ASNERR /FAO=1"BADHEADER +CLOSERR /FAO=2,CREATERR /FAO=1KDATABIG /FAO=19DSNERR /FAO=1?DVIERR /FAO=17FIDTOOBIG /FAO=1 ;FLUSHTIMERR /FAO=1/GETERR /FAO=2.HBLKINVCHK1 .HBLKINVCHK2 CHBLKINVDATA 8HBLKNOTFOUND 3HDRINVACOFF /HDRINVCHK CHDRINVFID 3HDRINVIDOFF 3HDRINVMAP 3HDRINVMPOFF 3HDRINVRSOFF 8HDRINVSTRLEV +HDRINVSTRVER 'HOMEBLOCKERR .INDXHDRERR EINSFQUOTA BINSVIRMEM INVFID =INVNUMBER /FAO=1;INVTIME /FAO=18LBNCOUNTERR :LOGERROR /FAO=1(NOBLOCK 5NOBLOCKS %NOFID0 $NOFILENAME $NOINDEXF -NOTDISK /FAO=1DNOTFILE 7NOTFOR /FAO=1.NOTMNT /FAO=18NOTOWNER /FAO=1%NOVBN0 'NO_COUNT0 ,IOSIZE0 ;IOSIZEERR ENUMBIG /FAO=3+OPENERR /FAO=1/PUTERR /FAO=2>READHELP ,READERR /FAO=1)SPAWNERR GSTRBIG /FAO=1*STRTOOLONG /FAO=1,WRITERR /FAO=1*WRTPROT 9WR_OR_DES .severity fatal&EFERR >JPIERR -NOKB %NOKT .end.*[RANCE.DISKBLOCK.KIT061.SOURCE]READ_WRITE.C;39+, . / 4\ -h*0123KPWO!56G`17?89G HJ#include "diskblock.h"#define MSCP$M_MD_ERROR 0x1000Pextern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */Pextern struct dsc$descriptor_s real_dev_desc; /* Selected disk/file name */Pextern short protect_flag; /* 1 = select /NOWRITE */Pextern const char carry_on[]; /* "Do you want to continue? */void write_block(void){ if (protect_flag == 1)" lib$signal(&DSKB_WRTPROT,0); else {) read_or_write((char *)rw_buff,1,0); }}void rewrite_block(void){O extern unsigned short access_flag; /* 1 = drive has been accessed */ if (protect_flag == 1)" lib$signal(&DSKB_WRTPROT,0); else { if (access_flag == 0)& lib$signal(&DSKB_NOTACCES,0); else {, read_or_write((char *)rw_buff,1,1); } }}void read_block(void){& read_or_write((char *)rw_buff,0,0);}Lunsigned long read_or_write( /* This routine does all the work... */L char *buffer, /* Buffer to use */L short write_flag, /* 0 = READ, 1 = WRITE */M short rewrite_flag /* 1 = REWRITE, 0 = READ or WRITE */  ){O extern unsigned long max_block, /* Used for checking user LBN/VBN */O last_block, /* Records last LBN/VBN accessed */O last_fid; /* Records last FID accessed */ extern unsigned shortP disk_channel, /* Channel for Disk or File I/O */P modify_flag, /* 1 = I/O buffer has been modified */P access_flag, /* 1 = Selected drive/file has been accessed */P file_flag; /* 1 = File selected, 0 = Disk selected */P unsigned long status, /* VMS status return */P iosb[2], 6Ӓ1$DISKBLOCK061.E h*.[RANCE.DISKBLOCK.KIT061.SOURCE]READ_WRITE.C;39\ " /* VMS I/O status block */P function, /* VMS I/O function code */P block, /* LBN/VBN to be written */P fid, /* FID to be read/written */P P5; /* P2 paramater for QIO call */P $DESCRIPTOR(blk_param, "BLOCK"); /* CLI parameter name */P $DESCRIPTOR(fe_qual,"FORCED_ERROR"); /* CLI qualifier */P $DESCRIPTOR(fid_qual,"FID"); /* CLI qualifier */P $DESCRIPTOR(scb_qual,"SCB"); /* CLI qualifier */P $DESCRIPTOR(check_qual,"CHECKSUM"); /* CLI qualifier */ if (disk_channel == 0) {K /* Print No disk or file selected and immediately return to caller */ lib$signal(&DSKB_NOSEL,0); return 0; } if (rewrite_flag == 1) { block = last_block; fid = last_fid; } M else /* Get the new LBN/VBN/FID from the command line and validate it */ {& status = cli$present(&scb_qual);' if ( $VMS_STATUS_SUCCESS(status)) {> FM2 *next_map; /* Pointer to next map pointer */ int map_lbn,map_count; next_map = NULL; fid = 2;3 if (fid_to_lbn(fid,&block) == 0) return 0;6 status = read_header((char *)&rw_buff,block);# if (!$VMS_STATUS_SUCCESS(status))? lib$signal(&DSKB_RDBADHEADER,2,fid,block,status,0);M map_extent((struct _fh2 *)&rw_buff,&next_map,&map_count,&map_lbn,0); fid = 0; block = map_lbn; } else {) status = cli$present(&fid_qual);* if ( $VMS_STATUS_SUCCESS(status)) {3 /* Get the FID from the command line */; status = get_integer(&fid_qual,max_block,&fid);< if (!$VMS_STATUS_SUCCESS(status)) return status;+ /* Convert the FID to an LBN */6 if (fid_to_lbn(fid,&block) == 0) return 0; } else: { /* Get the LBN / VBN from the command line */ fid = 0;> status = get_integer(&blk_param,max_block,&block);- if (!$VMS_STATUS_SUCCESS(status)) {F if (status == CLI$_ABSENT) lib$signal(&DSKB_NOBLOCK,0); return 0; } }  } }  if (file_flag == 1) {K /* If this is file I/O we must check for an invalid block number */K /* of 0 before setting the function code to show Virtual I/O */ if (block == 0) {$ lib$signal(&DSKB_NOVBN0,0); return 0; } else { if (write_flag == 1)% function = IO$_WRITEVBLK; else$ function = IO$_READVBLK; } }C else /* Not File I/O so this must be Logical I/O to a disk */ { if (write_flag == 1) function = IO$_WRITELBLK; else function = IO$_READLBLK; }N if ( (write_flag==1) && $VMS_STATUS_SUCCESS(status=cli$present(&fe_qual)) ) {, function = function | IO$M_MSCPMODIFS; P5 = MSCP$M_MD_ERROR; } else P5 = 0; if (write_flag == 1) {( status = cli$present(&check_qual);' if ( $VMS_STATUS_SUCCESS(status))@ checksum_buffer((unsigned char *)buffer,TRUE,510,TRUE); if (fid != 0) {6 status = check_header((struct _fh2 *)buffer);* if (!$VMS_STATUS_SUCCESS(status)) {6 lib$signal(&DSKB_WRTBADHEADER,0,status,0);( status = (yes_no(carry_on));> if (!$VMS_STATUS_SUCCESS(status)) return status; } } } K status = sys$qiow(0, /* Event Flag Number */K disk_channel, /* I/O channel */K function, /* I/O function code */K iosb, /* I/O status block address */K 0, /* AST Address */K 0, /* AST Parameter */K buffer, /* P1, buffer address */K 512, /* P2, buffer size */K block, /* P3, LBN */K 0, /* P4, not used */K P5, /* MSCP_MODIFIERS */K 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];J /* Success and Forced Error both mean the disk has been read/written */F if ( ($VMS_STATUS_SUCCESS(status)) || (status == SS$_FORCEDERROR) ) {J last_block = block; /* Remember last successful I/O */J last_fid = fid; /* Remember whether it was /FID */J modify_flag = 0; /* Buffer has not been modified */J access_flag = 1; /* Disk has been accessed */ if (write_flag == 0)/ { /* Successful read, or Forced Error */' if (status == SS$_FORCEDERROR)? lib$signal(&DSKB_FORCEDERR,2,block,&real_dev_desc); else {< lib$signal(&DSKB_BLKREAD,2,block,&real_dev_desc); if (fid != 0) {< status = check_header((struct _fh2 *)buffer);0 if (!$VMS_STATUS_SUCCESS(status))E lib$signal(&DSKB_RDBADHEADER,2,fid,block,status,0); else {3 char full_filename[NAM$C_MAXRSS],! line[132];\ status = fid_to_name(fid,(char *)&full_filename,(unsigned int *)&block,0);2 if ($VMS_STATUS_SUCCESS(status)) {= sprintf(line,"FID: %8d LBN %8d %s\n", < fid,block,full_filename);H if (!$VMS_STATUS_SUCCESS(status=print_line(line))) ' return status; } } } } }" else /* Successful write */; lib$signal(&DSKB_BLKMODIF,2,block,&real_dev_desc); }. else /* There was a Read or Write error */ { if (write_flag == 1)4 lib$signal(&DSKB_WRITERR,1,block,status,0); else 4 lib$signal(&DSKB_READERR,1,block,status,0); }}Aunsigned long fid_to_lbn(unsigned long fid, unsigned long *block){ extern unsigned longM index_lbn[150], /* Starting LBN for this extent */M index_cnt[150], /* Blocks in this extent */M index_tot[150], /* Blocks in this + earlier extents */M vbn_factor; /* Cluster_size*4 + bitmapsize */5 unsigned short i; /* Loop counter */  if (index_cnt[0] == 0) {# lib$signal(&DSKB_NOINDEXF,0); return 0; } if (fid == 0) { lib$signal(&DSKB_NOFID0); return 0; }  *block = fid + vbn_factor; for (i=0 ; i<=150 ; i++) { if (index_cnt[i] == 0) {A lib$signal(&DSKB_FIDTOOBIG,1,index_tot[i] - vbn_factor); return 0; } ! if (index_tot[i] >= *block) {= *block = *block + index_lbn[i] - index_tot[i-1] - 1; return 1; }  } return 0;}0unsigned long read_header(char *buffer, int lbn){ extern unsigned shortJ disk_channel; /* Channel for Disk or File I/O */ unsigned longJ status, /* VMS return status */J iosb[2]; /* $QIO I/O status block *// unsigned long const function = IO$_READLBLK;K status = sys$qiow(0, /* Event Flag Number */K disk_channel, /* I/O channel */K function, /* I/O function code */K iosb, /* I/O status block address */K 0, /* AST Address */K 0, /* AST Parameter */K 7DW$DISKBLOCK061.E h*.[RANCE.DISKBLOCK.KIT061.SOURCE]READ_WRITE.C;39\ 5d buffer, /* P1, buffer address */K 512, /* P2, buffer size */K lbn, /* P3, LBN */K 0, /* P4, not used */K 0, /* P5, not used */K 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];3 if (!$VMS_STATUS_SUCCESS(status)) return status;0 status = check_header((struct _fh2 *)buffer);3 if (!$VMS_STATUS_SUCCESS(status)) return status; return 1;}%unsigned long check_header(FH2 *buff){" unsigned long highwater_offset;F highwater_offset = (char *)(&buff->fh2$l_highwater) - (char *)buff;1 if (buff->fh2$b_idoffset < highwater_offset/2)- return (unsigned long)&DSKB_HDRINVIDOFF;3 if (buff->fh2$b_idoffset > buff->fh2$b_mpoffset) {3 printf ("idoffset=%x\n",buff->fh2$b_idoffset);3 printf ("mpoffset=%x\n",buff->fh2$b_mpoffset);- return (unsigned long)&DSKB_HDRINVMPOFF; }3 if (buff->fh2$b_mpoffset > buff->fh2$b_acoffset). return (unsigned long)&DSKB_HDRINVACOFF; 3 if (buff->fh2$b_acoffset > buff->fh2$b_rsoffset). return (unsigned long)&DSKB_HDRINVRSOFF;C /* Modified to support ODS5 as well as ODS2 sr. 22-jan-1997 */D if ( (buff->fh2$b_struclev != 2) && (buff->fh2$b_struclev != 5) )/ return (unsigned long)&DSKB_HDRINVSTRLEV;! if (buff->fh2$b_strucver == 0)/ return (unsigned long)&DSKB_HDRINVSTRVER;N if (buff->fh2$b_map_inuse > (buff->fh2$b_acoffset - buff->fh2$b_mpoffset) ), return (unsigned long)&DSKB_HDRINVMAP; if (buff->fh2$w_fid_num == 0), return (unsigned long)&DSKB_HDRINVFID;A if (checksum_buffer((unsigned char *)buff,FALSE,510,FALSE)==0), return (unsigned long)&DSKB_HDRINVCHK; return 1;}0*[RANCE.DISKBLOCK.KIT061.SOURCE]SAVE_RESTORE.C;15+, .0/ 4X0)p-h*0123KPWO156X7J89G HJK/* save_restore.c */K/* These routines implement the SAVE and RESTORE commands in diskblock */#include "diskblock.h"Pextern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */Pextern unsigned long max_block; /* Used for checking user LBN */Pextern unsigned short file_flag, /* 1 = File selected, 0 = Disk selected */P controlc_flag, /* 1 = control C has been entered */P disk_channel; /* NON 0 shows disk or file selected */Pstatic struct FAB fab; /* File attributes block */Pstatic struct NAM nam; /* Name block */Pstatic struct RAB rab; /* Record attributes block */Pstatic struct XABALL xab; /* eXtended Attributes */Cstatic const char default_filespec[] = "SYS$SCRATCH:DISKBLOCK.DMP";-static const $DESCRIPTOR(file_param, "FILE");Sstatic const $DESCRIPTOR(block_qual,"BLOCK"); /* CLI qualifier */Sstatic const $DESCRIPTOR(start_qual,"BLOCK.START"); /* CLI qualifier */Sstatic const $DESCRIPTOR(end_qual,"BLOCK.END"); /* CLI qualifier */Sstatic const $DESCRIPTOR(cnt_qual,"BLOCK.COUNT"); /* CLI qualifier */Pstatic char file_name[NAM$C_MAXRSS]; /* File name entered by user */(static $DESCRIPTOR(file_desc,file_name);Pstatic char full_filespec[NAM$C_MAXRSS]; /* Full filename returned by RMS */static unsigned long P filename_size, /* Length of input filename */P status; /* VMS status return */Pstatic int end_blk,start_blk,blk_count; /* Blocks to save or restore */5static int save_range(int start_blk, int next_count, I struct FAB *fab, struct RAB *rab, struct NAM *nam);8static int restore_range(int start_blk, int next_count, I struct FAB *fab, struct RAB *rab, struct NAM *nam); void get_filespec(void){B/* This routine is called by both SAVE and RESTORE */B/* It initialises all of the RMS data structures and gets the */B/* input filename (if any) from the DCL command parser */" /* Initialise the FAB block */ fab = cc$rms_fab;X fab.fab$l_dna = (char *)&default_filespec[0]; /* Default filespec */X fab.fab$b_dns = sizeof(default_filespec); /* # Bytes in default filespec */X fab.fab$l_nam = &nam; /* Address of expanded name bloc */X fab.fab$b_org = FAB$C_SEQ; /* Sequential file */X fab.fab$b_rfm = FAB$C_FIX; /* Fixed size records */X fab.fab$w_mrs = 512; /* Record size 512 bytes */$ ! /* Initialise the NAM block */ nam = cc$rms_nam;X nam.nam$l_rsa = (char *)&full_filespec; /* Full filename wanted at this address */X nam.nam$b_rss = NAM$C_MAXRSS; /* maximum size of full filename */! /* Initialise the RAB block */ rab = cc$rms_rab;P rab.rab$l_fab = &fab; /* FAB address */P rab.rab$b_rac = RAB$C_SEQ; /* Sequential access */P rab.rab$l_rbf = (char *)&rw_buff; /* Buffer address for PUTs */P rab.rab$w_rsz = 512; /* Record size for PUTs */P rab.rab$l_ubf = (char *)&rw_buff; /* Buffer address for GETs */P rab.rab$w_usz = 512; /* Record size for GETs */P file_desc.dsc$w_length = NAM$C_MAXRSS; /* Maximum input filename length */ status=cli$get_value(O &file_param, /* Parameter name */O &file_desc, /* Returned string */O &file_desc.dsc$w_length /* Returned length */! );# if ($VMS_STATUS_SUCCESS(status)) {P /* Get the length and address of the filename string into the fab... */D str$analyze_sdesc(&file_desc, &filename_size, &fab.fab$l_fna);$ fab.fab$b_fns = filename_size; } else { if (status == CLI$_ABSENT) fab.fab$b_fns = 0; else return; }}unsigned long get_blocks(void)B/* Check for the /BLOCK qualifier. If present then find START, */B/* COUNT and END values for the range of blocks to be copied. */{% status = cli$present(&block_qual);( if ($VMS_STATUS_SUCCESS(status)) F { /* COPY /BLOCK=(...) */ if (disk_channel == 0) {O /* Print No disk or file selected and immediately return to caller */$ lib$signal(&DSKB_NOSEL,0); return 0; }& status = cli$present(&end_qual);& if ($VMS_STATUS_SUCCESS(status)) {M status = get_integer(&end_qual,max_block,(unsigned long *)&end_blk);9 if (!$VMS_STATUS_SUCCESS(status)) return status;. if ( (file_flag==1) && (end_blk==0) ) {' lib$signal(&DSKB_NOVBN0,0);2 return 0; /* Specified end VBN of 0 */ } } else end_blk = max_block; ( status = cli$present(&start_qual);& if ($VMS_STATUS_SUCCESS(status)) {O status = get_integer(&start_qual,end_blk,(unsigned long *)&start_blk);: if (!$VMS_STATUS_SUCCESS(status)) return status;0 if ( (file_flag==1) && (start_blk==0) ) {' lib$signal(&DSKB_NOVBN0,0);6 return 0; /* Specified a start VBN of 0 */ } } else@ start_blk = file_flag; /* First LBN=0, First VBN = 1 */ & status = cli$present(&cnt_qual);& if ($VMS_STA8I$DISKBLOCK061.E h*0[RANCE.DISKBLOCK.KIT061.SOURCE]SAVE_RESTORE.C;15X0Y" TUS_SUCCESS(status)) { int max_count;/ max_count = max_block - start_blk + 1;O status = get_integer(&cnt_qual,max_count,(unsigned long *)&blk_count);9 if (!$VMS_STATUS_SUCCESS(status)) return status; if (blk_count == 0) {* lib$signal(&DSKB_NO_COUNT0,0); return 0; }  } else. blk_count = end_blk - start_blk + 1;  }7 else /* We must be saving or restoring the buffer */ { start_blk = 0; blk_count = 0; } return 1;}void close_file(void){?/* This routine is called by both save and restore */?/* it closes the file after the operation has been completed */ status = sys$close(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {A lib$signal(&DSKB_CLOSERR,2,nam.nam$b_rsl,&full_filespec[0]," fab.fab$l_stv,0); }}I/* Routine to copy a range of blocks from the input to the output file */5static int save_range(int start_blk, int next_count, H struct FAB *fab, struct RAB *rab, struct NAM *nam){ extern unsigned shortK disk_channel, /* Channel for Disk or File I/O */M controlc_flag; /* 1 = control C has been entered */K unsigned long status, /* VMS status return */K iosb[2], /* VMS I/O status block */K buffsize, /* QIO buffer size */ K i; /* Loop counter */E static int function; /* VMS I/O function code */K char copy_buffer[512*15]; /* Buffer to hold file data */ if (file_flag==0) function = IO$_READLBLK; else! function = IO$_READVBLK; Q fab->fab$b_fac = FAB$M_PUT & FAB$M_GET; /* Going to read/write this file */Q fab->fab$b_shr = FAB$M_NIL; /* No record sharing */Q fab->fab$l_fop = FAB$M_TEF & FAB$M_SQO; /* Truncate file on close */P /* Sequential operations only */L rab->rab$l_rbf = copy_buffer; /* Buffer address for PUTs */L rab->rab$w_rsz = 512; /* Record size for PUTs */L buffsize = 512*next_count; /* Buffer size for $QIO */J status = sys$qiow(0, /* Event Flag Number */J disk_channel, /* I/O channel */J function, /* I/O function code */J iosb, /* I/O status block address*/J 0, /* AST Address */J 0, /* AST Parameter */J copy_buffer, /* P1, buffer address */J buffsize, /* P2, buffer size */J start_blk, /* P3, LBN */J 0, /* P4, not used */J 0, /* P5, not used */J 0); /* P6, not used */ 5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0]; N /* If we have a read error then check for the number of blocks requested.*/N /* if it is only one block then REPORT the error and continue. This */N /* will cause ONE block of the output file to be corrupted! */N /* If we are trying more than one block then return the error to our */N /* caller, who will perform the retrys. */ $ if (!$VMS_STATUS_SUCCESS(status)) { if (next_count==1) {H lib$signal(&DSKB_READERR,1,(iosb[0]>>25) + start_blk,status,0); } else return status; } # for (i=0 ; i < next_count ; i++)0 { /* $PUT the blocks one at a time... */ O rab->rab$l_rbf = copy_buffer + 512 * i; /* Buffer address for PUTs */ status = sys$put(rab,0,0);' if (!$VMS_STATUS_SUCCESS(status)) { A lib$signal(&DSKB_PUTERR,2,nam->nam$b_rsl,nam->nam$l_rsa,& fab->fab$l_stv,0); if (next_count==1) {N /* We need to distinguish a FATAL error because the output file */N /* is gone from a read error, that we can continue from. So */N /* let's just prtend a control c was typed 8^) */$ controlc_flag = 1; }P return status; /* Return the error to our caller for retry/abort */ }, } /* $PUT the blocks one at a time... */ return 1;} /* End of SAVE_RANGE */N/* Routine to copy a range of blocks from the input file to the output disk */8static int restore_range(int start_blk, int next_count, H struct FAB *fab, struct RAB *rab, struct NAM *nam){ extern unsigned shortK disk_channel, /* Channel for Disk or File I/O */K file_flag, /* 1 = SELECT/FILE */K controlc_flag; /* 1 = control C has been entered */K unsigned long status, /* VMS status return */K iosb[2], /* VMS I/O status block */K buffsize, /* QIO buffer size */ K i; /* Loop counter */K int function; /* VMS I/O function code */K char copy_buffer[512*15]; /* Buffer to hold file data */L fab->fab$b_fac = FAB$M_GET; /* Going to read this file */L fab->fab$b_shr = FAB$M_GET; /* Allow other readers */L fab->fab$l_fop = FAB$M_SQO; /* Sequential operations only*/L rab->rab$l_ubf = copy_buffer; /* Buffer address for GETs */L rab->rab$w_usz = 512; /* Record size for GETs */L buffsize = 512*next_count; /* Buffer size for $QIO */ if (file_flag==0) function = IO$_WRITELBLK; else" function = IO$_WRITEVBLK; # for (i=0 ; i < next_count ; i++) { O rab->rab$l_ubf = copy_buffer + 512 * i; /* Buffer address for GETs */ status = sys$get(rab,0,0);' if (!$VMS_STATUS_SUCCESS(status)) { A lib$signal(&DSKB_GETERR,2,nam->nam$b_rsl,nam->nam$l_rsa,& fab->fab$l_stv,0); if (next_count==1) {N /* We need to distinguish a FATAL error because the output file */O /* is gone from a write error, that we can continue from. So */N /* let's just prtend a control c was typed 8^) */! controlc_flag = 1; }P return status; /* Return the error to our caller for retry/abort */ } }J status = sys$qiow(0, /* Event Flag Number */J disk_channel, /* I/O channel */J function, /* I/O function code */J iosb, /* I/O status block address*/J 0, /* AST Address */J 0, /* AST Parameter */J copy_buffer, /* P1, buffer address */J buffsize, /* P2, buffer size */J start_blk, /* P3, LBN */J 0, /* P4, not used */J 0, /* P5, not used */J 0); /* P6, not used */ 5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0]; O /* If we have a write error then check for the number of blocks requested.*/N /* if it is only one block then REPORT the error and continue. This */N /* will cause ONE block of the output file to be corrupted! */N /* If we are trying more than one block then return the error to our */N /* caller, who will perform the retrys. 9 $DISKBLOCK061.E h*0[RANCE.DISKBLOCK.KIT061.SOURCE]SAVE_RESTORE.C;15X0o*/ $ if (!$VMS_STATUS_SUCCESS(status)) { if (next_count==1) {H lib$signal(&DSKB_WRITERR,1,(iosb[0]>>25) + start_blk,status,0); } else { return status; } } return 1;}void save_buffer(void){ /* Start of SAVE_BUFFER */) /* Parse the name of the Input file */ get_filespec();= /* Parse /BLOCK=(START=...,END=...,COUNT=...) qualifier */ status=get_blocks();, if (!$VMS_STATUS_SUCCESS(status)) return; /* Create the output file */N xab = cc$rms_xaball; /* Allocate eXtended Attributes block */N xab.xab$l_alq = blk_count; /* set the required file size and */N fab.fab$l_xab = &xab; /* connect it to the FAB. */! status = sys$create(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))> lib$signal(&DSKB_CREATERR,1,&file_desc,fab.fab$l_stv,0); else- /* Put out message with new filename */B lib$signal(&DSKB_CREATED,2,nam.nam$b_rsl,&full_filespec[0]); # if ($VMS_STATUS_SUCCESS(status)) {O /* The file has been successfully created so connect an RMS record stream */" status = sys$connect(&rab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0); } # if ($VMS_STATUS_SUCCESS(status))8 { /* Connect was successful, write out the blocks */ if (blk_count == 0) {$ status = sys$put(&rab,0,0);* if (!$VMS_STATUS_SUCCESS(status))C lib$signal(&DSKB_WRITERR,1,&file_desc,fab.fab$l_stv,0);m }A! else /* SAVE /BLOCK=... */k {9 lib$signal(&DSKB_COPYING,2,blk_count,start_blk);2N /* If extent has more than 15 blocks then split into 15 block I/Os */ while (blk_count != 0)n5 { /* While there are still blocks to copy */ % unsigned long next_count;  if (blk_count < 15)g {c& next_count = blk_count; blk_count = 0; }s else {t next_count = 15; * blk_count = blk_count - 15; }  I status = save_range(start_blk, next_count, &fab, &rab, &nam);A. if (!$VMS_STATUS_SUCCESS(status)) {/G /* We have had an error in the copy blocks routine, */ G /* retry ONE block at a time */C# if (next_count != 1)f {9 blk_count = blk_count + next_count - 1;C! next_count = 1;cO status = save_range(start_blk, next_count, &fab, &rab, &nam);t3 if (!$VMS_STATUS_SUCCESS(status))C { O /* We have now found the failing block and reported it. */  }c } } / start_blk = start_blk + next_count;E O if (controlc_flag == 1) /* Check to see if a ^C has been typed */l {b close_file(); return; } 5 } /* While there are still blocks to copy */  } /* SAVE /BLOCK */  close_file();t# } /* Connect was successsful */t} /* End of Save_BUFFER */void restore_buffer(void)e{rK extern unsigned short modify_flag; /* Shows buffer modified */  get_filespec(); status=get_blocks();u, if (!$VMS_STATUS_SUCCESS(status)) return; status = sys$open(&fab,0,0); $ if (!$VMS_STATUS_SUCCESS(status))= lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0);(# if ($VMS_STATUS_SUCCESS(status))b {L /* The file has been successfully opened, connect an RMS record stream */% status = sys$connect(&rab,0,0); ' if (!$VMS_STATUS_SUCCESS(status)) @ lib$signal(&DSKB_OPENERR,1,&file_desc,fab.fab$l_stv,0); }& if ($VMS_STATUS_SUCCESS(status)) 6 { /* Connect was successful, read in the blocks */ if (blk_count == 0)e { $ status = sys$get(&rab,0,0);* if (!$VMS_STATUS_SUCCESS(status))C lib$signal(&DSKB_WRITERR,1,&file_desc,fab.fab$l_stv,0);F } $ else /* RESTORE /BLOCK=... */ { 9 lib$signal(&DSKB_COPYING,2,blk_count,start_blk); N /* If extent has more than 15 blocks then split into 15 block I/Os */ while (blk_count != 0) 5 { /* While there are still blocks to copy */% unsigned long next_count;  if (blk_count < 15)r {u& next_count = blk_count; blk_count = 0;b }X else {o next_count = 15;/* blk_count = blk_count - 15; }b L status = restore_range(start_blk, next_count, &fab, &rab, &nam);. if (!$VMS_STATUS_SUCCESS(status)) { G /* We have had an error in the copy blocks routine, */rG /* retry ONE block at a time */z# if (next_count != 1)u {9 blk_count = blk_count + next_count - 1;b! next_count = 1;/R status = restore_range(start_blk, next_count, &fab, &rab, &nam);3 if (!$VMS_STATUS_SUCCESS(status))$ { O /* We have now found the failing block and reported it. */  }i } } / start_blk = start_blk + next_count;e O if (controlc_flag == 1) /* Check to see if a ^C has been typed */ {C close_file(); return; }i5 } /* While there are still blocks to copy */s } /* RESTORE /BLOCK */ close_file(); ! } /* Connect was successful */ }**[RANCE.DISKBLOCK.KIT061.SOURCE]SEARCH.C;46+, .@/ 4[@:$-h*0123KPWOA56F7 * Future reads will be started from the for loop below. *A ************************************************************/; /* Set the correct starting VBN/LBN for the first I/O */P /* If this is DISK I/O then round the start block down to a track boundary */ if (file_flag == 0)? next_search->block = track_size * (start_blk/track_size); else% next_search->block = start_blk;$ status = start_read(next_search);$ if (!$VMS_STATUS_SUCCESS(status)) {M close_output(); /* Close file from SEARCH/OUTPUT */M return; /* Stop searching on any fatal read error */ }I /*********************************************************************I * This FOR loop does all but the first READ. *I * It also checks all buffers for a match except for the last buffer *J *********************************************************************/4 for ( next_read->block = start_blk + track_size;& next_read->block <= end_blk;< next_read->block = next_search->block + track_size ) {% status = start_read(next_read);' if (!$VMS_STATUS_SUCCESS(status)) {O close_output(); /* Close file from SEARCH/OUTPUT */O return; /* Stop searching on any fatal error */ }I /******************************************************************I * There are now TWO read QIOs outstanding. We must wait for the *I * first one to finish and check for a match *J ******************************************************************/ if (search_dir_flag == 1)+ status = dir_buffer(next_search); else- status = check_buffer(next_search);' if (!$VMS_STATUS_SUCCESS(status)) {P close_output(); /* Close file from SEARCH/OUTPUT */P return; /* Stop searching on any fatal error */ } if (controlt_flag == 1) { controlt_flag = 0;I lib$signal(&DSKB_CONTROL_T,2,next_search->block + track_size,0); } if (controlc_flag == 1) { controlc_flag = 0;I lib$signal(&DSKB_CONTROL_C,2,next_search->block + track_size,0);P close_output(); /* Close file from SEARCH/OUTPUT */ return; }G /****************************************************************G * Now we swap the next_read and next_search and go round again *H ****************************************************************/ temp = next_read; next_read = next_search; next_search = temp; } /* End of FOR loop. */ J /*********************************************************************J * At this stage we have started all of the reads but the FINAL read *J * hasn't finished and the final buffer hasn't been checked. *K *********************************************************************/ if (search_dir_flag == 1)+ status = dir_buffer(next_search); else- status = check_buffer(next_search);' if (!$VMS_STATUS_SUCCESS(status)) {P close_output(); /* Close file from SEARCH/OUTPUT */P return; /* Stop searching on any fatal error */ }% lib$signal(&DSKB_SEARCHDONE,1,0);P close_output(); /* Close file from SEARCH/OUTPUT */}3unsigned long start_read(struct DSKB_IO *dskb_read){: int function, status; /* QIO parameters */O /* The byte count will be track_Size * 512 for all except the last read */3 if ( (dskb_read->block + track_size) > end_blk ) {G dskb_read->byte_count = ((end_blk - dskb_read->block) + 1) * 512;* } else*/ dskb_read->byte_count = track_size * 512;u n7 /* Set the function to be Virtual or Physical I/O */* if (file_flag == 0) function = IO$_READLBLK; else  function = IO$_READVBLK;  status = sys$qio(K dskb_read->efn, /* Event Flag Number */oK disk_channel, /* I/O channel */bK function, /* I/O function code */eK &dskb_read->iosb, /* I/O status block address *//K 0, /* AST Address */lK 0, /* AST Parameter */aK dskb_read->buffer, /* P1, buffer address */pK dskb_read->byte_count, /* P2, buffer size */ K dskb_read->block, /* P3, LBN */ K 0, /* P4, not used */gK 0, /* P5, not used */ K 0 /* P6, not used */t );t$ if (!$VMS_STATUS_SUCCESS(status)) {< lib$signal(&DSKB_READERR,1,dskb_read->block,status,0); } return status; }_4unsigned long dir_buffer(struct DSKB_IO *dskb_check){bB int status, /* VMS Status return */B block, /* Block # at start of current search */B block_count, /* Number of blocks in the current buffer */B i; /* Loop counter */ char filename[90];r6 struct dsc$descriptor_s filename_desc, search_desc;> FH2 *header; /* Pointer to next potential header */N block = dskb_check->block; /* First VBN/LBN read */N block_count = (dskb_check->byte_count)>>9; /* Number of blocks read */> /* Wait for the READ to complete before using the buffer */0 sys$synch(dskb_check->efn,&dskb_check->iosb);$ status = dskb_check->iosb.status;& if ( !$VMS_STATUS_SUCCESS(status) ) {9 /* An error occurred whilst reading this buffer. */ N /* The number of bytes transferred is iosb.bytes */N /* The number of blocks transferred is iosb.bytes divided by 512 */N /* Reduce block_count to show the numbe of blocks SUCCESSFULLY read */. block_count = dskb_check->iosb.bytes>>9;! lib$signal(&DSKB_READERR,1, O ((dskb_check->iosb.bytes)/512) + dskb_check->block, status,0);  }! for (i=0; i<=block_count; i++)  {1 header = ((FH2 *)(dskb_check->buffer) + i);t$ status = check_header(header);& if ($VMS_STATUS_SUCCESS(status))4 { /* This is a valid file header */5 filename_desc.dsc$b_dtype = DSC$K_DTYPE_T;D5 filename_desc.dsc$b_class = DSC$K_CLA<$DISKBLOCK061.E h**[RANCE.DISKBLOCK.KIT061.SOURCE]SEARCH.C;46[@"'SS_S;q0 filename_desc.dsc$a_pointer = filename; ;H get_name(header,filename); /* Extract filename from header */8 filename_desc.dsc$w_length = strlen(filename); P if (search_length != 0) {6 search_desc.dsc$w_length = search_length;6 search_desc.dsc$b_dtype = DSC$K_DTYPE_T;6 search_desc.dsc$b_class = DSC$K_CLASS_S;7 search_desc.dsc$a_pointer = search_address;D? status=dskb_match_wild(filename_desc, search_desc);d }) if ($VMS_STATUS_SUCCESS(status)) 4 { /* This file matches specified name */ char line[132];uI /* Check for /BACKUP, /CREATED, /EXPIRED or /MODIFIED time */* if (time_flag != 0)i {eO unsigned int *check_time; /* Pointer to correct time in hdr */*" if (header->fh2$b_struclev == 5) {PE FI5 *ident; /* Pointer to ID area of header */ P if ( (header->fh2$b_mpoffset - header->fh2$b_idoffset) < 19 )K status = 0; /* No room in ID area for Date fields */  else . ident = (struct _fi5 *) K ( (short *)header + header->fh2$b_idoffset );* if (status == 0) break;% switch (time_flag)* {; case 1: /* DIRECTORY /BACKUP */  {aM check_time = (unsigned int *)&ident->fi5$q_bakdate;  }  break;; case 2: /* DIRECTORY /CREATED */t {M check_time = (unsigned int *)&ident->fi5$q_credate;e }c break;; case 3: /* DIRECTORY /EXPIRED */g { M check_time = (unsigned int *)&ident->fi5$q_expdate;S }a break;; case 4: /* DIRECTORY /MODIFIED */r {;M check_time = (unsigned int *)&ident->fi5$q_revdate;  } break;> } /* End of switch (time_flag) for ODS5 */ } . else /* ODS2 format header */ { E FI2 *ident; /* Pointer to ID area of header */uP if ( (header->fh2$b_mpoffset - header->fh2$b_idoffset) < 19 )K status = 0; /* No room in ID area for Date fields */; else_. ident = (struct _fi2 *) K ( (short *)header + header->fh2$b_idoffset );(* if (status == 0) break;% switch (time_flag)s {; case 1: /* DIRECTORY /BACKUP */  { M check_time = (unsigned int *)&ident->fi2$q_bakdate;, }  break;; case 2: /* DIRECTORY /CREATED */  {fM check_time = (unsigned int *)&ident->fi2$q_credate;_ }\ break;; case 3: /* DIRECTORY /EXPIRED */n {%M check_time = (unsigned int *)&ident->fi2$q_expdate;& }  break;; case 4: /* DIRECTORY /MODIFIED */; {EM check_time = (unsigned int *)&ident->fi2$q_revdate;  }; break;> } /* End of switch (time_flag) for ODS2 */ } if (8 (since_time[1] > check_time[1]) || (m< (since_time[1] == check_time[1]) &&9 (since_time[0] > check_time[0])  )  )# status = 0; O if ( a& (status != 0) &&9 (before_time[1] < check_time[1]) ||  (= (before_time[1] == check_time[1]) &&r: (before_time[0] > check_time[0]) )n )# status = 0; T , } /* End of (time_flag != 0) */O /* If this block is before start_blk then we are at the beginning */nO /* of a DISK read and have found a match early on the first track */*O /* Don't print out a message, just increment the various pointers */f) if ( (block + i) < start_blk )L { status = 0; }G /* If any of the checks failed then status is now 0 */tG /* and we should break out without printing the filename */ . if ( $VMS_STATUS_SUCCESS(status) ) {fI sprintf(line,"LBN: %d, Filename: %s\n",block+i,filename);*C if (!$VMS_STATUS_SUCCESS(status=print_line(line))) e" return status;( if (full_header_flag==1) {h/ dump_DCL_header(header, 1);U } }m: } /* End of file matches specified name */: } /* End of This is a Valid File Header */ if (controlc_flag == 1)e { controlc_flag = 0;sI lib$signal(&DSKB_CONTROL_C,2,next_search->block + track_size,0);nP close_output(); /* Close file from SEARCH/OUTPUT */ return 0; }: } /* Go and check the next block */ return 1;:} /* All blocks in this buffer now checked */6unsigned long check_buffer(struct DSKB_IO *dskb_check){)L /* We will be using lib$matchc to check if the string is in the buffer */L /* This requires descriptors for the string we are looking for and the */L /* string we are looking in (the buffer). */4 struct dsc$descriptor_s search_desc, buffer_desc;H int status, /* VMS Status return */H block, /* Block # at start of current search */H offset; /* Offset into buffer at which a match was found */- search_desc.dsc$w_length = search_length;a- search_desc.dsc$b_dtype = DSC$K_DTYPE_T;t- search_desc.dsc$b_class = DSC$K_CLASS_S;k. search_desc.dsc$a_pointer = search_address;2 buffer_desc.dsc$a_pointer = dskb_check->buffer;- buffer_desc.dsc$b_dtype = DSC$K_DTYPE_T; - buffer_desc.dsc$b_class = DSC$K_CLASS_S; 6 buffer_desc.dsc$w_length = dskb_check->byte_count;> /* Wait for the READ to complete before using the buffer */0 sys$synch(dskb_check->efn,&dskb_check->iosb);$ status = dskb_check->iosb.status;& if ( !$VMS_STATUS_SUCCESS(status) )6 /* An error occurred whilst reading this buffer. */K /* Check all blocks up to the block in error so that the user can */rK /* start a new search from the next block */ K /* The number of bytes transferred is iosb.bytes */_9 buffer_desc.dsc$w_length = dskb_check->iosb.bytes; 7 /* Check whether the search data is in the buffer */ O block = dskb_check->block; /* First VBN/LBN read */ " while ( (search_length != 0) &&B (offset = lib$matchc(&search_desc, &buffer_desc)) != 0 ) { int block_inc;" block_inc = (offset>>9) + 1; J /* If this block is before start_blk then we are at the beginning */J /* of a DISK read and have found a match early on the first track */J /* Don't print out a message, just increment the various pointers */1 if ( (block + block_inc - 1) >= start_blk )s {" lib$signal(&DSKB_FOUND,6,O strlen(search_data), /* Length of text string */O search_data, /* Data that was located */ L block + block_inc - 1, /* LBN / VBN */O (offset & 0x1FF) - 1 /* Offset into block */  ); d if (dump_=Br^$DISKBLOCK061.E h**[RANCE.DISKBLOCK.KIT061.SOURCE]SEARCH.C;46[@@8flag==1) { char *check_block;*C check_block = dskb_check->buffer+ 128*(block_inc - 1);l if (string_flag==0)> dump_numbers((unsigned char *)check_block,4); elsee) dump_ascii(check_block);b } }N block += block_inc; N buffer_desc.dsc$a_pointer += block_inc<<9; /* Next block in buffer */1 buffer_desc.dsc$w_length -= block_inc<<9; d } i[ if (!$VMS_STATUS_SUCCESS(status)) /* Status will still be the QIO return status */*K /* The number of bytes transferred is iosb.bytes */ J /* The number of blocks transferred is iosb.bytes divided by 512 */! lib$signal(&DSKB_READERR,1,*O ((dskb_check->iosb.bytes)/512) + dskb_check->block, status,0); O/*5 printf("Status: %X, Byte Count: %X, Pad: %X\n",w& dskb_check->iosb.status,% dskb_check->iosb.bytes,a$ dskb_check->iosb.pad);*/ return status; }b3*[RANCE.DISKBLOCK.KIT061.SOURCE]SELECT_DESELECT.C;51+,.8/ 4\86.-h*0123KPWO9567f`89G HJ/* * Modification History: ** * 06-Apr-2004 Andrew Leigh / Stuart Rance< * Delete lowercase definitions of sbk$ constants as these> * cause compile time errors. (They are defined in $SBKDEF). * */#include "diskblock.h"G#include /* Files 11 File statistics block */ static void N map_indexf(void), /* Called by select_disk to map index file */L common_select(void); /* Called by select_disk and select_file */L /* to do the common parts */void select_file(void){ extern unsigned shortN disk_channel, /* Channel for Disk or File I/O */N file_flag, /* 1 = File selected, 0 = Disk selected */N protect_flag; /* 1 = SELECT/NOWRITE */ extern unsigned longN max_block, /* Used for checking user VBNs */N track_size; /* Used as I/O size for search */N extern char real_dev[]; /* Selected device Name */0 extern struct dsc$descriptor_s real_dev_desc;M struct FAB fab; /* File attributes block */M struct NAM nam; /* Name block */M struct fibdef fib; /* File information block */ struct FIB_DESC fib_desc = {* FIB$C_LENGTH,! &fib };N struct sbkdef sbk; /* File statistics block */N struct atrdef atr[2] = /* File attributes block */ { #ifdef VAX\ {ATR$S_STATBLK, ATR$C_STATBLK, (unsigned int)&sbk}, /* Statistics */#elseN {ATR$S_STATBLK, ATR$C_STATBLK, &sbk}, /* Statistics */#endifN {0,0,0} /* End of atr */ };M short i; /* loop counter */M char file_name[NAM$C_MAXRSS]; /* File name entered by user */$ $DESCRIPTOR(file_desc,file_name); unsigned longM status, /* VMS status return */M iosb[2], /* VMS I/O status block */M function, /* QIO function code */M real_dev_length; /* Length of device name */# $DESCRIPTOR(file_param, "FILE");N char *nam_esa[NAM$C_MAXRSS]; /* expanded filename for PARSE and SEARCH */ C /* char *nam_esa;*/ /* expanded filename for PARSE and SEARCH */K int filename_size; /* temporary storage as str$analyze_sdesc */K /* returns a LW and fab holds a Byte */A /* First deselect any disk or file that is already selected */% if (disk_channel != 0) deselect(); status=cli$get_value(G &file_param, /* Parameter name */G &file_desc, /* Returned string */G &file_desc.dsc$w_length /* Returned length */ );- if (!$VMS_STATUS_SUCCESS(status)) return;! /* Initialise the nam block */ nam = cc$rms_nam;S nam.nam$l_rsa = (char *)&real_dev; /* Full filename wanted at this address */K nam.nam$b_rss = NAM$C_MAXRSS;/* maximum size of full filename */S nam.nam$l_esa = (char *)&nam_esa; /* Expanded string address */K nam.nam$b_ess = NAM$C_MAXRSS;/* maximum size of expanded filename str */" /* Initialise the fab block */ fab = cc$rms_fab; fab.fab$l_nam = &nam; fab.fab$l_fop = FAB$M_NAM;J /* Get the length and address of the filename string into the fab... */A str$analyze_sdesc(&file_desc, &filename_size, &fab.fab$l_fna);! fab.fab$b_fns = filename_size;J /* Use RMS to find the file and fill in the NAM and FAB blocks */ status = sys$parse(&fab,0,0);# if ($VMS_STATUS_SUCCESS(status))% status = sys$search(&fab,0,0);$ if (!$VMS_STATUS_SUCCESS(status)) {6 lib$signal(&DSKB_OPENERR,1,&file_desc,status,0);+ return; /* Failed to find the file */ }C /* Copy full filespec from NAM block to descriptor real_dev */. real_dev_desc.dsc$w_length = nam.nam$b_rsl;' for (i=0; i <= nam.nam$b_rsl; i ++ )% real_dev[i] = nam.nam$l_rsa[i];B /**************************************************************B * We can't do one track reads for Virtual I/O since we won't *B * be able to locate track boundaries. Choose an arbitrary *B * figure for the size of each search I/O *C **************************************************************/ track_size = 15;K /* Now carry out all of operations that are common to /FILE and disks */ common_select();" /* Initialise the fib block */ memset(&fib,0,FIB$C_LENGTH);= /* Copy the File ID from the nam block to the fib block */2 memcpy( &fib.FIB_FID , &nam.nam$w_fid[0], 6 );O /* Set the fib to ingore locks and to be writable (except select/NOWRITE) */ if (protect_flag == 0)1 fib.FIB_ACCTL = FIB$M_WRITE | FIB$M_NOLOCK; else# fib.FIB_ACCTL = FIB$M_NOLOCK;M /*************************************************************************M * We must now issue an ACCESS QIO to open the file. We need to specify *M * a file attributes block and a statistics block in order to obtain *M * the allocation count for the file which will be used as the maximum *M * VBN which we will attempt to access. *N *************************************************************************/' function = IO$_ACCESS | IO$M_ACCESS; status = sys$qiow(A 0, /* Event Flag Number */A disk_channel, /* I/O channel */A function, /* I/O function code */A iosb, /* I/O status block address */A 0, /* AST Address */A 0, /* AST Parameter */A &fib_desc, /* P1, fib descriptor */A 0, /* P2, not used */A 0, >dŎ$DISKBLOCK061.Eh*3[RANCE.DISKBLOCK.KIT061.SOURCE]SELECT_DESELECT.C;51\8~" /* P3, not used */A 0, /* P4, not used */A atr, /* P5, Attributes block */A 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];$ if (!$VMS_STATUS_SUCCESS(status)) {# /* Failed to open the file */6 lib$signal(&DSKB_OPENERR,1,&file_desc,status,0); deselect(); return; }: /* Get the file allocation from the statistics block */% max_block = sbk.sbk$w_filesizl + (sbk.sbk$w_filesizh << 16);1 /* Check for a file with NO VBN's allocated */ if (max_block == 0) {4 lib$signal(&DSKB_NOBLOCKS,1,&real_dev_desc,0); deselect(); return; }; /* Set flag to show that a file is currently selected */ file_flag = 1;; /* Output a message showing the current select status */ /* show_status(); */} /* End of select_file */void select_disk(void){ extern unsigned shortN disk_channel, /* Channel for Disk or File I/O */P file_flag; /* 1 = File selected, 0 = Disk selected */ extern unsigned longP pid, /* PID of invoking process */P max_block, /* Used for checking user LBNs */P track_size; /* Used as I/O size for search */P extern char real_dev[]; /* Selected device Name */0 extern struct dsc$descriptor_s real_dev_desc;P char dev_name[NAM$C_MAXRSS]; /* Device name entered by user */" $DESCRIPTOR(dev_desc,dev_name); unsigned longP status, /* VMS status return */P iosb[2], /* I/O status block used by $GETDVI */P mount_test, /* bit 0 = device mounted */P foreign_test, /* bit 0 = device mounted foreign */P select_owner, /* PID of process owning drive */P devclass, /* Should be DC$_DISK */P real_dev_length;/* Length of device name */ struct ITEM_LIST itmlst[8];* const $DESCRIPTOR(qual_des,"OVERRIDE");) const $DESCRIPTOR(dev_param, "DRIVE");A /* First deselect any disk or file that is already selected */% if (disk_channel != 0) deselect();; /* Set flag to show that a disk is currently selected */ file_flag = 0;+ /* Get the name of the disk to select */G status = cli$get_value(&dev_param,&dev_desc,&dev_desc.dsc$w_length);$ if (!$VMS_STATUS_SUCCESS(status)) return;L /* Build item list for GETDVI to get information about this disk */ ! itmlst[0].buffer_length = 4;( itmlst[0].item_code = DVI$_FOR;2 itmlst[0].address = (int)&foreign_test;! itmlst[0].retlen = 0;! itmlst[1].buffer_length = 4;( itmlst[1].item_code = DVI$_MNT;0 itmlst[1].address = (int)&mount_test;! itmlst[1].retlen = 0;! itmlst[2].buffer_length = 4;( itmlst[2].item_code = DVI$_PID;2 itmlst[2].address = (int)&select_owner;! itmlst[2].retlen = 0;! itmlst[3].buffer_length = 4;- itmlst[3].item_code = DVI$_DEVCLASS;. itmlst[3].address = (int)&devclass;! itmlst[3].retlen = 0;! itmlst[4].buffer_length = 4;- itmlst[4].item_code = DVI$_MAXBLOCK;/ itmlst[4].address = (int)&max_block;! itmlst[4].retlen = 0;! itmlst[5].buffer_length = 4;, itmlst[5].item_code = DVI$_SECTORS;0 itmlst[5].address = (int)&track_size;! itmlst[5].retlen = 0;" itmlst[6].buffer_length = 31;. itmlst[6].item_code = DVI$_ALLDEVNAM;. itmlst[6].address = (int)&real_dev;5 itmlst[6].retlen = (int)&real_dev_length; itmlst[7].buffer_length = 0; itmlst[7].item_code = 0;   status = sys$getdvi(? 0, /* Event flag number */? 0, /* Channel (not used) */? &dev_desc, /* Device Name */? &itmlst, /* Item list address */? &iosb, /* I/O Status Block */? 0, /* AST address */? 0, /* AST param */? 0 /* NULL argument */ ); 5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];$ if (!$VMS_STATUS_SUCCESS(status)) {4 lib$signal(&DSKB_DVIERR,1,&dev_desc,status,0); return; }2 /**********************************************2 * Decrement max_block since LBNs start at 0 *3 **********************************************/ --max_block;8 /****************************************************8 * Fill in descriptor length for device name *9 ****************************************************/3 real_dev_desc.dsc$w_length = strlen(real_dev)-1;2 /**********************************************2 * Check that the selected device is a disk *3 **********************************************/ if (devclass != DC$_DISK) {, lib$signal(&DSKB_NOTDISK,1,&dev_desc); return; }+ /***************************************+ * Check that selected disk is mounted *, ***************************************/ if (mount_test == 0) {+ lib$signal(&DSKB_NOTMNT,1,&dev_desc); return; }  C /***************************************************************C * If /OVERRIDE was specified then there are no more checks *D ***************************************************************/# status = cli$present(&qual_des);$ if (!$VMS_STATUS_SUCCESS(status)) {< /*****************************************************< * Check that the selected drive is mounted foreign *= *****************************************************/ if (foreign_test == 0) {. lib$signal(&DSKB_NOTFOR,1,&dev_desc); return; } < /*****************************************************< * Check that the selected foreign mounted disk is *< * owned by this process *= *****************************************************/ if (pid != select_owner) {0 lib$signal(&DSKB_NOTOWNER,1,&dev_desc); return; } C } /* End of cli$present(override) */C common_select(); /* Go assign channel etc... */C map_indexf(); /* Map the index file */G/* show_status(); */ /* Output message showing status */C} /* End of select_disk */void common_select(void){>/*************************************************************> * This routine is called from select_disk or select file *> * it will Assign a channel to the selected disk/file, *> * allocate buffers for performing I/Os, clear the arrays *> * indicating that the indexfile has been mapped etc. *? *************************************************************/M/* These arrays are filled in during SELECT to show the indexfile extents */ extern unsigned longM index_lbn[150], /* Starting LBN for this extent */M index_cnt[150], /* Blocks in this extent */M index_tot[150]; /* Blocks in this + earlier extents */0 extern struct dsc$descriptor_s real_dev_desc;P extern struct DSKB_IO dskb_io[2]; /* Descriptions of two possible I/Os */P /* buffer addresses are filled in here */P extern unsigned long track_size; /* Detemines buffer size for malloc */ extern unsigned shortP disk_channel, /* Channel for Disk or File I/O */P modify_flag, /* 1 = I/O buffer has been modified */P access_flag, /* 1 = Selected drive/file has been accessed */P file_flag, /* 1 = File selected, 0 = Disk selected */P protect_flag; /* 1 = SELECT/NOWRI? $DISKBLOCK061.Eh*3[RANCE.DISKBLOCK.KIT061.SOURCE]SELECT_DESELECT.C;51\8W"TE */P unsigned long status, /* VMS status return */P i; /* loop counter */) const $DESCRIPTOR(write_qual,"WRITE");$ /* Clear the index file arrays */ for (i=0 ; i<150 ; i++) { index_lbn[i]=0; index_cnt[i]=0; index_tot[0]=0; } /* Assign an I/O channel */ status = sys$assign(E &real_dev_desc, /* Device Name */E &disk_channel, /* Returned Channel number */E 0, /* Access Mode */E 0 /* Mailbox Name */ );$ if (!$VMS_STATUS_SUCCESS(status)) {9 lib$signal(&DSKB_ASNERR,1,&real_dev_desc,status,0); return; }F /* Allocate buffers for search I/Os */ for (i=0 ; i<=1 ; i++) {! if ( (dskb_io[i].buffer = G (char*)realloc(dskb_io[i].buffer,track_size<<9)) == NULL ) {) lib$signal(&DSKB_INSVIRMEM,0); return; } }% status = cli$present(&write_qual);$ if (!$VMS_STATUS_SUCCESS(status))F protect_flag = 1; /* Select /write */ elseF protect_flag = 0; /* Select /nowrite */F modify_flag = 0; /* Buffer not modified */F access_flag = 0; /* This channel not accessed yet */F} /* End of select_common */void reselect(void){?/**************************************************************? * This routine deassigns and reassigns the channel to the *? * currently selected disk or file. It is called from TEST.C *? * to ensure that all outstanding test I/Os have been cleaned *? * up before another test is run... *@ **************************************************************/0 extern struct dsc$descriptor_s real_dev_desc; extern unsigned shortP disk_channel; /* Channel for Disk or File I/O */P unsigned long status; /* VMS status return */" /* Deassign existing channel */ if (disk_channel == 0)+ /* Print No disk or file selected */! lib$signal(&DSKB_NOSEL,0); else {) status = sys$dassgn(disk_channel);( if (!$VMS_STATUS_SUCCESS(status))> lib$signal(&DSKB_DSNERR,1,&real_dev_desc,status,0); else {& /* Assign new I/O channel */ status = sys$assign(G &real_dev_desc, /* Device Name */G &disk_channel, /* Returned Channel number */G 0, /* Access Mode */G 0 /* Mailbox Name */ );+ if (!$VMS_STATUS_SUCCESS(status)) {@ lib$signal(&DSKB_ASNERR,1,&real_dev_desc,status,0); return; } } }@} /* End of reselect */void map_indexf(void){ extern unsigned longJ max_block, /* Used for checking user VBNs */J index_lbn[150], /* Starting LBN for this extent */J index_cnt[150], /* Blocks in this extent */J index_tot[150], /* Blocks in this + earlier extents */J vbn_factor; /* Cluster_size*4 + bitmapsize */J extern const char use_it[]; /* Do you want to use it anyway? */2 unsigned long read_home(char *buffer, int lbn);B HM2 home_buff; /* Buffer to hold home block */B FH2 indexf_buff; /* Buffer to hold index file header */? FM2 *next_map; /* Pointer to next indexf map pointer */J unsigned long status, /* VMS Status return */J homelbn, /* LBN of Home Block */J indexflbn; /* LBN of Index File Header */J unsigned short i; /* Loop Counter */* const $DESCRIPTOR(nomap_qual, "NOMAP");+ const $DESCRIPTOR(home_qual, "HOMELBN");- const $DESCRIPTOR(index_qual, "INDEXLBN");, const $DESCRIPTOR(factor_qual, "FACTOR");) /* If SELECT /NOMAP then do nothing */% status = cli$present(&nomap_qual);, if ($VMS_STATUS_SUCCESS(status)) return; K /* If /INDEXLBN specified then get INDEX FILE LBN and FACTOR from DCL */% status = cli$present(&index_qual);# if ($VMS_STATUS_SUCCESS(status)) {= status = get_integer(&index_qual,max_block,&indexflbn);0 if (!$VMS_STATUS_SUCCESS(status)) return;? status = get_integer(&factor_qual,max_block,&vbn_factor);/ if (!$VMS_STATUS_SUCCESS(status)) return; }  else {- /* If /HOMELBN specified then use it */' status = cli$present(&home_qual);& if ($VMS_STATUS_SUCCESS(status)) {= status = get_integer(&home_qual,max_block,&homelbn);2 if (!$VMS_STATUS_SUCCESS(status)) return;7 status = read_home((char *)&home_buff,homelbn);* if (!$VMS_STATUS_SUCCESS(status)) {6 lib$signal(&DSKB_HOMEBLOCKERR,0,status,0);$ status = yes_no(use_it);6 if (!$VMS_STATUS_SUCCESS(status)) return; } } elseJ /* No home block specified, try the first 5000 blocks of the disk */W for (homelbn=1 ; (homelbn <= 5000) && (!$VMS_STATUS_SUCCESS(status)) ; homelbn++) {8 status = read_home((char *)&home_buff,homelbn); } ' if (!$VMS_STATUS_SUCCESS(status)) {3 lib$signal(&DSKB_HBLKNOTFOUND,0,status,0); return; }; /* Use home block fields to find INDEX FILE header */G indexflbn = home_buff.hm2$l_ibmaplbn + home_buff.hm2$w_ibmapsize; } 8 status = read_header((char *)&indexf_buff,indexflbn);$ if (!$VMS_STATUS_SUCCESS(status)) {. lib$signal(&DSKB_INDXHDRERR,0,status,0); status = yes_no(use_it);0 if (!$VMS_STATUS_SUCCESS(status)) return; }L /* Set the VBN factor, this is used to convert FIDs to Index File VBNs */H vbn_factor = home_buff.hm2$w_cluster * 4 + home_buff.hm2$w_ibmapsize;B for (i=0, next_map=NULL ; (next_map != NULL) || (i == 0) ; i++) {X map_extent(&indexf_buff, &next_map, (int *)&index_cnt[i], (int *)&index_lbn[i],0); if (index_cnt[i] == 0)L i -= 1; /* No LBN and Count in a placement pointer so step back */ else  {& index_tot[i] += index_cnt[i];' index_tot[i+1] = index_tot[i]; }  }3} /* End of map_indexf */Dvoid map_extent(FH2 *buff, /* Buffer containing file header */D FM2 **map, /* input - previous map pointer */N /* output - current map pointer */N int *count, /* Count from current map pointer */N int *lbn, /* Starting LBN from current map */N short flag) /* 1 = return placement pointers */N /* 0 = return mapping pointers */{ unsigned short pointer_size; if ((*map) == NULL)8 /* Find the first Mapping Pointer in the header */@ (*map) = (FM2 *) ( (short *)buff + buff->fh2$b_mpoffset ); switch ((*map)->fm2$v_format) { case 0: {& pointer_size = FM2$K_LENGTH0; if (flag==1) *count = 1; else *count = 0; break; } case 1: {& pointer_size = FM2$K_LENGTH1; if (flag==0) {. *count = 1 + (*map)->fm2$b_count1;F *lbn = (*map)->fm2$w_lowlbn | (*map)->fm2$v_highlbn<<16; } else *count = 0;  break; } case 2: {& pointer_size = FM2$K_LENGTH2; if (flag==0) {? FM2_1 *map1; /* Format 2 of a mapping pointer */# map1 = (FM2_1 *)*map;. *count = 1 + (*map)->fm2$v_count2;& *lbn = map1->fm2$l_lbn2; } else *count@$DISKBLOCK061.Eh*3[RANCE.DISKBLOCK.KIT061.SOURCE]SELECT_DESELECT.C;51\80 = 0; break; } case 3: {& pointer_size = FM2$K_LENGTH3; if (flag==0) {> FM2_2 *map1; /* Format 3 of a mapping pointer */# map1 = (FM2_2 *)*map;K *count = 1 + (map1->fm2$w_lowcount | (*map)->fm2$v_count2<<16);& *lbn = map1->fm2$l_lbn3; } else *count = 0; break; }0 } /* End of case (mapping pointer type) */ & /* Find the next mapping pointer */7 if ( (buff->fh2$b_map_inuse -= pointer_size/2) == 0) *map = NULL; else 2 *map = (FM2 *)((char *)*map + pointer_size);} /* End of map_extent */.unsigned long read_home(char *buffer, int lbn){ extern unsigned shortJ disk_channel; /* Channel for Disk or File I/O */ unsigned longJ status, /* VMS return status */J iosb[2]; /* $QIO I/O status block */- const char txtDECFILE11B[] = "DECFILE11B";! const function = IO$_READLBLK;K status = sys$qiow(0, /* Event Flag Number */K disk_channel, /* I/O channel */K function, /* I/O function code */K iosb, /* I/O status block address */K 0, /* AST Address */K 0, /* AST Parameter */K buffer, /* P1, buffer address */K 512, /* P2, buffer size */K lbn, /* P3, LBN */K 0, /* P4, not used */K 0, /* P5, not used */K 0); /* P6, not used */5 if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];4 if (!$VMS_STATUS_SUCCESS(status)) return status;5 if (memcmp(&buffer[496], &txtDECFILE11B, 10) != 0). return (unsigned long)&DSKB_HBLKINVDATA;B if (checksum_buffer((unsigned char *)buffer,FALSE,58,FALSE)==0). return (unsigned long)&DSKB_HBLKINVCHK1;C if (checksum_buffer((unsigned char *)buffer,FALSE,510,FALSE)==0). return (unsigned long)&DSKB_HBLKINVCHK2; return 1;}void deselect(void){0 extern struct dsc$descriptor_s real_dev_desc; extern unsigned shortP disk_channel, /* Channel for Disk or File I/O */P access_flag; /* 1 = Selected drive/file has been accessed */P unsigned long status; /* VMS status return */ if (disk_channel == 0)+ /* Print No disk or file selected */! lib$signal(&DSKB_NOSEL,0); else {) status = sys$dassgn(disk_channel);( if (!$VMS_STATUS_SUCCESS(status))> lib$signal(&DSKB_DSNERR,1,&real_dev_desc,status,0); else { disk_channel = 0; access_flag = 0;5 lib$signal(&DSKB_DESEL,1,&real_dev_desc); } }},*[RANCE.DISKBLOCK.KIT061.SOURCE]SET_SHOW.C;16+,= ./ 4X-h*0123KPWO56g)7k89G HJ#include "diskblock.h"void show_status(void){ extern unsigned longP max_block, /* Used for checking user LBNs */P last_block; /* Last VBN/LBN successfully read/written */ extern unsigned shortP disk_channel, /* Channel for Disk or File I/O */P modify_flag, /* 1 = I/O buffer has been modified */P access_flag, /* 1 = Selected drive/file has been accessed */P file_flag, /* 1 = File selected, 0 = Disk selected */P protect_flag, /* 1 = SELECT / NOWRITE */P log_flag; /* 1 = LOG FILE is open */( /* RMS data structures for logfile */P extern struct FAB logfab; /* File attributes block */P extern struct NAM lognam; /* Name block */P extern struct RAB lograb; /* Record attributes block */M/* These arrays are filled in during SELECT to show the indexfile extents */ extern unsigned longM index_lbn[150], /* Starting LBN for this extent */M index_cnt[150], /* Blocks in this extent */M index_tot[150], /* Blocks in this + earlier extents */M vbn_factor; /* Cluster_size*4 + bitmapsize */M extern char real_dev[]; /* Selected device Name */0 extern struct dsc$descriptor_s real_dev_desc;M unsigned long status; /* VMS status return */M unsigned short i; /* Loop counter */M char line[32]; /* Text for output from print_line() */ sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (log_flag!=0)D lib$signal(&DSKB_LOGFILE,2,lognam.nam$b_rsl,lognam.nam$l_rsa); if (disk_channel == 0)+ /* Print No disk or file selected */! lib$signal(&DSKB_NOSEL,0); else  {P /* Print DISK/FILE xxxxx has LBNs/VBNs in the range aaa to bbb (^Xccc) */ if (file_flag == 0)@ lib$signal(&DSKB_DISKSEL,2,&real_dev_desc,max_block); else@ lib$signal(&DSKB_FILESEL,2,&real_dev_desc,max_block); . /* Print WRITEs are enabled/disabled */ if (protect_flag == 1)& lib$signal(&DSKB_WRTPROT,0); else& lib$signal(&DSKB_WRTENAB,0); if (access_flag == 1)7 /* Print "Last block read/written was xxx" */3 lib$signal(&DSKB_LASTBLOCK,1,last_block); else9 /* Print "No blocks have been read/written" */( lib$signal(&DSKB_NOTACCES,0);3 /* Print Buffer HAS/HAS NOT been modified */ if (modify_flag == 0)( lib$signal(&DSKB_BUFNOTMOD,0); else( lib$signal(&DSKB_BUFMOD,0);  if (index_cnt[0] != 0)= /* Print Index File has been successfully mapped... */ {: lib$signal(&DSKB_INDEXFMAP,0); = lib$signal(&DSKB_FACTOR,2,vbn_factor,vbn_factor+1);- for (i=0 ; index_cnt[i] != 0 ; i++); printf(" Count:%11u LBN:%13u\n",+ index_cnt[i],index_lbn[i]); } 6 } /* End of if (disk_channel == 0)... else... */ sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } /* End of show_status */void set_nyi(void){ lib$signal(&DSKB_NYI);}void set_log(void){P extern struct FAB logfab; /* File attributes block */P extern struct NAM lognam; /* Name block */P extern struct RAB lograb; /* Record attributes block */P extern char logfilespec[NAM$C_MAXRSS]; /* Full filename returned by RMS */ P extern unsigned short log_flag; /* 1 = log file is open */) const $DESCRIPTOR(close_qual,"CLOSE");( const $DESCRIPTOR(file_param,"FILE");P char file_name[NAM$C_MAXRSS]; /* File name entered by user */P $DESCRIPTOR(file_desc,file_name); /* Input filename descriptor */? const char default_filespec[] = "SYS$SCRATCH:DISKBLOCK.LOG"; P unsigned long status; /* VMS status return */P unsigned long filename_size; /* A^-w$DISKBLOCK061.E= h*,[RANCE.DISKBLOCK.KIT061.SOURCE]SET_SHOW.C;16X Length of input filename *// /* Close any logfile that is already open */ if (log_flag!=0) {& status = sys$close(&logfab,0,0);' if (!$VMS_STATUS_SUCCESS(status))F lib$signal(&DSKB_CLOSERR,3,lognam.nam$b_rsl,lognam.nam$l_rsa, logfab.fab$l_stv,0); log_flag = 0;E lib$signal(&DSKB_LOGCLOSE,2,lognam.nam$b_rsl,lognam.nam$l_rsa); } 6 /* If this is SET LOG/CLOSE then we are all done */% status = cli$present(&close_qual);+ if ($VMS_STATUS_SUCCESS(status)) return; status=cli$get_value(L &file_param, /* Parameter name */L &file_desc, /* Returned string */L &file_desc.dsc$w_length /* Returned length */ );8 /* File name is not required, just use default... */I if ( !$VMS_STATUS_SUCCESS(status) && (status != CLI$_ABSENT) ) return; " /* Initialise the FAB block */ logfab = cc$rms_fab;X logfab.fab$l_dna = (char *)&default_filespec[0]; /* Default filespec */P logfab.fab$b_dns = sizeof(default_filespec); /* Default filespec size */P logfab.fab$b_fac = FAB$M_PUT | FAB$M_GET; /* Going to read/write */P logfab.fab$l_fop = FAB$M_TEF | FAB$M_SQO; /* Truncate file on close */P /* Sequential operations only */P logfab.fab$l_nam = &lognam; /* Address of name block */P logfab.fab$b_org = FAB$C_SEQ; /* Sequential file */P logfab.fab$b_rat = FAB$M_CR; /* Carriage return per record */P logfab.fab$b_rfm = FAB$C_VAR; /* Variable size records */P logfab.fab$b_shr = FAB$M_SHRGET; /* Allow simultaneous reads */N logfab.fab$w_mrs = 1024; /* Max Record size */! /* Initialise the NAM block */ lognam = cc$rms_nam;X lognam.nam$l_rsa = (char *)&logfilespec; /* Full filename at this address */P lognam.nam$b_rss = NAM$C_MAXRSS; /* max size of full filename */ ! /* Initialise the RAB block */ lograb = cc$rms_rab;P lograb.rab$l_fab = &logfab; /* FAB address */P lograb.rab$b_rac = RAB$C_SEQ; /* Sequential access */ J /* Get the length and address of the filename string into the fab... */D str$analyze_sdesc(&file_desc, &filename_size, &logfab.fab$l_fna);' logfab.fab$b_fns = filename_size;$ status = sys$create(&logfab,0,0);$ if (!$VMS_STATUS_SUCCESS(status))A lib$signal(&DSKB_CREATERR,1,&file_desc,logfab.fab$l_stv,0); else {I /* The file has been successfully created, connect record stream */( status = sys$connect(&lograb,0,0);' if (!$VMS_STATUS_SUCCESS(status))C lib$signal(&DSKB_OPENERR,1,&file_desc,lograb.rab$l_sts,0); else {L /* Everything worked, put out info message with the new filename */G lib$signal(&DSKB_CREATED,2,lognam.nam$b_rsl,lognam.nam$l_rsa); log_flag = 1; }3 } /* End of log file successfully created */3} /* End of set_log */void set_page(void){# extern unsigned short term_flag; term_flag = 1;}void set_nopage(void){# extern unsigned short term_flag; term_flag = 0;}void set_write(void){D extern unsigned short protect_flag; /* 1 = SELECT / NOWRITE */ protect_flag = 0;}void set_nowrite(void){D extern unsigned short protect_flag; /* 1 = SELECT / NOWRITE */ protect_flag = 1;}0*[RANCE.DISKBLOCK.KIT061.SOURCE]SPAWN_ATTACH.C;15+,@./ 4N-h*0123KPWO 56ǫ87v89G HJ #include "diskblock.h"void spawn(void){unsigned long status, status1;char spawn_param[256];*$DESCRIPTOR(spawn_param_desc,spawn_param);&$DESCRIPTOR(command_param, "COMMAND");B status = cli$get_value(&command_param, &spawn_param_desc);( if ($VMS_STATUS_SUCCESS(status))3 status1=lib$spawn(&spawn_param_desc); else" status1=lib$spawn();}void attach(void){Junsigned long pid, /* PID returned by $GETJPI, used by lib$attach */J status, /* VMS status return */C length; /* Returned length from CLI$GET_VALUE etc... */Jint iosb[2]; /* I/O Status Block for $GETJPI system service */struct ITEM_LISTJgetjpi_itemlist[2]; /* Item List for $GETJPI system service */Jchar proc_name[32]; /* Process name from command line */&$DESCRIPTOR(proc_name_desc,proc_name);%$DESCRIPTOR(attach_param, "PROCESS"); status = cli$get_value(N &attach_param, /* Parameter name */N &proc_name_desc, /* Buffer for data */N &proc_name_desc.dsc$w_length /* Returned length */ );$ if ($VMS_STATUS_SUCCESS(status)) {. getjpi_itemlist[0].buffer_length = 4;5 getjpi_itemlist[0].item_code = JPI$_PID;6 getjpi_itemlist[0].address = (int)&pid;. getjpi_itemlist[0].retlen = 0;. getjpi_itemlist[1].buffer_length = 0;. getjpi_itemlist[1].item_code = 0; status = sys$getjpiw(! 0, ! 0, / &proc_name_desc, 0 &getjpi_itemlist, % &iosb, ! 0,  0 );: if ($VMS_STATUS_SUCCESS(status)) status = iosb[0];D if ($VMS_STATUS_SUCCESS(status)) status = lib$attach(&pid);  } 9 if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status);})*[RANCE.DISKBLOCK.KIT061.SOURCE]TEST.C;249+,.H/ 4XHA2-h*0123KPWOI56[f7'.or89G HJ#include "diskblock.h"2/*************************************************2 * This module carries out the TEST function *3 *************************************************/F#define MAXQUEUE 100 /* Maximum length of outstanding I/O queue */F#define DEFQUEUE 20 /* Default length of outstanding I/O queue */3#define RANDOM ((double) rand() / 2415919103.0)E#define MSCP$M_MD_SCCHL 0x400 /* Suppress caching (low speed) */G#define MSCP$M_MD_SCCHH 0x800 /* Suppress caching (high speed) */</***********************************************************: * Each DSKB_IO data structure describes one I/O operation= ***********************************************************/+static struct DSKB_IO *test_io[MAXQUEUE+1];Gextern unsigned char rw_buff[512]; /* Main READ/WRITE buffer */Pextern unsigned short disk_channel, /* Channel for Disk or File I/O */P file_flag, /* 1 = File selected, 0 = Disk selected */P protect_flag, /* 1 = file is selected READ ONLY */P controlt_flag, /* 1 = control T has been entered */P controlc_flag; /* 1 = control C has been entered */Kextern int thirty_secs[2]; /* VMS Quadword for 30 seconds */Kextern int flush_efn; /* EFN used for $SETIMR */static unsigned int P start_blk, /* First VBN/LBN to read/write */P eB9$DISKBLOCK061.Eh*)[RANCE.DISKBLOCK.KIT061.SOURCE]TEST.C;249XHY"nd_blk, /* Last VBN/LBN to read/write */P blk_count, /* end_blk - start_blk + 1 */P queue, /* Length of I/O queue requested */P currentq, /* Number of I/Os outstanding */P iosize, /* Size of each I/O (in blocks) */P duration, /* Runtime in seconds */P readpercent, /* Percentage reads */P test_block, /* Start VBN/LBN of previous I/O */P total_io, /* Count of I/Os completed */P test_efn; /* Event flag used for all test I/O */ unsigned charP cache_flag, /* 0 = bypass cache */P compare_flag, /* 1 = data compare every I/O */P sequential_flag, /* 1 = Sequential I/O, 0 = Random */T singlepass_flag, /* 1 = Exit after a single sequential pass */P done_flag, /* 1 = finished */P qio_p5; /* P5 param for $QIO (MSCP modifiers) */ static time_tP start_time, /* Time when first I/O started */P end_time; /* Time when last I/O finished */void test_disk(void){Pextern unsigned long max_block, /* Used for checking user LBN/VBN */P maxpercent, /* Used for checking percentages */P track_size; /* Number of blocks per read QIO */Pextern const char carry_on[]; /* "Do you want to continue? */Pextern char real_dev[]; /* Selected device Name */0const $DESCRIPTOR(sequential_qual,"SEQUENTIAL");0const $DESCRIPTOR(singlepass_qual,"SINGLEPASS");(const $DESCRIPTOR(random_qual,"RANDOM");,const $DESCRIPTOR(start_qual,"BLOCK.START");(const $DESCRIPTOR(end_qual,"BLOCK.END");*const $DESCRIPTOR(cnt_qual,"BLOCK.COUNT");/const $DESCRIPTOR(corrupt_qual,"CORRUPT.DATA");,const $DESCRIPTOR(duration_qual,"DURATION");&const $DESCRIPTOR(queue_qual,"QUEUE");(const $DESCRIPTOR(iosize_qual,"IOSIZE");2const $DESCRIPTOR(readpercent_qual,"READPERCENT");4const $DESCRIPTOR(writepercent_qual,"WRITEPERCENT");$const $DESCRIPTOR(data_qual,"DATA");*const $DESCRIPTOR(compare_qual,"COMPARE");*const $DESCRIPTOR(nocache_qual,"NOCACHE");Pchar line[132]; /* Text to be output */9float tempf; /* Temporary performance results */Cunsigned long status, /* VMS status return */C i,j, /* General loop variables */C iosb[2], /* for GETSYI & GETJPI */C pagefile, /* Free pagefile space */C diolm, /* Process DIOLM quota */C runtime, /* Number of seconds */C astlm; /* Process ASLM quota */struct ITEM_LIST ; itemlist[3]; /* Item List for system services */Bvoid test_ast(int astparam); /* AST routine for I/O completion */< /********************************************************< * If no disk or file is selected then exit immediately *= ********************************************************/ if (disk_channel == 0) {K /* Print No disk or file selected and immediately return to caller */ lib$signal(&DSKB_NOSEL,0); return; }< /********************************************************< * Check for BLOCK= START/END/COUNT qualifiers *= ********************************************************/# status = cli$present(&end_qual);# if ($VMS_STATUS_SUCCESS(status)) {J status = get_integer(&end_qual,max_block,(unsigned long *)&end_blk);/ if (!$VMS_STATUS_SUCCESS(status)) return;+ if ( (file_flag==1) && (end_blk==0) ) {$ lib$signal(&DSKB_NOVBN0,0);- return; /* Specified end VBN of 0 */ } }  else end_blk = max_block;% status = cli$present(&start_qual);# if ($VMS_STATUS_SUCCESS(status)) {L status = get_integer(&start_qual,end_blk,(unsigned long *)&start_blk);0 if (!$VMS_STATUS_SUCCESS(status)) return;- if ( (file_flag==1) && (start_blk==0) ) {$ lib$signal(&DSKB_NOVBN0,0);1 return; /* Specified a start VBN of 0 */ } }  else= start_blk = file_flag; /* First LBN=0, First VBN = 1 */# status = cli$present(&cnt_qual);# if ($VMS_STATUS_SUCCESS(status)) {! int max_count, block_count;, max_count = max_block - start_blk + 1;N status = get_integer(&cnt_qual,max_count,(unsigned long *)&block_count);/ if (!$VMS_STATUS_SUCCESS(status)) return; if (block_count == 0) {' lib$signal(&DSKB_NO_COUNT0,0); return; } , end_blk = start_blk + block_count - 1; }' blk_count = end_blk - start_blk + 1;< /********************************************************( * Get queue length from command line= ********************************************************/% status = cli$present(&queue_qual);# if ($VMS_STATUS_SUCCESS(status)) {I status = get_integer(&queue_qual,MAXQUEUE,(unsigned long *)&queue);/ if (!$VMS_STATUS_SUCCESS(status)) return; } else queue = DEFQUEUE;< /********************************************************$ * Get I/O size from command line= ********************************************************/& status = cli$present(&iosize_qual);# if ($VMS_STATUS_SUCCESS(status)) {D status = get_integer(&iosize_qual,0,(unsigned long *)&iosize);/ if (!$VMS_STATUS_SUCCESS(status)) return; if (iosize == 0) {% lib$signal(&DSKB_IOSIZE0,0); return; }  } else iosize = 1; if (iosize > blk_count) {' lib$signal(&DSKB_IOSIZEERR,0); return; }< /********************************************************) * Get test duration from command line= ********************************************************/( status = cli$present(&duration_qual);# if ($VMS_STATUS_SUCCESS(status)) {H status = get_integer(&duration_qual,0,(unsigned long *)&duration);/ if (!$VMS_STATUS_SUCCESS(status)) return; } else duration = 0;< /********************************************************, * Get Read write ratio from command line= ********************************************************/+ status = cli$present(&readpercent_qual);# if ($VMS_STATUS_SUCCESS(status)) {W status = get_integer(&readpercent_qual,maxpercent,(unsigned long *)&readpercent);/ if (!$VMS_STATUS_SUCCESS(status)) return; } else readpercent = 100;, status = cli$present(&writepercent_qual);# if ($VMS_STATUS_SUCCESS(status)) {X status = get_integer(&writepercent_qual,maxpercent,(unsigned long *)&readpercent);/ if (!$VMS_STATUS_SUCCESS(status)) return;& readpercent = 100 - readpercent; }5 if ( (readpercent != 100) && (protect_flag == 1) ) {" lib$signal(&DSKB_WRTPROT,0);" return;  }; /********************************************************! * Get flags from command line= ********************************************************/' status = cli$present(&nocache_qual);# if ($VMS_STATUS_SUCCESS(status)) { cache_flag = 0;P qio_p5 = (unsigned char)MSCP$M_MD_SCCHL | (unsigned char)MSCP$M_MD_SCCHH;< qio_p5 = 0; /* Until the controller stuff works!!! */ } else { cache_flag = 1; qio_p5 = 0; }' status = cli$present(&compare_qual);# if ($VMS_STATUS_SUCCESS(status)) compare_flag = 1; else compare_flag = 0; * status = cli$present(&sequential_qual);# if ($VMS_STATUS_SUCCESS(status)) sequential_flag = 1; else sequential_flag = 0; * status = cli$present(&singlepass_qual);# if ($VMS_STATUS_SUCCESS(status)) singlepass_flag = 1; else singlepass_flag = 0; ; /******************************************************** * Print out test parC. $DISKBLOCK061.Eh*)[RANCE.DISKBLOCK.KIT061.SOURCE]TEST.C;249XHG"ameters= ********************************************************/J sprintf(line,"\n"); /* Leave a blank line */= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;M sprintf(line,"About to start testing with the following parameters...\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;1 sprintf(line,"\tDevice:\t\t\t %s\n",real_dev);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;( sprintf(line,"\tTest Duration:\t\t");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (duration == 0): sprintf(line," Unlimited (Type ^C to terminate)\n"); else- sprintf(line," %d Seconds\n",duration);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;M sprintf(line,"\tRead/Write Ratio:\t %d:%d\n",readpercent,100-readpercent);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;0 sprintf(line,"\tQueue Length:\t\t %d",queue);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (queue == 0)- sprintf(line, " (Synchronous I/Os)\n"); else. sprintf(line, " (Asynchronous I/Os)\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;/ sprintf(line,"\tI/O Size:\t\t %d\n",iosize);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;5 sprintf(line,"\tStart Block:\t\t %d\n",start_blk);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;1 sprintf(line,"\tEnd Block:\t\t %d\n",end_blk);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;" sprintf(line,"\tSeeks:\t\t\t");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if ( blk_count == iosize) sprintf(line," None\n"); else if (sequential_flag == 1)& sprintf(line, " Sequential"); else" sprintf(line, " Random");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (singlepass_flag == 1)) sprintf(line, " Single Pass\n"); else sprintf(line, "\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;' sprintf(line,"\tData Compare:\t\t");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (compare_flag == 1)! sprintf(line," Enabled\n"); else" sprintf(line," Disabled\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;H/* Remove documentation for /NOCACHE until we have controller support!!!% sprintf(line,"\tData Cache:\t\t");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (cache_flag == 1)! sprintf(line," Enabled\n"); else" sprintf(line," Disabled\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;*/J sprintf(line,"\n"); /* Leave a blank line */= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (readpercent != 100) {= sprintf(line,"\tYou have specified some WRITE I/Os\n");@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;E sprintf(line,"\tThis will completely destroy %s\n\n",real_dev);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; }< /********************************************************8 * If writes are allowed then check for /CORRUPT=DATA= ********************************************************/ if (readpercent != 100)' status = cli$present(&corrupt_qual);$ if (!$VMS_STATUS_SUCCESS(status)) {) lib$signal(&DSKB_READHELP,0); return; }; /********************************************************3 * Get user to confirm testing with these params= ********************************************************/@ if (!$VMS_STATUS_SUCCESS(status=(yes_no(carry_on)))) return;> /***********************************************************< * Check that user quotas will allow this number of I/Os @ ***********************************************************/# itemlist[0].buffer_length = 4;, itemlist[0].item_code = JPI$_DIOLM;- itemlist[0].address = (int)&diolm;# itemlist[0].retlen = 0;# itemlist[1].buffer_length = 4;, itemlist[1].item_code = JPI$_ASTLM;- itemlist[1].address = (int)&astlm;# itemlist[1].retlen = 0;# itemlist[2].item_code = 0; status = sys$getjpi(? 0, /* Event flag number */? 0, /* pidadr (not used) */? 0, /* prcnam (not used) */? &itemlist, /* Item list address */? &iosb, /* I/O Status Block */? 0, /* AST address */? 0 /* AST param */ );$ if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status,0);, if ( (queue > astlm) || (queue > diolm) ) {$ lib$signal(&DSKB_INSFQUOTA,0); return; }; /********************************************************: * Check that there is plenty of pagefile space. so that: * we can't possibly hang the system if the users quotas> * are set ridiculously high!!! (We had to reboot VIVIAN!!)< ********************************************************/# itemlist[0].buffer_length = 4;4 itemlist[0].item_code = SYI$_PAGEFILE_FREE;0 itemlist[0].address = (int)&pagefile;# itemlist[0].retlen = 0;# itemlist[1].buffer_length = 0;# itemlist[1].item_code = 0; status = sys$getsyi(A 0, /* Event flag number */A 0, /* CSID (not used) */A 0, /* Node Name (not used) */? &itemlist, /* Item list address */? &iosb, /* I/O Status Block */? 0, /* AST address */? 0, /* AST param */? 0 /* NULL argument */ );$ if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status,0);H /*********************************************************************F * If we are going to use more than half the free pagefile then exitI *********************************************************************/( if (pagefile < (iosize * queue * 2) ) {$ lib$signal(&DSKB_INSVIRMEM,0); return; }; /********************************************************+ * Allocate resources for doing the I/Os= ********************************************************/ for (i=0 ; iefn = test_efn;@ /********************************************************. * Byte count is number of blocks * 512A ********************************************************/* test_io[i]->byte_count = iosize<<9; @ /********************************************************/ * Allocate the data buffer for this I/OA ********************************************************/" if ( (test_io[i]->buffer = D (char*)realloc(test_io[i]->buffer,iosize<<9)) == NULL ) { int j; for (j=0; (jbuffer);' test_io[j]->buffer = NULL; free(test_io[j]); test_io[j] = NULL; }) lib$signal(&DSKB_INSVIRMEM,0);D~ $DISKBLOCK061.Eh*)[RANCE.DISKBLOCK.KIT061.SOURCE]TEST.C;249XHK& return; }@ /********************************************************& * Decide on the starting blockA ********************************************************/6 if ( (test_block > (end_blk - iosize + 1)) || % (test_block < start_blk) )& test_block = start_blk;' test_io[i]->block = test_block;@ /********************************************************0 * Decide whether this is a read or writeA ********************************************************/J if ( (readpercent != 100) && ( (RANDOM * 100 + 1) > readpercent) ) {6 test_io[i]->dskb_io_flags.DSKB_IO_READ = 0; if (file_flag == 0)3 test_io[i]->function = IO$_WRITELBLK; elseC test_io[i]->function = IO$_WRITEVBLK | IO$M_NOVCACHE; } else {6 test_io[i]->dskb_io_flags.DSKB_IO_READ = 1; if (file_flag == 0)2 test_io[i]->function = IO$_READLBLK; elseB test_io[i]->function = IO$_READVBLK | IO$M_NOVCACHE; } if (compare_flag ==1)L test_io[i]->function = test_io[i]->function | IO$M_DATACHECK;#/* Cache flag not currently used... if (cache_flag == 0)I test_io[i]->function = test_io[i]->function | IO$M_MSCPMODIFS;*/ }A /*************************************************************? * All the resources have been allocated. Now start the I/OsB **************************************************************/A /*************************************************************? * Don't allow any ASTs to be delivered until we have started * all of the I/O requests.B **************************************************************/5 if (!$VMS_STATUS_SUCCESS(status=sys$setast('\0'))) { lib$signal(status); return; } start_time = time(NULL); for (i=0;ibuffer)+512*j, &rw_buff, 512);E status = sys$qio(test_io[i]->efn, /* Event flag */( disk_channel, /* Channel */5 test_io[i]->function, /* Read/Write */1 &test_io[i]->iosb, /* IOSB address */( test_ast, /* AST routine */. i, /* AST parameter */2 test_io[i]->buffer, /* Buffer address */4 test_io[i]->byte_count, /* Byte count *// test_io[i]->block, /* VBN or LBN */7 0, /* P4 */7 qio_p5, /* MSCP Modifiers */7 0); /* P6 */' if (!$VMS_STATUS_SUCCESS(status)) { lib$signal(status); return; } }L /************************************************************************J * Re-enable AST delivery and allow the AST routine to complete the workM *************************************************************************/H currentq = queue; /* Remember how many I/Os are in progress */D total_io = 0; /* reset counter */D controlc_flag = 0; /* 1 = control C has been entered */D done_flag = 0; /* 1 = AST routine reporting finished */5 if (!$VMS_STATUS_SUCCESS(status=sys$setast('\1'))) { lib$signal(status); return; } ) /* Sleep till AST Routine wakes us */ while (currentq > 0)  {3 if (!$VMS_STATUS_SUCCESS(status=sys$hiber())) { lib$signal(status); return; } }L /************************************************************************N * We arrive here when the AST routine issues a sys$wake because we are doneM *************************************************************************/ done_flag = 0;+ runtime = difftime(end_time,start_time);L /************************************************************************ * Print out the test resultsM *************************************************************************/ sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;9 sprintf(line,"Total I/Os completed:\t %d\n",total_io);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;6 sprintf(line,"Run time:\t\t %d Seconds\n",runtime);= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; if (runtime > 0) {- tempf = (float)total_io/(float)runtime;7 sprintf(line,"I/Os per second:\t %5.1f\n",tempf);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; 6 tempf = 1000 * (float)runtime / (float)total_io;4 sprintf(line,"mS per I/O:\t\t %5.1f\n",tempf);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;4 tempf = (float)iosize * (float)total_io / 2.0;$ tempf = tempf /(float)runtime;F sprintf(line,"Throughput:\t\t %5.1f KBytes per second\n",tempf);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } else {G sprintf(line,"Statistics not calculated for 0 second runtime\n");@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; } sprintf(line,"\n");= if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return;5/* Deassign the I/O buffers and DSKB_IO structures *//* 1 for (i=0 ; ibuffer); test_io[i]->buffer = NULL; free(test_io[i]);  test_io[i] = NULL; } return;*/}%void cancel_timeout_ast(int astparam){B/****************************************************************/B/* We arrive here 30 seconds after a issuing an I/O cancel */B/* If the Done flag is still set then a timeout has happened */B/****************************************************************/B unsigned long status; /* VMS status return */B char line[132]; /* Text to be output */I if (done_flag != 0) /* We still haven't finished!!! */ { currentq = 0;5 if (!$VMS_STATUS_SUCCESS(status=sys$wake(0,0))) lib$signal(status); }}void test_ast(int astparam){M unsigned long status; /* VMS status return */M unsigned long j; /* Loop variable for buffer fill */M char line[132]; /* Text to be output */J total_io++; /* Bump the counter showing how many I/Os we have done */: /* Decrement counter for number of I/Os in progress */ currentq = currentq - 1; = /* Note the time, so we can check if we have finished...*/ end_time = time(NULL);L /************************************************************************/ * Check to see if a Control-C has been typedM *************************************************************************/F if (done_flag == 1) /* Last few I/Os shouldn't be processed... */ {1 /* Count down the I/Os when I was debugging  < sprintf(line,"Outstanding I/O count:\t%d\n",currentq);@ if (!$VMS_STATUS_SUCCESS(status=print_line(line))) return; */O /************************************************************************C * Check to see if all I/Os are finished and wake up main codeP *************************************************************************/ if (currentq < 1)  {: if (!$VMS_STATUS_SUCCESS(status=sys$cantim(0,0))) lib$signal(status);8 if (!$VMS_STATUS_SUCCESS(status=sys$wake(0,0))) lib$signal(status); } return; }L /************************************************************************D * Check to see if our time is up, if so then simulate a Control-CM *************************************************************************/ if (duration != 0) {5 if ( difftime(end_time,start_time) >= duration) controlc_flag = 1; } L /************************************************************************7 * Check to see if we have finished a Single Pass runM *************************************************************************/! if ( (singlepass_flag ==1) && # (test_block > start_blk) &&' (test_block + iosize) > end_blk ) E@ć$DISKBLOCK061.Eh*)[RANCE.DISKBLOCK.KIT061.SOURCE]TEST.C;249XH7 controlc_flag = 1;L /************************************************************************- * Check to see if Control-C has been typedM *************************************************************************/ if (controlc_flag ==1) { end_time = time(NULL); done_flag = 1;; /* controlc_flag = 0; CAUSED IO TO NEVER FINISH!!! */O /************************************************************************$ * Cancel any outstanding $QIOsP *************************************************************************/@ if (!$VMS_STATUS_SUCCESS(status=sys$cancel(disk_channel))) lib$signal(status);O /************************************************************************C * Check to see if all I/Os are finished and wake up main codeP *************************************************************************/ if (currentq < 1) {: if (!$VMS_STATUS_SUCCESS(status=sys$cantim(0,0))) lib$signal(status);8 if (!$VMS_STATUS_SUCCESS(status=sys$wake(0,0))) lib$signal(status); }O /************************************************************************O * Start a 30 second timer to ensure we don't hang if an I/O has been lostP *************************************************************************/H status = sys$setimr(flush_efn,thirty_secs,cancel_timeout_ast,0,0);& if(!$VMS_STATUS_SUCCESS(status))2 lib$signal(&DSKB_FLUSHTIMERR,0,status,0); return; }  if (done_flag ==0) {O /************************************************************************$ * Check status of completed IOP *************************************************************************/ A if ( !$VMS_STATUS_SUCCESS(test_io[astparam]->iosb.status) ) {N /* The number of bytes transferred is iosb.bytes */N /* The number of blocks transferred is iosb.bytes divided by 512 */ int failed_block;A failed_block = ( (test_io[astparam]->iosb.bytes)/512) + 1 test_io[astparam]->block; ? if (test_io[astparam]->dskb_io_flags.DSKB_IO_READ ==1)4 lib$signal(&DSKB_READERR,1,failed_block,F test_io[astparam]->iosb.status,0); else4 lib$signal(&DSKB_WRITERR,1,failed_block,I test_io[astparam]->iosb.status,0); }O /************************************************************************ * Submit another I/OP *************************************************************************/? /********************************************************% * Decide on the starting block@ ********************************************************/ if (sequential_flag == 0)@ test_block = start_blk + RANDOM * (blk_count - iosize); else {* test_block = test_block + iosize;7 if ( (test_block > (end_blk - iosize + 1)) || & (test_block < start_blk) )# test_block = start_blk; }, test_io[astparam]->block = test_block;@ /********************************************************0 * Decide whether this is a read or writeA ********************************************************/J if ( (readpercent != 100) && ( (RANDOM * 100 + 1) > readpercent) ) {K /* If write then fill this buffer from the main Diskblock Buffer */( for (j=0 ; j<=iosize-1 ; j++)L memcpy((test_io[astparam]->buffer)+512*j, &rw_buff, 512); if (file_flag == 0): test_io[astparam]->function = IO$_WRITELBLK; elseH test_io[astparam]->function = IO$_WRITEVBLK|IO$M_NOVCACHE; } else { if (file_flag == 0)9 test_io[astparam]->function = IO$_READLBLK; elseG test_io[astparam]->function = IO$_READVBLK|IO$M_NOVCACHE; } if (compare_flag ==1)- test_io[astparam]->function = > test_io[astparam]->function | IO$M_DATACHECK;F currentq = currentq + 1; /* Increment count of I/Os in progress */  status = sys$qio(0,* disk_channel, /* Channel */9 test_io[astparam]->function, /* Read/Write */7 &test_io[astparam]->iosb, /* IOSB address */0 test_ast, /* AST routine */, astparam, /* AST parameter */8 test_io[astparam]->buffer, /* Buffer address */9 test_io[astparam]->byte_count, /* Byte count */7 test_io[astparam]->block, /* VBN or LBN */9 0, /* P4 */9 qio_p5, /* P5 */9 0); /* P6 */= if (!$VMS_STATUS_SUCCESS(status)) lib$signal(status);* }}* FN|$DISKBLOCK061.E(h*1[RANCE.DISKBLOCK.KIT061.SOURCE]MEKIQ[U@E]-:Hqe.C;51T0;2% 51]B4k@F[d:+|2cG=Kf ~kS|Rx=,c`a9n9V NgY;kuhgk"D 3`1kAlhXN'r*qX VV`f@ s3`Xg~ YJyeJ2#!UbS@.HsjgBmsMidUf7W#JS#Myt`FW:&|j6$ |@J%Z3[D@xNf`@m>Fi; }-o.r'gyWe5Nn&bKEG;NL2f.4VQ[?F)=b QEBGu6Vnw3 Le<4uJ .k;FHDo88+VDO! h1i?@#TxU &.6Oj"} @vsF|VXElqA8 &vv(qib<,`RP\PS=M-l3pBJIBtQ$/_g5^9}ISIknd^ cQr-sj5Q3!\6O Z@eyc`GX-,{.tVWzhK#;(|V\8!r?m*^kp8cd9jY"+ &U4j>Tyqb&et[OE^$IcJ//`$8s^01cp%uZ)4Ew + "hRRj1 !Ve:fpQRP-=ng4?g:o}P-?/@bjDT#WPt:?Yg@BKOB|C7QM!_F*5>Fd/FAnYD|=*N-[ylGRqk5$U)!lb3EK L=Q"0v6g^(]% < }RXm?~ut|(o1nB6 "<S{p$PO 5?i_#$VwLTu*@e.l3;XO ?f}}zJ}${3T`.C!wx$<1y({jQN8qA>Z-Tn6-^eWbt0GL%TO Bh[> w@ 3yI;_'Az.)ln2)^tpxQ,{16_])^RwZ1TV~o/uV(vgN/2dV.G,J^;|%u}#.uym ac[ wm%P c$E]"a"iJ'ZP~ g"g=vvsaR4W](.R?Y~"2q4GXPrINC0 w^$E0p! qNe7BT!IPG]Vs`9JYy0o!uw,taqX`4mV5g:V%inA`}:A'H])t"4 AO2-E9oR`R_F8bSJ!uv9ao"W0?-m)`5pjv*~a'~HmmL%:_%K]+~A>CZk\[sQ=l A6p,FH.||=P\dbK  1LTeBhtpfK$nr7uILvY`;/]HT%GYvsY3G;cTIQha9}fqx#;} 1sz%8z*i5l[m&3zJbF>.[' 3agP0e?~9j m`+yH;%lu18om.mmUa>Q;-]gNML1>ndJ1"YqfJWC(FRrJ;NtFO'! H_4x*UG r9Ww5mXprUa>sD(RL"Eyi ;1m%0~1(?itk])x =v5\}^ H3,D FXgcX~#qXF,{r2e- xhOX;c>4GqsEv>126 ]O qi{[.K&N weh$ ICOUX}~ v S ?(F;">a9 %Aq R("]}1[rL^ {=0UDg`W _La|nf-@8[.,5~!!HvVQ Nx)iVeD@T@|gj -d#PR Vu0]Aiz|c3;{V4!/mYAk<%Sp)8_WXA':A(O?N|Lb}8S]| Z$:f #=Cz99NtuwZlR:/( 'XLRNtkUF^C`nN2Ja'heZ)xAmnbsYYz y&aW)ua_>VcK^789&Gj$JGh(X[I,7ZC?Wgx1q>*#'; 2jlMI ?&4$fn%A. I#NI5Lnz03O!#uo/e O;E~dX\ :piyk1K+o_a{Lz*Ll*\G*Qt_2&Ob6p/QWQ=a^ZU;Wv f-6B= ,+}"Ci)nkw{D4kx?<-I#`c+ YGF9}5 "xG#N<>r-w*8B8fF+?1"/i>rOBq&5sya4x(:,Vn.mI[eOuORDqGJp1ki3,{G+1TzD=L&U+<.IZILyebA=o=Oc2< >k6!LE)An&yZuF&QC_mIA#2zxfO`[fY\2sCF|RHC3=7;Ml PpW|>95(!Efx'<$b7bu(=-V~R.}K@$ bb1 /SoqJ -.p3I(Vp $n;nZwL*oc#Mr:cn!3m{h`+(0x0%v BS$ni:u~ UZltq?A89qfW.A[mF"H ;J A]bOY_&Dqi@c (%ma. 2PzXg;qL?,eV170udRaKu::ndN|" ^~XRAb+TBOzP# y.s E8j}+s{%5%HB$~sMPTiV}h*?Jf*r&6TTj}$?@o |T+8b6$w6cc Ma[J,[K9i%5_> v[zY4zZ_) @X4;f'aJcNa^%(6a)Y`UFMG1>lu~*CC-ipsO[c5i}8p U|P2A6@'p0h=K$D-WYzn{"Z[/U{b/y/yNf K#@Zal,A8n,|0iM t@23'L4~bIi kr2zL{R 5>LT{`8DR! {h";YyHZ_< R;,CF &^GV Iq`1bH<{%*"SFu]$k"Z fF7*Gsb#T\1[Ek/j1K2bL)MsOw#`n|LuI;&|9p[WlV$ x\NI[k\aGk44L&hzI 8-? |EeSX HYdAH`NH~d["5P(>wRi;tVYaA< VgHJ+:V7NG?bqgMV/&"t$"J x?tJQQ5B Gt}DX"f2`Z4?*QbBT LS= '|rUx%G/<5u}LvN 1 1F+w]P5hsJ[O_W5 swg34!]c;Us5^K]dtD l~\+`f =z,ccaq0ac"UWyG>FM\d1.yW "r1ZYf%2~jQH>V87` OJ?@TXa*U2O/r9{KWI4Aru>n'' gbif3I*m_sbdrC7?-Sa=Od(QM(k 6u;*>)z7(C,zMPp=SU_oM^3#%6 D4L>n%+ywQ]l^Yd,:b-$2YPuFlx*}P{|z dBhHC~#b^C2y[g$ID e"QEE`] v )Fd~C[kSY\Chn/,@#UHh`]Ugm\O,;l\V0UG<YBMCvvRYcWY{Ib|Z(GN%{!L#T~S_Oszap=K'YRZr9lRE#X4FDH^P*!K 7JS Iu a7huT9XSS&P-t6A6 9v$G- `:G(oN1~2SP=J69yZZmINYL5 )[:_0k2LLW8^YM?9>{m2wH_\v|h{Q6U{eUahN3)Gz)Wl ,x`sq3rW[u FF~iJ{8 jHUGx\H =*KB+OMx n@GV#[ h/+i'4};^DL7|C"I<7"z Wv!gUHwbfyL'Y+}@wqESijg8kE(Z>tG9Gg WN@+l] Tzw'npB2OM*@1. Nvk7MdWl8t=()PpB0dfCl{LYsg`#L8L$MmBZ(/;?rAr#E 6o.S1"xa5tdNgB4y=,mmaC}>{kF XOzq"'|ByElnahQi2=n}P5Z(C 07Y8R2jU?] F8uxnh7 {Dj^<}0*Qjl)k*O`mX8q|T_eLQg#5Vi1!.40H04Y<",h"k:-)U^%Pn~CpTf\DtW\erP|Pq=GXk9],K"~S #M05!F YARnDEv5q ' 5}H EL|3Teg8IV Yaegx"T%5kPX9Z47A#24>V=M5R"WJr$|}P0xbkR /  n*/ \6n)j2)VlSK.@kE%lO+5@ A?dQg9cra1(k:V+tmA&Q&;+W93njh$Z#/ivhn'$Rx*lk,9U]>(8-D]EmD3H- %cA f,BA~[);jp vUL-v2 =]vW&t* F50 !,0G4e7Ojiu@9L"~m PPN}]7#R5W9i%8_b%s h.zfhzDAl"UES~R=FKBwoKU|D ^&:.g m%*x! sF-ocn1i)*D$rP4by#G/J4+0H<S8S3p mvP\"a9NH*Ts@ K*ImzYB lnP"f,0;d=oUCSRRB"=V90sv4%$CXoB~]U;~GyHG1h8 1yGJ|Py|?_ ,  f4 j"FY_3YFqQT0wG{^[3A!/8]qIw-{K4 s!V3tz\yMC= 2bIp3PK$B*Y)HF;J`)odB_/exez-Dj7U<}%xOks5lH I3 r<<Y?OCFTp/nPBv *{accrF(nwLN{+ G@ /WwQ7xLT6nW1[\r}Nv@"@T cO] C>^\hv@ |)wW8@ fVNP @acjdW$wmp1nc_kt*YEj/Jpk]E SAKy~|>jV"yiN!`,T@+ k/pfZ&MPSsjGRck@(^W Ju^;RR<v*gjVKhc\ak/9%N;U_'L zE ;z;_X8Xn$wA~H$S3)Wnh!}0N\N]c@1yh2~n8?$f4$;\=45"#&'3a4@ !N9<Wj56u=T-`%(uP5Umb4PABQg/%C.>#{]OMZVPV 0(mAOHwiC143 -Uw[yy)VdqHggt {TvfE/ObH8x1+E)~ \/h] Oy!=jRyw~x4W8#A!-oYH7B$zG /3\ m{7G^W @!b O=j?(rYyg-u DxT R"gFbD,H/zu|Ba Q1dU@MQ7}KuV#?Cc413lS3oFxT" } %8DP{&]C+Q djDSM?/n{X-_dkZHv4]*R+nl6FbOx;nX[WR_Ey?zjeRT8vP}O  f_AH9\f+=1=nqTH B:K>8Q $ ]8=*#TAKssJcK=q1~cUMR'~0La.M)/,Vn JOB+ f-/ijQ|tw{ f@]V|CYh@HZ8K44V\jP`nJ\xReSH&x&93gO7K)k 8 BH"/7UfJT_sg]H=OaEa*2dbh02}jPeU:p;UZ]u^,l Fol5Mv+hNj]'}C'(GxD^uthIxwsjI4Pfrs I = U+]Fmf(?daqEpVC91vEy= .L4l< =4l*:a'\fWw<S0J{Dd ]xU7z\f9|>2]o|" H:N_~xUD>6f@DkO pi. .$6r# {!Qu$[um] )\>9Jw/tgyO+Iu  htNHgE_A/?l(>ClY)j3HNq4[)=$q,TO;C As\q-)e~S3MJZ=q Fo~:R}D b]fQeijU] 22OH\]4.y1!p]+k| ;92 (qrwlDvk1] "0].`@|rv{+eWmY9OoO $H J}2!(3=GD~*Z8e}s'-kWjJDo?k:L$ 928$I*3{mqTiz,`F_R !1oSWr$bpv9uSJ%}:c*F :,I`! ZalibdfSlg+];1aKE:oSV,]N X{\mfN3`z?~sKzI q$Q6q68%X!`\C0g wu*Ds%A8Zv2>=!_Pj(x F*D&\&Wc#Ta.#J%mGdJi~[.~EPzggo)! Ah{& _G .# yq1dM J}SV0VeipkB~)h2QMmD$kAP`A8=I4%=uEG =l,9/Ie$l8"+~&OjBM ?g >S">bD|rM<.Bpt7R,UT lxep n%eqJ9U9r)'~sJKmfS.K4oDxnz;=S9n|J`xO8U` eiZ|3wjalmq1!"17H\wzwO+:&R4n~c em3jS'/mNARbT)%i"sp^7tR5nuf-Zb6?s>u{m Dhx3rbLfIB+q<{<73k-e g${^ q.*i+3g/;~qyTWP-mIW@g7 y'V7m)t^bRV,Y}3)*dU(Pg&F;J cv:2o-,9z%1u( G|A(u_Do#&I~*3Y>C2&&p3bC\m2]C:JR4Rble!Bb~9 6sA8$}BbN}j&bPASvIqirTahU6qU]Q /1 fIRSTBN/LBN to read/write */P e