aboutsummaryrefslogtreecommitdiff
path: root/doc/gdbm.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gdbm.texi')
-rw-r--r--doc/gdbm.texi16
1 files changed, 12 insertions, 4 deletions
diff --git a/doc/gdbm.texi b/doc/gdbm.texi
index b5ba53d..4a0b1a7 100644
--- a/doc/gdbm.texi
+++ b/doc/gdbm.texi
@@ -212,20 +212,20 @@ library. The include file @code{gdbm.h}, that can be included by the user,
contains a definition of these functions.
@example
#include <gdbm.h>
GDBM_FILE gdbm_open(name, block_size, flags, mode, fatal_func);
-void gdbm_close(dbf);
+int gdbm_close(dbf);
int gdbm_store(dbf, key, content, flag);
datum gdbm_fetch(dbf, key);
int gdbm_delete(dbf, key);
datum gdbm_firstkey(dbf);
datum gdbm_nextkey(dbf, key);
int gdbm_reorganize(dbf);
-void gdbm_sync(dbf);
+int gdbm_sync(dbf);
int gdbm_exists(dbf, key);
char *gdbm_strerror(errno);
int gdbm_setopt(dbf, option, value, size);
int gdbm_fdesc(dbf);
int gdbm_export (GDBM_FILE, const char *, int, int);
int gdbm_export_to_file (GDBM_FILE dbf, FILE *fp);
@@ -366,20 +366,24 @@ Copy file ownership and mode from @var{src} to @var{dst}.
@cindex closing database
@cindex database, closing
It is important that every file opened is also closed. This is needed to
update the reader/writer count on the file:
-@deftypefn {gdbm interface} void gdbm_close (GDBM_FILE @var{dbf})
+@deftypefn {gdbm interface} int gdbm_close (GDBM_FILE @var{dbf})
This function closes the @code{gdbm} file and frees all memory
associated with it. The parameter is:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@end table
+
+@code{Gdbm_close} returns 0 on success. On error, it sets
+@code{gdbm_errno} and system @code{errno} variables to the codes
+describing the error and returns -1.
@end deftypefn
@node Count
@chapter Number of Records
@cindex number of records
@deftypefn {gdbm interface} int gdbm_count (GDBM_FILE @var{dbf}, @
@@ -675,21 +679,25 @@ Unless your database was opened with the @samp{GDBM_SYNC} flag,
continuing. This allows for faster writing of databases at the risk
of having a corrupted database if the application terminates in an
abnormal fashion. The following function allows the programmer to
make sure the disk version of the database has been completely updated
with all changes to the current time.
-@deftypefn {gdbm interface} void gdbm_sync (GDBM_FILE @var{dbf})
+@deftypefn {gdbm interface} int gdbm_sync (GDBM_FILE @var{dbf})
Synchronizes the changes in @var{dbf} with its disk file. The
parameter is a pointer returned by @code{gdbm_open}.
This function would usually be called after a complete set of changes
have been made to the database and before some long waiting time.
The @code{gdbm_close} function automatically calls the equivalent of
@code{gdbm_sync} so no call is needed if the database is to be closed
immediately after the set of changes have been made.
+
+@code{Gdbm_sync} returns 0 on success. On error, it sets
+@code{gdbm_errno} and system @code{errno} variables to the codes
+describing the error and returns -1.
@end deftypefn
@node Flat files
@chapter Export and Import
@cindex Flat file format
@cindex export

Return to:

Send suggestions and report system problems to the System administrator.