Line-by-line Anatomy of DB.c
(Cont.)
DmSetDatabaseInfo( dbCard, dbID, NULL, &attributes, NULL, ... );
This function Err DmSetDatabaseInfo ( ... ) sets information about a DB.
DmGetDatabaseLockState( db, NULL, NULL, &locks );
This function void DmGetDatabaseLockState( DmOpenRef dbR, UInt8 *highest, UInt32 *count, UInt32 *busy ) returns information about the number of locked and busy records in a database.
dbR
:
Database access pointer
For the following parameters, pass NULL
if you don't want to retrieve them.
highest
:
The highest lock count found for all of the records in the database.
If a database has two records, one has a lock count of 2 and one has a lock count of 1, the highest lock count is 2.
count
:
The number of records that have the lock count that is returned in the highest parameter
busy
:
The number of records that have the busy bit set
This function is intended to be used for debugging purposes.
You can use it to obtain information about how many records are busy and how much locking occurs.
nbRec = DmNumRecords( db );
This function UInt16 DmNumRecords( DmOpenRef dbP ) returns the number of records in a database.
dbP
: DmOpenRef
to open database
Records that have that have the deleted
bit set are included in the count.
If you want to exclude these records from your count, use DmNumRecordsInCategory( ) and pass dmAllCategories
as the category.