1 /* -*- c-basic-offset: 2 -*- */
2 /*
3   Copyright(C) 2015-2016 Brazil
4 
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License version 2.1 as published by the Free Software Foundation.
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.config;
19 
20 
21 private static import groonga_d.groonga;
22 private static import groonga_d.table;
23 
24 extern(C):
25 nothrow @nogc:
26 
27 enum GRN_CONFIG_MAX_KEY_SIZE = groonga_d.table.GRN_TABLE_MAX_KEY_SIZE;
28 
29 /* 1 is for '\0' */
30 enum GRN_CONFIG_MAX_VALUE_SIZE = GRN_CONFIG_VALUE_SPACE_SIZE - uint.sizeof - 1;
31 
32 enum GRN_CONFIG_VALUE_SPACE_SIZE = 4 * 1024;
33 
34 //GRN_API
35 groonga_d.groonga.grn_rc grn_config_set(groonga_d.groonga.grn_ctx* ctx, const (char)* key, int key_size, const (char)* value, int value_size);
36 
37 //GRN_API
38 groonga_d.groonga.grn_rc grn_config_get(groonga_d.groonga.grn_ctx* ctx, const (char)* key, int key_size, const (char)** value, uint* value_size);
39 
40 //GRN_API
41 groonga_d.groonga.grn_rc grn_config_delete(groonga_d.groonga.grn_ctx* ctx, const (char)* key, int key_size);
42 
43 //GRN_API
44 groonga_d.groonga.grn_obj* grn_config_cursor_open(groonga_d.groonga.grn_ctx* ctx);
45 
46 //GRN_API
47 groonga_d.groonga.grn_bool grn_config_cursor_next(groonga_d.groonga.grn_ctx* ctx, groonga_d.groonga.grn_obj* cursor);
48 
49 //GRN_API
50 uint grn_config_cursor_get_key(groonga_d.groonga.grn_ctx* ctx, groonga_d.groonga.grn_obj* cursor, const (char)** key);
51 
52 //GRN_API
53 uint grn_config_cursor_get_value(groonga_d.groonga.grn_ctx* ctx, groonga_d.groonga.grn_obj* cursor, const (char)** value);
54 
55 /* Deprecated since 5.1.2. Use GRN_CONFIG_* instead. */
56 
57 enum GRN_CONF_MAX_KEY_SIZE = GRN_CONFIG_MAX_KEY_SIZE;
58 enum GRN_CONF_MAX_VALUE_SIZE = GRN_CONFIG_MAX_VALUE_SIZE;
59 enum GRN_CONF_VALUE_SPACE_SIZE = GRN_CONFIG_VALUE_SPACE_SIZE;
60 
61 //GRN_API
62 groonga_d.groonga.grn_rc grn_conf_set(groonga_d.groonga.grn_ctx* ctx, const (char)* key, int key_size, const (char)* value, int value_size);
63 
64 //GRN_API
65 groonga_d.groonga.grn_rc grn_conf_get(groonga_d.groonga.grn_ctx* ctx, const (char)* key, int key_size, const (char)** value, uint* value_size);