From: SMTP%"nick@nick01.demon.co.uk" 26-SEP-1994 13:14:37.80 To: EVERHART CC: Subj: RE: How many file headers left? (was: Trying to extend page file...) X-Newsgroups: comp.os.vms From: nick@nick01.demon.co.uk (Nick de Smith) Subject: RE: How many file headers left? (was: Trying to extend page file...) Organization: his office Reply-To: nick@nick01.demon.co.uk X-Newsreader: Demon Internet Simple News v1.29 Lines: 906 Date: Mon, 26 Sep 1994 16:17:53 +0000 Message-ID: <780596273snz@nick01.demon.co.uk> Sender: usenet@demon.co.uk To: Info-VAX@Mvb.Saic.Com X-Gateway-Source-Info: USENET In article <9409241815.AA23384@uu3.psi.com> leichter@lrw.com "Jerry Leichter" writes: [*snip*] > division tells you exactly how many more extents you have room for. (I can't > find the documentation to check, but it may be that on some larger disks an > extent may require more than 2 words; so take this as a maximum.) The table of types for ODS-2 disks is: Type Words Max LBN Max extent size FM2$C_FORMAT1 2 2^22-1 256 FM2$C_FORMAT2 3 2^32-1 16384 FM2$C_FORMAT3 4 2^32-1 2^30 There is also a FM2$C_FORMAT0 which is used to apply absolute placement information for the following retrieval pointer. > Looking back, I realize that this answers a question raised by the original > problem (since a page file can't have extension headers), while you seem to > be asking about the more global issue of counting free headers on a disk. I > know of no direct way to display that value. However, it would be easy enough > to write a program to do it - all it would have to do is walk through the > header allocation bitmap. Perhaps someone has already done this and will post > the code. Note that, because of caching, even if you aren't creating and > deleting files on the disk, any count you get this way will necessarily be > approximate. The code included here uses an undocumented XQP subfunction to flush the relevant cache prior to the scan - it is therefore far more accurate than not flushing the cache, but there is always the possibility that in the interval between calling the code to flush the cache, and reading the disk data that a small error will creep in. However, I think that may be allowed as being within the limit sof experimental error ;-) This code was originally part of an article I wrote for VAX Professional - it seems to still work fine. You will need privs to run this code... Nick nick@nick01.demon.co.uk European DECUS Core Technology SIG Chairman Note: my NCDLAB address is no longer valid $! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))' $! $! This archive created by VMS_SHARE Version 8.3 $! On 26-SEP-1994 15:33:44.57 By user NICK $! $! The VMS_SHARE software that created this archive $! was written by Andy Harper, Kings College London UK $! -- December 1992 $! $! Credit is due to these people for their original ideas: $! James Gray, Michael Bednarek $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. AAAREADME.TXT;1 $! 2. ATRDEF.H;1 $! 3. FATDEF.H;1 $! 4. FH2DEF.H;1 $! 5. FIBDEF.H;1 $! 6. FM2DEF.H;1 $! 7. HM2DEF.H;1 $! 8. INDEX_HEADERS.C;1 $! 9. EXTEND_FILE.C;1 $! 10. BUILD.COM;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!" $ if f$getsyi("CPU") .gt. 127 then $ goto start $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $unpack: subroutine ! P1=filename, P2=checksum, P3=attributes $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'" $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped" $ delete 'f'* $ exit $dirok: $ x=f$search(P1) $ if x .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped" $ delete 'f'* $ exit $file_absent: $ w "-I-UNPACK, Unpacking file ", P1 $ n=P1 $ if P3 .nes. "" then $ n=f $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='n' PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t, SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE; PROCEDURE SkipPartsep LOOP EXITIF MARK(NONE)=END_OF(b);EXITIF INDEX(ERASE_LINE, "-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE COPY_PREVIOUS(b,n)LOCAL m, s,e;m:=MARK(NONE);MOVE_HORIZONTAL(-b);s:=MARK(NONE);MOVE_HORIZONTAL(n-1);e:= MARK(NONE);POSITION(m);COPY_TEXT(CREATE_RANGE(s,e));ENDPROCEDURE; PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);l := LENGTH( s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1; CASE c FROM ' ' TO '`' ['\']: b:=GetHex(s,p); n:=GetHex(s,p+2); p:=p+4; COPY_PREVIOUS(b,n);['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[' ']: p:=p+1; [INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE; PROCEDURE Decode POSITION(BEGINNING_OF(b));LOOP EXITIF MARK(NONE)=END_OF(b); IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine; MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO( COMMAND_LINE,"file_name");b:=CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO( COMMAND_LINE,"output_file"));QUIT; $ if p3 .eqs. "" then $ goto dl $ open/write fdl &f $ write fdl "RECORD" $ write fdl P3 $ close fdl $ w "-I-CONVRFM, Converting record format to ", P3 $ convert/fdl=&f &f-1 &P1 $dl: delete 'f'* $ checksum 'P1' $ if checksum$checksum .nes. P2 then $ - e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ exit $ endsubroutine $start: $! $ create 'f' XHi, X XThis`20is`20just`20the`20code`20(as`20it`20stands`20on`2009-Oct-91).`20It V\3104complete`20and`20debugged`20- XI`20don'\4C04ink`20that`20I'll`20do`20much`20more`20to`20it,`20unless`20anyone V\5204es`20up`20with\1504 Xideas`20abou\5006gs\3A04add`20to`20\AD04output. X XI've`20kept`20it`20simple`20(no`20fancy`20graphics`20etc)`20in`20order`20 V\4503keep\4A05size`20down,`20and Xso`20as`20not`20to`20confuse`20the`20reader. X XIf`20this`20format`20is`20ok,`20let`20me`20know`20and\FB06just\6A07rucking`20a Vlong. X XINDEX_HEADERS.C`20(\3504all`20\6C04*.H`20files)\5F04a`20utility`20th\7104nspec Vts`20\2A04index Xfile\9004`20internal`20fragmentation.`20Much`20of`20wh\4104t`20reports`20 V\5E03\4604same`20as`20can`20be Xobtained`20from`20DUMP/\A906,`20bu\4005includes`20more`20detail`20relevant`20t Vo`20\5604matter`20in Xhand,`20in`20particular`20\2204type\9704extents`20and`20how`20m\AF04map`20spac Ve`20is`20left.`20It`20is Xalso`20a`20nice`20exampl\4505using`20FCS.`20Try`20running`20it`20with`20READAL VL`20privilege`20(it`20only Xreads\9105index`20file`20-`20no`20writes`20a\E504one). X XEXTEND_FILE.C\9B04a`20little`20utility`20that\1904used`20to`20extend`20any`20 V\5A05by\6C04 Xspecified`20number\C404blocks.`20This`20can`20be\4706on\A010on`20\5204disk, V`20even Xa`20live`20on\BD04you`20will`20nee\8605have`20BYPASS`20or`20SYSPRV\1904use`20i Vt.`20Once`20\3704\2A05run Xit,`20\1109to`20do`20an`20ANALYZE/DISK/REPAIR\9F08volume\2B04fix`20up\1505seco Vndary X\BE0Bheader`20(RMS`20only`20writes`20\3104primary\2407,`20surprise\0A0A!). X XAfter`20that,`20\3704\5E0Bis`20extended.`20The`20reason`20for`20needing`20 V\D006this`20is Xthat\4613\9B05\4B08`20by`201000`20blocks`20(rou\1805\E904\4B04e`20next Xcluster`20boundary)`20at`20a`20time`20due\2C04an`20undocumented`20constraint V\8103`20XQP,`20so`20being Xabl\3405push\A310up`20by`20more`20than`20\9F0B,`20say`2050,\B20B\8804 Xtime,`20allows`20you\5C05revent`20\5F04drea\D604"HEADERFULL"`20message`20(and V`20then`20having`20to XBACKUP`20\1A04rest\8D06e`20disk.`20This`20is,`20in`20essence,`20my\2204sis`20f Vor`20\2D04article. X XBUILD.COM`20builds`20both`20programs`20from`20source. X XRegards, X XNick`20de`20Smith XNICK@NCDLAB.ULCC.AC.UK`09PSI%234213300154::NICK $ call unpack AAAREADME.TXT;1 1126709157 "" $! $ create 'f' X/* X`20*`20$ATRDEF`20-`20Attribute`20list`20description X`20*\2B04The`20at\2508control`20\2D05is`20used`20to`20read`20and`20write`20fil Ve\360As.\4904It\3E04sists`20of\0C04catenated`20a\6111blocks`20termi\2406by`20a V\4804single`20zero`20longword.\AA06is`20is`20a`20trimmed`20down`20version V\7404the`20full`20$ATRDEF`20\B204does`20not`20include\4B04\2904detailed`20over Vlays\2E05bitfield`20masks.`20Th\5307\6708is`20over`20125\4A04lines`20long V\A404/ X#define`20ATR$C_HEADER`20`20`20`200xA\0704\0404\0606/*`20File`20header`20 V\1D0E\0808\510FS_\510C200`20\511Asize\5121C_FILE_SPEC`200x2E`20\5114specificat Vion`20\A220\510D\A216\510E\A90F*/ X Xtypedef`20struct`20$atr\0F04`7B X\2104unsigned`20short`20atr$w_size;`20\6A0CSize`20of`20attribute`20in`20bytes V\6B0C\5119type\510EAt\4908type`20cod\B70C\5115long`20`20atr$l_addr\510Fddress V`20\A50Dtext\510D`7D`20\FF07; $ call unpack ATRDEF.H;1 1665619417 "" $! $ create 'f' X/* X`20*`20$FATDEF`20-`20File`20ATtributes`20record`20definition. X`20*\3304Converted`20from`20`5BV54.VMSLIB.LIS`5DFH2DEF.SDL,`2030-Sep-91,`20by V`20Nick`20de`20Smith\4A04This\6808is`20found`20in`20the`20file`20header`20blo V\3A03FH2$W_RECATTR`20field,`20and\4A04may`20be`20read`20directly`20\9F05\4C04 V\4706,`20or`20via`20a`20ATR$C_\4B08at\F508\4B04read\EB04\9E06is`20a`20trimm V\F003down`20version`20of`20\A805ull`20$FATDEF\8E04`20does`20not`20include X\4B03\2904detailed`20overlays\2E05bitfield`20masks.\7809structur\3804finiti V\7303reflects`20Figure`201-7`20"ACP`20-`20QIO`20Record`20At\CF0CArea"`20in V\8405"VMS`20I/O`20User's`20Reference`20Manual:`20Part`201"`20(AA-LA84B-TE). X`20*/ Xtypedef\9B07`20$fatdef`20`7B X`20`20`20`20unsigned`20char`20`20fat$b_rtype;`20\2004\0404/*\A308type\1709 V\0909\0606*/ X\511Aattrib\5308\510A\1806utes\5122short`20fat$w_rsiz\A215size`20in`20by\5412 V\5110long\A206l_hiblk;\510CHighest`20allocated`20VBN`20\5129ef\5110End-of-file V`20\4B11\F322ffbyte\5209/*`20First`20free`20byte\F704\7C0B\5115char\A206b_bkts Viz\5209/*`20Bucket`20size\4D04blocks\A21E\510Cvfcs\510EVFC`20\4E09yte\4D0F V\F320maxrec\F30CMaximum`20record`20s\5C13\511Cdefext\510CDefault`20exten\510B V\FB0B\511Cgb\9F0A\5106Global`20buffer`20count`20\F328def$$fill_1`5B`204`20`5D; V\5104Spare`20\4410\5126$w_versions\A707\F30B\1A07`20limit`20(.DIR`20only) V\5105`7D`20$fatdef; X#define`20FAT$S_FATDEF`20\4C03(sizeof(struct\3008))\3108`09FAT$C_LENGTH\0D05 V\3E08\220DK_\2213 $ call unpack FATDEF.H;1 478147097 "" $! $ create 'f' X/* X`20*`20$FH2DEF`20-`20File`20header`20definitions`20for`20Files-11`20Structure V`20Level`202 X`20*\4704Converted`20from`20`5BV54.VMSLIB.LIS`5DFH2DEF.SDL,`2030-Sep-91,`20by V`20Nick`20de`20Smith\4A04This`20is`20a`20trimmed`20down`20version`20of`20the V`20full\BC09an\2504es`20not`20include\4B04\2904detailed`20overlays\2E05bitfiel Vd`20masks.`20Th\5307\6708is`20over`20140\4A04lines`20long. X\A408structur\6404finition`20reflects`20Fig\1B042-2`20"Format`20\BB07Head V\5A03Area" X\4D03in\1705"VMS`20File`20Systems`20Internals"`20book`20by`20Kirby`20McCoy`20( VEY-F575E-DP). X`20*/ Xtypedef\9B07`20$fh2def`20`7B X`20`20`20`20unsigned`20char`20`20fh2$b_idoffset;\2204`20`20/*`20Ident`20area V\B103fset\A104words`20\2406`20`20*/ X\5119mp\5110Map`20\0A03''\0606\0B08\1006\5122ac\5110ACL`20\513Brs\5110Reserv V\2703\4304\5126short`20fh2$w_seg_num;\2B07/*`20File`20segment`20numbe\7E03 V\4D0A\5121truclev;\510Ftructure`20level\5112#define`20FH2$C_LEVEL1\1B040x10 V\0905\A20A0401`20octal:\5811\2B07\51162`20\5105200`20\510D1000`20\5117\3405 V\F31Efid`5B`203`20`5D\F30FID\E60F\F31CS_FI\30050x6 X\6A19ext_\6E0B/*`20Extension`20f\7418\BB1Crecattr`5B`2016`20\5203\BB08record V`20attributes\511Dlong`20`20fh2$l_filechar\9E03\2404\5108characteristic\4F0E V\5109/*`20Note:`20\4B0E<24:31>`20ar\9904served`20for`20user`20and`20CSS\0D04. V`09\F125prot\9F07\7304Re\EC05protection\9D0F\5113char\F106b_map_inuse\5306 V\5103#`20of`20map\B104a`20words`20in\A104\5125acc_mode\A307/*`20Least`20privil Veged`20access`20mode\5117long\5106l_fileowner;\5108File`20owner`20UIC\F012 V\5113short`20fh2$w_fileprot\A20A\5105protection\5130backlink`5B`203`20`5D; V\5104Back`20link`20pointer`20\5121char\F306b_journal;\2B07/*`20Journal`20contr Vol`20flags\512Aru_active\5306/*`20If`20<>0,`20file`20has`20\2006`20RUs\F321def V$$w_fill_3;\5107Reserved`20\EB12\5118long\A206l_highwater;\A208High-water`20ma Vrk`20in\AD06\510E#define`20FH2$C_LENGTH\1B040x50\2B0C/*`20Length`20of`20head V\5703area\A227def$$l_fill_6`5B`202`20`5D;`20\F524\A211SUBSET0_\AA0D8`20\A239ch Var\A205$r_class_prot`5B`2020`20\A306Security`20classification`20mask\A215FULL V\9F0D6C\7C07\A20Dfull\A708\A226def$$b_fill_4`5B`20402`20\A306Rest\5305ile`20 V\5312\5110short`20fh2$w_checksum;`20\A208Fi\450A\1E08\A10E\5104`7D`20$fh2def; X\FE0CS_FH2DEF`20\2603(sizeof(struct\3008)) $ call unpack FH2DEF.H;1 1681937468 "" $! $ create 'f' X/* X`20*`20$FIBDEF`20-`20File`20Information`20Block`20definitions`20for\2705s-11 V`20Structure`20Level`202 X`20*\5204This`20is`20a`20trimmed`20down`20version`20of`20the`20full`20\7D08an V\2504es`20not`20include\4B04\2904detailed`20overlays\2E05bitfield`20masks. X\7808st\9508\B80A`20reflects`20Figure`201-4`20"F\EF15\4904Format"`20in\8105"VM VS`20I/O`20User's`20Reference`20Manual:`20Part`201"`20(AA-LA84B-TE). X`20*/ Xtypedef\9807`20$fibdef`20`7B X`20`20`20`20unsigned`20\0D04`20`20fib$l_acctl`20:`2024;\1504/*`20Access`20cont Vrol`20bits`20\3307\0808*/ X\0704char\160Bfib$b_wsize;\1509/*`20Window`20size\4910\510F\A209short`20fib$w_ Vfid_num;\510AFile`20numbe\7F0C\512Dseq;\510Fsequenc\5A17\5110\FC06\F306fid_rvn V;\510ASh\6F05orm`20rvn\A225\5110nmx;\510AExtended`20fi\FC18\F31Cdid`5B`203`20 V`5D\5207/*`20Directory`20\5205FID`20\A220long\A206l_wcc;\2B0B/*`20Wild`20car V\0503ontext\F322\A20Cnmctl;\510CName\4C05rol`20bits\512Ecntrlfun\A807/*`20ACP V`20\5008function\F32Bcntrlva\A508\5118parameter`20\5107`7D`20$fibdef; X#define`20FIB$C_ACCDATA`200xA`20\870E\5C04bove`20data`20necessary`20for`20acce Vss\5C07\5107`09FIB$C_FLUSH_CACHE`20`20`200x12\510BFlush`20selected`20cache`20 V\FE11\510FID\4F09\5105\200FEXTENT\23080x2 X\200EQUOTA_\910A3 X\200EBFRD\610A0x4 $ call unpack FIBDEF.H;1 224623912 "" $! $ create 'f' X/* X`20*`20$FM2DEF`20-`20Retrieval`20pointer`20definitions`20for`20Files-11`20Stru Vcture`20Level`202 X`20*\4D04Converted`20from`20`5BV54.VMSLIB.LIS`5DFH2DEF.SDL,`2030-Sep-91,`20by V`20Nick`20de`20Smith\4A04This`20s\6709\8A0A`20reflects`20Figures`202-5`20to V\07038`20"R\C409Pointer\4C04Format"`20in`20the`20"VMS\CB05`20Systems`20Interna Vls"`20book\9104Kirby`20McCoy(EY-F575E-DP). X`20*/ Xtypedef\A107`20$fm2def`20`7B X`20`20`20`20variant_un\AF04\1406\0404unsigned`20short`20fm2$w_word0; X#define`20FM2$M_EXACT`20`200x0001 X\1C0EONCYL`20\1C062 X\1C0ELBN`20\69030x1000\1C0FRV\1C072000 X\9408\AC08\C907\AD0A\B10D:`2014; X\1B15fm2$m_format\28032;\770DC_PLACEMENT`090x0\420C`20/*`20Explicit`20placemen Vt`20control\2609*/\510FFORMAT1`090x1`09`09/*`20Retrieval`20Pointer`20Fo\8D051 V`20\441F2`090x2`09\441D2`20\441F3`090x3`09\441D3`20\440B\0B08`7D`20a;\0D09vari Vant_struct`20`7B\1909\0404unsigned`20char`20fm2$b_count1\410A\280Dfm2$m_highlb Vn`20:`206;\760Bb;\0D09\310Fcount2`20:`2014\2406`7D`20c;\0905\9F08union`20 V\9E0A\4109short`20fm2$w_lowlbn\6613long`20`20fm2$l_lbn2;\4821count\270A\8708st Vruct\880B\440D:`201\F10B\8212\81093;\2609`7D`20d;\F307e; X#define`20FM2$C_LENGTH0`200x2\1A151`200x4 X\1A142`200x6 X\1A143`200x8 X`7D`20$fm2def; $ call unpack FM2DEF.H;1 1884133822 "" $! $ create 'f' X/* X`20*`20$HM2DEF`20-`20Home`20Block`20definitions`20for`20Files-11`20Structure V`20Level`202 X`20*\4604Converted`20from`20`5BV54.VMSLIB.LIS`5DFH2DEF.SDL,`2030-Sep-91,`20by V`20Ni\6F05`20Smith\4A04This`20is`20a`20trimmed`20down`20version`20of`20the`20f Vull\BB09an\2504es`20not`20include\4B04\2904detailed`20overlays\2E05bitfield V`20masks. X\7808st\DF08definition`20reflects`20Fig\1B042-20`20"Format\9008Home`20Block" X\4D03in\1605"VMS`20File`20Systems`20Internals"`20book`20by`20Kirby`20McCoy`20( VEY-F575E-DP). X`20*/ Xtypedef\9B07`20$hm2def`20`7B X`20`20`20`20unsigned`20long`20`20hm2$l_homelbn;\2104\0303/*`20LBN\A904home`20( Vi.e.`20this)`20block\2606*/ X\5119al\530D\510Aalternate\5B06\4F0B\5120tidx\511Dindex`20file`20header`20 V\5110short`20hm2$w_struclev\F407/*`20Volume`20structure`20level\9D08\A208#defi Vne`20HM2$C_LEVEL1\1B040x10\0905\2B07/*`200401`20octal:\5611\2B07\51162`20 V\5105200`20\510D1000`20\5117\3405\5105\F319cluster;\510AStorage`20bitmap`20c V\2106`20factor\5122homevbn;\510AVBN`20of`20home`20(i.e.`20this)`20block\5122al V\530D\510Aalternate\5B06\4F0B\5120tidx\511Dindex`20file`20header`20\511Cibmapv V\F409\510A\470Bbitmap\9F08\A213long`20`20hm2$l_ibmaplb\510BLB\513Dmaxfiles; V\5109Maximum`20#`20files`20on`20volume\511A\F311size\5206/*`20In\9B09\9C08size V,`20blocks\5120resf\A20E#`20reserved`20\A318\511Cdevtyp\A007\5105Disk`20device V`20type\EA0A\5125rvn;\2B0B/*`20Relative\9708number\5129setcount\F30ACount`20of V`20\5106s`20in`20set\5128volchar\F30BVo\9905characteristics`20\511Clong`20`20h Vm2$l_volowne\5208\510Aowner`20UIC\4B0D\5122sec_mask\5111security`20mask\511F V\F30Cprotect;\F311\1907ion`20\A221\510Cfileprot\A20ADefault`20file\5717\511Cre Vcp\500A\5111record`20\580F\511Cchecksum1;\5108First`20\1808\F012\5113long`20 V`20hm2$q_credate`5B`202`20`5D\5403/*`20Volume`20creat\9304date\511Fchar\5106b_ Vwindow\F208\F30C\1A06`20siz\5010\511Dlru_lim;\5112LRU`20limit\F322short`20hm2$ Vw_extend\A214file`20extend\5120long\A206q_retainmin`5B`202`20`5D;`20/*`20Minim Vum`20\5205retention`20perio\5C06\5123ax\510Bax\513Dvdate`5B\4F06\5004Volume V\4A03vision`20date\F31Fchar\5106r_min_class\53030`20\A306\5307min\AA05security V`20class\5121ax\5142short`20hm2$w_filetab_fid`5B`203\5207File`20lookup`20tab V\0D03FID`20\F31A\510Clowstruclev;\2403/*`20Lowest`20s\1607`20on`20vo\B305 V\5125high\520B/*`20High\521F\5110char`20`20hm2def$$fill_1`5B`20310\F207Spar V\900B\EC0B\5117long\5105$l_serialnum\F104\A205Pack`20serial`20numbe\7D03\5112# Vdefine`20HM2$S_STRUCNAME`200xC X\BE16$t_strucname`5B`20\3810\CB06Volume`20set`20name\6D16VOLN\3304`20`20\6D1Dv Voln\6B0B\3608\6903\E907\6D07\6909\6D15OWNERN\DA21ownern\6F0B\380A\DA0Downer V\7308\6D11FORMAT\6504\6D1Dformat\6A08\3507\D807\DA0C\2806`20typ\6E03*/ X\5116def$$fill_2`5B`202`20\AF06Spar\A304\5407\0A0A\0A0A\5110short`20hm2$w_chec Vksum2;\9308Second`20ch\1906\5117`7D`20$hm2def; X#define`20\E506HM2DEF`20(sizeof(`20struct`20\2E07`20)) $ call unpack HM2DEF.H;1 56624721 "" $! $ create 'f' X`0C X/******\0606\0C0C\1818\1F1F X X`20Program`09:`20INDEX_HEADERS.C X`20Author`09`09:`20Nick`20de`20Smith X`20Creation`20date\1F0303-Oct-91 X X`20Edit`09Edit\1D06By`09Reason X`20`2003`0922-\2A06`09NMdS`09Add`20in`20EFBLK`20checking`20to`20Count_Headers( V). X\3E032`0915\3E0Ell\3E04the`20call`20to`20Flush_FID_Cache\3A071`09\A209\3A06New V X\1903`A9`201991`20by`20\E10D`20and`20Applied`20Telematics`20Group`20Ltd,`20UK. V`20\7F04rights\4B03reserved. X X`20Function: X`20This`20program`20is`20a`20simple`20fragmentation`20analys\2004nd`20reportin Vg`20utility`20designed X`20to`20be`20used`20\3705`20ODS-2`20volume's`20Index`20File.`20You`20will`20ne Ved`20read`20access`20to`20the X`20specified`20\4114 X X`20To\6C04:`20`20`20$`20\1A06=`20"$dev:`5Bdir`5DINDEX_HEADERS" X\2703\0303\0505\2F08`5Bdevice-name`5D`20`20`20!`20Default`20\1906`20is`20user' Vs`20current`20disk X\7B05build:\4C03CC`20I\6B0C.C\6C0ELINK\220FOBJ,SYS$INPUT/OPTION\350CSYS$SYSTEM V:SYS.STB/SELECTIVE_SEARCH X\2F10HARE:VAXCRTL/SHARE\870D! X X******\0606\0C0C\1818\1F1F/ X X#define`09VERSION`20"V01.03" X#module`09\F70D\2708 X X#include`09"atrdef.h"`20\AD0B`20`20/*`20ATtRibute`20control`20block`20defns V\2606*/ X\4A0Afatd\4A16File\4F04ributes`20\4809initio\4E04\4A0Eh2\4A1CHeader`20(ODS`202 V)\480E\4A10ib\4A1CInformation`20B\9511\4A0Em2\4A17Retrieval`20pointer`20\5506 V\8E05\2606\4A0Dhm\4A18Home\8807\DD17\4A04\4B0Adescrip`20\490E\4B05VMS`20\1F07t Vor`20\4710\9510iodef\4811\4A05I/O`20\3F14\260B\4A0Cpsld\4B14/*`20Process`20sta Vtus\9421ss\9419System\4905ii\9214\4A0Fts\9418\4A07condition`20code`20masks V\4A0B X/* X`20Macro`20to`20check`20the`20return\D108from`20a`20routine`20that\2207s`20a V`20VMS`20\2906 X*/ X#define`20ss_check(`20command`20)`20`7B`20`5C X\7904long\5C08=`20(c\2106);\1F07if`20(`20(\2007`26`20STS$M_SUCCESS)`20==`200 V`20\4C0A`09r\AB0C\4308`7D`20`5C X`7D X\DD0Dswap\DC05words`20in\BB03longword.`20This`20is`20needed`20as`20some\2109 V\3004 X`20ODS`202`20structures`20are\4904this`20swapped`20format\0704`20PDP-11`20comp Vatability! X*/ X#define`20SWAP(`20value\D303`20((((unsigned`20long)v\1B05`26`200x0000FFFF)`20< V<`2016)`20`7C\EB07\0404\0808\0808\481BFFFF0000)`20>>\4804) X Xstatic`20\3209short`20q_iosb`5B`204`20`5D;\5606/*`20I/O`20status`20block\7C13* V/ X\5116w_chan\4C07\510Cchannel`20to`20use\511Bstruct`20$fh2def`20r_fh2\500C V\5104File`20Header`20\A306(ODS`202)`20\511Cat\5104*ar_fat`20=\5111Attributes V`20B\F812*/ X\0805`26r_fh2.fh2$w_recattr\A00D\5105...located`20inside`20the`20\B80C\A213hm V\F307hm2\F310Disk`20Home`20\9C06\F111\510Cunsigned`20long`20l_header_count V\5905/*`20#`20of`20all\A607\2306s`20\512Dfree\A906\5108currently`20free\5610 V\511Amap_area_siz\5305/*`20Size\5404the`20extent`20map`20area`20(bytes)\511E V\2405_inuse;`09/*`20Bytes\5204\4709in`20use\F325map_\8606s;\F30D\1507\4C04 V\5809\5114struct`20dsc$descriptor_d`20x_name`20=`20`7B\5304Full`20file`20 V\1605\FF07opened`20file*/ X\5C080,`20DSC$K_DTYPE_T\0F08CLASS_D,`200`20`7D; X#define`20DEFAULT_DISK`20"SYS$DISK:"\4E08/*`20Na\7306default`20disk`20to`20use V\D02C\3705\D007\5309\4B07analys\4F09\5105\D02E`0C X X/********\0808\1010\2020\0F0F X X`09`09`09I`20N`20D`20E`20X`20_`20H\0803A`20\0E04R`20S X XGenerate`20a`20report`20on`20the`20usag\DF05\0D04Index`20File`20(INDEXF.SYS) V`20\2C07selected Xdisk`20volume. X X*\CB4E/ X XINDEX_HEADERS() X`7B X`20`20`20`20ss_check(`20Get_Command()`20)\1D04\0404\0303/*\1D04\AE05name\D908 V\B105to`20use`20\2603*/ X\510EOpen_Index_File\550B/*`20Open`20INDEXF.SYS`20on\5405right`20\5A05\5104 V\5205printf(`20"Processing`20%.*s`20(%s)`5Cn", X\A908x_name.dsc$w_length,\150Ca_pointer,`20VERSION`20);\6506\B70ARead_Home_Blo Vck(\B70DRead\FD0AHome`20Block\8208\0303*/ X\510EFlush_FID_Cache\510EFlush\5205File`20ID`20cache\500B\5112Count_Headers( V\4F0A\5105Count\5105headers`20in`20use`20and`20free\5114lose_Index_File\540A V\5104lose\5105Index\A806\A00C\5113Analyse_Map_Area\510Eheck\5110extent`20map V`20\5114Display_Result\F505`09/*`20\1707\4D05final`20r\2106\9C0D\4C05return V`20SS$_NORMAL;\C50F\9D06Re\2705success`20to`20caller`20\520D`7D X`0C X X/********\0808\1010\2020\0F0F X X`09`09`09O`20p`20e`20n`20_`20I\0603d`20e`20x`20_`20F`20i`20l`20e X XOpen`20\EE04INDEXF.SYS`20file`20and`20read\1D05\1205header. XWe`20do`20this`20by`20assigning`20a`20channel`20to`20\3604required`20disk`20de Vvice,`20\5904then Xaccessing`20\800Fby`20its`20File`20ID`20(FID).`20The`20FID`20for\3106ndex V\2506is Xalways`20fixed`20as`20(1,1,0). X\3704\BF0B`20is\D706at\4605same`20time`20as`20\1104\9606\8404us\D605n`20attrib Vutes Xitem`20list. X X******\0606\0C0C\1818\1F1F/ Xstatic XOpen_Index_File() X`7B X`20`20`20`20char`20t_name`5B`20ATR$S_FILE_SPEC`20`5D;\2405struct`20$atrdef`20r V_attrib`5B`5D`20=`20`7B\2104\0303/*`20A\D209`20description\2007\0606*/ X\0B08`7B`20\6E0F,`20ATR$C_\110B\9806`20`7D, X\3610HEADER\1103\3608\110B`26r_fh2\360E0,`200,`200`20`7D\1405`7D;\D80Dfibd V\D805fib;`20\B10D\D804File`20Informa\D205Block`20\D813\5107dsc$descriptor_s V`20x_fib`20=`20`7B\9209FIB$C_ACCDATA,`20DSC$K_DTYPE_T\0F08CLASS_S,\D105ib`20 V\B603\6606s_check(`20SYS$ASSIGN(\B712Assign`20a`20channelto`20the`20device`20 V\B70C\0404`26x_disk`09,`20\4A0F\510ADe\3A05to`20as\5B05\5907\1204\2607\510Cw_c Vhan\511CReturned`20I/O\4D09\260E\510BPSL$C_USER\5316\F304ccess`20mode`20is`20u Vser`20(highest)\51110`09)`20\1607\4B12Mailbox`20name\E104use\2610*/ X\4C05r_fib.fib$w_fid_num`20=`201;\520FINDEXF.SYS\9C04file`20(1,1,0)\EE10\510Ab V_fid_nmx\51030;\6E15seq`20\6E04\3A15rvn`20\3A05\1E0Fl_acctl`20`20`20\1E04 V\A90FNo`20special`20access`20contro\2F04\A91Awsize`20\5115Use`20default`20wind Vow`20s\2D06\510C\5205ss_check(`20SYS$QIOW(`20\280C\5207Call`20the`20XQP\2011 V\A30D\04040`09,`20\2516/*`20EFN`200`20\2017\4B11w_chan\501CDisk`20channel`20 V\5021IO$_ACCESS`20`7C\0D04M_\0E06\6108/*`20Open`20file`20and`20get`20informati Von`20\5110q_iosb\A11CI/O`20status`20block\A11E0`09\4B1BAST`20routine`20\EC22 V\4B21parameter`20\4B20`26x_fib\501CP1`20=>`20FIB`20descriptor\9B37P2\4B05ile V`20name`20string`20(not`20used)\4B0E\0807\511C3`20=>`20Resultant`20\5605length V`20(word)`20\512F4`20\5112\F80E\510Br_attrib,\511B5`20=>`20Attribute`20control V`20block`20\2605\A20C`09)`20)\4B196`20-`20not`20used\7116\4B07ss_check(`20q_io Vsb`5B`200`20`5D`20\590E/*`20Check`20final`20QIO`20status`20\510F\9D09\E517 V\520CSave`20the`20name`20of\0C05file`20opene\B604\A311STR$COPY_R(`20`26x_name, V`20`26t\0909_name`5B`202`20\C204) X\3E05if`20(`20(r_fh2.fh2$w_struclev`20`26`200xFF00)`20!=`20FH2$C_LEVEL2`20) V`20`7B X\AC08return`20SS$_FILESTRUCT;\CC0DOnly`20ODS`202.x`20is`20supported`20here V\2605\CC07`7D X\0705\540BNORMAL\500B\580BRe\2705success`20to`20caller`20\260A*/ X`7D X`0C X X/********\0808\1010\2020\0F0F X X`09`09`09R`20e`20a`20d`20_`20H`20o`20m\0E03_`20B`20l`20o`20c`20k X XRead`20the`20disk`20Home`20Block.`20The`20is`20needed`20in`20order`20to`20loca Vte`20\3604Index`20File Xheader`20allocation`20bitmap. X\4A04first`20\600A\5B04in`20Virtual`20\1406#2`20of`20\580E. XCheck`20that`20th\3704s`20an`20ODS`202\B606an\C304\1F05e`20user`20\B804ot`20pu Vlling`20a`20fast`20one. X X******\0606\0C0C\1818\1F1F/ Xstatic XRead_Home_Block() X`7B X`20`20`20`20ss_check(`20SYS$QIOW(`20\1804\0505\0707/*`20Read\C105Disk`20head V\C803block\2609*/ X\0704`090\0605`09,\4512EFN`20\1E05\6211\4511w_chan\0B05\4913File`20channel`20 V\491EIO$_READVBLK\1104\4E13\DC05Virtual`20Bl\D40C\4E10q_iosb\9718I/O`20status V`20b\4715\490A0`20\0604\4514AST`20routine`20\DC1F\451Eparameter`20\451D`26r_hm V2\D318P1`20=>`20Buffer`20to`20read`20in\0B04\4910HM2$S_HM2DEF`20\1103\4E142 V`20=`20\4E08length\97182`20`09`20\93173`20\4503VBN`202`20(1st`20home`20block) V\450F0`20\45194`20-`20`20not`20used`20\8610\45275`20\452F)`20\A308\450A6`20 V\4527ss_check(`20q_iosb`5B`200`20`5D`20\5111Check`20final`20QIO`20status`20 V\510F\5205if`20(`20(r_hm2.hm2$w_struclev`20`26`200xFF00)`20!=`20HM2$C_LEVEL2 V`20)`20`7B X\4908return`20SS$_FILESTRUCT;\8F0DOnly`20ODS`202.x`20is`20supported`20here V\E00C`7D X\530FNORMAL\4F0B\570BRe\2705success`20to`20caller`20\E60D`7D X`0C X X/********\0808\1010\2020\0F0F X X`09`09`09F`20l`20u`20s`20h`20_`20F`20I`20D\0803C`20a`20c`20h`20e X XFlush`20the`20File`20ID`20cache`20back\AD04disk.`20This`20uses`20an`20undocume Vnted`20ACP`20control Xfunction.`20Previously,`20you`20had`20to`20open`20INDEXF.SYS`20for`20write`20 V\0903have`20faile\2C04 Xallocate`20a`20header`20(thus`20causing`20a`20new`20extent\5C04be`20a\3307d). X X******\0606\0C0C\1818\1F1F/ Xstatic XFlush_FID_Cache() X`7B X`20`20`20`20struct`20$fibdef`20r_fib;`20\1A04\0505\0505/*`20File`20Information V`20Block`20\260C*/ X\510Bdsc$descriptor_s`20x_fib`20=`20`7B\2605\2A05izeof(\8310),`20DSC$K_DTYPE_T V\0F08CLASS_S,`20`26r_fib`20`7D; X\4B05r_fib.fib$w_cntrlfunc\6903FIB$C_FLUSH_CACHE;\C905lush`20specified`20cache V\C20E\510Al_cntrlval`20\510AID\4F08`20`20\5109the`20File`20ID`20\530A*/ X\5205ss_check(`20SYS$QIOW(`20\7407\0808\4B04Call\4A05XQP`20\2111\A30C\04040 V`09,`20\2516/*`20EFN`200`20\2017\4B11w_chan\501CDisk`20channel`20\5021IO$_ACPC VONTROL\5712/*`20Perform`20an`20ACP`20control`20function`20\510Eq_iosb\A11CI/O V`20status`20block\A11E0`09\4B1BAST`20routine`20\EC22\4B21parameter`20\4B20`26x V_fib\501CP1`20=>`20FIB`20descriptor\9B37P2\4B05ile`20name`20string`20(not`20us Ved)\4B0E\0807\511C3`20=>`20Resultant`20\5605length`20(word)`20\512F4`20\5112 V\F80E\512F5`20=>`20Attribute`20control`20block\2606\510C`09)`20)\4B196`20-`20n Vot`20used\7116\4B07ss_check(`20q_iosb`5B`200`20`5D`20\590E/*`20Check`20final V`20QIO`20status`20\510F\5205return`20SS$_NORMAL;\A315Re\2705success`20to`20cal Vler`20\520D`7D X`0C X X/********\0808\1010\2020\0F0F X X`09`09`09C`20o`20u`20n`20t`20_`20H`20e`20a`20d\0603r`20s X XCount`20the`20number`20of`20allocated`20headers`20in`20the`20index`20file,`20a Vnd`20\370Bthat Xare`20currently\3504use. X X\D34F/ Xstatic\BC06_H\A406() X`7B X`20`20`20`20unsigned`20char`20*ab_buffer,\0C06yte;`09/*`20=>`20to`20$QIO`20rea Vd`20buffer\4104\0404\0505*/ X\510Dlong`20l_read_size;\2B0A/*`20Size`20of`20\530A\4D0D\5120vbn;\2B0B/*`20VBN V`20\501E\5118index_left\530A/*`20#`20of`20bytes`20left`20in`20index`20bitmap V`20\511Abuffer\F50E\F315\2906\A212globalref`20shor\7B04t`20IOC$GW_MAXBUF; V\5105Maximum`20allowed`20I/O`20on`20this`20system\5104/* X`20The`20following`2016`20entry`20table`20contains`20the`20number`20\FB04it V\4703et\F904each\1404the X`2016`20combinations`20of`204`20bits.`20This`20is`20used`20to`20speed`20up V\5B05bit`20counting`20procedure X`20\2D08count\850Ffree`20headers.`20You`20can`20also\3704`20a`20256\CD0C X`20to`20be`20even`20faster,`20but`20its`20a`20pain`20to`20type`20in. X*/ X`20`20`20`20static`20readonly`20unsigned`20char`20b_nibble_count`5B`200x10`20 V`5D`20=`20`7B\3D05\04040x00,`200x01,\0606\06042,\0C0C\120A3,\380C\2014\0C0C V\120A4`20`7D; X X/* X`20Determine`20the`20count`20of`20headers`20that`20have`20already`20been`20all Vocated.`20The`20format X`20of`20\4604Index`20File`20is`20fixed`20so\4C06\200F\4907ion`20bitmap`20comes V X`20just`20befor\9A06first`20header\7505refore,`20\1D04number\B80C\A109`20is X`20\2404size\A108in\8104file`20minus\1505VBN`20\2007la\7D04lock`20\1207bit`20m Vap. X*/ X`20`20`20`20l_header_count`20=`20SWAP(`20ar_fat->fat$l_hiblk`20)`20-\3305 V\0404(r_hm2.hm2$w_ibmapvbn`20+`20\1711\AE05-`201); X/* X`20It`20is`20possible`20that\9705In\C904File`20has`20been`20extended`20using V`20RMS`20or`20FCS`20to X`20a`20s\5B04greater`20than`20\4A04configured`20maximum`20number`20of`20files. V`20If`20this`20is X`20\3405ase,\3A04strain\1405\350Aheaders`20we`20check`20so`20\B905we`20don't V`20overflow\4E06\CC0Ballocation`20bitmap.`20XQP`20does\8206sort\6404\5906all V\4205time.`20 X*/ X`20`20`20`20if`20(`20l_header_count`20>`20r_hm2.hm2$l_maxfiles`20)`20`7B\3305 V\0404\320F=`20\3214; X\2B04`7D X\310Dfree\3003\410E;`09/*`20Initially`20assume\B205are`20\3305\7705*/ X X/* X`20A\FB06e`20a`20buffer`20for`20\DE04$QIO`20Index`20File`20bitmap`20reads`20th Vat`20i\0804e`20same X`20size`20as\1205maximum\7704owed\5A07ed`20I/O.`20This`20allows`20us`20to`20do V\3705\6206 X`20scan`20in\4B06in\4B05number`20of\8106. X`20We`20round`20\3B05\BC06\8505down\5604\4505teger`20\3E0Ablocks\1F04ease V\3C04 X`20case`20where`20we`20have\9507multiple`20\7407*/ X`20`20`20`20l_buffer_s\6F04=`20(unsigned`20long)`20IOC$GW_MAXBUF`20`26`20`7E51 V1; X`20`20`20`20ss_check(`20LIB$GET_VM(`20`26l_buffer_size,`20`26ab\1107`20)`20) X X\3A04l_read_vbn\0E04=`20r_hm2.hm2$w_ibmapvbn;`20/*`20Starting`20VBN`20for`20bi Vtmap\3604\0404`20`20*/ X X/* X`20Determine`20the`20number`20of`20bytes`20in`20\1704\3D07that`20contain`20val Vid`20information. X`20The`20end-of-file`20FAT`20entry`20\3607s`20\4F04\9404of`20\0B04highest`20bl Vock`20written`20+`201. X`20When`20\2504Index`20File`20is`20full,`20XQP`20checks`20to`20see`20i\5206EFB VLK`20is`20\0D04same`20as X\0D05HIBLK.`20If`20it`20is,`20\5C12extended;\4E04not,\530Bmarker`20is X`20just`20pushed`20up`20towards`20HIBLK,`20and`20\3704intervening`20blocks`20z Veroed. X*/ X`20`20`20`20l_index_left`20=`20SWAP(`20ar_fat->fat$l_efblk`20)`20-\3105\0404(r V_hm2.hm2$w_ibmapvbn`20+`20\1711size`20-`201);\3C05if`20(`20\720D>`20\340Al_max Vfiles\6D03`7B X\6D08\A20F\3014\5E06`7D X\6418l_header_count\5E1C\2A0E\580C\290F(l\100C+`207)`20/`208; X X/* X`20The`20number`20of`20Index`20File`20allocation`20bitmap`20bytes`20to`20read V`20must`20not`20be`20greater X`20than`20the`20size\5104\0C04\3F06.`20This`20is`20another`20simple`20sanity V`20check. X*/\C305if`20(\C80E>`20(r_hm2.hm2$w_ibmap\6605*`20512)`20)`20`7B\3A05\0404retur Vn`20SS$_BADFILEHDR;\1F05`7D X\F705Now`20\C705in\A405\F91Din`20chunks`20as`20large`20as`20we`20can, X`20adding`20up\4A05number`20of`20free`20header\3A05we`20go\E209wh\6D04\E50F V\C503\C408\0404/*`20W\2705still`20some`20l\2804to\BE05...`20`20`20*/ X\FA09if\5310<=`20l_buffer_size`20\6404/*`20If`201\4505`20is`20enough\4F06 V\5206\870Cl_read\3E06\4E04\5E0A;`20/*`20...\4805all`20that\5104\7B05\420A V\510B`7D`20else`20`7B\621D\B00B\6308\3605\680Ewe`20can\6212 X X\0B08ss_check(`20SYS$QIOW(`20\780C/*`20Re\5304`20chunk`20of`20the`20bitmap V\BE14\04040`20\0503`09,\490D\4B05EFN`20\1D05\1B0F\0B0B\4B0Fw_ch\C206\5014File V\9903annel`20\5025IO$_READVBLK\5113\EC05Virtual`20Block`20\511Fq_iosb\A118I/O V`20status`20b\4E15\50110`20\4B17AST`20routine`20\EC26\4B1Dparameter`20\4B24ab_ Vbuffer`09\4F13P1`20=>`20Buffer`20to`20read`20in`20to`20\4F17(l_read_size+511)/ V512*512\5E03\51042`20=`20\5108length\A01F\5007vbn`09\A1143`20\5004ase`20VBN V`20for`20\A405\501A0`09\48154`20-`20`20not`20use\3F0D\482F5`20\4832)`20)`20 V\48106`20\482Bss_check(`20q_iosb`5B`200`20`5D`20\550A/*`20Check`20final`20QIO V`20status`20\510F\5209l_index_left`20-=`20l_read_size;\5207Update`20number`20o Vf`20bytes`20l\3204\A312if`20(\560E)`20`7B`09`09/*`20If`20some`20data`20\1A05to V`20read...`20\4811\9D06read_vbn`20+=\9B0C`20/`20512;`20\9E0Abase`20VBN`20for V`20next`20read\510C`7D X\0B09ab_byte`20=\0A05uffer;\780C/*`20=>`20Buffer\F10A\220C\AD0Fwhile`20\F804 V\A309--\F904\510ACount`20bits`20set`20in`20each\5B05\FC17header_free`20-=`20b_ Vnibble_count`5B`20*a\C607`26`200x0F`20`5D; X\402D(*\4107++\4305F0)`20>>`204\490C`7D X\0606\0705ss_check(`20LIB$FREE_VM(`20`26l_buffer_size,`20`26ab_buffer`20)`20) V\3B06return`20SS$_NORMAL;\AB0C\0606/*`20R\2706success`20to`20caller`20\260A*/ X`7D X`0C X X/******\0606\0C0C\1818\1F1F X X`09`09`09C`20l`20o`20s`20e`20_`20I`20n`20d\0A03x`20_`20F`20i`20l`20e X XClose`20the`20INDEXF.SYS`20file. X X*\914E/ Xstatic\7406_Index_File() X`7B X`20`20`20`20ss_check(`20SYS$DASSGN(\1904\0404\0707/*`20Fre\B306index\AE05`20ch Vannel\2608*/ X\0B08w_chan`20)`20) X X\1004return`20SS$_NORMAL;\620F\6506Re\2705success`20to`20caller`20\260A*/ X`7D X`0C X X/\FF25\2525***** X X`09`09`09A`20n`20a`20l`20y`20s`20e`20_`20M\0E03p`20_`20A`20r`20e`20a X XAnalyse`20the`20extent`20map`20area`20of`20\1704file`20header. X X\A64F/ Xstatic\8908_Map_Area() X`7B X`20`20`20`20unsigned`20long`20l_map_bytes_left;`09/*`20#\AB04bytes`20left`20to V`20check`20in\CE05\4603*/ X\4D14entry_size;\1F04\0404`20/*`20Size\5404\3D04entry\1D09\0909\5118xtent_lbn V\510DLBN`20of`20\1E06\4D12\5122\A30D\A20B\521B\5107struct`20$fm2def`20*ar_fm2 V\9E0A\5107=>`20E\4C06\F519*/ X\5205l_map_area_size`20=`20(r_fh2.fh2$b_acoffset`20-`20\170Cmp\1706)`20*`202; V\490Bbytes_inus\4B04\330Dap_\1806\3305\3405\BF06\7404\D910)(((char`20*)`26r_fh V2)`20+`20\8214\4E04);\4F06printf(`20"`5CnAnalysis`20of`20Index`20File`20extent Vs:`5Cn"`20\3608\B90Cleft\8F03\CC11\E306wh\4404(`20\3211)`20`7B X\2104\0404switch\2603\DD06->fm2$m_forma\2A0Ecase`20FM2$C_PLACEMENT: X\1E08\9B06entry_size`20=`20\2C06LENGTH0;\2A0D\FB09\0C03Explicit`20placement:" V\EE04\300Cif\A20Fw_word0`20`26`20FM2$M_EXACT)\580BExact"\4831ONCYL)\480BOneCyl Vinder"\4E31LBN`20`20)\4E0BLBN\4632RV\460FSpecificVol"\4E10\2609`5Cn\1C11break; V\1309case\6305C_FORMAT1:\2F0Dl_entry_size`20`20=`20\2B06LENGTH1;\2B10xtent_lbn V\2B04\CF0Elowlbn`20+ X\330C\0C0C\0303(a\330Bm_high\3404<<`2016)\6D17\9905\6D0Eb_count1`20+`201\FD2E2 V:\FD292;\FD29l_lbn\3018\C013m_count2`20\C0313:\C0293;\C02E\3018\C013w_lowcount V`20+\350D\0C0C\0303(a\F514<<`2016)\FC21default:\240D/*`20Should`20never`20happ Ven`20*/ X\4A1B`7D X\0A08if`20(\CA0Dm_format`20!=`20FM2$C_PLACEMENT`20)`20`7B X\560Cl_map_extents++;\1D0Dprintf(`20"`20`20`20Extent`20%3d,`20Type`20%2d`20(%d V`20bytes),`20LBN`20%10d,`20Size\0B05`5Cn",\510D\7615,`20\BD14,`20l_entry_size, V`20\4817\4406_lbn\3105\0E06size`20)\CC0A`7D X\0A08\6A06`20=`20(struct`20$fm2def`20*)(((char`20*)\2506)`20+`20\830C\500B V\BF06bytes_left`20-=\2B0D\2A06`7D X\0705return`20SS$_NORMAL;\C812/*`20R\2706success`20to`20caller`20\260A*/ X`7D X`0C X X/******\0606\0C0C\1818\1F1F X X`09`09`09D`20i`20s`20p`20l`20a`20y`20_`20R`20e\1003u`20l`20t`20s X XDisplay`20the`20results`20from\1105data`20gathered. X X\A04F/ Xstatic\8508_R\8106() X`7B X#define`20BUFFER_SIZE`2023 X`20`20`20`20char`20t_creation`5B`20\240C`5D;\2405struct`20dsc$descriptor_s`20x V_cre`20=`20`7B\2605\0404\3D0B,`20DSC$K_DTYPE_T,\0F07CLASS_S,\740B`20`7D; X\6806s_check(`20SYS$ASCTIM(\5B08\0707/*`20Convert`20c\4008date`20to`20ASCII V\2605*/\9309`26x_cre.dsc$w_length,`20\510EReturned`20length\720F\5116\1E0D V\5110=>`20r\5408string\511Cr_hm2.hm2$q_credate\5110Da\E206co\FB06\A21E0`20 V\1E11)`20)`20\510CFormat:`201`20=`20full`20d\6204\5110\5205printf(`20"`5Cn" V`20); X\140DVolume`20nam\3E0B:`20%.*s`5Cn", X\AA14\0E0EHM2$S_VOLNAME,`20r_hm2.hm2$t_vol\5905\7510Owner`20\740E\7534OWNERN V\7711owner\7915\EE07creation`20date`20\792Dx_cre.dsc$w_length,\140Ba_point V\DD03\7A18luster`20factor:`20%d`5Cn",\BE0Bw_\2308\4210Allocated`20blocks\8F05 V\4209SWAP(`20ar_fat->fat$l_hiblk`20)\4A1Bheader\4B05\4A09l_header_count\3D11Fr Vee\380C\870E\3D09free`20\3C10Maximum`20#`20of`20files\3C0Cr_hm2.hm2$l_maxf V\2005\4312p`20area`20size`20\7F0B`20bytes\8507map_area_s\2604\4419bytes`20f V\AB04\C30C\3E0D-l_map_bytes_inuse\5011Number\D404extent\D604\5010\1A08); X\3D05return`20SS$_NORMAL;\CD08\0808`20`20/*`20R\2706success`20to`20caller`20 V\260A*/ X`7D X`0C X X/******\0606\0C0C\1818\1F1F X X`09`09`09G`20e`20t`20_`20C`20o`20m`20m`20a`20n`20d X XGet`20the`20optional`20command`20(name`20of`20\1E04disk`20device`20to`20look V`20at). X X*\AB4E/ Xstatic XGet_C\8B06() X`7B X`20`20`20`20static`20$DESCRIPTOR(`20x_default,`20DEFAULT_DISK`20);`20/*`20De V\1C05\C00D\4A04*/ X\5206s_check(`20LIB$GET_FOREIGN( X\2805\0303`26x_d\3E04`20`20,`20\1408\0909\0303/*`20Returned`20c\B106\2613*/ X\0B080`20\0A08\5119Prompt`20to`20us\B106\513FLength`20of`20\A319\5115)`20)`20 V\A21Cflag\A016\5105\5205if`20(`20x_disk.dsc$w_le\8E05==\6A03)`20`7B`20\5205If V`20no`20disk`20name`20was`20entered...\A310ss_check(`20STR$COPY_DX(`20`26 V\6806,`20\0904efault\C405/*`20...use`20the`20\1A08\5108`7D X\0604return`20SS$_NORMAL;\FA15Re\2705success`20to`20caller`20\FA0D`7D $ call unpack INDEX_HEADERS.C;1 162819248 "" $! $ create 'f' X/******\0606\0C0C\1818\1F1F X X`20Program`09:`20EXTEND_FILE.C X`20Author`09`09:`20Nick`20de`20Smith X`20Creation`20date\1F0303-Oct-91 X X`20Edit`09Edit\1D06By`09Reason X`20`2001`090\2A08`09NMdS`09New X X`20`A9`201991`20by`20\680D`20and`20Applied`20Telematics`20Group`20Ltd,`20UK. V`20All`20rights X`20reserved. X X`20Function: X`20This`20program`20uses`20RMS`20to`20extend`20the`20specif\6B04file\8D04 V\1604passed`20number`20of X`20blocks.`20It`20will`20work`20on`20any`20file,`20but`20was`20written\5A08cal Vly`20to`20\3207 X`20an`20Index`20File\B304To\9E04:`20`20`20$`20Ex\9B05=`20"$dev:`5Bdir`5DEXTEND V_FILE" X\2603\0303\0505\2E09`20\7306build: V\4503CC`20E\620A\610ELINK\1E0C,SYS$INPUT/OPTION X\2F0BSYS$SHARE:VAXCRTL/SHARE\520D! X X******\0606\0C0C\1818\1F1F/ X X#module`09E\A90A`20"V01.01" X X#include`20`20`20`09rms\8E0B\0A0A/*`20RMS`20definitions\2614*/ X\4D08`09ssdef\4A16System`20statii`20\7015\4A0Dts\4B15\4A0Acondition`20code`20m Vask\A009*/ X X/* X`20Macro`20to`20check`20the`20return\8805us`20from`20a`20routine`20that\2207s V`20a`20VMS`20\2906 X*/ X#def\2504ss_check(`20command`20)`20`7B`20`5C X\7904long\5C08=`20(c\2106);\1F07if`20(`20(\2007`26`20STS$M_SUCCESS)`20==`200 V`20\4C0A`09r\AB0C\4308`7D`20`5C X`7D X`0C X X/******\0606\0C0C\1818\1F1F X X`09`09`09`09m`20a`20i`20n X XExtend`20the`20specified`20file`20by\1605passed`20number`20of`20blocks. X X*\994E/ X Xmain(\FF05int`20\0703argc`09`20`20`20,`20\0E04\0505\0A0A/*`20Argument`20coun V\3205\2611*/ X\0704char\0F05argv`5B`5D)\5120vector\5117`7B X\0904struct`20FAB`20r_fab`20=`20cc$rms_fab;`20\5308RMS`20\2404block`20for`20sp Vecified`20file\A40A\5107NAM`20r_nam`20\5109nam\510E\2404\5122\F505t_file`5B V`20NAM$C_MAXRSS`20`5D;\F50BResultant`20\3F05nam\4404\F510\0704unsigned`20long V`20l_current\4D09\5107Current`20size`20of\9608\510F\5205if`20(`20argc`20<`203 V`20)`20`7B`20\7B10\5206heck`20#`20of`20passed`20parameters\A30E\0404printf( V`20"Usage:`20extend_f\8704`20`5Cn"`20);\4809return V`20SS$_NORMAL;\9911Exit`20gracefully`20\BF13\9907`7D X\0705r_fab.fab$b_fac`20=`20FAB$M_PUT;\580BSay`20we`20need`20write`20access V\5812\510Cshr`20\5108SHRP\5408/*`20Allow`20other`20to\5408s`20well\5118l_fna V`20=`20argv`5B`201`20`5D;\A20Cet`20the`20name`20of\0C05file...`20\A21Afns`20= V`20strlen(`20\5909`20);`20/*`20...and`20its`20length`20\F00B\A216nam\5103`26r_ Vnam\9F09\A206=>`20associated`20NAM`20block\510F\5207nam.nam$l_rs\F404t_file V\520FNa\EC06opened`20file\A20F\A30A\5108b_rs\F404NAM$C_MAXRSS;\5108Size\5104bu Vffer`20for\5C0Dname*\A307ss_check(`20SYS$OPEN(`20`26r_fab,`200,`200`20)`20) V\5304Open`20the\9E15\F50Dl_current`20=`20r_fab.fab$l_alq\F809\A404ave`20\2A08s Vi\B106\5D0E\5208\460F\5803atoi(`20argv`5B`202`20`5D`20);\5305et`20#\F805locks V`20to`20extend`20by\520E\F60EEXTEND\F816Ex\4105\FA19\5208printf(`20"F\2604%.*s V\7C07ed`20from`20%d.`20to`20\0704\9F06`5Cn",\3B05\E306nam.nam$b_rsl,`20t_file, V`20l_current,\0B0A`20+`20r_fab.fab$l_alq`20); X\D913CLOSE(\D807\D205\2404/*`20Close`20\D519\D90Creturn`20SS$_NORMAL;\2C12 V\5203Re\2705success`20to`20caller\520E`7D $ call unpack EXTEND_FILE.C;1 1618499691 "" $! $ create 'f' X$`20Set`20Symbol/Scope=(NoLocal,NoGlobal) X$! X$`20CC/Debug`20INDEX_HEADERS X$`20Link\150E,SYS$INPUT/Option XSYS$SHARE:VAXCRTL/SHARE\1806YSTEM:SYS.STB/SEL\710FEXTEND_FILE X\6F07\130B\6D2A$! $ call unpack BUILD.COM;1 1315977643 "" $ v=f$verify(v) $ exit