
So, we will need an array,  which contains names of types of fields.
You can see this array below.

char	*ts[]= {
	"dBase III",
	"FoxPro",
	"dBase IV",
	"Visual FoxPro",
	"Unknown"
	};

The program  will print a type  of a field  of a database as  a text
instead of a single character.

Please look to the function, which prints structures of databases, I
will describe each element of this function below.

void
StructInfo()
{
 char	*f1,*f2;

 f1=strrchr(d1->filename, '\\');
 f2=strrchr(d2->filename, '\\');
 if (f1) ++f1; else f1=d1->filename;
 if (f2) ++f2; else f2=d2->filename;

 printf("File: %-30s | File: %-30s\n"
	"Type: %-30s | Type: %-30s\n"
	"Last updated: %02d.%02d.%04d             | Last updated: %02d.%02d.%04d\n"
	"File size: %13ld             | File size: %13ld\n"
	"Header size: %11d             | Header size: %11d\n"
	"Record count: %10d             | Record count: %10d\n"
	"Field count: %11d             | Field count: %11d\n"
	"Record length: %9d             | Record length: %9d\n"
	,
	f1, f2,

	ts[GetMemoType(d1)], ts[GetMemoType(d2)],
	
	d1->hdr.last_month, d1->hdr.last_day, d1->hdr.last_year+1900,
	d2->hdr.last_month, d2->hdr.last_day, d2->hdr.last_year+1900,

	SetFilePointer(d1->h, 0, NULL, FILE_END),SetFilePointer(d2->h, 0, NULL, FILE_END),
	d1->hdr.offset_first, d2->hdr.offset_first,
	reccount(d1), reccount(d2),
	fieldcount(d1), fieldcount(d2),
	d1->hdr.rec_len, d2->hdr.rec_len
	);
}

First we will  extract filenames from names of the  databases (if it
is possible).

 char	*f1,*f2;

 f1=strrchr(d1->filename, '\\');
 f2=strrchr(d2->filename, '\\');
 if (f1) ++f1; else f1=d1->filename;
 if (f2) ++f2; else f2=d2->filename;

Names of databases:

 printf("File: %-30s | File: %-30s\n"
	[...]
	f1, f2,

Types of databases.
The function GetMemoType returns a type of memo-fields.
0-dbase3, 2-FoxPro, 3-dbase4, 4-visualfoxpro, 5-unknown.
It will be transformed to the text with the help of our array.

	"Type: %-30s | Type: %-30s\n"
	[...]
	ts[GetMemoType(d1)], ts[GetMemoType(d2)],

Date of  last update. We print  it in m-d-y format.  Values of year,
month and  day we take  directly from  headers of DBF-files.  We add
1900 to the value of year.

I do not exclude a probability that this program will continue to be
used until  2156, when the  byte which stores the  years, overflows.
However,  I hope  that  my  grandchildren will  forgive  me for  not
inserting an overflow check.

	"Last updated: %02d.%02d.%04d             | Last updated: %02d.%02d.%04d\n"
	[...]
	d1->hdr.last_month, d1->hdr.last_day, d1->hdr.last_year+1900,
	d2->hdr.last_month, d2->hdr.last_day, d2->hdr.last_year+1900,

The sizes  of files on  a disk we receive  with help of  a function,
which sets a pointer to the end of a file. But we could calculate it
by the formula:
	record count * record length + header length.

	"File size: %13ld             | File size: %13ld\n"
	[...]
	SetFilePointer(d1->h, 0, NULL, FILE_END),SetFilePointer(d2->h, 0, NULL, FILE_END),

Header length - it is an offset to a first record.
We take  the value from a  structure, which describes a  header of a
database.

	"Header size: %11d             | Header size: %11d\n"
	[...]
	d1->hdr.offset_first, d2->hdr.offset_first,

Record count.  As a database is  not filtered that we  can take this
value from the header, too. But let's call the function.
Hint:
The function reccount() returns record count in view of a filter.

	"Record count: %10d             | Record count: %10d\n"
	[...]
	reccount(d1), reccount(d2),

Number of fields. Generally, really a number of fields are stored in
the variable  num_nld of the  struct DBF. The  function fieldcount()
returns number  of really used  fields, but  in this moment  that is
equal.

	"Field count: %11d             | Field count: %11d\n"
	[...]
	fieldcount(d1), fieldcount(d2),

And at last a record length. This value we takes from header.

	"Record length: %9d             | Record length: %9d\n"
	[...]
	d1->hdr.rec_len, d2->hdr.rec_len

The function prints such a result:

File: sample.dbf                     | File: Birthday.dbf
Type: dBase III                      | Type: dBase III
Last updated: 02.21.2001             | Last updated: 02.20.2001
File size:          1359             | File size:          1553
Header size:         225             | Header size:         225
Record count:         14             | Record count:         16
Field count:           6             | Field count:           6
Record length:        81             | Record length:        83
