NAME
dbfree, dbclose - free datascope memory
SYNOPSIS
#include "db.h" ;
int dbfree(Dbptr db)
int dbclose(Dbptr db)
DESCRIPTION
dbfree frees up the space allocated when a new view is created.
When a view is created using
dbjoin(3),
dbsubset(3),
dbsort(3), or by
some other means, a large two dimensional array of database pointers
is created. This array contains references to the various rows in the
base tables which make up the view. At the same time, a number of c
structures which describe this new view are created.
dbfree
frees the data array, and the structures which describe the new view.
The input database pointer must identify a single table -- that is,
db.table and db.database should be valid.
dbclose attempts to free all the memory allocated when a database
was opened, as well as closing all the related open files.
RETURN VALUES
dbclose returns zero on success, but may return dbINVALID if it
was not possible to close a file (this should never happen)
dbfree returns zero for success, or may return dbINVALID if the
input
db pointer is invalid; this may occur if a view has
already been freed.
LIBRARY
$(DBLIBS)
BUGS AND CAVEATS
Long running processes are likely to get better performance by using
dbmatches(3) and
dbfind(3), rather than constructing views repeatedly.
Grouped views created by dbgroup(3) are dependent on the table or view
they're grouping, so you must be careful not to free that dependent view until
you also free the the group view.
SEE ALSO
dbopen(3)
dbintro(3)
AUTHOR
Daniel Quinlan