dbm_store Subroutine

Purpose

Places data under a key.

Library

C Library (libc.a)

Syntax

#include <ndbm.h>

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

Description

The dbm_store subroutine places data under a key.

Parameters

Item Description
db Specifies the database to store.
key Specifies the input key.
content Specifies the value associated with the key to store.
flags Contains either the DBM_INSERT or DBM_REPLACE flag.

Return Values

Upon successful completion, this subroutine returns a value of 0. If unsuccessful, the subroutine returns a negative value. When the dbm_store subroutine is called with the flags parameter set to the DBM_INSERT flag and an existing entry is found, it returns a value of 1. If the flags parameter is set to the DBM_REPLACE flag, the entry will be replaced, even if it already exists.