summaryrefslogtreecommitdiffstats
path: root/debian/manpages/tdb_store.3
blob: d701963853bcf72529c999014b9f3237497ff517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.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 <tdb.h>
.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 <tridge@linuxcare.com> and 
Luke Kenneth Casson Leighton
Man page: Ben Woodard <ben@valinux.com>
.SH "SEE ALSO"
.BR gdbm (3),
.BR tdb(3)