diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-11 12:07:32 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-11 12:07:32 +0000 |
commit | bd2e0f98caf08c5c0448773cd1cf91dceee557bb (patch) | |
tree | 54fbebdabf744f926d120b777801cc048b6adc8f /doc/gdbm.texinfo | |
parent | e8a2a215a7b73924da50b1407f107cfccd4fe979 (diff) | |
download | gdbm-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.texinfo | 26 |
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 |
875 | Check whether memory mapping is enabled. The @var{value} should point | 875 | Check whether memory mapping is enabled. The @var{value} should point |
876 | to an integer where to return the status. | 876 | to an integer where to return the status. |
877 | |||
878 | @kwindex GDBM_GETDBNAME | ||
879 | @item GDBM_GETDBNAME | ||
880 | Return the name of the database disk file. The @var{value} should | ||
881 | point to a variable of type @code{char**}. A pointer to the newly | ||
882 | allocated copy of the file name will be placed there. The caller is | ||
883 | responsible for freeing this memory when no longer needed. For | ||
884 | example: | ||
885 | |||
886 | @example | ||
887 | char *name; | ||
888 | |||
889 | if (gdbm_setopt (dbf, GDBM_GETDBNAME, &name, sizeof (name))) | ||
890 | @{ | ||
891 | fprintf (stderr, "gdbm_setopt failed: %s\n", | ||
892 | gdbm_strerror (gdbm_errno)); | ||
893 | @} | ||
894 | else | ||
895 | @{ | ||
896 | printf ("database name: %s\n", name); | ||
897 | free (name); | ||
898 | @} | ||
899 | @end example | ||
900 | |||
877 | @end table | 901 | @end table |
878 | 902 | ||
879 | The return value will be @samp{-1} upon failure, or @samp{0} upon | 903 | The 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 |
888 | int value = 10; | 912 | int value = 10; |
889 | ret = gdbm_setopt(dbf, GDBM_CACHESIZE, &value, sizeof(int)); | 913 | ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int)); |
890 | @end group | 914 | @end group |
891 | @end example | 915 | @end example |
892 | 916 | ||