1 /* -*- c-basic-offset: 2 -*- */ 2 /* 3 Copyright(C) 2009-2016 Brazil 4 Copyright(C) 2018-2021 Sutou Kouhei <kou@clear-code.com> 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License version 2.1 as published by the Free Software Foundation. 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 module groonga_d.token_cursor; 20 21 22 private static import groonga_d.groonga; 23 private static import groonga_d.token; 24 25 extern(C): 26 nothrow @nogc: 27 28 enum grn_token_cursor_status 29 { 30 GRN_TOKEN_CURSOR_DOING = 0, 31 GRN_TOKEN_CURSOR_DONE, 32 GRN_TOKEN_CURSOR_DONE_SKIP, 33 GRN_TOKEN_CURSOR_NOT_FOUND, 34 } 35 36 //Declaration name in C language 37 enum 38 { 39 GRN_TOKEN_CURSOR_DOING = .grn_token_cursor_status.GRN_TOKEN_CURSOR_DOING, 40 GRN_TOKEN_CURSOR_DONE = .grn_token_cursor_status.GRN_TOKEN_CURSOR_DONE, 41 GRN_TOKEN_CURSOR_DONE_SKIP = .grn_token_cursor_status.GRN_TOKEN_CURSOR_DONE_SKIP, 42 GRN_TOKEN_CURSOR_NOT_FOUND = .grn_token_cursor_status.GRN_TOKEN_CURSOR_NOT_FOUND, 43 } 44 45 enum GRN_TOKEN_CURSOR_ENABLE_TOKENIZED_DELIMITER = 0x01 << 0; 46 enum GRN_TOKEN_CURSOR_PARALLEL = 0x01 << 1; 47 48 extern struct _grn_token_cursor; 49 alias grn_token_cursor = _grn_token_cursor; 50 51 //GRN_API 52 grn_token_cursor* grn_token_cursor_open(groonga_d.groonga.grn_ctx* ctx, groonga_d.groonga.grn_obj* table, const (char)* str, size_t str_len, groonga_d.token.grn_tokenize_mode mode, uint flags); 53 54 //GRN_API 55 groonga_d.groonga.grn_rc grn_token_cursor_set_source_column(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor, groonga_d.groonga.grn_obj* column); 56 57 //GRN_API 58 groonga_d.groonga.grn_rc grn_token_cursor_set_source_id(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor, groonga_d.groonga.grn_id id); 59 60 //GRN_API 61 groonga_d.groonga.grn_rc grn_token_cursor_set_index_column(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor, groonga_d.groonga.grn_obj* column); 62 63 //GRN_API 64 groonga_d.groonga.grn_rc grn_token_cursor_set_query_options(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor, groonga_d.groonga.grn_obj* query_options); 65 66 //GRN_API 67 groonga_d.groonga.grn_id grn_token_cursor_next(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor); 68 69 //GRN_API 70 grn_token_cursor_status grn_token_cursor_get_status(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor); 71 72 //GRN_API 73 groonga_d.groonga.grn_rc grn_token_cursor_close(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor); 74 75 //GRN_API 76 groonga_d.token.grn_token* grn_token_cursor_get_token(groonga_d.groonga.grn_ctx* ctx, grn_token_cursor* token_cursor);