diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-08 15:25:25 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-08 15:35:13 +0300 |
commit | 27b5d96eec6d43eed834c9f1492b1f3d38bf60ec (patch) | |
tree | ac20224e957ad7688ec31d03e6080c09ab9fc4c9 /doc | |
parent | 4aef6b36f862e46723403bc6422ac47058a5ef19 (diff) | |
download | gdbm-27b5d96eec6d43eed834c9f1492b1f3d38bf60ec.tar.gz gdbm-27b5d96eec6d43eed834c9f1492b1f3d38bf60ec.tar.bz2 |
Improve _gdbm_findkey interface.
* doc/gdbm.texi: Document gdbm_exists in detail.
* src/findkey.c (_gdbm_findkey): return parameters can be
NULL.
* src/gdbmexists.c (gdbm_exists): Remove unnecessary
local variables. Reset gdbm_errno to 0 if the key was
not found.
* src/gdbmdelete.c (gdbm_delete): Remove unnecessary
local variables.
* src/gdbmfetch.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmstore.c: Likewise.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gdbm.texi | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/gdbm.texi b/doc/gdbm.texi index 6fad9d9..4c7c5c0 100644 --- a/doc/gdbm.texi +++ b/doc/gdbm.texi @@ -464,8 +464,14 @@ else You may also search for a particular key without retrieving it: @deftypefn {gdbm interface} int gdbm_exists (GDBM_FILE @var{dbf}, datum @var{key}) -Returns @samp{true} (@samp{1}) if the @var{key} exists in @var{dbf} -and @samp{false} (@samp{0}) otherwise. +Checks whether the @var{key} exists in the database @var{dbf}. + +If @var{key} is found, returns @samp{true} (@samp{1}). If it is not +found, returns @samp{false} (@samp{0}) and sets @code{gdbm_errno} to +@samp{GDBM_NO_ERROR} (@samp{0}). + +On error, returns @samp{0} and sets @code{gdbm_errno} to a +non-@samp{0} error code. The parameters are: |