gdbm_store inserts or replaces records in the database.
ret = gdbm_store(dbf, key, content, flag);
The parameters are:
gdbm.h) asks that the old data be replaced by the new
content. The value GDBM_INSERT asks that an error be returned and no action taken if the
The values returned in
contenthave a NULL dptr field. Both
contentmust have the dptr field be a non-NULL value. Since a NULL dptr field is used by other functions to indicate an error, a NULL field cannot be valid data.
flagwas GDBM_INSERT and the
keywas already in the database.
contentis keyed by
key. The file on disk is updated to reflect the structure of the new database before returning from this function.
If you store data for a
key that is already in the data base,
gdbm replaces the old data with the new data if called with
GDBM_REPLACE. You do not get two data items for the same
key and you do
not get an error from
The size in
gdbm is not restricted like
data can be as large as you want.
Go to the first, previous, next, last section, table of contents.