File: dbzdbm.c

package info (click to toggle)
suck 4.3.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,196 kB
  • sloc: ansic: 12,086; perl: 528; sh: 363; makefile: 345; java: 144
file content (45 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (13)
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
/*
 * dbm emulation on top of dbz
 */

#include <dbz.h>

/*
 - dbminit - open a database, creating it (using defaults) if necessary
 */
int 				/* 0 success, -1 failure */
dbminit(name)
char *name;
{
	return(dbzdbminit(name));
}

/*
 - dbmclose - close a database
 */
int
dbmclose()
{
	return(dbzdbmclose());
}

/*
 - fetch - get an entry from the database
 */
datum				/* dptr NULL, dsize 0 means failure */
fetch(key)
datum key;
{
	return(dbzdbmfetch(key));
}

/*
 - store - add an entry to the database
 */
int				/* 0 success, -1 failure */
store(key, data)
datum key;
datum data;
{
	return(dbzdbmstore(key, data));
}