.TH gdbm_reorganize() "" "" "GDBM Function (libgdbm)"
.PC "Reorganize a GDBM data base"
.B "#include <gdbm.h>"
\fBint gdbm_reorganize(\fIdatabase\^\fB)\fR
\fBGDBM_FILE \fIdatabase\^\fB;\fR
.PP
Function
.B gdbm_reorganize()
reorganizes the contents of the data base to which
.I database
points.
.I database
must have been returned by a call to
.BR gdbm_open() .
.PP
When you delete a record from a GDBM data base,
the GDBM routines to not close up the space within the data base, because
doing so would make the GDBM routines unacceptably slow.
Thus, if you delete many records from within a data base, its file will
be much larger than it need be.
In this case, you should call
.B gdbm_reorganize()
to close up the ``holes'' in it.
.PP
.B gdbm_reorganize()
returns zero if all went well.
If something went wrong, it returns a value other than zero and sets the
global variables
.B errno
and
.B gdbm_errno
to appropriate values.
(For information on how to interpret the contents of these variables,
see the Lexicon entries for
.B errno.h
and
.BR gdbmerrno.h ).
.SH "See Also"
.XR "gdbm.h," gdbm.h
.XR "gdbmerrno.h," gdbmerr.h
.XR "gdbm_open()," gdbm_open
.XR "libgdbm" libgdbm
.SH Notes
For a statement of copyright and permissions on this routine, see the
Lexicon entry for
.BR libgdbm .
