<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>Index File Debug Utility</TITLE>
<META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
</HEAD>
<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff">

<H1 ALIGN="CENTER">Index File Debug Utility</H1>
<P><HR></P>
<P ALIGN="CENTER"><CENTER><TABLE BORDER CELLSPACING=5 BORDERCOLOR="#000000" CELLPADDING=5 WIDTH=468>
<TR><TD VALIGN="MIDDLE" COLSPAN=2>
<P ALIGN="CENTER"><B>Topics</B></TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="MIDDLE">
<P ALIGN="CENTER"><A HREF="#Usage">Usage</A></TD>
<TD WIDTH="50%" VALIGN="MIDDLE">
<P ALIGN="CENTER"><A HREF="#Compiling">Compiling</A></TD>
</TR>
</TABLE>
</CENTER></P>

<P><HR></P>
<P><IMG SRC="vbdicon.gif" WIDTH=32 HEIGHT=32><A NAME="Usage"><B><FONT SIZE=4>Usage</A></B></FONT> </P>
<P>The VBD index file utility is a console-based program used to analyze VBD index files created by the <A HREF="../../classes/btree.htm">B-tree class</A>. Index files are used by an application to store the location of objects in a data file. This program will not rebuild damaged index files. Every index file is unique and must be rebuilt by the application that created it. This utility is supplied for in-depth troubleshooting and development purposes only. </P>
<P>To use the utility enter the name of the program followed by the name of the index file: </P>
<PRE>
<B>ix_debug grocery.btx</PRE>
</B><P>After opening the file in read-only mode, the utility program will display a menu and give you a "<B>&gt;</B>" prompt. At the prompt, enter the letter of an operation you wish to perform. </P>
<FONT COLOR="#008080"><PRE>
(D) Dump the B-tree index
(F) Find a key in the B-tree index file
(L) List the contents of the B-tree index file
(H) Help (prints this menu)
(P) Print the B-tree node by node
(Q) Quit
(S) Display VBD file stats
(T) Display B-tree stats
(V) Display this program's version number</PRE>
</FONT><P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">D</FONT>" to dump all the B-tree entry keys to the screen. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">F</FONT>" to find a specified B-tree entry key in the index file: </P>
<FONT COLOR="#008080"><PRE>
Enter Key Name: Bread

Found: Bread
Entry Key Name:             Bread
Object's data file address: 105
Object's class ID:          1001</PRE>
</FONT><P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">L</FONT>" to list all the B-tree entry keys in order. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">H</FONT>" to display this menu again, after the program processes your selection. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">P</FONT>" to print the contents of B-tree node by node. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">Q</FONT>" to exit this program. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">S</FONT>" to display detailed file information about this file. This information is used to analyze and troubleshoot VBD files. </P>
<PRE>
<FONT COLOR="#008080">----- Static information -----
VBD File Name: grocery.btx</FONT> (VBD file currently open)
<FONT COLOR="#008080">VBDFile Signature: VBDFILE</FONT> (VBD file signature)
<FONT COLOR="#008080">VBDFile Version Number: 1025</FONT> (VBD file manager version number)
<FONT COLOR="#008080">File Header Size: 28</FONT> (size of the VBD file header in bytes)
<FONT COLOR="#008080">VB Header Size: 16</FONT> (size of the Variable Block headers in bytes)
<FONT COLOR="#008080">Static area size: 20</FONT> (size of VBD static storage area in bytes) 
<FONT COLOR="#008080">Static file size: 528</FONT> (size of the file in bytes)

