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