.TH TDB_STORE 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" .SH NAME tdb_store \- store a record in a tdb database. .SH SYNOPSIS .nf .B #include .sp .BI "int tdb_store(TDB_CONTEXT *" tdb ", TDB_DATA " key ", TDB_DATA " record ", int " flag ");" .sp .SH DESCRIPTION Store a lump of data pointed to by .I record in the .I tdb database under the index pointed to by .I key. The TDB_DATA structure used by both .I key and .I record is defined as: .PP .RS .nf typedef struct { char *dptr; size_t dsize; } TDB_DATA; .fi .RE .PP The .I flag determines the way that tdb_store behaves and can be any one of the following values. .TP .B TDB_REPLACE Insert a record creating a new one or overwriting an existing one. .TP .B TDB_INSERT Insert a new entry but refuse to overwrite an existing entry. .TP .B TDB_MODIFY Replace an existing record with a new one. This will fail if, a record does not already exist. .PP .SH "RETURN VALUE" A return value of 0 indicates success and \-1 indicates failure. .SH AUTHORS Software: Andrew Tridgell and Luke Kenneth Casson Leighton Man page: Ben Woodard .SH "SEE ALSO" .BR gdbm (3), .BR tdb(3)