diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-10 23:26:56 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-10 23:26:56 +0000 |
commit | e5f0f221444618ba6004d697af2535bdaff906bf (patch) | |
tree | dc6285c26798934129a0b9fbfbc68a788ea06177 /src/gdbmconst.h | |
parent | 74f7fe561e31637bdbf21aeb817d4a22bbf9c91a (diff) | |
download | gdbm-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 'src/gdbmconst.h')
-rw-r--r-- | src/gdbmconst.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/gdbmconst.h b/src/gdbmconst.h index 7a3f5b9..24eac5f 100644 --- a/src/gdbmconst.h +++ b/src/gdbmconst.h @@ -35,29 +35,6 @@ #define GDBM_MAGIC32_SWAP 0xcd9a5713 /* MAGIC32 swapped. */ #define GDBM_MAGIC64_SWAP 0xcf9a5713 /* MAGIC64 swapped. */ -/* Parameters to gdbm_open. */ -#define GDBM_READER 0 /* READERS only. */ -#define GDBM_WRITER 1 /* READERS and WRITERS. Can not create. */ -#define GDBM_WRCREAT 2 /* If not found, create the db. */ -#define GDBM_NEWDB 3 /* ALWAYS create a new db. (WRITER) */ -#define GDBM_OPENMASK 7 /* Mask for the above. */ -#define GDBM_FAST 0x10 /* Write fast! => No fsyncs. OBSOLETE. */ -#define GDBM_SYNC 0x20 /* Sync operations to the disk. */ -#define GDBM_NOLOCK 0x40 /* Don't do file locking operations. */ -#define GDBM_NOMMAP 0x80 /* Don't use mmap(). */ - -/* Parameters to gdbm_store for simple insertion or replacement in the - case a key to store is already in the database. */ -#define GDBM_INSERT 0 /* Do not overwrite data in the database. */ -#define GDBM_REPLACE 1 /* Replace the old value with the new value. */ - -/* Parameters to gdbm_setopt, specifing the type of operation to perform. */ -#define GDBM_CACHESIZE 1 /* Set the cache size. */ -#define GDBM_FASTMODE 2 /* Turn on or off fast mode. OBSOLETE. */ -#define GDBM_SYNCMODE 3 /* Turn on or off sync operations. */ -#define GDBM_CENTFREE 4 /* Keep all free blocks in the header. */ -#define GDBM_COALESCEBLKS 5 /* Attempt to coalesce free blocks. */ - /* In freeing blocks, we will ignore any blocks smaller (and equal) to IGNORE_SIZE number of bytes. */ #define IGNORE_SIZE 4 |