]> git.saurik.com Git - apple/libc.git/blob - db/man/FreeBSD/dbm.3.patch
Libc-498.tar.gz
[apple/libc.git] / db / man / FreeBSD / dbm.3.patch
1 --- dbm.3 2005-07-28 16:23:28.000000000 -0700
2 +++ dbm.3.edit 2006-07-12 11:16:35.000000000 -0700
3 @@ -33,28 +33,54 @@
4 .Nm dbm_store
5 .Nd database access functions
6 .Sh SYNOPSIS
7 -.In fcntl.h
8 .In ndbm.h
9 -.Ft DBM *
10 -.Fn dbm_open "const char *base" "int flags" "int mode"
11 +.Ft int
12 +.Fo dbm_clearerr
13 +.Fa "DBM *db"
14 +.Fc
15 .Ft void
16 -.Fn dbm_close "DBM *db"
17 +.Fo dbm_close
18 +.Fa "DBM *db"
19 +.Fc
20 .Ft int
21 -.Fn dbm_store "DBM *db" "datum key" "datum data" "int flags"
22 -.Ft datum
23 -.Fn dbm_fetch "DBM *db" "datum key"
24 +.Fo dbm_delete
25 +.Fa "DBM *db"
26 +.Fa "datum key"
27 +.Fc
28 +.Ft int
29 +.Fo dbm_dirfno
30 +.Fa "DBM *db"
31 +.Fc
32 .Ft int
33 -.Fn dbm_delete "DBM *db" "datum key"
34 +.Fo dbm_error
35 +.Fa "DBM *db"
36 +.Fc
37 .Ft datum
38 -.Fn dbm_firstkey "DBM *db"
39 +.Fo dbm_fetch
40 +.Fa "DBM *db"
41 +.Fa "datum key"
42 +.Fc
43 .Ft datum
44 -.Fn dbm_nextkey "DBM *db"
45 -.Ft int
46 -.Fn dbm_error "DBM *db"
47 -.Ft int
48 -.Fn dbm_clearerr "DBM *db"
49 +.Fo dbm_firstkey
50 +.Fa "DBM *db"
51 +.Fc
52 +.Ft datum
53 +.Fo dbm_nextkey
54 +.Fa "DBM *db"
55 +.Fc
56 +.Ft DBM *
57 +.Fo dbm_open
58 +.Fa "const char *file"
59 +.Fa "int open_flags"
60 +.Fa "mode_t file_mode"
61 +.Fc
62 .Ft int
63 -.Fn dbm_dirfno "DBM *db"
64 +.Fo dbm_store
65 +.Fa "DBM *db"
66 +.Fa "datum key"
67 +.Fa "datum content"
68 +.Fa "int store_mode"
69 +.Fc
70 .Sh DESCRIPTION
71 Database access functions.
72 These functions are implemented using
73 @@ -74,38 +100,38 @@
74 .Ed
75 .Pp
76 The
77 -.Fn dbm_open base flags mode
78 +.Fn dbm_open file open_flags file_mode
79 function
80 -opens or creates a database.
81 +opens or creates a database file.
82 The
83 -.Fa base
84 +.Fa file
85 argument
86 is the basename of the file containing
87 the database; the actual database has a
88 .Pa .db
89 suffix.
90 I.e., if
91 -.Fa base
92 +.Fa file
93 is
94 .Qq Li /home/me/mystuff
95 then the actual database is in the file
96 .Pa /home/me/mystuff.db .
97 The
98 -.Fa flags
99 +.Fa open_flags
100 and
101 -.Fa mode
102 +.Fa file_mode
103 arguments
104 are passed to
105 .Xr open 2 .
106 .Pq Dv O_RDWR | O_CREAT
107 is a typical value for
108 -.Fa flags ;
109 +.Fa open_flags ;
110 .Li 0660
111 is a typical value for
112 -.Fa mode .
113 +.Fa file_mode .
114 .Dv O_WRONLY
115 is treated as O_RDWR in
116 -.Fa flags .
117 +.Fa open_flags .
118 The pointer returned by
119 .Fn dbm_open
120 identifies the database and is the
121 @@ -130,18 +156,18 @@
122 normally returns zero.
123 .Pp
124 The
125 -.Fn dbm_store db key data flags
126 +.Fn dbm_store db key content store_mode
127 function
128 inserts or replaces an entry in the database.
129 The
130 -.Fa flags
131 +.Fa store_mode
132 argument
133 is either
134 .Dv DBM_INSERT
135 or
136 .Dv DBM_REPLACE .
137 If
138 -.Fa flags
139 +.Fa store_mode
140 is
141 .Dv DBM_INSERT
142 and the database already contains an entry for
143 @@ -153,7 +179,7 @@
144 function
145 normally returns zero but returns 1 if the entry could not be
146 inserted (because
147 -.Fa flags
148 +.Fa store_mode
149 is
150 .Dv DBM_INSERT ,
151 and an entry with
152 @@ -168,7 +194,7 @@
153 returns
154 .Dv NULL
155 or the
156 -.Fa data
157 +.Fa content
158 corresponding to
159 .Fa key .
160 .Pp
161 @@ -223,10 +249,30 @@
162 .Fn dbm_dirfno db
163 function
164 returns the file descriptor to the database.
165 +.Sh LEGACY SYNOPSIS
166 +.Fd #include <fcntl.h>
167 +.Fd #include <ndbm.h>
168 +.Pp
169 +The include file
170 +.In ndbm.h
171 +is necessary for all functions.
172 +.Pp
173 +.Ft DBM *
174 +.br
175 +.Fo dbm_open
176 +.Fa "const char *file"
177 +.Fa "int open_flags"
178 +.Fa "int file_mode"
179 +.Fc ;
180 +.Pp
181 +.Fa file_mode
182 +has type
183 +.Vt int .
184 .Sh SEE ALSO
185 .Xr open 2 ,
186 .Xr dbopen 3 ,
187 -.Xr hash 3
188 +.Xr hash 3 ,
189 +.Xr compat 5
190 .Sh STANDARDS
191 These functions (except
192 .Fn dbm_dirfno )