Line-by-line Anatomy of DB.c
(Cont.)
DmReleaseRecord( db, index, true );
This function Err DmReleaseRecord( DmOpenRef dbP, UInt16 index, Boolean dirty ) clears the busy
bit for the given record and sets the dirty
bit if dirty is true
.
Call this routine when you finish modifying or reading a record that you've called DmGetRecord( ) on or created using DmNewRecord( ).
dbP
:
DmOpenRef
to open database
index
:
The record to unlock
dirty
:
If true
, set the dirty
bit.
DmRecordInfo( db, curRec, &attr, NULL, NULL )
This function Err DmRecordInfo( DmOpenRef dbP, UInt16 index, UInt16 *attrP, UInt32 *uniqueIDP, LocalID *chunkIDP ) retrieves the record information as stored in the database header.
dbP
:
DmOpenRef
to open database
index
:
Index of the record
For the following parameters, pass NULL
if the values are not wanted.
attrP
:
The record's attributes.
See “Record Attribute Constants.”
uniqueIDP
:
The record's unique ID
chunkIDP
:
The record's local ID
if ( ( error = DmRemoveRecord( db, curRec ) ) == 0 ) {
This function Err DmRemoveRecord( DmOpenRef dbP, UInt16 index ) removes a record from a database and disposes of its data chunk.
It should only be used for newly-created records that have just been deleted or records that have never been sync'ed.
dbP
:
DmOpenRef
to open database
index
:
Index of the record to remove