1 /* 2 Copyright(C) 2013-2017 Brazil 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.cache; 19 20 21 private static import groonga_d.groonga; 22 23 extern(C): 24 nothrow @nogc: 25 26 enum GRN_CACHE_DEFAULT_MAX_N_ENTRIES = 100; 27 extern struct _grn_cache; 28 alias grn_cache = _grn_cache; 29 30 //GRN_API 31 void grn_set_default_cache_base_path(const (char)* base_path); 32 33 //GRN_API 34 const (char)* grn_get_default_cache_base_path(); 35 36 //GRN_API 37 grn_cache* grn_cache_open(groonga_d.groonga.grn_ctx* ctx); 38 39 //GRN_API 40 grn_cache* grn_persistent_cache_open(groonga_d.groonga.grn_ctx* ctx, const (char)* base_path); 41 42 //GRN_API 43 groonga_d.groonga.grn_rc grn_cache_close(groonga_d.groonga.grn_ctx* ctx, grn_cache* cache); 44 45 //GRN_API 46 groonga_d.groonga.grn_rc grn_cache_current_set(groonga_d.groonga.grn_ctx* ctx, grn_cache* cache); 47 48 //GRN_API 49 grn_cache* grn_cache_current_get(groonga_d.groonga.grn_ctx* ctx); 50 51 //GRN_API 52 groonga_d.groonga.grn_rc grn_cache_default_reopen(); 53 54 //GRN_API 55 groonga_d.groonga.grn_rc grn_cache_set_max_n_entries(groonga_d.groonga.grn_ctx* ctx, grn_cache* cache, uint n); 56 57 //GRN_API 58 uint grn_cache_get_max_n_entries(groonga_d.groonga.grn_ctx* ctx, grn_cache* cache);