summaryrefslogtreecommitdiffabout
path: root/doc/gdbm.texinfo
authorSergey Poznyakoff <gray@gnu.org.ua>2011-08-11 12:07:32 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-08-11 12:07:32 (GMT)
commitbd2e0f98caf08c5c0448773cd1cf91dceee557bb (patch) (side-by-side diff)
tree54fbebdabf744f926d120b777801cc048b6adc8f /doc/gdbm.texinfo
parente8a2a215a7b73924da50b1407f107cfccd4fe979 (diff)
downloadgdbm-bd2e0f98caf08c5c0448773cd1cf91dceee557bb.tar.gz
gdbm-bd2e0f98caf08c5c0448773cd1cf91dceee557bb.tar.bz2
New option GDBM_GETDBNAME.
* src/gdbm.h.in (GDBM_GETDBNAME): New option. * src/gdbmsetopt.c (gdbm_setopt): Handle GDBM_GETDBNAME. * doc/gdbm.texinfo (Options): Document GDBM_GETDBNAME.
Diffstat (limited to 'doc/gdbm.texinfo') (more/less context) (ignore whitespace changes)
-rw-r--r--doc/gdbm.texinfo26
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo
index 04efeea..3463b84 100644
--- a/doc/gdbm.texinfo
+++ b/doc/gdbm.texinfo
@@ -874,6 +874,30 @@ disable it.
@item GDBM_GETMMAP
Check whether memory mapping is enabled. The @var{value} should point
to an integer where to return the status.
+
+@kwindex GDBM_GETDBNAME
+@item GDBM_GETDBNAME
+Return the name of the database disk file. The @var{value} should
+point to a variable of type @code{char**}. A pointer to the newly
+allocated copy of the file name will be placed there. The caller is
+responsible for freeing this memory when no longer needed. For
+example:
+
+@example
+char *name;
+
+if (gdbm_setopt (dbf, GDBM_GETDBNAME, &name, sizeof (name)))
+ @{
+ fprintf (stderr, "gdbm_setopt failed: %s\n",
+ gdbm_strerror (gdbm_errno));
+ @}
+else
+ @{
+ printf ("database name: %s\n", name);
+ free (name);
+ @}
+@end example
+
@end table
The return value will be @samp{-1} upon failure, or @samp{0} upon
@@ -886,7 +910,7 @@ code could be used:
@example
@group
int value = 10;
-ret = gdbm_setopt(dbf, GDBM_CACHESIZE, &value, sizeof(int));
+ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int));
@end group
@end example

Return to:

Send suggestions and report system problems to the System administrator.