DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(gdbm.info.gz) Options

Info Catalog (gdbm.info.gz) Errors (gdbm.info.gz) Top (gdbm.info.gz) Locking
 
 Seting options.
 ***************
 
    `Gdbm' supports the ability to set certain options on an already
 open database.
 
      ret = gdbm_setopt(dbf, option, value, size);
 
    The parameters are:
 
 GDBM_FILE dbf
      The pointer returned by `gdbm_open'.
 
 int option
      The option to be set.
 
 int *value
      A pointer to the value to which `option' will be set.
 
 int size
      The length of the data pointed to by `value'.
 
    The valid options are:
 
    GDBM_CACHESIZE - Set the size of the internal bucket cache.  This
 option may only be set once on each GDBM_FILE descriptor, and   is set
 automatically to 100 upon the first access to the database.
 
    GDBM_FASTMODE - Set fast mode to either on or off.  This allows
 fast mode to be toggled on an already open and active database.
 value (see below) should be set to either TRUE or FALSE.    _This
 option is now obsolete._
 
    GDBM_SYNCMODE - Turn on or off file system synchronization
 operations.  This   setting defaults to off; value (see below) should
 be set to either TRUE or   FALSE.
 
    GDBM_CENTFREE - Set central free block pool to either on or off.
 The default is off, which is how previous versions of `Gdbm'   handled
 free blocks.  If set, this option causes all subsequent free   blocks
 to be placed in the _global_ pool, allowing (in theory)   more file
 space to be reused more quickly.  value (see below) should   be set to
 either TRUE or FALSE.    _NOTICE: This feature is still under study._
 
    GDBM_COALESCEBLKS - Set free block merging to either on or off.
 The default is off, which is how previous versions of `Gdbm'   handled
 free blocks.  If set, this option causes adjacent free blocks   to be
 merged.  This can become a CPU expensive process with time, though,
 especially if used in conjunction with GDBM_CENTFREE.  value (see below)
  should be set to either TRUE or FALSE.    _NOTICE: This feature is
 still under study._
 
    The return value will be -1 upon failure, or 0 upon success.  The
 global variable `gdbm_errno' will be set upon failure.
 
    For instance, to set a database to use a cache of 10, after opening
 it with `gdbm_open', but prior to accessing it in any way, the following
 code could be used:
 
      int value = 10;
      ret = gdbm_setopt(dbf, GDBM_CACHESIZE, &value, sizeof(int));
 
Info Catalog (gdbm.info.gz) Errors (gdbm.info.gz) Top (gdbm.info.gz) Locking
automatically generated byinfo2html