aboutsummaryrefslogtreecommitdiff
path: root/doc/gdbm.texinfo
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-08-10 23:26:56 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-08-10 23:26:56 +0000
commite5f0f221444618ba6004d697af2535bdaff906bf (patch)
treedc6285c26798934129a0b9fbfbc68a788ea06177 /doc/gdbm.texinfo
parent74f7fe561e31637bdbf21aeb817d4a22bbf9c91a (diff)
downloadgdbm-e5f0f221444618ba6004d697af2535bdaff906bf.tar.gz
gdbm-e5f0f221444618ba6004d697af2535bdaff906bf.tar.bz2
Improve gdbm_setopt interface.
* src/gdbm.h.in (GDBM_OPENMASK): New constant. * src/gdbmconst.h: Remove constants duplicated in gdbm.h.in. * src/gdbmdefs.h (gdbm_file_info) <allow_mmap> <mmap_inited>: Replace with a single member: memory_mapping. All callers updated. (GDBM_SETCACHESIZE,GDBM_SETSYNCMODE) (GDBM_SETCENTFREE,GDBM_SETCOALESCEBLKS): New option names. (GDBM_SETMMAP,GDBM_GETMMAP,GDBM_GETFLAGS) (GDBM_GETCACHESIZE,GDBM_GETSYNCMODE,GDBM_GETCENTFREE) (GDBM_GETCOALESCEBLKS,GDBM_GETMAXMAPSIZE): New option codes. * src/gdbmsetopt.c: Implement new options. * doc/gdbm.texinfo: Document new options.
Diffstat (limited to 'doc/gdbm.texinfo')
-rw-r--r--doc/gdbm.texinfo79
1 files changed, 68 insertions, 11 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo
index 5dc8a97..04efeea 100644
--- a/doc/gdbm.texinfo
+++ b/doc/gdbm.texinfo
@@ -739,7 +739,7 @@ open database.
739 739
740@deftypefn {gdbm interface} int gdbm_setopt (GDBM_FILE @var{dbf}, int @var{option}, @ 740@deftypefn {gdbm interface} int gdbm_setopt (GDBM_FILE @var{dbf}, int @var{option}, @
741 void *@var{value}, int @var{size}) 741 void *@var{value}, int @var{size})
742Sets an option on the database. 742Sets an option on the database or returns the value of an option.
743 743
744The parameters are: 744The parameters are:
745 745
@@ -747,9 +747,10 @@ The parameters are:
747@item dbf 747@item dbf
748The pointer returned by @code{gdbm_open}. 748The pointer returned by @code{gdbm_open}.
749@item option 749@item option
750The option to be set. 750The option to be set or retreived.
751@item value 751@item value
752A pointer to the value to which @var{option} will be set. 752A pointer to the value to which @var{option} will be set or where to
753place the option value (depending on the option).
753@item size 754@item size
754The length of the data pointed to by @var{value}. 755The length of the data pointed to by @var{value}.
755@end table 756@end table
@@ -759,11 +760,29 @@ The valid options are:
759 760
760@table @asis 761@table @asis
761@kwindex GDBM_CACHESIZE 762@kwindex GDBM_CACHESIZE
762@item GDBM_CACHESIZE 763@kwindex GDBM_SETCACHESIZE
764@item GDBM_SETCACHESIZE
765@itemx GDBM_CACHESIZE
763Set the size of the internal bucket cache. This option may only be 766Set the size of the internal bucket cache. This option may only be
764set once on each GDBM_FILE descriptor, and is set automatically to 100 767set once on each GDBM_FILE descriptor, and is set automatically to 100
765upon the first access to the database. The @var{value} should point 768upon the first access to the database. The @var{value} should point
766to an integer holding the desired cache size. 769to a @code{size_t} holding the desired cache size.
770
771The @samp{GDBM_CACHESIZE} option is provided for compatibility with
772earlier versions.
773
774@kwindex GDBM_GETCACHESIZE
775@item GDBM_GETCACHESIZE
776Return the size of the internal bucket cache. The @var{value} should
777point to a @code{size_t} variable, where the size will be stored.
778
779@kwindex GDBM_GETFLAGS
780@item GDBM_GETFLAGS
781Return the flags describing the state of the database. The @var{value} should
782point to a @code{int} variable where to store the flags. The return
783is the same as the flags used when opening the database (@pxref{Open,
784gdbm_open}), except that it reflects the current state (which may have
785been altered by another calls to @code{gdbm_setopt}.
767 786
768@kwindex GDBM_FASTMODE 787@kwindex GDBM_FASTMODE
769@item GDBM_FASTMODE 788@item GDBM_FASTMODE
@@ -773,22 +792,34 @@ to an integer: @samp{TRUE} to enable fast mode, and @samp{FALSE} to
773disable it. 792disable it.
774 793
775This option is retained for compatibility with previous versions of 794This option is retained for compatibility with previous versions of
776@code{gdbm}. Its effect is the reverse of @code{GDBM_SYNCMODE} 795@code{gdbm}. Its effect is the reverse of @code{GDBM_SETSYNCMODE}
777(see below). 796(see below).
778 797
798@kwindex GDBM_SETSYNCMODE
779@kwindex GDBM_SYNCMODE 799@kwindex GDBM_SYNCMODE
780@item GDBM_SYNCMODE 800@item GDBM_SETSYNCMODE
801@itemx GDBM_SYNCMODE
781Turn on or off file system synchronization operations. This 802Turn on or off file system synchronization operations. This
782setting defaults to off. The @var{value} should point 803setting defaults to off. The @var{value} should point
783to an integer: @samp{TRUE} to turn synchronization on, and @samp{FALSE} to 804to an integer: @samp{TRUE} to turn synchronization on, and @samp{FALSE} to
784turn it off. 805turn it off.
785 806
786Note, that this option is a reverse of @code{GDBM_FASTMODE}, 807Note, that this option is a reverse of @code{GDBM_FASTMODE},
787i.e. calling @code{GDBM_SYNCMODE} with @samp{TRUE} has the same effect 808i.e. calling @code{GDBM_SETSYNCMODE} with @samp{TRUE} has the same effect
788as calling @code{GDBM_FASTMODE} with @samp{FALSE}. 809as calling @code{GDBM_FASTMODE} with @samp{FALSE}.
789 810
811The @samp{GDBM_SYNCMODE} option is provided for compatibility with
812earlier versions.
813
814@kwindex GDBM_GETSYNCMODE
815@item GDBM_GETSYNCMODE
816Return the current synchronization status. The @var{value} should
817point to an @code{int} where the status will be stored.
818
819@kwindex GDBM_SETCENTFREE
790@kwindex GDBM_CENTFREE 820@kwindex GDBM_CENTFREE
791@item GDBM_CENTFREE 821@item GDBM_SETCENTFREE
822@itemx GDBM_CENTFREE
792@emph{NOTICE: This feature is still under study.} 823@emph{NOTICE: This feature is still under study.}
793 824
794Set central free block pool to either on or off. The default is off, 825Set central free block pool to either on or off. The default is off,
@@ -798,8 +829,13 @@ set, this option causes all subsequent free blocks to be placed in the
798more quickly. The @var{value} should point to an integer: @samp{TRUE} to 829more quickly. The @var{value} should point to an integer: @samp{TRUE} to
799turn central block pool on, and @samp{FALSE} to turn it off. 830turn central block pool on, and @samp{FALSE} to turn it off.
800 831
832The @samp{GDBM_CENTFREE} option is provided for compatibility with
833earlier versions.
834
835@kwindex GDBM_SETCOALESCEBLKS
801@kwindex GDBM_COALESCEBLKS 836@kwindex GDBM_COALESCEBLKS
802@item GDBM_COALESCEBLKS 837@item GDBM_SETCOALESCEBLKS
838@itemx GDBM_COALESCEBLKS
803@emph{NOTICE: This feature is still under study.} 839@emph{NOTICE: This feature is still under study.}
804 840
805Set free block merging to either on or off. The default is off, which 841Set free block merging to either on or off. The default is off, which
@@ -810,13 +846,34 @@ used in conjunction with GDBM_CENTFREE. The @var{value} should point
810to an integer: @samp{TRUE} to turn free block merging on, and @samp{FALSE} to 846to an integer: @samp{TRUE} to turn free block merging on, and @samp{FALSE} to
811turn it off. 847turn it off.
812 848
849@kwindex GDBM_GETCOALESCEBLKS
850@item GDBM_GETCOALESCEBLKS
851Return the current status of free block merging. The @var{value} should
852point to an @code{int} where the status will be stored.
853
813@kwindex GDBM_SETMAXMAPSIZE 854@kwindex GDBM_SETMAXMAPSIZE
814@item GDBM_SETMAXMAPSIZE 855@item GDBM_SETMAXMAPSIZE
815Sets maximum size of the memory mapped region. The @var{value} should 856Sets maximum size of a memory mapped region. The @var{value} should
816point to a value of type @code{size_t}, @code{unsigned long} or 857point to a value of type @code{size_t}, @code{unsigned long} or
817@code{unsigned}. The actual value is rounded to the nearest page 858@code{unsigned}. The actual value is rounded to the nearest page
818boundary (the page size is obtained from 859boundary (the page size is obtained from
819@code{sysconf(_SC_PAGESIZE)}). 860@code{sysconf(_SC_PAGESIZE)}).
861
862@kwindex GDBM_GETMAXMAPSIZE
863@item GDBM_GETMAXMAPSIZE
864Return the maximum size of a memory mapped region. The @var{value} should
865point to a value of type @code{size_t} where to return the data.
866
867@kwindex GDBM_SETMMAP
868@item GDBM_SETMMAP
869Enable or disable memory mapping mode. The @var{value} should point
870to an integer: @samp{TRUE} to enable memory mapping or @samp{FALSE} to
871disable it.
872
873@kwindex GDBM_GETMMAP
874@item GDBM_GETMMAP
875Check whether memory mapping is enabled. The @var{value} should point
876to an integer where to return the status.
820@end table 877@end table
821 878
822The return value will be @samp{-1} upon failure, or @samp{0} upon 879The return value will be @samp{-1} upon failure, or @samp{0} upon

Return to:

Send suggestions and report system problems to the System administrator.