Documentation Source Text

Check-in [42037c5bc7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Incremental progress on btree module documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 42037c5bc7487b35b08a63f4c6fc925f81df10fc
User & Date: dan 2009-05-29 12:10:16.000
Context
2009-05-29
12:12
Add hlr50000.txt. (check-in: 208f3f4f7c user: dan tags: trunk)
12:10
Incremental progress on btree module documentation. (check-in: 42037c5bc7 user: dan tags: trunk)
2009-05-28
11:53
Add a skeleton and some notes for btree module documentation. (check-in: 209bab6a3d user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Added images/btreemodule_overview.svg.


































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="639.00098"
   height="270.57031"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.46"
   sodipodi:docname="btreemodule_overview.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape"
   version="1.0">
  <defs
     id="defs4">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 526.18109 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="744.09448 : 526.18109 : 1"
       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
       id="perspective10" />
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     gridtolerance="10000"
     guidetolerance="10"
     objecttolerance="10"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="1.4142136"
     inkscape:cx="310.55643"
     inkscape:cy="154.09115"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="true"
     inkscape:snap-global="true"
     inkscape:window-width="1584"
     inkscape:window-height="1009"
     inkscape:window-x="69"
     inkscape:window-y="0"
     showborder="false"
     inkscape:showpageshadow="false"
     borderlayer="false">
    <inkscape:grid
       type="xygrid"
       id="grid3161"
       visible="true"
       enabled="true" />
  </sodipodi:namedview>
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(157.25195,-171.72546)">
    <rect
       style="opacity:1;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect2387"
       width="20.010523"
       height="180.02304"
       x="149.97864"
       y="232.373" />
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="80"
       y="182.36218"
       id="text3167"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3169"
         x="80"
         y="182.36218"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">In-Memory Page Cache</tspan></text>
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 150,262.36218 C 170,262.36218 170,262.36218 170,262.36218"
       id="path3171" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 150,382.36218 C 170,382.36218 170,382.36218 170,382.36218"
       id="path3173" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 150,352.36218 C 170,352.36218 170,352.36218 170,352.36218"
       id="path3175" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 150,322.36218 C 170,322.36218 170,322.36218 170,322.36218"
       id="path3177" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 150,292.36218 C 170,292.36218 170,292.36218 170,292.36218"
       id="path3179" />
    <rect
       style="opacity:1;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect3181"
       width="60.79163"
       height="239.53868"
       x="130.0336"
       y="202.2571"
       ry="15.556349" />
    <g
       id="g3275"
       transform="matrix(0.625,0,0,0.6689418,54.258318,50.469681)"
       style="stroke-width:1.54655659;stroke-miterlimit:4;stroke-dasharray:none">
      <path
         transform="matrix(1.5986945,0,0,1.9722665,-220.0992,-284.6418)"
         d="M 420,287.36218 A 25,5 0 1 1 370,287.36218 A 25,5 0 1 1 420,287.36218 z"
         sodipodi:ry="5"
         sodipodi:rx="25"
         sodipodi:cy="287.36218"
         sodipodi:cx="395"
         id="path3183"
         style="opacity:1;fill:none;stroke:#000000;stroke-width:0.87096417;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
         sodipodi:type="arc" />
      <path
         transform="matrix(1.5982703,0,0,1.972289,-219.94212,-214.17107)"
         d="M 420,287.36218 A 25,5 0 1 1 370,287.36218 A 25,5 0 1 1 420,287.36218 z"
         sodipodi:ry="5"
         sodipodi:rx="25"
         sodipodi:cy="287.36218"
         sodipodi:cx="395"
         id="path3267"
         style="opacity:1;fill:none;stroke:#000000;stroke-width:0.8710748;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
         sodipodi:type="arc" />
      <path
         transform="translate(81.374023,171.72546)"
         id="path3271"
         d="M 290,110.86475 L 290,180.86475"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.54655659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         transform="translate(81.374023,171.72546)"
         id="path3273"
         d="M 370,110.86475 L 370,180.86475"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.54655659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <g
       id="g3291"
       transform="matrix(0.625,0,0,0.6689418,54.258318,167.27637)"
       style="stroke-width:1.54655659;stroke-miterlimit:4;stroke-dasharray:none">
      <path
         transform="matrix(1.5986945,0,0,1.9722665,-220.0992,-284.6418)"
         d="M 420,287.36218 A 25,5 0 1 1 370,287.36218 A 25,5 0 1 1 420,287.36218 z"
         sodipodi:ry="5"
         sodipodi:rx="25"
         sodipodi:cy="287.36218"
         sodipodi:cx="395"
         id="path3293"
         style="opacity:1;fill:none;stroke:#000000;stroke-width:0.87096417;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
         sodipodi:type="arc" />
      <path
         transform="matrix(1.5982703,0,0,1.972289,-219.94212,-214.17107)"
         d="M 420,287.36218 A 25,5 0 1 1 370,287.36218 A 25,5 0 1 1 420,287.36218 z"
         sodipodi:ry="5"
         sodipodi:rx="25"
         sodipodi:cy="287.36218"
         sodipodi:cx="395"
         id="path3295"
         style="opacity:1;fill:none;stroke:#000000;stroke-width:0.8710748;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
         sodipodi:type="arc" />
      <path
         transform="translate(81.374023,171.72546)"
         id="path3297"
         d="M 290,110.86475 L 290,180.86475"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.54655659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         transform="translate(81.374023,171.72546)"
         id="path3299"
         d="M 370,110.86475 L 370,180.86475"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.54655659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="351.37402"
       y="272.59021"
       id="text3301"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3303"
         x="351.37402"
         y="272.59021"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">Journal File</tspan></text>
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="351.37402"
       y="382.59021"
       id="text3305"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3307"
         x="351.37402"
         y="382.59021"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">Database File         </tspan></text>
    <rect
       style="fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect3309"
       width="91.258865"
       height="29.945938"
       x="-69.884842"
       y="232.64427"
       ry="10.585812" />
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="-49.853683"
       y="252.67543"
       id="text3311"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3313"
         x="-49.853683"
         y="252.67543"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">Client 1</tspan></text>
    <g
       id="g3321"
       transform="translate(-76.824561,94.94894)"
       style="stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none">
      <rect
         ry="10.585812"
         y="287.61011"
         x="8.1674261"
         height="29.945938"
         width="91.258865"
         id="rect3315"
         style="opacity:1;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <text
         sodipodi:linespacing="125%"
         id="text3317"
         y="307.64127"
         x="28.198584"
         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
         xml:space="preserve"><tspan
           style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans"
           y="307.64127"
           x="28.198584"
           id="tspan3319"
           sodipodi:role="line">Client 2</tspan></text>
    </g>
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="201.37402"
       y="322.59021"
       id="text3331"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3333"
         x="201.37402"
         y="322.59021"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">IO using VFS interface</tspan></text>
    <text
       xml:space="preserve"
       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
       x="-158.62598"
       y="322.59021"
       id="text3335"
       sodipodi:linespacing="125%"><tspan
         sodipodi:role="line"
         id="tspan3337"
         x="-158.62598"
         y="322.59021"
         style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;font-family:Sans;-inkscape-font-specification:Sans">Data Exchanged Using B-Tree Interface</tspan></text>
    <g
       id="g3374">
      <path
         id="path3342"
         d="M 37.588091,247.23327 L 56.370507,237.10827 L 56.370507,242.17077 L 75.152923,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3344"
         d="M 37.588091,247.23328 L 56.370507,257.35828 L 56.370507,252.29578 L 75.152922,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3352"
         d="M 112.71776,247.23327 L 93.935344,237.10827 L 93.935344,242.17077 L 75.152928,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3354"
         d="M 112.71776,247.23328 L 93.93534,257.35828 L 93.93534,252.29578 L 75.152925,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <g
       transform="translate(-1.1872931,150)"
       id="g3380">
      <path
         id="path3382"
         d="M 37.588091,247.23327 L 56.370507,237.10827 L 56.370507,242.17077 L 75.152923,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3384"
         d="M 37.588091,247.23328 L 56.370507,257.35828 L 56.370507,252.29578 L 75.152922,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3386"
         d="M 112.71776,247.23327 L 93.935344,237.10827 L 93.935344,242.17077 L 75.152928,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3388"
         d="M 112.71776,247.23328 L 93.93534,257.35828 L 93.93534,252.29578 L 75.152925,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <g
       transform="translate(165.15996,115.06251)"
       id="g3390">
      <path
         id="path3392"
         d="M 37.588091,247.23327 L 56.370507,237.10827 L 56.370507,242.17077 L 75.152923,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3394"
         d="M 37.588091,247.23328 L 56.370507,257.35828 L 56.370507,252.29578 L 75.152922,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3396"
         d="M 112.71776,247.23327 L 93.935344,237.10827 L 93.935344,242.17077 L 75.152928,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3398"
         d="M 112.71776,247.23328 L 93.93534,257.35828 L 93.93534,252.29578 L 75.152925,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <g
       transform="translate(165.15996,25.062506)"
       id="g3400">
      <path
         id="path3402"
         d="M 37.588091,247.23327 L 56.370507,237.10827 L 56.370507,242.17077 L 75.152923,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3404"
         d="M 37.588091,247.23328 L 56.370507,257.35828 L 56.370507,252.29578 L 75.152922,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3406"
         d="M 112.71776,247.23327 L 93.935344,237.10827 L 93.935344,242.17077 L 75.152928,242.17077"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         id="path3408"
         d="M 112.71776,247.23328 L 93.93534,257.35828 L 93.93534,252.29578 L 75.152925,252.29578"
         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
    </g>
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 160,130.57031 L 230,90.570312"
       id="path3410"
       transform="translate(-157.25195,171.72546)" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 160,160.57031 L 230,200.57031"
       id="path3412"
       transform="translate(-157.25195,171.72546)" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 430,130.57031 L 400,110.57031"
       id="path3416"
       transform="translate(-157.25195,171.72546)" />
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 430,160.57031 L 400,180.57031 L 400,180.57031"
       id="path3418"
       transform="translate(-157.25195,171.72546)" />
  </g>
</svg>
Changes to images/fileformat/rtdocs.css.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  /* Style for requirements paragraph. */
  .req       { margin: 1.0em 10ex; color: darkblue }
  .subreq    { margin: 1.0em 5ex 1.0em 15ex; color: darkblue }
  .subsubreq { margin: 1.0em 5ex 1.0em 20ex; color: darkblue }

  .req:before { color: black; content: "[" attr(id) "] "}
  .subreq:before { color: black; content: "[" attr(id) "] "}
  .subsubreq:before { color: black; content: "[SUBSUBREQ] " }

  /* The dark-green color used for headings. */
  h1,h2,h3,h4,#toc_header,#document_title { color: #80a796 }

  .req code {display: block; margin: 0.5em 5ex}

  code {white-space: pre}

  /* Style for content headings */
  h2           { margin-left: 10px }
  h3           { margin-left: 20px }
  h4           { margin-left: 30px }
  h1,h2,h3,h4  { font-weight: normal }













<







1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
  /* Style for requirements paragraph. */
  .req       { margin: 1.0em 10ex; color: darkblue }
  .subreq    { margin: 1.0em 5ex 1.0em 15ex; color: darkblue }
  .subsubreq { margin: 1.0em 5ex 1.0em 20ex; color: darkblue }

  .req:before { color: black; content: "[" attr(id) "] "}
  .subreq:before { color: black; content: "[" attr(id) "] "}
  .subsubreq:before { color: black; content: "[SUBSUBREQ] " }

  /* The dark-green color used for headings. */
  h1,h2,h3,h4,#toc_header,#document_title { color: #80a796 }

  .req code {display: block; margin: 0.5em 5ex}

  code {white-space: pre}

  /* Style for content headings */
  h2           { margin-left: 10px }
  h3           { margin-left: 20px }
  h4           { margin-left: 30px }
  h1,h2,h3,h4  { font-weight: normal }
63
64
65
66
67
68
69


70
71
72
73





    text-decoration: none;
  }
  .defnlink { font-style: italic }
  .defnlink:visited,.reqlink:visited { color: inherit }
  h1 .defnlink, h2 .defnlink, h3 .defnlink, h4 .defnlink, .defn .defnlink{ font-style: inherit }
  :link:hover,:visited:hover { background: wheat }



  img {
    display:block;
  }













>
>




>
>
>
>
>
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
    text-decoration: none;
  }
  .defnlink { font-style: italic }
  .defnlink:visited,.reqlink:visited { color: inherit }
  h1 .defnlink, h2 .defnlink, h3 .defnlink, h4 .defnlink, .defn .defnlink{ font-style: inherit }
  :link:hover,:visited:hover { background: wheat }

  .defn { white-space: nowrap }

  img {
    display:block;
  }

  pre.api {
    margin: 1em 15ex;
    font-size: 150%;
  }

