Update.
[glibc.git] / db2 / btree / btree.src
blob6145696d28d9aea405b084a96e295710d349a98b
1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 1996, 1997
5  *      Sleepycat Software.  All rights reserved.
6  */
8 #include "config.h"
10 #ifndef lint
11 static const char sccsid[] = "@(#)btree.src     10.6 (Sleepycat) 11/2/97";
12 #endif /* not lint */
14 PREFIX  bam
17  * BTREE-pg_alloc: used to record allocating a new page.
18  *
19  * meta_lsn:    the meta-data page's original lsn.
20  * page_lsn:    the allocated page's original lsn.
21  * pgno:        the page allocated.
22  * next:        the next page on the free list.
23  */
24 BEGIN pg_alloc
25 ARG     fileid          u_int32_t       lu
26 POINTER meta_lsn        DB_LSN *        lu
27 POINTER page_lsn        DB_LSN *        lu
28 ARG     pgno            db_pgno_t       lu
29 ARG     ptype           u_int32_t       lu
30 ARG     next            db_pgno_t       lu
31 END
34  * BTREE-pg_free: used to record freeing a page.
35  *
36  * pgno:        the page being freed.
37  * meta_lsn:    the meta-data page's original lsn.
38  * header:      the header from the free'd page.
39  * next:        the previous next pointer on the metadata page.
40  */
41 BEGIN pg_free
42 ARG     fileid          u_int32_t       lu
43 ARG     pgno            db_pgno_t       lu
44 POINTER meta_lsn        DB_LSN *        lu
45 DBT     header          DBT             s
46 ARG     next            db_pgno_t       lu
47 END
50  * BTREE-split: used to log a page split.
51  *
52  * left:        the page number for the low-order contents.
53  * llsn:        the left page's original LSN.
54  * right:       the page number for the high-order contents.
55  * rlsn:        the right page's original LSN.
56  * indx:        the number of entries that went to the left page.
57  * npgno:       the next page number
58  * nlsn:        the next page's original LSN (or 0 if no next page).
59  * pg:          the split page's contents before the split.
60  */
61 BEGIN split
62 ARG     fileid          u_int32_t       lu
63 ARG     left            db_pgno_t       lu
64 POINTER llsn            DB_LSN *        lu
65 ARG     right           db_pgno_t       lu
66 POINTER rlsn            DB_LSN *        lu
67 ARG     indx            u_int32_t       lu
68 ARG     npgno           db_pgno_t       lu
69 POINTER nlsn            DB_LSN *        lu
70 DBT     pg              DBT             s
71 END
74  * BTREE-rsplit: used to log a reverse-split
75  *
76  * pgno:        the page number of the page copied over the root.
77  * pgdbt:       the page being copied on the root page.
78  * nrec:        the tree's record count.
79  * rootent:     last entry on the root page.
80  * rootlsn:     the root page's original lsn.
81  */
82 BEGIN rsplit
83 ARG     fileid          u_int32_t       lu
84 ARG     pgno            db_pgno_t       lu
85 DBT     pgdbt           DBT             s
86 ARG     nrec            db_pgno_t       lu
87 DBT     rootent         DBT             s
88 POINTER rootlsn         DB_LSN *        lu
89 END
92  * BTREE-adj: used to log the adjustment of an index.
93  *
94  * pgno:        the page modified.
95  * lsn:         the page's original lsn.
96  * indx:        the index adjusted.
97  * indx_copy:   the index to copy if inserting.
98  * is_insert:   0 if a delete, 1 if an insert.
99  */
100 BEGIN adj
101 ARG     fileid          u_int32_t       lu
102 ARG     pgno            db_pgno_t       lu
103 POINTER lsn             DB_LSN *        lu
104 ARG     indx            u_int32_t       lu
105 ARG     indx_copy       u_int32_t       lu
106 ARG     is_insert       u_int32_t       lu
110  * BTREE-cadjust: used to adjust the count change in an internal page.
112  * pgno:        the page modified.
113  * lsn:         the page's original lsn.
114  * indx:        the index to be adjusted.
115  * adjust:      the signed adjustment.
116  * total:       if the total tree entries count should be adjusted
117  */
118 BEGIN cadjust
119 ARG     fileid          u_int32_t       lu
120 ARG     pgno            db_pgno_t       lu
121 POINTER lsn             DB_LSN *        lu
122 ARG     indx            u_int32_t       lu
123 ARG     adjust          int32_t         ld
124 ARG     total           int32_t         ld
128  * BTREE-cdel: used to log the intent-to-delete of a cursor record.
130  * pgno:        the page modified.
131  * lsn:         the page's original lsn.
132  * indx:        the index to be deleted.
133  */
134 BEGIN cdel
135 ARG     fileid          u_int32_t       lu
136 ARG     pgno            db_pgno_t       lu
137 POINTER lsn             DB_LSN *        lu
138 ARG     indx            u_int32_t       lu
142  * BTREE-repl: used to log the replacement of an item.
144  * pgno:        the page modified.
145  * lsn:         the page's original lsn.
146  * orig:        the original data.
147  * new:         the replacement data.
148  * duplicate:   the prefix of the replacement that matches the original.
149  */
150 BEGIN repl
151 ARG     fileid          u_int32_t       lu
152 ARG     pgno            db_pgno_t       lu
153 POINTER lsn             DB_LSN *        lu
154 ARG     indx            u_int32_t       lu
155 ARG     isdeleted       u_int32_t       lu
156 DBT     orig            DBT             s
157 DBT     repl            DBT             s
158 ARG     prefix          u_int32_t       lu
159 ARG     suffix          u_int32_t       lu