aboutsummaryrefslogtreecommitdiff
path: root/doc/gdbm.texinfo
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-08-11 12:07:32 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-08-11 12:07:32 +0000
commitbd2e0f98caf08c5c0448773cd1cf91dceee557bb (patch)
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')
-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
@@ -876,2 +876,26 @@ 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
@@ -888,3 +912,3 @@ code could be used:
int value = 10;
-ret = gdbm_setopt(dbf, GDBM_CACHESIZE, &value, sizeof(int));
+ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int));
@end group

Return to:

Send suggestions and report system problems to the System administrator.