<FONT COLOR="#008080">----- Dynamic Information -----
File status Byte: Good Open Read/Write</FONT> (status of this file)
<FONT COLOR="#008080">VBDFile Free Space: 0</FONT> (file address of the next free block)
<FONT COLOR="#008080">VBDFile End of File: 528</FONT> (end of file marker)
<FONT COLOR="#008080">VBDFile Heap Start: 48</FONT> (file address where all block allocation starts)
<FONT COLOR="#008080">VBDFile Highest VB: 48</FONT> (file address of the last block)
<FONT COLOR="#008080">Total VBs in file: 1</FONT> (total number of blocks, including deleted ones)
<FONT COLOR="#008080">Total deleted VBs: 0</FONT> (total number of deleted blocks)</PRE>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">T</FONT>" to display the B-tree statistics. </P>
<FONT COLOR="#008080"><PRE>
---- Btree Statistics ----
Tree stats: 188 entries, 52 nodes, 1 levels
Root FAU = 20704
Fast binds/hits/misses: 376 / 160 / 52 (91%)
Reservations:           588
Buckets in use:         0 / 1024</PRE>
</FONT><B><U><P>Fast Binds</B></U>:<BR>
Fast binds take place when a cache pointer references or binds to a cache bucket that previously existed, was unbound, and did not change its state in memory or on disk. When a fast bind occurs the bucket is simply locked by the cache pointer without having to reserve another bucket in the cache. </P>
<B><U><P>Hits</B></U>:<BR>
Hits represent the number of cache buckets that did not have to be acquired because the bucket for the file address already existed in the cache. </P>
<B><U><P>Misses</B></U>:<BR>
Misses represent the number of cache buckets that had to be acquired because a bucket for the file address did not already exist in the cache. </P>
<B><U><P>Reservations</B></U>:<BR>
Reservations represent the total number of the Fast Binds, Hits, and Misses. </P>
<B><U><P>Buckets In Use</B></U>:<BR>
Buckets in use represent the number of buckets that are currently locked. The number of buckets represents the size of the cache. The cache size in bytes is equal to the total number of buckets multiplied by the size of a B-tree entry key. </P>
<P><IMG SRC="button1.gif" WIDTH=14 HEIGHT=14>Enter "<FONT COLOR="#008080">Z</FONT>" to display this program's version number. </P>
<P><HR></P>
<P><IMG SRC="vbdicon.gif" WIDTH=32 HEIGHT=32><A NAME="Compiling"><B><FONT SIZE=4>Compiling</A></B></FONT> </P>
<B><U><P>Console Base Utility Program</B></U>:<BR>
Four makefiles are provided in the "console" directory to compile the source code on one of four different compilers. </P>
<PRE>
"msvc40.mak"  - Makefile for Microsoft visual C/C++ 4.2
"djgpp.mak"   - Makefile for DJGPP gcc 2.7.2.1 
"gnu_gcc.mak" - Makefile for GNU g++ 2.7.2.1 
"hpux10.mak"  - Makefile for HPUX C++ A.10.24  </PRE>
<B><U><P>Building the Executable:</B></U><BR>
To compile use the "<B>make -f</B>" option followed by the makefile name. To compile using MSVC use the "<B>nmake -f</B>" option. The resulting executable will be named after the name set by the <B>PROJECT</B> macro in the makefile. By default the program will be named "ix_debug" under UNIX or "ix_debug.exe" under Windows 95/DOS. </P>
<B><U><P>Installing:</B></U><BR>
Execute a "<B>make -f (makefile name) install</B>" to move the executable to the "bin" directory. </P>
<B><U><P>Removing the Object Files and the Executable:</B></U><BR>
To remove the object files and the executable use the "make -f" option followed by the makefile name, followed by "clean": <B>make -f hpux10.mak clean</B> </P>
<P>Under MSVC use the "nmake -f" option followed by the makefile name, followed by "clean": <B>nmake -f msvc40.mak clean</P>
</B><P><HR></P>
<P ALIGN="CENTER"><CENTER><TABLE BORDER CELLSPACING=1 BORDERCOLOR="#000000">
<TR><TD VALIGN="MIDDLE">
<P ALIGN="CENTER"><A HREF="../utils.htm"><B>End Of Document</B></A></TD>
</TR>
</TABLE>
</CENTER></P>

<P>&nbsp;</P></BODY>
</HTML>
