dbm_store()

store record in database 

Function


SYNOPSIS

#include <ndbm.h>

int dbm_store(DBM *db, datum key, datum content, int store_mode);


DESCRIPTION

The dbm_store() function writes a record to the database specified by db. The record is identified by the specified key and content, and is inserted in the specified mode.

A datum consists of at least two members, dptr and dsize. The dptr member points to an object that is dsize bytes in length. Arbitrary binary data, as well as character strings, may be stored in the object pointed to by dptr.


PARAMETERS

db 

Points to the database where the record is to be stored. This must be a pointer returned by a prior call to dbm_open().

key 

Is the key for the record to be stored.

content 

Is the record that is to be associated with key in the database.

store_mode 

Controls whether the new record replaces any pre-existing record that has the same key as specified by key. If the database contains a record that matches key and store_mode is DBM_REPLACE, the existing record is replaced with the new record. If the database contains a record that matches key and store_mode is DBM_INSERT, the existing record is not replaced with the new record.


RETURN VALUES

The dbm_store() function returns 0 on success and a negative number on error.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
dbm_clearerr(), dbm_close(), dbm_delete(), dbm_error(), dbm_fetch(), dbm_firstkey(), dbm_nextkey(), dbm_open(), dbopen()


PTC MKS Toolkit 10.5 Documentation Build 40.