1 /*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved.
5 *
6 * $Id:
7 */
8
9 #ifndef HAVE_HEAP
10 #include "db_config.h"
11
12 #include "db_int.h"
13 #include "dbinc/db_page.h"
14 #include "dbinc/heap.h"
15
16 /*
17 * If the library wasn't compiled with the Heap access method, various
18 * routines aren't available. Stub them here, returning an appropriate
19 * error.
20 */
21
22 /*
23 * __db_no_heap_am --
24 * Error when a Berkeley DB build doesn't include the access method.
25 *
26 * PUBLIC: int __db_no_heap_am __P((ENV *));
27 */
28 int
__db_no_heap_am(env)29 __db_no_heap_am(env)
30 ENV *env;
31 {
32 __db_errx(env,
33 "library build did not include support for the Heap access method");
34 return (DB_OPNOTSUP);
35 }
36
37 int
__heap_db_create(dbp)38 __heap_db_create(dbp)
39 DB *dbp;
40 {
41 COMPQUIET(dbp, NULL);
42 return (0);
43 }
44
45 int
__heap_db_close(dbp)46 __heap_db_close(dbp)
47 DB *dbp;
48 {
49 COMPQUIET(dbp, NULL);
50 return (0);
51 }
52
53 int
__heap_get_heapsize(dbp,gbytes,bytes)54 __heap_get_heapsize(dbp, gbytes, bytes)
55 DB *dbp;
56 u_int32_t *gbytes, *bytes;
57 {
58 COMPQUIET(gbytes, NULL);
59 COMPQUIET(bytes, NULL);
60 return (__db_no_heap_am(dbp->env));
61 }
62
63 int
__heapc_dup(orig_dbc,new_dbc)64 __heapc_dup(orig_dbc, new_dbc)
65 DBC *orig_dbc, *new_dbc;
66 {
67 COMPQUIET(new_dbc, NULL);
68 return (__db_no_heap_am(orig_dbc->env));
69 }
70
71 int
__heapc_gsplit(dbc,dbt,bpp,bpsz)72 __heapc_gsplit(dbc, dbt, bpp, bpsz)
73 DBC *dbc;
74 DBT *dbt;
75 void **bpp;
76 u_int32_t *bpsz;
77 {
78 COMPQUIET(dbt, NULL);
79 COMPQUIET(bpp, NULL);
80 COMPQUIET(bpsz, NULL);
81 return (__db_no_heap_am(dbc->env));
82 }
83
84 int
__heap_append(dbc,key,data)85 __heap_append(dbc, key, data)
86 DBC *dbc;
87 DBT *key, *data;
88 {
89 COMPQUIET(key, NULL);
90 COMPQUIET(data, NULL);
91 return (__db_no_heap_am(dbc->env));
92 }
93
94 int
__heap_backup(dbenv,dbp,ip,fp,handle,flags)95 __heap_backup(dbenv, dbp, ip, fp, handle, flags)
96 DB_ENV *dbenv;
97 DB *dbp;
98 DB_THREAD_INFO *ip;
99 DB_FH *fp;
100 void *handle;
101 u_int32_t flags;
102 {
103 COMPQUIET(dbp, NULL);
104 COMPQUIET(ip, NULL);
105 COMPQUIET(fp, NULL);
106 COMPQUIET(handle, NULL);
107 COMPQUIET(flags, 0);
108 return (__db_no_heap_am(dbenv->env));
109 }
110
111 int
__heapc_init(dbc)112 __heapc_init(dbc)
113 DBC *dbc;
114 {
115 return (__db_no_heap_am(dbc->env));
116 }
117
118 int
__heap_init_print(env,dtabp)119 __heap_init_print(env, dtabp)
120 ENV *env;
121 DB_DISTAB *dtabp;
122 {
123 COMPQUIET(env, NULL);
124 COMPQUIET(dtabp, NULL);
125 return (0);
126 }
127
128 int
__heap_init_recover(env,dtabp)129 __heap_init_recover(env, dtabp)
130 ENV *env;
131 DB_DISTAB *dtabp;
132 {
133 COMPQUIET(env, NULL);
134 COMPQUIET(dtabp, NULL);
135 return (0);
136 }
137
138 int
__heap_meta2pgset(dbp,vdp,heapmeta,pgset)139 __heap_meta2pgset(dbp, vdp, heapmeta, pgset)
140 DB *dbp;
141 VRFY_DBINFO *vdp;
142 HEAPMETA *heapmeta;
143 DB *pgset;
144 {
145 COMPQUIET(vdp, NULL);
146 COMPQUIET(heapmeta, NULL);
147 COMPQUIET(pgset, NULL);
148 return (__db_no_heap_am(dbp->env));
149 }
150
151 int
__heap_metachk(dbp,name,hm)152 __heap_metachk(dbp, name, hm)
153 DB *dbp;
154 const char *name;
155 HEAPMETA *hm;
156 {
157 COMPQUIET(name, NULL);
158 COMPQUIET(hm, NULL);
159 return (__db_no_heap_am(dbp->env));
160 }
161
162 int
__heap_new_file(dbp,ip,txn,fhp,name)163 __heap_new_file(dbp, ip, txn, fhp, name)
164 DB *dbp;
165 DB_THREAD_INFO *ip;
166 DB_TXN *txn;
167 DB_FH *fhp;
168 const char *name;
169 {
170 COMPQUIET(ip, NULL);
171 COMPQUIET(txn, NULL);
172 COMPQUIET(fhp, NULL);
173 COMPQUIET(name, NULL);
174 return (__db_no_heap_am(dbp->env));
175 }
176
177 int
__heap_open(dbp,ip,txn,name,base_pgno,flags)178 __heap_open(dbp, ip, txn, name, base_pgno, flags)
179 DB *dbp;
180 DB_THREAD_INFO *ip;
181 DB_TXN *txn;
182 const char *name;
183 db_pgno_t base_pgno;
184 u_int32_t flags;
185 {
186 COMPQUIET(ip, NULL);
187 COMPQUIET(txn, NULL);
188 COMPQUIET(name, NULL);
189 COMPQUIET(base_pgno, 0);
190 COMPQUIET(flags, 0);
191 return (__db_no_heap_am(dbp->env));
192 }
193
194 int
__heap_pgin(dbp,pg,pp,cookie)195 __heap_pgin(dbp, pg, pp, cookie)
196 DB *dbp;
197 db_pgno_t pg;
198 void *pp;
199 DBT *cookie;
200 {
201 COMPQUIET(pg, 0);
202 COMPQUIET(pp, NULL);
203 COMPQUIET(cookie, NULL);
204 return (__db_no_heap_am(dbp->env));
205 }
206
207 int
__heap_pgout(dbp,pg,pp,cookie)208 __heap_pgout(dbp, pg, pp, cookie)
209 DB *dbp;
210 db_pgno_t pg;
211 void *pp;
212 DBT *cookie;
213 {
214 COMPQUIET(pg, 0);
215 COMPQUIET(pp, NULL);
216 COMPQUIET(cookie, NULL);
217 return (__db_no_heap_am(dbp->env));
218 }
219
220 void
__heap_print_cursor(dbc)221 __heap_print_cursor(dbc)
222 DBC *dbc;
223 {
224 (void)__db_no_heap_am(dbc->env);
225 }
226
227 int
__heapc_refresh(dbc)228 __heapc_refresh(dbc)
229 DBC *dbc;
230 {
231 return (__db_no_heap_am(dbc->env));
232 }
233
234 int
__heap_salvage(dbp,vdp,pgno,h,handle,callback,flags)235 __heap_salvage(dbp, vdp, pgno, h, handle, callback, flags)
236 DB *dbp;
237 VRFY_DBINFO *vdp;
238 db_pgno_t pgno;
239 PAGE *h;
240 void *handle;
241 int (*callback) __P((void *, const void *));
242 u_int32_t flags;
243 {
244 COMPQUIET(vdp, NULL);
245 COMPQUIET(pgno, 0);
246 COMPQUIET(handle, NULL);
247 COMPQUIET(h, NULL);
248 COMPQUIET(callback, NULL);
249 COMPQUIET(flags, 0);
250 return (__db_no_heap_am(dbp->env));
251 }
252
253 int
__heap_stat(dbc,spp,flags)254 __heap_stat(dbc, spp, flags)
255 DBC *dbc;
256 void *spp;
257 u_int32_t flags;
258 {
259 COMPQUIET(spp, NULL);
260 COMPQUIET(flags, 0);
261 return (__db_no_heap_am(dbc->env));
262 }
263
264 int
__heap_stat_print(dbc,flags)265 __heap_stat_print(dbc, flags)
266 DBC *dbc;
267 u_int32_t flags;
268 {
269 COMPQUIET(flags, 0);
270 return (__db_no_heap_am(dbc->env));
271 }
272
273 int
__heap_truncate(dbc,countp)274 __heap_truncate(dbc, countp)
275 DBC *dbc;
276 u_int32_t *countp;
277 {
278 COMPQUIET(countp, NULL);
279 return (__db_no_heap_am(dbc->env));
280 }
281
282 int
__heap_vrfy(dbp,vdbp,h,pgno,flags)283 __heap_vrfy(dbp, vdbp, h, pgno, flags)
284 DB *dbp;
285 VRFY_DBINFO *vdbp;
286 PAGE *h;
287 db_pgno_t pgno;
288 u_int32_t flags;
289 {
290 COMPQUIET(h, NULL);
291 COMPQUIET(vdbp, NULL);
292 COMPQUIET(pgno, 0);
293 COMPQUIET(flags, 0);
294 return (__db_no_heap_am(dbp->env));
295 }
296
297 int
__heap_vrfy_meta(dbp,vdp,meta,pgno,flags)298 __heap_vrfy_meta(dbp, vdp, meta, pgno, flags)
299 DB *dbp;
300 VRFY_DBINFO *vdp;
301 HEAPMETA *meta;
302 db_pgno_t pgno;
303 u_int32_t flags;
304 {
305 COMPQUIET(vdp, NULL);
306 COMPQUIET(meta, NULL);
307 COMPQUIET(pgno, 0);
308 COMPQUIET(flags, 0);
309 return (__db_no_heap_am(dbp->env));
310 }
311
312 int
__heap_vrfy_structure(dbp,vdp,flags)313 __heap_vrfy_structure(dbp, vdp, flags)
314 DB *dbp;
315 VRFY_DBINFO *vdp;
316 u_int32_t flags;
317 {
318 COMPQUIET(vdp, NULL);
319 COMPQUIET(flags, 0);
320 return (__db_no_heap_am(dbp->env));
321 }
322
323 int
__heap_exist()324 __heap_exist()
325 {
326 return (0);
327 }
328 #endif /* !HAVE_HEAP */
329