void * DBLock(
VMFileHandle file,
DBGroup group,
DBItem item);
This routine locks the specified item and returns a pointer to it. It is passed the file, group, and item handles specifying a DB item. If it fails, it returns a null pointer.
Include: dbase.h
See Also: DBLockGetRef(),DBLockUngrouped().
void * DBLockGetRef(
VMFileHandle file,
DBGroup group,
DBItem item,
optr * ref);
This routine is just like
DBLock(), except that it writes the item's optr to the passed address.
Include: dbase.h
Warnings: The optr is only valid until the DB item is unlocked.
void * DBLockGetRefUngrouped(
VMFileHandle file,
DBGroupAndItem id,
optr * ref);
This routine is the same as
DBLockGetRef(), except that it is passed a
DBGroupAndItem
value.
Include: dbase.h
void * DBLockMap(
VMFileHandle file);
This routine locks the specified file's map item and returns its address. To unlock the map item, call
DBUnlock() normally.
Include: dbase.h
See Also: DBLockMap().
void * DBLockUngrouped(
VMFileHandle file,
DBGroupAndItem id);
This routine is the same as
DBLock(), except that it is passed a
DBGroupAndItem
value.
Include: dbase.h
void DBReAlloc(
VMFileHandle file,
DBGroup group,
DBItem item,
word size);
This routine changes the size of a DB item. It is passed the file, group, and item handles specifying the DB item, and a new size for the item (in bytes). If the new size is larger than the old, space will be added to the end of the item; if the new size is smaller than the old, the item will be truncated to fit.
Warnings: If the new size is larger than the old, all pointers to items in the group are invalidated. Space added is not zero-initialized.
Include: dbase.h
void DBReAllocUngrouped(
VMFileHandle file,
DBGroupAndItem id,
word size);
This routine is just like
DBReAlloc(), except it is passed a
DBGroupAndItem
value instead of separate group and item handles.
Warnings: If the new size is larger than the old, all pointers to ungrouped items are invalidated. Space added is not zero-initialized.
Include: dbase.h
void DBSetMap(
VMFileHandle file,
DBGroup group,
DBItem item);
This routine sets the DB map item. You can later retrieve a
DBGroupAndItem
structure identifying this item by calling
DBGetMap(). The routine is passed the file, group, and item handles specifying the new map item; it does not return anything.
Include: dbase.h
void DBSetMapUngrouped(
VMFileHandle file,
DBGroupAndItem id);
This routine is just like
DBSetMap(), except it is passed a
DBGroupAndItem
value instead of separate group and item handles.
Include: dbase.h
void DBUnlock(
void * ptr); /* address of item to unlock */
This routine unlocks the DB item whose address is passed.
Tips and Tricks: Only the segment address of the pointer is significant. Thus, you can pass a pointer to somewhere within an item (or immediately after it) to unlock it.
Be Sure To: If the item has been changed, make sure you call
DBDirty()
before
you unlock it.
Include: dbase.h
GEOS SDK TechDocs|
|
DBDeref() ... |
DiskCheckInUse() ...