Validate 1.51
Copyright (C)2000 Cornel Huth
http://40th.com/

 - Use validate.exe alone to see the help/use listing.
 - Make a backup before doing any write/fix operations.
 - See validate.txt for previous (and a bit dated) docs.
 - Registered Bullet programmers can contact support for
   help in using this tool.

 - See the end of this doc for a very abbreviated output.

1.51
Changes: Bogus files are now caught before GPF'ing, reporting
         EXB_BAD_FILETYPE for DBFs and EXB_UNKNOWN_INDEX for index files.

         Platforms: Win32, WinCE H/PC Pro (ARM, MIPS, SH3, SH4), OS2, Linux


1.50
Changes: Added a few more tests (but no new switches)

         Added more stats

         Added WinCE H/PC Pro support (ARM, SH3, SH4, MIPS).


1.3x
Changes: Added index validation

           -check:ix=indexfile.ix4

           checks (read-only) the index file for dups, proper order, and
           displays stats.

           -fix:ix=indexfile.ix4

           is the same as check but also reindexes the ix4.  This is useful
           to clear the incomplete transaction flag in the header, too.

           Both -check:ix= and -fix:ix= must be used in conjunction with a
           regular data file, such as

              validate.exe data.dbf -check:ix=index.ix4

           where index.ix4 indexes data.dbf.  Use -v to show duplicate keys'
           record numbers, and out-of-order keys' record numbers.  Use -ss
           to show the scoreboad, esp. nice for huge files.


         Added way to set the record count in a DBF

           -fix:rc=n

           sets the record count to n (use n = -1 set the count to the file's
           calculated record count).

         Added way to set the autoinc value in a DBF

           -fix:ai=n

           sets the next auto-inc value to n (use n = 0 for never-used).  The
           checksum is calculated and set automatically.

         Added way to clear the incomplete transaction flag in a DBF/DBT

           -fix:xf   

         Added way to delete or undelete an individual record number

           -del:n
           -undel:n

           deletes/undeletes the record at recNo = n.

         Added display of special DBF/DBT/IX4 flags such as ALIGN8_NODE_BIT
         to output.

1.22
Changes: DBF with only 6-9 records would loop endlessly on record display,
         now if there are 10 or fewer records all 10 are displayed together.

         Added autoinc/checksum display


1.21
Changes: -sort: fix, and other generally good stuff.


1.20
Changes: Added -pack, -sort:, -bu:, -mhs:, -miu:, -mdump switches, and some
         docs.

         Linux version to match the Win32 and OS2 versions.  All versions
         stuffed into a single package for my ease.  Toss out whatever
         you don't want.


1.11a
Changes: Supports record and key decryption (use -key: switch) (see Bullet
         3.1 beta 2+ for details on the new crypto features)

         Supports all FTYPE_* fields (including binary memo number,
         FTYPE_MB)

         Indicates if field alignment is not ideal (with [Alignment Check]
         note)


        Validate utilities available for download are fully functional,
        but currently are beta/demo and no warranty or suitability is
        implied.  They all work perfectly here.

 ---------------------------------------------------------------------------
                         A very basic example run
 ---------------------------------------------------------------------------

Z:\>validate $demo_01.dbf -check:ix=$demo_01.ix4 -mdump -all

Validate 1.5   Copyright (C)2000 Cornel Huth  All rights reserved [Jan 23 2000]
[Bullet 3.10][WNT][Beta [03:10:12]] (http://40th.com/ -> 40th Floor)
cmdline: $demo_01.dbf -check:ix=$demo_01.ix4 -mdump -cd -mv -mcd -mco -zc:126 

 ================================= DBF detail =================================
     filename: $demo_01.dbf (local) [0x1]
       fileID: 0x8B     
   file bytes: 31999425	(31249.4 KB)  (30.51 MB)
  last update: 20000123 (yyyymmdd)
 xact pending: 0
 record bytes: 32
      records: 999976 	(calculated: 999976.0)
 deleted recs: 0               
 header bytes: 193
 start offset: 193
      autoinc: 0	(checksum: valid)
    encrypted: 0	(this is not used by Bullet crypto)
    last byte: 0x1A

 fld#   fieldname  T  len.dc  offset   notes
 ----  ----------  -  ------  ------  -----------------------------------------
    .  delete tag  *    1.0        0
    1  RSV01~~~~~  C    3.0        1   FTYPE_C:   character, text (0T or not)
    2  EMPID~~~~~  C    9.0        4   FTYPE_C:   character, text (0T or not)
    3  RSV13~~~~~  C    1.0       13   FTYPE_C:   character, text (0T or not)
    4  PERSONAL~~  M   10.0       14   FTYPE_M:   memo field, text# (no 0T)
    5  SALARY~~~~  N    8.2       24   FTYPE_N:   numeric, text

  Rec# |t|RSV|EMPID    |R|PERSONAL  |SALARY  |
      1| |~~~|00000001~|~|          |12345.78|
      2| |~~~|00000002~|~|          |12345.78|
      3| |~~~|00000003~|~|          |12345.78|
      4| |~~~|00000004~|~|          |12345.78|
      5| |~~~|00000005~|~|          |12345.78|

 999972| |~~~|000F422D~|~|          |12345.78|
 999973| |~~~|000F422E~|~|          |12345.78|
 999974| |~~~|000F422F~|~|          |12345.78|
 999975| |~~~|000F4230~|~|          |12345.78|
 999976| |~~~|000F4231~|~|          |12345.78|

 ================================== DBT dump ==================================
   Blk#     Fileoff  AvailLnk    Blocks   Bytes   ---------- Comments ---------
 00000000  00000000  00000001        1      512   header block
	inUseFlag is 0008FFFF

 ================================= DBT detail =================================
  8-dot owner: $demo_01
   file bytes: 512  (0.5 KB)  (0.00 MB)
 xact pending: 0
  bytes/block: 512
   hdr blocks: 1 
  data blocks: 0 	(calculated: 0.0)
 max del size: 0 	(memo block#=0 [0x0])
   new block#: 1 	(0x1)               
 deleted blks: 0  
 deleted chns: 0  
  blocks used: 0 	(calculated: 0)        
  blocks lost: 0 	(orphaned)

 ================================= IX4 detail =================================
     filename: $demo_01.ix4 (local) [0x1]
      file ID: '41ch'	
   file bytes: 17069056	(16669.0 KB)  (16.27 MB)
   last flush: 20000120.19
 xact pending: 0
     nodesize: 512 
    keyLength: 8 
  key padding: 0	
 maxKeys/node: 31 
 avgKeys/node: 30.0 	(96% utilization) 
     rootNode: 33336	(file offset: 0x1047200)
    availNode: 0	(no deleted nodes) 
 new freeNode: 33337	(calculated: 33337.0) 
       noKeys: 999976	(counted: 999976  dups: 0  out-of-order: 0)
   node seeks: 1066648	(node seeks per key: 1.07)
   cache hits: 999977	(node cache hit rate: 93%)
      ST size: 256
    code page: 437 
 country code: 1 
  sortCmpCode: 0x0001001F (SORT_BY_FTYPE  SORT_DUPS_ALLOWED  SORT_USE_OEM_SET)
   expression: "SUBSTR(EMPID,1,8)"
   xlateCount: 1 

  key              record              fld   kc  fld                   
 comp  field type  offset  field name  ofs  len   sz  flags            
 ----  ----------  ------  ----------  ---  ---  ---  -----------------
    1  FTYPE_C          4  EMPID         0    8    9               