Changes to pages/btreemodule.in.
1
2
3
4
5






















6
7
8
9
10
11
12
<title>SQLite B-Tree Module</title>
<tcl>

hd_keywords {btree design}
source [file join $::DOC pages fancyformat.tcl]






















fancyformat_document "SQLite B-Tree Module" hlr50000.txt {

  [h1 "Document Overview"]

  [h2 "Scope and Purpose"]

  <ul>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
<title>SQLite B-Tree Module</title>
<tcl>

hd_keywords {btree design}
source [file join $::DOC pages fancyformat.tcl]

set fd [open [file join $SRC src btree.h]]
set btree_h [read $fd]
close $fd

proc btree_api_defn {args} {

  foreach api $args {

    set re_head {\n[^\n]*}
    if { [string match BTREE* $api] } {
      set re_tail {[^\n]*\n}
    } else {
      set re_tail {[^;]*;}
    }

    regexp $re_head$api$re_tail $::btree_h api_defn
    lappend ret [string trim $api_defn]
  }
  return "<pre class=api>[join $ret "\n"]</pre>"
}

fancyformat_document "SQLite B-Tree Module" hlr50000.txt {

  [h1 "Document Overview"]

  [h2 "Scope and Purpose"]

  <ul>
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
56
57
58
59

60





61
62


63
64

65
66
67




68
69
70


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    the interfaces and sub-systems described in this document are not stable.
    They may be changed in any way with each new SQLite release. Any 
    external software development that uses these interfaces must be prepared
    to adapt to interface refactoring without notice.

  [h2 "Document and Requirements Organization"]








  [h2 "Glossary"]
























  [h1 "Module Requirements"]

  <p>
    The SQLite B-Tree module, the software module described by this document,
    is designed to query and modify a database stored using the database image
    format described in <cite>ref_file_format</cite>. Database images may
    exist only in volatile main-memory (in-memory databases), or may be stored 
    persistently within the file-system. Or, a database image may be stored

    primarily in main-memory with the file-system used as secondary storage if
    the database image grows too large.





  <p><i>










    One-to-many connections to each database. Need a term for an in-memory cache (struct BtShared).
  </i>









  <p><i>
    Roughly what is encapsulated by the module.
  </i>

    [h2 "Functional Requirements"]

    <p>
      This section contains requirements describing the functionality required 
      from the B-Tree module.

    [h3 "Opening and Closing Connections"]

  <ul>

    <li> Open connection.





    <li> Close connection.
  </ul>



      [fancyformat_import_requirement H50010]


    [h3 "New Database Image Configuration"]
  <ul>




    <li> Set/get page-size.
    <li> Set/get auto-vacuum capable.
  </ul>



    [h3 "Transaction and Savepoint Functions"]
  <ul>
    <li> Begin transaction.
    <li> CommitPhaseOne()/CommitPhaseTwo().
    <li> Rollback transaction.
    <li> Query for transaction state (no-transaction, readonly, read-write).
    <li> Begin savepoint(s).
    <li> Release savepoint(s).
    <li> Rollback savepoint(s).
  </ul>

    [h3 "Reading From the Database Image"]
  <ul>
    <li> Open b-tree cursor.
    <li> Close b-tree cursor.
    <li> Seek cursor (and all of its variants).

    <li> Retrieve current key/data pointed to by cursor.
    <li> Read selected database header fields.
  </ul>

    [h3 "Writing to the Database Image"]
  <ul>
    <li> Create new b-tree structure.
    <li> Drop existing b-tree structure.
    <li> Clear b-tree structure contents.
    <li> Incremental vacuum step.
    <li> Write selected database header fields.
    <li> Delete entry pointed to by cursor.
    <li> Insert new entry into b-tree.
  </ul>

    [h3 "Backup API Requirements"]
  <ul>
    <li> Callbacks for backup module.
    <li> Page read/write APIs for backup module.
  </ul>

    [h3 "Configuration Requirements"]








>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








|
>
|
|
>
>
>
>

|
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>












|
|
>
|
>
>
>
>
>
|
|
>
>

|
>


|
>
>
>
>
|
|
<
>
>

















>















|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
    the interfaces and sub-systems described in this document are not stable.
    They may be changed in any way with each new SQLite release. Any 
    external software development that uses these interfaces must be prepared
    to adapt to interface refactoring without notice.

  [h2 "Document and Requirements Organization"]

     [Table]
        [Tr] <th> Requirement ids <th> Contents
        [Tr] <td> H50**** <td> Requirement statements specifying the functionality required of the B-Tree module.
        [Tr] <td> H51**** <td> Requirement statements specifying the API provided by the B-Tree module.
        [Tr] <td>         <td> Requirement statements specifying some details of the internal workings of the B-Tree module.
      </table>

  [h2 "Glossary"]

    <table id=glossary>
      [Glossary "B-Tree Database Connection" {
        A B-Tree database connection is a single client connection to an in-memory 
        page cache, through which a single temporary or persistent database may
        be accessed. This term is used throughout this document to avoid confusing
	such connections with SQL level SQLite client connections, which are
        sometime simply termed "database connections".
      }]
      [Glossary "Lazy-write cache" {
      }]
      [Glossary "Page cache" {
      }]
      [Glossary "Persistent database" {
      }]
      [Glossary "Read-through cache" {
      }]
      [Glossary "Shared-cache mode" {
      }]
      [Glossary "Temporary database" {
      }]
    </table>
   

  [h1 "Module Requirements"]

  <p>
    The SQLite B-Tree module, the software module described by this document,
    is designed to query and modify a database stored using the database image
    format described in <cite>ref_file_format</cite>. Database images may
    exist only in volatile main-memory (in-memory databases), or may be stored 
    persistently within the file-system (also described in
    <cite>ref_file_format</cite>). Or, a database image may be stored primarily
    in main-memory with the file-system used as secondary storage if the
    database image grows too large. Database images stored only in main-memory,
    and those stored primarily in main-memory with the file-system used only to
    provide secondary storage space are known collectively as temporary
    databases. Database images stored persistently in the file-system are termed
    persistent databases.

  <p>
    This module implements an in-memory page cache to manage database image
    content. The size of the pages managed by the cache are the same as the
    page-size of the database image. When operating on a persistent database, 
    the cache operates as a read-through, lazy-write cache. When committing a 
    database transaction, the user explicitly directs the cache to flush all 
    dirty pages through to persistent storage. A single in-memory page cache 
    used to access the content of a persistent database may support multiple
    logical client connections. <span class=todo>Some brief explanation of what
    this means. And maybe a pointer to the "Multi-User Database Requirements"
    section.</span>

  <p>
    When operating on a temporary database, there may only be one client for
    each page cache. Depending on the SQLite configuration, either the database
    or journal file, or both, may be omitted from the system.

      [Figure btreemodule_overview.svg figure_overview "Role of Page Cache"]

  <p>
    Figure <cite>figure_overview</cite> depicts...

  <p><i>
    Roughly what is encapsulated by the module.
  </i>

    [h2 "Functional Requirements"]

    <p>
      This section contains requirements describing the functionality required 
      from the B-Tree module.

    [h3 "Opening and Closing Connections"]
  
    <p>
      The B-Tree module provides an interface to open new b-tree database connections.

      [fancyformat_import_requirement H50010]
      [fancyformat_import_requirement H50020]
      [fancyformat_import_requirement H50030]
      [fancyformat_import_requirement H50040]
      [fancyformat_import_requirement H50050]

    <p>
      The B-Tree module also provides an interface to close existing b-tree database 
      connections.

      [fancyformat_import_requirement H50060]
      [fancyformat_import_requirement H50070]

    [h3 "New Database Image Configuration"]

    <p>
      The following requirements describe database configuration options that
      are only applicable to new database images. For the purposes of the
      following requirements, a "new database image" is defined as one that is
      zero pages in size.


      [fancyformat_import_requirement H50080]
      [fancyformat_import_requirement H50090]

    [h3 "Transaction and Savepoint Functions"]
  <ul>
    <li> Begin transaction.
    <li> CommitPhaseOne()/CommitPhaseTwo().
    <li> Rollback transaction.
    <li> Query for transaction state (no-transaction, readonly, read-write).
    <li> Begin savepoint(s).
    <li> Release savepoint(s).
    <li> Rollback savepoint(s).
  </ul>

    [h3 "Reading From the Database Image"]
  <ul>
    <li> Open b-tree cursor.
    <li> Close b-tree cursor.
    <li> Seek cursor (and all of its variants).
    <li> Next/Prev cursor operations.
    <li> Retrieve current key/data pointed to by cursor.
    <li> Read selected database header fields.
  </ul>

    [h3 "Writing to the Database Image"]
  <ul>
    <li> Create new b-tree structure.
    <li> Drop existing b-tree structure.
    <li> Clear b-tree structure contents.
    <li> Incremental vacuum step.
    <li> Write selected database header fields.
    <li> Delete entry pointed to by cursor.
    <li> Insert new entry into b-tree.
  </ul>

    [h3 "Backup/Vacuum API Requirements"]
  <ul>
    <li> Callbacks for backup module.
    <li> Page read/write APIs for backup module.
  </ul>

    [h3 "Configuration Requirements"]

125
126
127
128
129
130
131



132
133
134
135
136
137
138
  <ul>
    <li> Mutexes/thread-safety features.
    <li> Lock on schema memory object.
    <li> Locks on b-tree tables.
    <li> "Unlock notify" feature.
  </ul>




  [h2 "Other Requirements"]

    [h3 "Caching and Memory Management Requirements"]
  <ul>
    <li> Memory allocation related features (pcache, scratch memory, other...).
    <li> Default pcache implementation (sqlite3_release_memory()).
    <li> Schema memory object allocation (destructor registration).







>
>
>







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
  <ul>
    <li> Mutexes/thread-safety features.
    <li> Lock on schema memory object.
    <li> Locks on b-tree tables.
    <li> "Unlock notify" feature.
  </ul>

    <p class=todo>
      The b-tree module preventing deadlock (by always grabbing mutexes in order of BtShared pointer) should be required here.

  [h2 "Other Requirements"]

    [h3 "Caching and Memory Management Requirements"]
  <ul>
    <li> Memory allocation related features (pcache, scratch memory, other...).
    <li> Default pcache implementation (sqlite3_release_memory()).
    <li> Schema memory object allocation (destructor registration).
176
177
178
179
180
181
182


















































































































183
184
185
186
187
188
189
          <br> * During sqlite3BtreeOpen(), to find the VFS to use,
          <br> * Accessing the SQLITE_SharedCache flag (for setting it),
          <br> * To check the same B-Tree is not attached more than once in shared-cache mode,
          <br> * To link the B-Tree into the pointer-order list of shared-cache b-trees used by the same handle (used for mutexes).
          <br> * To determine if an in-memory sub-journal should be used.
          <br> * To know how many savepoints are open in BtreeBeginTrans().
          <br> * Many, many times to assert() that the db mutex is held when the b-tree layer is accessed..



















































































































  [h1 "Module Implementation"]

  [h2 "Database Image Traversal and Manipulation"]

     <p class=todo>
       This section should describe exactly how bits and bytes are shifted







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
          <br> * During sqlite3BtreeOpen(), to find the VFS to use,
          <br> * Accessing the SQLITE_SharedCache flag (for setting it),
          <br> * To check the same B-Tree is not attached more than once in shared-cache mode,
          <br> * To link the B-Tree into the pointer-order list of shared-cache b-trees used by the same handle (used for mutexes).
          <br> * To determine if an in-memory sub-journal should be used.
          <br> * To know how many savepoints are open in BtreeBeginTrans().
          <br> * Many, many times to assert() that the db mutex is held when the b-tree layer is accessed..


    [h2 "Opening and Closing Connections"]

    <p>
      The following two functions are used to open and close B-Tree database connections, respectively.

      [btree_api_defn Btree]

      [btree_api_defn sqlite3BtreeOpen sqlite3BtreeClose]

    <p>
      Valid values for the <i>flags</i> argument to the
      <i>sqlite3BtreeOpen()</i> function consist of the bitwise OR of zero or
      more of the following symbols.

      [btree_api_defn BTREE_OMIT_JOURNAL BTREE_NO_READLOCK]

    [h2 "Database Image Configuration"]

      <p class=todo>
	This category doesn't work all that well. These APIs are used for other
        things too (i.e. switching to incremental-vacuum mode).

      [btree_api_defn BTREE_AUTOVACUUM_NONE BTREE_AUTOVACUUM_FULL BTREE_AUTOVACUUM_INCR]
      [btree_api_defn sqlite3BtreeSetAutoVacuum sqlite3BtreeSetPageSize]

    <p>
      Queries:

      [btree_api_defn sqlite3BtreeGetPageSize]
      [btree_api_defn sqlite3BtreeGetReserve]
      [btree_api_defn sqlite3BtreeGetAutoVacuum]

    [h2 "Connection Configuration"]

      [btree_api_defn sqlite3BtreeSetCacheSize sqlite3BtreeSetSafetyLevel sqlite3BtreeMaxPageCount ]

    <p>
      And functions to query the current configuration:

      [btree_api_defn sqlite3BtreeSyncDisabled]

    [h2 "Query Interfaces"]

      [btree_api_defn sqlite3BtreeGetFilename sqlite3BtreeGetJournalname]

    [h2 "Mutex Functions"]

<pre class=api>struct BtreeMutexArray {
  int nMutex;
  Btree *aBtree\[SQLITE_MAX_ATTACHED+1\];
};</pre>

      [btree_api_defn sqlite3BtreeEnter sqlite3BtreeEnterAll sqlite3BtreeLeave sqlite3BtreeEnterCursor sqlite3BtreeLeaveCursor sqlite3BtreeLeaveAll sqlite3BtreeMutexArrayEnter sqlite3BtreeMutexArrayLeave sqlite3BtreeMutexArrayInsert]

    [h2 "Reading and Traversing the Database Image"]

      [btree_api_defn BtCursor]

      [btree_api_defn sqlite3BtreeCursor sqlite3BtreeCursorSize sqlite3BtreeCloseCursor sqlite3BtreeClearCursor]

      [btree_api_defn sqlite3BtreeMoveto sqlite3BtreeMovetoUnpacked]

      [btree_api_defn sqlite3BtreeFirst sqlite3BtreeLast sqlite3BtreeNext sqlite3BtreePrevious sqlite3BtreeEof]

      [btree_api_defn sqlite3BtreeKeySize sqlite3BtreeKey sqlite3BtreeKeyFetch sqlite3BtreeDataFetch sqlite3BtreeDataSize sqlite3BtreeData]

      [btree_api_defn sqlite3BtreeCount]

      [btree_api_defn sqlite3BtreeGetMeta]

    [h2 "Modifying the Database Image"]

      [btree_api_defn sqlite3BtreeCreateTable]

      [btree_api_defn BTREE_INTKEY BTREE_ZERODATA BTREE_LEAFDATA]

      [btree_api_defn sqlite3BtreeDropTable sqlite3BtreeClearTable sqlite3BtreeUpdateMeta]

      [btree_api_defn sqlite3BtreeDelete sqlite3BtreeInsert sqlite3BtreeCursorHasMoved sqlite3BtreePutData]

      [btree_api_defn sqlite3BtreeIncrVacuum]

    [h2 "Transaction and Savepoint API"]

      [btree_api_defn sqlite3BtreeBeginTrans sqlite3BtreeCommitPhaseOne sqlite3BtreeCommitPhaseTwo sqlite3BtreeCommit sqlite3BtreeRollback]

      [btree_api_defn sqlite3BtreeBeginStmt sqlite3BtreeSavepoint]

      [btree_api_defn sqlite3BtreeIsInTrans sqlite3BtreeIsInReadTrans sqlite3BtreeIsInBackup]

    [h2 "What do these do?"]

      [btree_api_defn sqlite3BtreeFlags]

      <p class=todo>
        Where do the following go?

      [btree_api_defn sqlite3BtreeIntegrityCheck sqlite3BtreePager]

      [btree_api_defn sqlite3BtreeSchema sqlite3BtreeSchemaLocked sqlite3BtreeLockTable sqlite3BtreeTripAllCursors]

      <p class=todo>
        I know what the following do, but is this mechanism ever used? Or has it been superceded by other tricks in OP_NewRowid?

      [btree_api_defn sqlite3BtreeSetCachedRowid sqlite3BtreeGetCachedRowid sqlite3BtreeCopyFile]

      <p class=todo>
        Should move to btreeInt.h

      [btree_api_defn BtShared]



  [h1 "Module Implementation"]

  [h2 "Database Image Traversal and Manipulation"]

     <p class=todo>
       This section should describe exactly how bits and bytes are shifted
Changes to pages/fancyformat.tcl.
42
43
44
45
46
47
48







49
50
51
52
53
54
55
56
57
58
59
proc h2 {args} {uplevel H 2 $args}
proc h3 {args} {uplevel H 3 $args}
proc h4 {args} {uplevel H 4 $args}

proc Figure {zImage zName zCaption} {
  incr ::SectionNumbers(fig)
  set ::References($zName) [list $::SectionNumbers(fig) $zCaption]







  subst {
      <center>
      <a name="$zName"></a>
      <img src="images/fileformat/$zImage">
      <p><i>Figure $::SectionNumbers(fig) - $zCaption</i>
      </center>
  }
}

proc sort_by_length {lhs rhs} {
  return [expr [string length $lhs] - [string length $rhs]]







>
>
>
>
>
>
>



|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
proc h2 {args} {uplevel H 2 $args}
proc h3 {args} {uplevel H 3 $args}
proc h4 {args} {uplevel H 4 $args}

proc Figure {zImage zName zCaption} {
  incr ::SectionNumbers(fig)
  set ::References($zName) [list $::SectionNumbers(fig) $zCaption]

  if {[regexp {.*svg} $zImage ]} {
    set tag "<object data=\"images/$zImage\" style=\"overflow:hidden\"></object>"
  } else {
    set tag "<img src=\"images/fileformat/$zImage\">"
  }

  subst {
      <center>
      <a name="$zName"></a>
      $tag
      <p><i>Figure $::SectionNumbers(fig) - $zCaption</i>
      </center>
  }
}

proc sort_by_length {lhs rhs} {
  return [expr [string length $lhs] - [string length $rhs]]