1 /*
2   Copyright(C) 2021  Sutou Kouhei <kou@clear-code.com>
3 
4   This library is free software; you can redistribute it and/or
5   modify it under the terms of the GNU Lesser General Public
6   License as published by the Free Software Foundation; either
7   version 2.1 of the License, or (at your option) any later version.
8 
9   This library is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   Lesser General Public License for more details.
13 
14   You should have received a copy of the GNU Lesser General Public
15   License along with this library; if not, write to the Free Software
16   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18 module groonga_d.wal;
19 
20 
21 private static import groonga_d.groonga;
22 
23 extern (C):
24 nothrow @nogc:
25 
26 enum grn_wal_role
27 {
28 	/*
29 	 * Don't do any WAL related tasks. This is the default for backward
30 	 * compatibility.
31 	 */
32 	GRN_WAL_ROLE_NONE,
33 
34 	/*
35 	 * Record WAL and recover from WAL. The only one thread can be primary.
36 	 */
37 	GRN_WAL_ROLE_PRIMARY,
38 
39 	/*
40 	 * Only record WAL. Multiple threads/processes can be secondary.
41 	 */
42 	GRN_WAL_ROLE_SECONDARY,
43 }
44 
45 //Declaration name in C language
46 enum
47 {
48 	GRN_WAL_ROLE_NONE = .grn_wal_role.GRN_WAL_ROLE_NONE,
49 	GRN_WAL_ROLE_PRIMARY = .grn_wal_role.GRN_WAL_ROLE_PRIMARY,
50 	GRN_WAL_ROLE_SECONDARY = .grn_wal_role.GRN_WAL_ROLE_SECONDARY,
51 }
52 
53 //GRN_API
54 groonga_d.groonga.grn_rc grn_ctx_set_wal_role(groonga_d.groonga.grn_ctx* ctx, .grn_wal_role role);
55 
56 //GRN_API
57 .grn_wal_role grn_ctx_get_wal_role(groonga_d.groonga.grn_ctx* ctx);