manpagez: man pages & more
info gdbm
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2 Introduction to GNU dbm.

GNU dbm (gdbm) is a library of database functions that use extensible hashing and works similar to the standard UNIX dbm functions. These routines are provided to a programmer needing to create and manipulate a hashed database. (gdbm is NOT a complete database package for an end user.)

The basic use of gdbm is to store key/data pairs in a data file. Each key must be unique and each key is paired with only one data item. The keys can not be directly accessed in sorted order. The basic unit of data in gdbm is the structure:

  typedef struct {
             char *dptr;
             int  dsize;
          } datum;

This structure allows for arbitrary sized keys and data items.

The key/data pairs are stored in a gdbm disk file, called a gdbm database. An application must open a gdbm database to be able manipulate the keys and data contained in the database. gdbm allows an application to have multiple databases open at the same time. When an application opens a gdbm database, it is designated as a reader or a writer. A gdbm database can be opened by at most one writer at a time. However, many readers may open the database simultaneously. Readers and writers can not open the gdbm database at the same time.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on January 24, 2014 using texi2html 5.0.

© 2000-2023
Individual documents may contain additional copyright information.