Line-by-line Anatomy of DB.c (Cont.)
if ( DmQueryRecord( db, seek ) == NULL ) seek++;
This function MemHandle DmQueryRecord( DmOpenRef dbP, UInt16 index ) returns a handle to a record for reading only (does not set the busy bit).
dbP:
DmOpenRef to open database
index:
Which record to retrieve
if ( DmSetRecordInfo( db, index, &attr, NULL ) )
This function Err DmSetRecordInfo( DmOpenRef dbP, UInt16 index, UInt16 *attrP, UInt32 *uniqueIDP ) sets record information stored in the database header.
dbP:
DmOpenRef to open database
index:
Index of record
attrP:
Pointer to new attribute variable, or NULL.
See “Record Attribute Constants” for a list of possible values.
uniqueIDP:
Pointer to new unique ID variable, or NULL
DmDatabaseSize( dbCard, dbID, NULL, &totalBytes, &dataBytes );
This function Err DmDatabaseSize( UInt16 cardNo, LocalID dbID, UInt32 *numRecordsP, UInt32 *totalBytesP, UInt32 *dataBytesP ) retrieves size information on a database.
cardNo:
Card number the database resides on
dbID:
Database ID of the database
For the following parameters, pass NULL if you don't want to retrieve them.
numRecordsP:
The total number of records in the database
totalBytesP:
The total number of bytes used by the database including the overhead
dataBytesP:
The total number of bytes used to store just each record's data, not including overhead