1 /*
2    bdb2d is BerkeleyDB for D language
3    It is part of unDE project (http://unde.su)
4 
5    Copyright (C) 2009-2014 Nikolay (unDEFER) Krivchenkov <undefer@gmail.com>
6 
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 module berkeleydb.dblogverifyconfig;
22 
23 import berkeleydb.c;
24 
25 import std.stdint;
26 import std.string;
27 import core.sys.posix.pthread;
28 
29 alias DB_LOG_VERIFY_CONFIG DbLogVerifyConfig;
30 
31 /* Functions to edit DB_LOG_VERIFY_CONFIG */
32 void set_continue_after_fail(ref DB_LOG_VERIFY_CONFIG config, int value)
33 {
34     config.continue_after_fail = value;
35 }
36 
37 void set_verbose(ref DB_LOG_VERIFY_CONFIG config, int value)
38 {
39     config.verbose = value;
40 }
41 
42 void set_cachesize(ref DB_LOG_VERIFY_CONFIG config, uint32_t value)
43 {
44     config.cachesize = value;
45 }
46 
47 void set_temp_envhome(ref DB_LOG_VERIFY_CONFIG config, string value)
48 {
49     config.temp_envhome = value.toStringz();
50 }
51 
52 void set_dbfile(ref DB_LOG_VERIFY_CONFIG config, string value)
53 {
54     config.dbfile = value.toStringz();
55 }
56 
57 void set_dbname(ref DB_LOG_VERIFY_CONFIG config, string value)
58 {
59     config.dbname = value.toStringz();
60 }
61 
62 void set_start_lsn(ref DB_LOG_VERIFY_CONFIG config, DB_LSN value)
63 {
64     config.start_lsn = value;
65 }
66 
67 void set_end_lsn(ref DB_LOG_VERIFY_CONFIG config, DB_LSN value)
68 {
69     config.end_lsn = value;
70 }
71 
72 void set_start_time(ref DB_LOG_VERIFY_CONFIG config, time_t value)
73 {
74     config.start_time = value;
75 }
76 
77 void set_end_time(ref DB_LOG_VERIFY_CONFIG config, time_t value)
78 {
79     config.end_time = value;
80 }
81 
82 unittest
83 {
84     DB_LOG_VERIFY_CONFIG config;
85     config.set_continue_after_fail(1);
86 }