| 1 | /* |
| 2 | Copyright(C) 2018 Brazil |
| 3 | Copyright(C) 2021 Sutou Kouhei <[email protected]> |
| 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 as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "grn.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | typedef struct _grn_options grn_options; |
| 29 | |
| 30 | grn_options * |
| 31 | grn_options_create(grn_ctx *ctx, const char *path, const char *context_tag); |
| 32 | grn_options * |
| 33 | grn_options_open(grn_ctx *ctx, const char *path, const char *context_tag); |
| 34 | grn_rc |
| 35 | grn_options_close(grn_ctx *ctx, grn_options *options); |
| 36 | grn_rc |
| 37 | grn_options_remove(grn_ctx *ctx, const char *path); |
| 38 | |
| 39 | bool |
| 40 | grn_options_is_locked(grn_ctx *ctx, grn_options *options); |
| 41 | grn_rc |
| 42 | grn_options_clear_lock(grn_ctx *ctx, grn_options *options); |
| 43 | bool |
| 44 | grn_options_is_corrupt(grn_ctx *ctx, grn_options *options); |
| 45 | grn_rc |
| 46 | grn_options_flush(grn_ctx *ctx, grn_options *options); |
| 47 | |
| 48 | grn_rc |
| 49 | grn_options_set(grn_ctx *ctx, |
| 50 | grn_options *options, |
| 51 | grn_id id, |
| 52 | const char *name, |
| 53 | int name_length, |
| 54 | grn_obj *values); |
| 55 | grn_option_revision |
| 56 | grn_options_get(grn_ctx *ctx, |
| 57 | grn_options *options, |
| 58 | grn_id id, |
| 59 | const char *name, |
| 60 | int name_length, |
| 61 | grn_option_revision revision, |
| 62 | grn_obj *values); |
| 63 | grn_rc |
| 64 | grn_options_clear(grn_ctx *ctx, grn_options *options, grn_id id); |
| 65 | |
| 66 | grn_rc |
| 67 | grn_options_wal_recover(grn_ctx *ctx, grn_options *options); |
| 68 | |
| 69 | grn_rc |
| 70 | grn_options_warm(grn_ctx *ctx, grn_options *options); |
| 71 | |
| 72 | #ifdef __cplusplus |
| 73 | } |
| 74 | #endif |