xref: /openbsd/lib/libc/stdlib/icdb_new.3 (revision f6aab3d8)
1.\"	$OpenBSD: icdb_new.3,v 1.2 2016/09/04 19:05:09 jmc Exp $
2.\"
3.\" Copyright (c) Ted Unangst
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.\"
18.Dd $Mdocdate: September 4 2016 $
19.Dt ICBB_NEW 3
20.Os
21.Sh NAME
22.Nm icdb_new ,
23.Nm icdb_open ,
24.Nm icdb_get ,
25.Nm icdb_lookup ,
26.Nm icdb_nentries ,
27.Nm icdb_entries ,
28.Nm icdb_update ,
29.Nm icdb_add ,
30.Nm icdb_rehash ,
31.Nm icdb_save ,
32.Nm icdb_close
33.Nd simple database
34.Sh SYNOPSIS
35.In icbd.h
36.Ft struct icdb *
37.Fn icdb_new "uint32_t version" "uint32_t nentries" "uint32_t entrysize"
38.Ft struct icdb *
39.Fn icdb_open "const char *name" "int flags" "uint32_t version"
40.Ft int
41.Fn icdb_get "struct icdb *db" "void *entry" "uint32_t idx"
42.Ft int
43.Fn icdb_lookup "struct icdb *db" "int keynum" "const void *key" "void *entry" "uint32_t *idxp"
44.Ft int
45.Fn icdb_nentries "struct icdb *db"
46.Ft const void *
47.Fn icdb_entries "struct icdb *db"
48.Ft int
49.Fn icdb_update "struct icdb *db" "const void *entry" "int offset"
50.Ft int
51.Fn icdb_add "struct icdb *db" "const void *entry"
52.Ft int
53.Fn icdb_rehash "struct icdb *db"
54.Ft int
55.Fn icdb_save "struct icdb *db" "int fd"
56.Ft int
57.Fn icdb_close "struct icdb *db"
58.Sh DESCRIPTION
59These functions provide access to a simple memory mapped database format.
60.Sh EXAMPLES
61Look how easy it is to use.
62.Sh STANDARDS
63These functions are not standardized.
64.Sh HISTORY
65The icdb functions were introduced in
66.Ox 6.0 .
67.Sh AUTHORS
68.An Ted Unangst Aq Mt tedu@openbsd.org
69