Validate 1.82
Copyright (C)2001 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
 - See the end of this doc for a very abbreviated output
 - Use -nx for no expire, if needed (won't be on 1.73+)
 - use -ss to view scoring (% done, etc.)

1.82     DBF timestamp year display massaged a bit (before '80 assumed 2000+)

1.81     cosmetic change or two
1.80     validate 1.7x NT would fail if a memo DBT file was attached
         since it wasn't getting the correct file size of the DBT.

         Performance enhancements on the index modules.  Now can reindex
         10 million records a minute (800 MHz CPU class machine).

         Put in the -nsc switch, previously documented but not active.

         To create an index file when using the -gen: switch (see 1.72).
         use -sort:EMPID (or whatever expression) and the -ktf switch.
         Rename the $valtmp$.x42 to the index file you want.  You can
         then -gen:bignumber and use -fix:ix=yourname.ix4 to see it
         reindex the generated file.  For example:

           validate -gen:100 a.dbf           * create small file
           validate a.dbf -sort:EMPID -ktf   * make quick index
           ren $valtmp$.x42 a.ix4            * rename
           del a.dbf
           validate -gen:10000000 a.dbf      * create huge file
           validate a.dbf -fix:ix=a.ix4 -v -ss * reindex it


1.73a
Changes: on sort, key is not padded (align8) unless encryption (-key:)
         is specified.

1.72
Changes: Added -gen:n switch to generate any sized data file,
         of 128-byte recs (max file size based on OS is shown,
         either 2 GB [win9x] or 2**63 [NT/W2k]).

         The validate.exe now uses system32/msvcrt.dll

1.61
Changes: Changed FLT/DBL sprintf stuff


1.60
Changes: Added stale key check (-nsc to skip stale check)

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
 ---------------------------------------------------------------------------

D:\>validate a.dbf -fix:ix=a.ix4 -s0 -v > x.txt

Validate 1.80  Copyright (C)2001 Cornel Huth  All rights reserved [Dec 22 2000]
[Bullet 3.10][WNT][03:10:30] (http://40th.com/ -> 40th Floor)
cmdline: a.dbf -fix:ix=a.ix4 -s0 -v rw_mode -zc:126

 OS max filesize is 2**63 bytes (id=0x20190)


 ================================= DBF detail =================================
     filename: a.dbf (local) [0x1]
       fileID: 0x01     (Bullet extended types: len.dc is for display)
   file bytes: 640000193(625000.1 KB)  (610.35 MB) [not incl last byte if 0x1A]
  last update: 20001222 (yyyymmdd)
 xact pending: 0
 record bytes: 64
      records: 10000000 	(calculated: 10000000.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  ALIGN4~~~~  C    3.0        1   FTYPE_C:   character, text (0T or not)
    2  EMPID~~~~~  6    9.0        4   FTYPE_U32: 32-bit unsigned int
    3  U64~~~~~~~  8   17.0        8   FTYPE_U64: 64-bit unsigned int
    4  DBLTEXT~~~  N    8.2       16   FTYPE_N:   numeric, text
    5  NOTES~~~~~  C   40.0       24   FTYPE_C:   character, text (0T or not)


 ================================= IX4 detail =================================
     filename: a.ix4 (local) [0x1]
      file ID: '42ch'	(ALIGN8_NODE_BIT)
   Reindexing: done	(51 seconds)
 memAvail/use: 239636K/78253K	RBCR: 78125K	items/runs: 10000000/1
             :			RBCL: 78125K	runsxMerge: 1 x 78125K
   file bytes: 124880384	(121953.5 KB)  (119.09 MB)
   last flush: 20001222.9
 xact pending: 0
     nodesize: 512
    keyLength: 4
  key padding: 0
 maxKeys/node: 42
 avgKeys/node: 41.0 	(97% utilization)
     rootNode: 243905	(file offset: 0x7718400)
    availNode: 0	(no deleted nodes)
 new freeNode: 243906	(calculated: 243906.0)
         keys: 10000000	(counted: 10000000  dups: 0  out-of-order: 0  stale: 0)
   node seeks: 10487810	(node seeks per key: 1.05)
 L1cache hits: 10000001	(node cache hit rate: 95%)
 L2cache size: 6 nodes
 L2cache hits: 238096	(  L2 cache hit rate: 48%) [exclusive L1 hits]
   L1+L2 hits: 10238097	(totalcache hit rate: 97%)
      ST size: 256
    code page: 437
 country code: 1
  sortCmpCode: 0x0001001F (SORT_BY_FTYPE  SORT_DUPS_ALLOWED  SORT_USE_OEM_SET)
   expression: "EMPID"
   xlateCount: 1

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


