Add BSD license file
[platform/upstream/db4.git] / fileops / fileops_autop.c
1 /* Do not edit: automatically built by gen_rec.awk. */
2
3 #include "db_config.h"
4
5 #include "db_int.h"
6 #include "dbinc/crypto.h"
7 #include "dbinc/db_page.h"
8 #include "dbinc/db_am.h"
9 #include "dbinc/log.h"
10 #include "dbinc/txn.h"
11 #include "dbinc/fop.h"
12
13 /*
14  * PUBLIC: int __fop_create_42_print __P((ENV *, DBT *, DB_LSN *,
15  * PUBLIC:     db_recops, void *));
16  */
17 int
18 __fop_create_42_print(env, dbtp, lsnp, notused2, notused3)
19         ENV *env;
20         DBT *dbtp;
21         DB_LSN *lsnp;
22         db_recops notused2;
23         void *notused3;
24 {
25         __fop_create_42_args *argp;
26         u_int32_t i;
27         int ch;
28         int ret;
29
30         notused2 = DB_TXN_PRINT;
31         notused3 = NULL;
32
33         if ((ret = __fop_create_42_read(env, dbtp->data, &argp)) != 0)
34                 return (ret);
35         (void)printf(
36     "[%lu][%lu]__fop_create_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
37             (u_long)lsnp->file, (u_long)lsnp->offset,
38             (argp->type & DB_debug_FLAG) ? "_debug" : "",
39             (u_long)argp->type,
40             (u_long)argp->txnp->txnid,
41             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
42         (void)printf("\tname: ");
43         for (i = 0; i < argp->name.size; i++) {
44                 ch = ((u_int8_t *)argp->name.data)[i];
45                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
46         }
47         (void)printf("\n");
48         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
49         (void)printf("\tmode: %o\n", argp->mode);
50         (void)printf("\n");
51         __os_free(env, argp);
52         return (0);
53 }
54
55 /*
56  * PUBLIC: int __fop_create_print __P((ENV *, DBT *, DB_LSN *,
57  * PUBLIC:     db_recops, void *));
58  */
59 int
60 __fop_create_print(env, dbtp, lsnp, notused2, notused3)
61         ENV *env;
62         DBT *dbtp;
63         DB_LSN *lsnp;
64         db_recops notused2;
65         void *notused3;
66 {
67         __fop_create_args *argp;
68         u_int32_t i;
69         int ch;
70         int ret;
71
72         notused2 = DB_TXN_PRINT;
73         notused3 = NULL;
74
75         if ((ret = __fop_create_read(env, dbtp->data, &argp)) != 0)
76                 return (ret);
77         (void)printf(
78     "[%lu][%lu]__fop_create%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
79             (u_long)lsnp->file, (u_long)lsnp->offset,
80             (argp->type & DB_debug_FLAG) ? "_debug" : "",
81             (u_long)argp->type,
82             (u_long)argp->txnp->txnid,
83             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
84         (void)printf("\tname: ");
85         for (i = 0; i < argp->name.size; i++) {
86                 ch = ((u_int8_t *)argp->name.data)[i];
87                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
88         }
89         (void)printf("\n");
90         (void)printf("\tdirname: ");
91         for (i = 0; i < argp->dirname.size; i++) {
92                 ch = ((u_int8_t *)argp->dirname.data)[i];
93                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
94         }
95         (void)printf("\n");
96         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
97         (void)printf("\tmode: %o\n", argp->mode);
98         (void)printf("\n");
99         __os_free(env, argp);
100         return (0);
101 }
102
103 /*
104  * PUBLIC: int __fop_remove_print __P((ENV *, DBT *, DB_LSN *,
105  * PUBLIC:     db_recops, void *));
106  */
107 int
108 __fop_remove_print(env, dbtp, lsnp, notused2, notused3)
109         ENV *env;
110         DBT *dbtp;
111         DB_LSN *lsnp;
112         db_recops notused2;
113         void *notused3;
114 {
115         __fop_remove_args *argp;
116         u_int32_t i;
117         int ch;
118         int ret;
119
120         notused2 = DB_TXN_PRINT;
121         notused3 = NULL;
122
123         if ((ret = __fop_remove_read(env, dbtp->data, &argp)) != 0)
124                 return (ret);
125         (void)printf(
126     "[%lu][%lu]__fop_remove%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
127             (u_long)lsnp->file, (u_long)lsnp->offset,
128             (argp->type & DB_debug_FLAG) ? "_debug" : "",
129             (u_long)argp->type,
130             (u_long)argp->txnp->txnid,
131             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
132         (void)printf("\tname: ");
133         for (i = 0; i < argp->name.size; i++) {
134                 ch = ((u_int8_t *)argp->name.data)[i];
135                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
136         }
137         (void)printf("\n");
138         (void)printf("\tfid: ");
139         for (i = 0; i < argp->fid.size; i++) {
140                 ch = ((u_int8_t *)argp->fid.data)[i];
141                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
142         }
143         (void)printf("\n");
144         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
145         (void)printf("\n");
146         __os_free(env, argp);
147         return (0);
148 }
149
150 /*
151  * PUBLIC: int __fop_write_42_print __P((ENV *, DBT *, DB_LSN *,
152  * PUBLIC:     db_recops, void *));
153  */
154 int
155 __fop_write_42_print(env, dbtp, lsnp, notused2, notused3)
156         ENV *env;
157         DBT *dbtp;
158         DB_LSN *lsnp;
159         db_recops notused2;
160         void *notused3;
161 {
162         __fop_write_42_args *argp;
163         u_int32_t i;
164         int ch;
165         int ret;
166
167         notused2 = DB_TXN_PRINT;
168         notused3 = NULL;
169
170         if ((ret = __fop_write_42_read(env, dbtp->data, &argp)) != 0)
171                 return (ret);
172         (void)printf(
173     "[%lu][%lu]__fop_write_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
174             (u_long)lsnp->file, (u_long)lsnp->offset,
175             (argp->type & DB_debug_FLAG) ? "_debug" : "",
176             (u_long)argp->type,
177             (u_long)argp->txnp->txnid,
178             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
179         (void)printf("\tname: ");
180         for (i = 0; i < argp->name.size; i++) {
181                 ch = ((u_int8_t *)argp->name.data)[i];
182                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
183         }
184         (void)printf("\n");
185         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
186         (void)printf("\tpgsize: %lu\n", (u_long)argp->pgsize);
187         (void)printf("\tpageno: %lu\n", (u_long)argp->pageno);
188         (void)printf("\toffset: %lu\n", (u_long)argp->offset);
189         (void)printf("\tpage: ");
190         for (i = 0; i < argp->page.size; i++) {
191                 ch = ((u_int8_t *)argp->page.data)[i];
192                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
193         }
194         (void)printf("\n");
195         (void)printf("\tflag: %lu\n", (u_long)argp->flag);
196         (void)printf("\n");
197         __os_free(env, argp);
198         return (0);
199 }
200
201 /*
202  * PUBLIC: int __fop_write_print __P((ENV *, DBT *, DB_LSN *,
203  * PUBLIC:     db_recops, void *));
204  */
205 int
206 __fop_write_print(env, dbtp, lsnp, notused2, notused3)
207         ENV *env;
208         DBT *dbtp;
209         DB_LSN *lsnp;
210         db_recops notused2;
211         void *notused3;
212 {
213         __fop_write_args *argp;
214         u_int32_t i;
215         int ch;
216         int ret;
217
218         notused2 = DB_TXN_PRINT;
219         notused3 = NULL;
220
221         if ((ret = __fop_write_read(env, dbtp->data, &argp)) != 0)
222                 return (ret);
223         (void)printf(
224     "[%lu][%lu]__fop_write%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
225             (u_long)lsnp->file, (u_long)lsnp->offset,
226             (argp->type & DB_debug_FLAG) ? "_debug" : "",
227             (u_long)argp->type,
228             (u_long)argp->txnp->txnid,
229             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
230         (void)printf("\tname: ");
231         for (i = 0; i < argp->name.size; i++) {
232                 ch = ((u_int8_t *)argp->name.data)[i];
233                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
234         }
235         (void)printf("\n");
236         (void)printf("\tdirname: ");
237         for (i = 0; i < argp->dirname.size; i++) {
238                 ch = ((u_int8_t *)argp->dirname.data)[i];
239                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
240         }
241         (void)printf("\n");
242         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
243         (void)printf("\tpgsize: %lu\n", (u_long)argp->pgsize);
244         (void)printf("\tpageno: %lu\n", (u_long)argp->pageno);
245         (void)printf("\toffset: %lu\n", (u_long)argp->offset);
246         (void)printf("\tpage: ");
247         for (i = 0; i < argp->page.size; i++) {
248                 ch = ((u_int8_t *)argp->page.data)[i];
249                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
250         }
251         (void)printf("\n");
252         (void)printf("\tflag: %lu\n", (u_long)argp->flag);
253         (void)printf("\n");
254         __os_free(env, argp);
255         return (0);
256 }
257
258 /*
259  * PUBLIC: int __fop_rename_42_print __P((ENV *, DBT *, DB_LSN *,
260  * PUBLIC:     db_recops, void *));
261  */
262 int
263 __fop_rename_42_print(env, dbtp, lsnp, notused2, notused3)
264         ENV *env;
265         DBT *dbtp;
266         DB_LSN *lsnp;
267         db_recops notused2;
268         void *notused3;
269 {
270         __fop_rename_42_args *argp;
271         u_int32_t i;
272         int ch;
273         int ret;
274
275         notused2 = DB_TXN_PRINT;
276         notused3 = NULL;
277
278         if ((ret = __fop_rename_42_read(env, dbtp->data, &argp)) != 0)
279                 return (ret);
280         (void)printf(
281     "[%lu][%lu]__fop_rename_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
282             (u_long)lsnp->file, (u_long)lsnp->offset,
283             (argp->type & DB_debug_FLAG) ? "_debug" : "",
284             (u_long)argp->type,
285             (u_long)argp->txnp->txnid,
286             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
287         (void)printf("\toldname: ");
288         for (i = 0; i < argp->oldname.size; i++) {
289                 ch = ((u_int8_t *)argp->oldname.data)[i];
290                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
291         }
292         (void)printf("\n");
293         (void)printf("\tnewname: ");
294         for (i = 0; i < argp->newname.size; i++) {
295                 ch = ((u_int8_t *)argp->newname.data)[i];
296                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
297         }
298         (void)printf("\n");
299         (void)printf("\tfileid: ");
300         for (i = 0; i < argp->fileid.size; i++) {
301                 ch = ((u_int8_t *)argp->fileid.data)[i];
302                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
303         }
304         (void)printf("\n");
305         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
306         (void)printf("\n");
307         __os_free(env, argp);
308         return (0);
309 }
310
311 /*
312  * PUBLIC: int __fop_rename_print __P((ENV *, DBT *, DB_LSN *,
313  * PUBLIC:     db_recops, void *));
314  */
315 int
316 __fop_rename_print(env, dbtp, lsnp, notused2, notused3)
317         ENV *env;
318         DBT *dbtp;
319         DB_LSN *lsnp;
320         db_recops notused2;
321         void *notused3;
322 {
323         __fop_rename_args *argp;
324         u_int32_t i;
325         int ch;
326         int ret;
327
328         notused2 = DB_TXN_PRINT;
329         notused3 = NULL;
330
331         if ((ret = __fop_rename_read(env, dbtp->data, &argp)) != 0)
332                 return (ret);
333         (void)printf(
334     "[%lu][%lu]__fop_rename%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
335             (u_long)lsnp->file, (u_long)lsnp->offset,
336             (argp->type & DB_debug_FLAG) ? "_debug" : "",
337             (u_long)argp->type,
338             (u_long)argp->txnp->txnid,
339             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
340         (void)printf("\toldname: ");
341         for (i = 0; i < argp->oldname.size; i++) {
342                 ch = ((u_int8_t *)argp->oldname.data)[i];
343                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
344         }
345         (void)printf("\n");
346         (void)printf("\tnewname: ");
347         for (i = 0; i < argp->newname.size; i++) {
348                 ch = ((u_int8_t *)argp->newname.data)[i];
349                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
350         }
351         (void)printf("\n");
352         (void)printf("\tdirname: ");
353         for (i = 0; i < argp->dirname.size; i++) {
354                 ch = ((u_int8_t *)argp->dirname.data)[i];
355                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
356         }
357         (void)printf("\n");
358         (void)printf("\tfileid: ");
359         for (i = 0; i < argp->fileid.size; i++) {
360                 ch = ((u_int8_t *)argp->fileid.data)[i];
361                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
362         }
363         (void)printf("\n");
364         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
365         (void)printf("\n");
366         __os_free(env, argp);
367         return (0);
368 }
369
370 /*
371  * PUBLIC: int __fop_file_remove_print __P((ENV *, DBT *, DB_LSN *,
372  * PUBLIC:     db_recops, void *));
373  */
374 int
375 __fop_file_remove_print(env, dbtp, lsnp, notused2, notused3)
376         ENV *env;
377         DBT *dbtp;
378         DB_LSN *lsnp;
379         db_recops notused2;
380         void *notused3;
381 {
382         __fop_file_remove_args *argp;
383         u_int32_t i;
384         int ch;
385         int ret;
386
387         notused2 = DB_TXN_PRINT;
388         notused3 = NULL;
389
390         if ((ret = __fop_file_remove_read(env, dbtp->data, &argp)) != 0)
391                 return (ret);
392         (void)printf(
393     "[%lu][%lu]__fop_file_remove%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
394             (u_long)lsnp->file, (u_long)lsnp->offset,
395             (argp->type & DB_debug_FLAG) ? "_debug" : "",
396             (u_long)argp->type,
397             (u_long)argp->txnp->txnid,
398             (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
399         (void)printf("\treal_fid: ");
400         for (i = 0; i < argp->real_fid.size; i++) {
401                 ch = ((u_int8_t *)argp->real_fid.data)[i];
402                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
403         }
404         (void)printf("\n");
405         (void)printf("\ttmp_fid: ");
406         for (i = 0; i < argp->tmp_fid.size; i++) {
407                 ch = ((u_int8_t *)argp->tmp_fid.data)[i];
408                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
409         }
410         (void)printf("\n");
411         (void)printf("\tname: ");
412         for (i = 0; i < argp->name.size; i++) {
413                 ch = ((u_int8_t *)argp->name.data)[i];
414                 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
415         }
416         (void)printf("\n");
417         (void)printf("\tappname: %lu\n", (u_long)argp->appname);
418         (void)printf("\tchild: 0x%lx\n", (u_long)argp->child);
419         (void)printf("\n");
420         __os_free(env, argp);
421         return (0);
422 }
423
424 /*
425  * PUBLIC: int __fop_init_print __P((ENV *, DB_DISTAB *));
426  */
427 int
428 __fop_init_print(env, dtabp)
429         ENV *env;
430         DB_DISTAB *dtabp;
431 {
432         int ret;
433
434         if ((ret = __db_add_recovery_int(env, dtabp,
435             __fop_create_print, DB___fop_create)) != 0)
436                 return (ret);
437         if ((ret = __db_add_recovery_int(env, dtabp,
438             __fop_remove_print, DB___fop_remove)) != 0)
439                 return (ret);
440         if ((ret = __db_add_recovery_int(env, dtabp,
441             __fop_write_print, DB___fop_write)) != 0)
442                 return (ret);
443         if ((ret = __db_add_recovery_int(env, dtabp,
444             __fop_rename_print, DB___fop_rename)) != 0)
445                 return (ret);
446         if ((ret = __db_add_recovery_int(env, dtabp,
447             __fop_rename_print, DB___fop_rename_noundo)) != 0)
448                 return (ret);
449         if ((ret = __db_add_recovery_int(env, dtabp,
450             __fop_file_remove_print, DB___fop_file_remove)) != 0)
451                 return (ret);
452         return (0);
453 }