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
@@ -874,6 +874,30 @@ disable it.
874@item GDBM_GETMMAP 874@item GDBM_GETMMAP
875Check whether memory mapping is enabled. The @var{value} should point 875Check whether memory mapping is enabled. The @var{value} should point
876to an integer where to return the status. 876to an integer where to return the status.
877
878@kwindex GDBM_GETDBNAME
879@item GDBM_GETDBNAME
880Return the name of the database disk file. The @var{value} should
881point to a variable of type @code{char**}. A pointer to the newly
882allocated copy of the file name will be placed there. The caller is
883responsible for freeing this memory when no longer needed. For
884example:
885
886@example
887char *name;
888
889if (gdbm_setopt (dbf, GDBM_GETDBNAME, &name, sizeof (name)))
890 @{
891 fprintf (stderr, "gdbm_setopt failed: %s\n",
892 gdbm_strerror (gdbm_errno));
893 @}
894else
895 @{
896 printf ("database name: %s\n", name);
897 free (name);
898 @}
899@end example
900
877@end table 901@end table
878 902
879The return value will be @samp{-1} upon failure, or @samp{0} upon 903The return value will be @samp{-1} upon failure, or @samp{0} upon
@@ -886,7 +910,7 @@ code could be used:
886@example 910@example
887@group 911@group
888int value = 10; 912int value = 10;
889ret = gdbm_setopt(dbf, GDBM_CACHESIZE, &value, sizeof(int)); 913ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int));
890@end group 914@end group
891@end example 915@end example
892 916

Return to:

Send suggestions and report system problems to the System administrator.