add db.1.85
[nvi.git] / db.1.85 / docs / dbopen.3.ps
blobc621bef97db51a132b8902ceefcf72bb955c8992
1 %!PS-Adobe-3.0
2 %%Creator: groff version 1.08
3 %%DocumentNeededResources: font Times-Roman
4 %%+ font Times-Bold
5 %%+ font Times-Italic
6 %%DocumentSuppliedResources: procset grops 1.08 0
7 %%Pages: 4
8 %%PageOrder: Ascend
9 %%Orientation: Portrait
10 %%EndComments
11 %%BeginProlog
12 %%BeginResource: procset grops 1.08 0
13 /setpacking where{
14 pop
15 currentpacking
16 true setpacking
17 }if
18 /grops 120 dict dup begin
19 /SC 32 def
20 /A/show load def
21 /B{0 SC 3 -1 roll widthshow}bind def
22 /C{0 exch ashow}bind def
23 /D{0 exch 0 SC 5 2 roll awidthshow}bind def
24 /E{0 rmoveto show}bind def
25 /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
26 /G{0 rmoveto 0 exch ashow}bind def
27 /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
28 /I{0 exch rmoveto show}bind def
29 /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
30 /K{0 exch rmoveto 0 exch ashow}bind def
31 /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
32 /M{rmoveto show}bind def
33 /N{rmoveto 0 SC 3 -1 roll widthshow}bind def
34 /O{rmoveto 0 exch ashow}bind def
35 /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
36 /Q{moveto show}bind def
37 /R{moveto 0 SC 3 -1 roll widthshow}bind def
38 /S{moveto 0 exch ashow}bind def
39 /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
40 /SF{
41 findfont exch
42 [exch dup 0 exch 0 exch neg 0 0]makefont
43 dup setfont
44 [exch/setfont cvx]cvx bind def
45 }bind def
46 /MF{
47 findfont
48 [5 2 roll
49 0 3 1 roll 
50 neg 0 0]makefont
51 dup setfont
52 [exch/setfont cvx]cvx bind def
53 }bind def
54 /level0 0 def
55 /RES 0 def
56 /PL 0 def
57 /LS 0 def
58 /PLG{
59 gsave newpath clippath pathbbox grestore
60 exch pop add exch pop
61 }bind def
62 /BP{
63 /level0 save def
64 1 setlinecap
65 1 setlinejoin
66 72 RES div dup scale
67 LS{
68 90 rotate
70 0 PL translate
71 }ifelse
72 1 -1 scale
73 }bind def
74 /EP{
75 level0 restore
76 showpage
77 }bind def
78 /DA{
79 newpath arcn stroke
80 }bind def
81 /SN{
82 transform
83 .25 sub exch .25 sub exch
84 round .25 add exch round .25 add exch
85 itransform
86 }bind def
87 /DL{
89 moveto
91 lineto stroke
92 }bind def
93 /DC{
94 newpath 0 360 arc closepath
95 }bind def
96 /TM matrix def
97 /DE{
98 TM currentmatrix pop
99 translate scale newpath 0 0 .5 0 360 arc closepath
100 TM setmatrix
101 }bind def
102 /RC/rcurveto load def
103 /RL/rlineto load def
104 /ST/stroke load def
105 /MT/moveto load def
106 /CL/closepath load def
107 /FL{
108 currentgray exch setgray fill setgray
109 }bind def
110 /BL/fill load def
111 /LW/setlinewidth load def
112 /RE{
113 findfont
114 dup maxlength 1 index/FontName known not{1 add}if dict begin
116 1 index/FID ne{def}{pop pop}ifelse
117 }forall
118 /Encoding exch def
119 dup/FontName exch def
120 currentdict end definefont pop
121 }bind def
122 /DEFS 0 def
123 /EBEGIN{
124 moveto
125 DEFS begin
126 }bind def
127 /EEND/end load def
128 /CNT 0 def
129 /level1 0 def
130 /PBEGIN{
131 /level1 save def
132 translate
133 div 3 1 roll div exch scale
134 neg exch neg exch translate
135 0 setgray
136 0 setlinecap
137 1 setlinewidth
138 0 setlinejoin
139 10 setmiterlimit
140 []0 setdash
141 /setstrokeadjust where{
143 false setstrokeadjust
145 /setoverprint where{
147 false setoverprint
149 newpath
150 /CNT countdictstack def
151 userdict begin
152 /showpage{}def
153 }bind def
154 /PEND{
155 clear
156 countdictstack CNT sub{end}repeat
157 level1 restore
158 }bind def
159 end def
160 /setpacking where{
162 setpacking
164 %%EndResource
165 %%IncludeResource: font Times-Roman
166 %%IncludeResource: font Times-Bold
167 %%IncludeResource: font Times-Italic
168 grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
169 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
170 /Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
171 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
172 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
173 /exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
174 /parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
175 /five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
176 /D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
177 /bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
178 /r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
179 /guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
180 /daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
181 /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
182 /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
183 /section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
184 /registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
185 /paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
186 /onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
187 /Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
188 /Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
189 /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
190 /agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
191 /ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
192 /oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
193 /udieresis/yacute/thorn/ydieresis]def/Times-Italic@0 ENC0/Times-Italic RE
194 /Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE
195 %%EndProlog
196 %%Page: 1 1
197 %%BeginPageSetup
199 %%EndPageSetup
200 /F0 10/Times-Roman@0 SF 124.01(DBOPEN\(3\) BSD)72 48 R(Programmer')2.5 E 2.5
201 (sM)-.55 G 124.01(anual DBOPEN\(3\))340.17 48 R/F1 9/Times-Bold@0 SF -.18(NA)72
202 84 S(ME).18 E F0(dbopen \255 database access methods)108 96 Q F1(SYNOPSIS)72
203 112.8 Q/F2 10/Times-Bold@0 SF(#include <sys/types.h>)108 124.8 Q
204 (#include <limits.h>)108 136.8 Q(#include <db)108 148.8 Q(.h>)-.4 E(DB *)108
205 172.8 Q(dbopen\(const char *\214le, int \215ags, int mode, DBTYPE type,)108
206 184.8 Q(const v)158 196.8 Q(oid *openinf)-.1 E(o\);)-.25 E F1(DESCRIPTION)72
207 213.6 Q/F3 10/Times-Italic@0 SF(Dbopen)108 225.6 Q F0 .032
208 (is the library interf)2.532 F .031(ace to database \214les.)-.1 F .031
209 (The supported \214le formats are btree, hashed and UNIX \214le)5.031 F 2.82
210 (oriented. The)108 237.6 R .32
211 (btree format is a representation of a sorted, balanced tree structure.)2.82 F
212 .321(The hashed format is an)5.321 F -.15(ex)108 249.6 S .424
213 (tensible, dynamic hashing scheme.).15 F .423
214 (The \215at-\214le format is a byte stream \214le with \214x)5.423 F .423
215 (ed or v)-.15 F .423(ariable length)-.25 F 2.906(records. The)108 261.6 R .407
216 (formats and \214le format speci\214c information are described in detail in t\
217 heir respecti)2.906 F .707 -.15(ve m)-.25 H(anual).15 E(pages)108 273.6 Q F3
218 (btr)2.5 E(ee)-.37 E F0(\(3\),).18 E F3(hash)2.5 E F0(\(3\) and).28 E F3 -.37
219 (re)2.5 G(cno).37 E F0(\(3\).).18 E .433(Dbopen opens)108 290.4 R F3(\214le)
220 2.933 E F0 .433(for reading and/or writing.)2.933 F .433(Files ne)5.433 F -.15
221 (ve)-.25 G 2.933(ri).15 G .433(ntended to be preserv)346.737 290.4 R .433
222 (ed on disk may be created)-.15 F(by setting the \214le parameter to NULL.)108
223 302.4 Q(The)108 319.2 Q F3<8d61>4.661 E(gs)-.1 E F0(and)4.661 E F3 2.161
224 (mode ar)4.661 F(guments)-.37 E F0 2.161(are as speci\214ed to the)4.661 F F3
225 (open)4.661 E F0 2.162(\(2\) routine, ho).24 F(we)-.25 E -.15(ve)-.25 G 2.962
226 -.4(r, o).15 H 2.162(nly the O_CREA).4 F -.74(T,)-1.11 G .128
227 (O_EXCL, O_EXLOCK, O_NONBLOCK, O_RDONL)108 331.2 R 2.708 -1.29(Y, O)-1 H(_RD)
228 1.29 E .128(WR, O_SHLOCK and O_TR)-.3 F .127(UNC \215ags are)-.4 F 2.5
229 (meaningful. \(Note,)108 343.2 R(opening a database \214le O_WR)2.5 E(ONL)-.4 E
230 2.5(Yi)-1 G 2.5(sn)342.67 343.2 S(ot possible.\))354.06 343.2 Q(The)108 360 Q
231 F3(type)5.337 E F0(ar)5.337 E 2.837
232 (gument is of type DBTYPE \(as de\214ned in the <db)-.18 F 2.838
233 (.h> include \214le\) and may be set to)-.4 F(DB_BTREE, DB_HASH or DB_RECNO.)
234 108 372 Q(The)108 388.8 Q F3(openinfo)2.85 E F0(ar)2.85 E .349(gument is a poi\
235 nter to an access method speci\214c structure described in the access method')
236 -.18 F(s)-.55 E .03(manual page.)108 400.8 R(If)5.03 E F3(openinfo)2.53 E F0
237 .031(is NULL, each access method will use def)2.53 F .031
238 (aults appropriate for the system and the)-.1 F(access method.)108 412.8 Q F3
239 (Dbopen)108 429.6 Q F0 .416
240 (returns a pointer to a DB structure on success and NULL on error)2.917 F 5.416
241 (.T)-.55 G .416(he DB structure is de\214ned in)423.21 429.6 R(the <db)108
242 441.6 Q(.h> include \214le, and contains at least the follo)-.4 E
243 (wing \214elds:)-.25 E(typedef struct {)108 465.6 Q(DBTYPE type;)144 477.6 Q
244 (int \(*close\)\(const DB *db\);)144 489.6 Q
245 (int \(*del\)\(const DB *db, const DBT *k)144 501.6 Q -.15(ey)-.1 G 2.5(,u)-.5
246 G(_int \215ags\);)318.92 501.6 Q(int \(*fd\)\(const DB *db\);)144 513.6 Q
247 (int \(*get\)\(const DB *db, DBT *k)144 525.6 Q -.15(ey)-.1 G 2.5(,D)-.5 G
248 (BT *data, u_int \215ags\);)297.53 525.6 Q(int \(*put\)\(const DB *db, DBT *k)
249 144 537.6 Q -.15(ey)-.1 G 2.5(,c)-.5 G(onst DBT *data,)295.31 537.6 Q
250 (u_int \215ags\);)194 549.6 Q(int \(*sync\)\(const DB *db, u_int \215ags\);)144
251 561.6 Q(int \(*seq\)\(const DB *db, DBT *k)144 573.6 Q -.15(ey)-.1 G 2.5(,D)-.5
252 G(BT *data, u_int \215ags\);)298.64 573.6 Q 2.5(}D)108 585.6 S(B;)122.52 585.6
253 Q .101
254 (These elements describe a database type and a set of functions performing v)
255 108 602.4 R .101(arious actions.)-.25 F .101(These functions)5.101 F(tak)108
256 614.4 Q 3.039(eap)-.1 G .539(ointer to a structure as returned by)140.078 614.4
257 R F3(dbopen)3.038 E F0 3.038(,a).24 G .538
258 (nd sometimes one or more pointers to k)323.196 614.4 R -.15(ey)-.1 G .538
259 (/data struc-).15 F(tures and a \215ag v)108 626.4 Q(alue.)-.25 E 16.28
260 (type The)108 643.2 R
261 (type of the underlying access method \(and \214le format\).)2.5 E 12.95
262 (close A)108 660 R .988(pointer to a routine to \215ush an)3.488 F 3.489(yc)
263 -.15 G .989(ached information to disk, free an)293.968 660 R 3.489(ya)-.15 G
264 .989(llocated resources, and)446.662 660 R .112
265 (close the underlying \214le\(s\).)144 672 R .111(Since k)5.112 F -.15(ey)-.1 G
266 .111(/data pairs may be cached in memory).15 F 2.611(,f)-.65 G .111
267 (ailing to sync the \214le)455.666 672 R .494(with a)144 684 R F3(close)2.994 E
268 F0(or)2.994 E F3(sync)2.994 E F0 .495
269 (function may result in inconsistent or lost information.)2.994 F F3(Close)
270 5.495 E F0 .495(routines return)2.995 F(4.4 Berk)72 732 Q(ele)-.1 E 2.5(yD)-.15
271 G(istrib)132.57 732 Q 89.875(ution September)-.2 F(13, 1993)2.5 E(1)535 732 Q
273 %%Page: 2 2
274 %%BeginPageSetup
276 %%EndPageSetup
277 /F0 10/Times-Roman@0 SF 124.01(DBOPEN\(3\) BSD)72 48 R(Programmer')2.5 E 2.5
278 (sM)-.55 G 124.01(anual DBOPEN\(3\))340.17 48 R(-1 on error \(setting)144 84 Q
279 /F1 10/Times-Italic@0 SF(errno)2.5 E F0 2.5(\)a).18 G(nd 0 on success.)254.43
280 84 Q 21.28(del A)108 100.8 R(pointer to a routine to remo)2.5 E .3 -.15(ve k)
281 -.15 H -.15(ey).05 G(/data pairs from the database.).15 E(The parameter)144
282 117.6 Q F1<8d61>2.5 E(g)-.1 E F0(may be set to the follo)2.5 E(wing v)-.25 E
283 (alue:)-.25 E(R_CURSOR)144 134.4 Q .289
284 (Delete the record referenced by the cursor)180 146.4 R 5.288(.T)-.55 G .288
285 (he cursor must ha)363.342 146.4 R .588 -.15(ve p)-.2 H(re).15 E .288
286 (viously been initial-)-.25 F(ized.)180 158.4 Q F1(Delete)144 175.2 Q F0 .03
287 (routines return -1 on error \(setting)2.53 F F1(errno)2.53 E F0 .03
288 (\), 0 on success, and 1 if the speci\214ed).18 F F1 -.1(ke)2.53 G(y)-.2 E F0
289 -.1(wa)2.53 G 2.53(sn).1 G .03(ot in)521.91 175.2 R(the \214le.)144 187.2 Q
290 25.17(fd A)108 204 R .451
291 (pointer to a routine which returns a \214le descriptor representati)2.951 F
292 .75 -.15(ve o)-.25 H 2.95(ft).15 G .45(he underlying database.)431.73 204 R(A)
293 5.45 E .942(\214le descriptor referencing the same \214le will be returned to \
294 all processes which call)144 216 R F1(dbopen)3.442 E F0(with)3.442 E 1.629
295 (the same)144 228 R F1(\214le)4.129 E F0 4.129(name. This)4.129 F 1.628
296 (\214le descriptor may be safely used as a ar)4.128 F 1.628(gument to the)-.18
297 F F1(fcntl)4.128 E F0 1.628(\(2\) and).51 F F1(\215oc)144 240 Q(k)-.2 E F0 .425
298 (\(2\) locking functions.).67 F .425
299 (The \214le descriptor is not necessarily associated with an)5.425 F 2.925(yo)
300 -.15 G 2.925(ft)492.7 240 S .425(he under)501.735 240 R(-)-.2 E .198
301 (lying \214les used by the access method.)144 252 R .198
302 (No \214le descriptor is a)5.198 F -.25(va)-.2 G .198
303 (ilable for in memory databases.).25 F F1(Fd)5.198 E F0
304 (routines return -1 on error \(setting)144 264 Q F1(errno)2.5 E F0
305 (\), and the \214le descriptor on success.).18 E 21.28(get A)108 280.8 R
306 (pointer to a routine which is the interf)2.5 E .001(ace for k)-.1 F -.15(ey)
307 -.1 G .001(ed retrie).15 F -.25(va)-.25 G 2.501(lf).25 G .001
308 (rom the database.)399.755 280.8 R .001(The address and)5.001 F .061
309 (length of the data associated with the speci\214ed)144 292.8 R F1 -.1(ke)2.561
310 G(y)-.2 E F0 .06(are returned in the structure referenced by)2.561 F F1(data)
311 2.56 E F0(.).26 E F1(Get)144 304.8 Q F0(routines return -1 on error \(setting)
312 2.5 E F1(errno)2.5 E F0(\), 0 on success, and 1 if the).18 E F1 -.1(ke)2.5 G(y)
313 -.2 E F0 -.1(wa)2.5 G 2.5(sn).1 G(ot in the \214le.)471.66 304.8 Q 20.72(put A)
314 108 321.6 R(pointer to a routine to store k)2.5 E -.15(ey)-.1 G
315 (/data pairs in the database.).15 E(The parameter)144 338.4 Q F1<8d61>2.5 E(g)
316 -.1 E F0(may be set to one of the follo)2.5 E(wing v)-.25 E(alues:)-.25 E
317 (R_CURSOR)144 355.2 Q .051(Replace the k)180 367.2 R -.15(ey)-.1 G .051
318 (/data pair referenced by the cursor).15 F 5.052(.T)-.55 G .052
319 (he cursor must ha)393.98 367.2 R .352 -.15(ve p)-.2 H(re).15 E .052
320 (viously been)-.25 F(initialized.)180 379.2 Q(R_IAFTER)144 396 Q 1.165
321 (Append the data immediately after the data referenced by)180 408 R F1 -.1(ke)
322 3.664 G(y)-.2 E F0 3.664(,c).32 G 1.164(reating a ne)446.758 408 R 3.664(wk)
323 -.25 G -.15(ey)511.27 408 S(/data).15 E(pair)180 420 Q 6.065(.T)-.55 G 1.065
324 (he record number of the appended k)209.675 420 R -.15(ey)-.1 G 1.065
325 (/data pair is returned in the).15 F F1 -.1(ke)3.565 G(y)-.2 E F0(structure.)
326 3.565 E(\(Applicable only to the DB_RECNO access method.\))180 432 Q(R_IBEFORE)
327 144 448.8 Q 1.293(Insert the data immediately before the data referenced by)180
328 460.8 R F1 -.1(ke)3.793 G(y)-.2 E F0 3.793(,c).32 G 1.293(reating a ne)446.371
329 460.8 R 3.793(wk)-.25 G -.15(ey)511.27 460.8 S(/data).15 E(pair)180 472.8 Q
330 6.54(.T)-.55 G 1.54(he record number of the inserted k)210.15 472.8 R -.15(ey)
331 -.1 G 1.541(/data pair is returned in the).15 F F1 -.1(ke)4.041 G(y)-.2 E F0
332 (structure.)4.041 E(\(Applicable only to the DB_RECNO access method.\))180
333 484.8 Q(R_NOO)144 501.6 Q(VER)-.5 E(WRITE)-.55 E(Enter the ne)180 513.6 Q 2.5
334 (wk)-.25 G -.15(ey)242.69 513.6 S(/data pair only if the k).15 E .3 -.15(ey d)
335 -.1 H(oes not pre).15 E(viously e)-.25 E(xist.)-.15 E(R_SETCURSOR)144 530.4 Q
336 1.36(Store the k)180 542.4 R -.15(ey)-.1 G 1.36(/data pair).15 F 3.86(,s)-.4 G
337 1.359(etting or initializing the position of the cursor to reference it.)283.94
338 542.4 R(\(Applicable only to the DB_BTREE and DB_RECNO access methods.\))180
339 554.4 Q .563(R_SETCURSOR is a)144 571.2 R -.25(va)-.2 G .564
340 (ilable only for the DB_BTREE and DB_RECNO access methods because).25 F
341 (it implies that the k)144 583.2 Q -.15(ey)-.1 G 2.5(sh).15 G -2.25 -.2(av e)
342 241.81 583.2 T(an inherent order which does not change.)2.7 E .416
343 (R_IAFTER and R_IBEFORE are a)144 600 R -.25(va)-.2 G .416
344 (ilable only for the DB_RECNO access method because the).25 F(y)-.15 E 1.221
345 (each imply that the access method is able to create ne)144 612 R 3.722(wk)-.25
346 G -.15(ey)385.644 612 S 3.722(s. This).15 F 1.222(is only true if the k)3.722 F
347 -.15(ey)-.1 G 3.722(sa).15 G(re)532.23 612 Q
348 (ordered and independent, record numbers for e)144 624 Q(xample.)-.15 E .289
349 (The def)144 640.8 R .289(ault beha)-.1 F .289(vior of the)-.2 F F1(put)2.789 E
350 F0 .289(routines is to enter the ne)2.789 F 2.789(wk)-.25 G -.15(ey)388.998
351 640.8 S .288(/data pair).15 F 2.788(,r)-.4 G .288(eplacing an)444.284 640.8 R
352 2.788(yp)-.15 G(re)503.03 640.8 Q(viously)-.25 E -.15(ex)144 652.8 S(isting k)
353 .15 E -.15(ey)-.1 G(.)-.5 E F1(Put)144 669.6 Q F0 .37
354 (routines return -1 on error \(setting)2.87 F F1(errno)2.87 E F0 .37
355 (\), 0 on success, and 1 if the R_NOO).18 F(VER)-.5 E(WRITE)-.55 E F1<8d61>2.87
356 E(g)-.1 E F0 -.1(wa)144 681.6 S 2.5(ss).1 G(et and the k)165.84 681.6 Q .3 -.15
357 (ey a)-.1 H(lready e).15 E(xists in the \214le.)-.15 E(4.4 Berk)72 732 Q(ele)
358 -.1 E 2.5(yD)-.15 G(istrib)132.57 732 Q 89.875(ution September)-.2 F(13, 1993)
359 2.5 E(2)535 732 Q EP
360 %%Page: 3 3
361 %%BeginPageSetup
363 %%EndPageSetup
364 /F0 10/Times-Roman@0 SF 124.01(DBOPEN\(3\) BSD)72 48 R(Programmer')2.5 E 2.5
365 (sM)-.55 G 124.01(anual DBOPEN\(3\))340.17 48 R 20.17(seq A)108 84 R .002
366 (pointer to a routine which is the interf)2.502 F .002
367 (ace for sequential retrie)-.1 F -.25(va)-.25 G 2.502(lf).25 G .002
368 (rom the database.)416.694 84 R .001(The address)5.001 F .219
369 (and length of the k)144 96 R .519 -.15(ey a)-.1 H .219
370 (re returned in the structure referenced by).15 F/F1 10/Times-Italic@0 SF -.1
371 (ke)2.72 G(y)-.2 E F0 2.72(,a).32 G .22(nd the address and length of)426.42 96
372 R(the data are returned in the structure referenced by)144 108 Q F1(data)2.5 E
373 F0(.).26 E .937(Sequential k)144 124.8 R -.15(ey)-.1 G .937(/data pair retrie)
374 .15 F -.25(va)-.25 G 3.437(lm).25 G .936(ay be)289.748 124.8 R .936(gin at an)
375 -.15 F 3.436(yt)-.15 G .936(ime, and the position of the `)359.292 124.8 R
376 (`cursor')-.74 E 3.436('i)-.74 G 3.436(sn)519.894 124.8 S(ot)532.22 124.8 Q(af)
377 144 136.8 Q 1.585(fected by calls to the)-.25 F F1(del)4.085 E F0(,).51 E F1
378 -.1(ge)4.085 G(t).1 E F0(,).68 E F1(put)4.086 E F0 4.086(,o).68 G(r)308.452
379 136.8 Q F1(sync)4.086 E F0 4.086(routines. Modi\214cations)4.086 F 1.586
380 (to the database during a)4.086 F 1.404(sequential scan will be re\215ected in\
381  the scan, i.e. records inserted behind the cursor will not be)144 148.8 R
382 (returned while records inserted in front of the cursor will be returned.)144
383 160.8 Q(The \215ag v)144 177.6 Q(alue)-.25 E/F2 10/Times-Bold@0 SF(must)2.5 E
384 F0(be set to one of the follo)2.5 E(wing v)-.25 E(alues:)-.25 E(R_CURSOR)144
385 194.4 Q .523(The data associated with the speci\214ed k)180 206.4 R .824 -.15
386 (ey i)-.1 H 3.024(sr).15 G 3.024(eturned. This)367.236 206.4 R(dif)3.024 E .524
387 (fers from the)-.25 F F1 -.1(ge)3.024 G(t).1 E F0(routines)3.024 E 1.143
388 (in that it sets or initializes the cursor to the location of the k)180 218.4 R
389 1.443 -.15(ey a)-.1 H 3.642(sw).15 G 3.642(ell. \(Note,)464.924 218.4 R 1.142
390 (for the)3.642 F 1.275(DB_BTREE access method, the returned k)180 230.4 R 1.575
391 -.15(ey i)-.1 H 3.775(sn).15 G 1.276(ot necessarily an e)386.425 230.4 R 1.276
392 (xact match for the)-.15 F .598(speci\214ed k)180 242.4 R -.15(ey)-.1 G 5.598
393 (.T)-.5 G .598(he returned k)246.396 242.4 R .898 -.15(ey i)-.1 H 3.098(st).15
394 G .598(he smallest k)325.188 242.4 R .898 -.15(ey g)-.1 H .598
395 (reater than or equal to the speci\214ed).15 F -.1(ke)180 254.4 S 1.3 -.65
396 (y, p)-.05 H(ermitting partial k).65 E .3 -.15(ey m)-.1 H
397 (atches and range searches.\)).15 E(R_FIRST)144 271.2 Q 1.043(The \214rst k)180
398 283.2 R -.15(ey)-.1 G 1.044(/data pair of the database is returned, and the cu\
399 rsor is set or initialized to).15 F(reference it.)180 295.2 Q(R_LAST)144 312 Q
400 .085(The last k)180 324 R -.15(ey)-.1 G .085(/data pair of the database is ret\
401 urned, and the cursor is set or initialized to ref-).15 F(erence it.)180 336 Q
402 (\(Applicable only to the DB_BTREE and DB_RECNO access methods.\))5 E(R_NEXT)
403 144 352.8 Q(Retrie)180 364.8 Q .604 -.15(ve t)-.25 H .304(he k).15 F -.15(ey)
404 -.1 G .304(/data pair immediately after the cursor).15 F 5.304(.I)-.55 G 2.804
405 (ft)410.622 364.8 S .305(he cursor is not yet set, this is)419.536 364.8 R
406 (the same as the R_FIRST \215ag.)180 376.8 Q(R_PREV)144 393.6 Q(Retrie)180
407 405.6 Q .755 -.15(ve t)-.25 H .455(he k).15 F -.15(ey)-.1 G .455
408 (/data pair immediately before the cursor).15 F 5.455(.I)-.55 G 2.955(ft)419.05
409 405.6 S .454(he cursor is not yet set, this)428.115 405.6 R .62
410 (is the same as the R_LAST \215ag.)180 417.6 R .621
411 (\(Applicable only to the DB_BTREE and DB_RECNO)5.621 F(access methods.\))180
412 429.6 Q .911(R_LAST and R_PREV are a)144 446.4 R -.25(va)-.2 G .911
413 (ilable only for the DB_BTREE and DB_RECNO access methods).25 F(because the)144
414 458.4 Q 2.5(ye)-.15 G(ach imply that the k)202.16 458.4 Q -.15(ey)-.1 G 2.5(sh)
415 .15 G -2.25 -.2(av e)302.18 458.4 T(an inherent order which does not change.)
416 2.7 E F1(Seq)144 475.2 Q F0 .061(routines return -1 on error \(setting)2.561 F
417 F1(errno)2.561 E F0 .061(\), 0 on success and 1 if there are no k).18 F -.15
418 (ey)-.1 G .061(/data pairs less).15 F .35
419 (than or greater than the speci\214ed or current k)144 487.2 R -.15(ey)-.1 G
420 5.349(.I)-.5 G 2.849(ft)346.467 487.2 S .349
421 (he DB_RECNO access method is being used,)355.426 487.2 R .025
422 (and if the database \214le is a character special \214le and no complete k)144
423 499.2 R -.15(ey)-.1 G .025(/data pairs are currently a).15 F -.25(va)-.2 G(il-)
424 .25 E(able, the)144 511.2 Q F1(seq)2.5 E F0(routines return 2.)2.5 E 15.17
425 (sync A)108 528 R .458(pointer to a routine to \215ush an)2.958 F 2.957(yc)-.15
426 G .457(ached information to disk.)289.72 528 R .457
427 (If the database is in memory only)5.457 F(,)-.65 E(the)144 540 Q F1(sync)2.5 E
428 F0(routine has no ef)2.5 E(fect and will al)-.25 E -.1(wa)-.1 G(ys succeed.).1
429 E(The \215ag v)144 556.8 Q(alue may be set to the follo)-.25 E(wing v)-.25 E
430 (alue:)-.25 E(R_RECNOSYNC)144 573.6 Q .077(If the DB_RECNO access method is be\
431 ing used, this \215ag causes the sync routine to apply)180 585.6 R .75(to the \
432 btree \214le which underlies the recno \214le, not the recno \214le itself.)180
433 597.6 R .75(\(See the)5.75 F F1(bfname)3.25 E F0(\214eld of the)180 609.6 Q F1
434 -.37(re)2.5 G(cno).37 E F0(\(3\) manual page for more information.\)).18 E F1
435 (Sync)144 626.4 Q F0(routines return -1 on error \(setting)2.5 E F1(errno)2.5 E
436 F0 2.5(\)a).18 G(nd 0 on success.)336.91 626.4 Q/F3 9/Times-Bold@0 SF(KEY/D)72
437 643.2 Q -1.35 -.855(AT A)-.315 H -.666(PA)3.105 G(IRS).666 E F0 .134
438 (Access to all \214le types is based on k)108 655.2 R -.15(ey)-.1 G .134
439 (/data pairs.).15 F .134(Both k)5.134 F -.15(ey)-.1 G 2.634(sa).15 G .134
440 (nd data are represented by the follo)359.078 655.2 R .135(wing data)-.25 F
441 (structure:)108 667.2 Q(typedef struct {)108 684 Q(4.4 Berk)72 732 Q(ele)-.1 E
442 2.5(yD)-.15 G(istrib)132.57 732 Q 89.875(ution September)-.2 F(13, 1993)2.5 E
443 (3)535 732 Q EP
444 %%Page: 4 4
445 %%BeginPageSetup
447 %%EndPageSetup
448 /F0 10/Times-Roman@0 SF 124.01(DBOPEN\(3\) BSD)72 48 R(Programmer')2.5 E 2.5
449 (sM)-.55 G 124.01(anual DBOPEN\(3\))340.17 48 R -.2(vo)144 84 S(id *data;).2 E
450 (size_t size;)144 96 Q 2.5(}D)108 108 S(BT)122.52 108 Q(;)-.55 E
451 (The elements of the DBT structure are de\214ned as follo)108 124.8 Q(ws:)-.25
452 E 16.84(data A)108 141.6 R(pointer to a byte string.)2.5 E 17.95(size The)108
453 158.4 R(length of the byte string.)2.5 E -2.15 -.25(Ke y)108 175.2 T .829(and \
454 data byte strings may reference strings of essentially unlimited length althou\
455 gh an)3.579 F 3.328(yt)-.15 G 1.028 -.1(wo o)492.894 175.2 T 3.328(ft).1 G(hem)
456 522.78 175.2 Q 1.133(must \214t into a)108 187.2 R -.25(va)-.2 G 1.134
457 (ilable memory at the same time.).25 F 1.134
458 (It should be noted that the access methods pro)6.134 F 1.134(vide no)-.15 F
459 (guarantees about byte string alignment.)108 199.2 Q/F1 9/Times-Bold@0 SF(ERR)
460 72 216 Q(ORS)-.27 E F0(The)108 228 Q/F2 10/Times-Italic@0 SF(dbopen)3.389 E F0
461 .889(routine may f)3.389 F .889(ail and set)-.1 F F2(errno)3.388 E F0 .888
462 (for an)3.388 F 3.388(yo)-.15 G 3.388(ft)324.376 228 S .888
463 (he errors speci\214ed for the library routines)333.874 228 R F2(open)3.388 E
464 F0(\(2\)).24 E(and)108 240 Q F2(malloc)2.5 E F0(\(3\) or the follo).31 E(wing:)
465 -.25 E([EFTYPE])108 256.8 Q 2.5<418c>144 268.8 S(le is incorrectly formatted.)
466 159.28 268.8 Q([EINV)108 285.6 Q(AL])-1.35 E 2.812(Ap)144 297.6 S .313(aramete\
467 r has been speci\214ed \(hash function, pad byte etc.\) that is incompatible w\
468 ith the current)159.032 297.6 R .406
469 (\214le speci\214cation or which is not meaningful for the function \(for e)144
470 309.6 R .405(xample, use of the cursor with-)-.15 F .099
471 (out prior initialization\) or there is a mismatch between the v)144 321.6 R .1
472 (ersion number of \214le and the softw)-.15 F(are.)-.1 E(The)108 338.4 Q F2
473 (close)3.469 E F0 .969(routines may f)3.469 F .969(ail and set)-.1 F F2(errno)
474 3.469 E F0 .969(for an)3.469 F 3.469(yo)-.15 G 3.469(ft)320.18 338.4 S .969
475 (he errors speci\214ed for the library routines)329.759 338.4 R F2(close)3.468
476 E F0(\(2\),).18 E F2 -.37(re)108 350.4 S(ad).37 E F0(\(2\),).77 E F2(write)2.5
477 E F0(\(2\),).18 E F2(fr)2.5 E(ee)-.37 E F0(\(3\), or).18 E F2(fsync)2.5 E F0
478 (\(2\).).31 E(The)108 367.2 Q F2(del)2.969 E F0(,).51 E F2 -.1(ge)2.969 G(t).1
479 E F0(,).68 E F2(put)2.969 E F0(and)2.969 E F2(seq)2.969 E F0 .469
480 (routines may f)2.969 F .469(ail and set)-.1 F F2(errno)2.97 E F0 .47(for an)
481 2.97 F 2.97(yo)-.15 G 2.97(ft)377.59 367.2 S .47
482 (he errors speci\214ed for the library rou-)386.67 367.2 R(tines)108 379.2 Q F2
483 -.37(re)2.5 G(ad).37 E F0(\(2\),).77 E F2(write)2.5 E F0(\(2\),).18 E F2(fr)2.5
484 E(ee)-.37 E F0(\(3\) or).18 E F2(malloc)2.5 E F0(\(3\).).31 E(The)108 396 Q F2
485 (fd)2.5 E F0(routines will f)2.5 E(ail and set)-.1 E F2(errno)2.5 E F0
486 (to ENOENT for in memory databases.)2.5 E(The)108 412.8 Q F2(sync)2.5 E F0
487 (routines may f)2.5 E(ail and set)-.1 E F2(errno)2.5 E F0(for an)2.5 E 2.5(yo)
488 -.15 G 2.5(ft)307.71 412.8 S(he errors speci\214ed for the library routine)
489 316.32 412.8 Q F2(fsync)2.5 E F0(\(2\).).31 E F1(SEE ALSO)72 429.6 Q F2(btr)108
490 441.6 Q(ee)-.37 E F0(\(3\),).18 E F2(hash)2.5 E F0(\(3\),).28 E F2(mpool)2.5 E
491 F0(\(3\),).51 E F2 -.37(re)2.5 G(cno).37 E F0(\(3\)).18 E F2 .904(LIBTP: P)108
492 465.6 R(ortable)-.8 E 3.404(,M)-.1 G .904(odular T)189.738 465.6 R -.15(ra)-.55
493 G .904(nsactions for UNIX).15 F F0 3.404(,M).94 G(ar)328.884 465.6 Q .904
494 (go Seltzer)-.18 F 3.403(,M)-.4 G .903(ichael Olson, USENIX proceedings,)
495 392.041 465.6 R -.4(Wi)108 477.6 S(nter 1992.).4 E F1 -.09(BU)72 494.4 S(GS).09
496 E F0 .399(The typedef DBT is a mnemonic for `)108 506.4 R .399
497 (`data base thang')-.74 F .399(', and w)-.74 F .399
498 (as used because noone could think of a rea-)-.1 F(sonable name that w)108
499 518.4 Q(asn')-.1 E 2.5(ta)-.18 G(lready used.)216.03 518.4 Q
500 (The \214le descriptor interf)108 535.2 Q
501 (ace is a kluge and will be deleted in a future v)-.1 E(ersion of the interf)
502 -.15 E(ace.)-.1 E(None of the access methods pro)108 552 Q(vide an)-.15 E 2.5
503 (yf)-.15 G(orm of concurrent access, locking, or transactions.)275.16 552 Q
504 (4.4 Berk)72 732 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 732 Q 89.875
505 (ution September)-.2 F(13, 1993)2.5 E(4)535 732 Q EP
506 %%Trailer
508 %%EOF