| 1 | /* |
| 2 | Copyright (C) 2009-2016 Brazil |
| 3 | Copyright (C) 2021-2023 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"cxx . . $ `<file>/lib/grn.h`/ |
| 23 | #include "grn_str.h"cxx . . $ `<file>/lib/grn_str.h`/ |
| 24 | #include "grn_db.h"cxx . . $ `<file>/lib/grn_db.h`/ |
| 25 | #include "grn_onigmo.h"cxx . . $ `<file>/lib/grn_onigmo.h`/ |
| 26 | |
| 27 | #define ASIZEcxx . . $ `lib/grn_snip.h:27:9`! 256U |
| 28 | #define MAX_SNIP_TAG_COUNTcxx . . $ `lib/grn_snip.h:28:9`! 512U |
| 29 | #define DEFAULT_SNIP_COND_CAPACITYcxx . . $ `lib/grn_snip.h:29:9`! 32U |
| 30 | #define MAX_SNIP_RESULT_COUNTcxx . . $ `lib/grn_snip.h:30:9`! 16U |
| 31 | |
| 32 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | #define SNIPCOND_NONSTOPcxx . . $ `lib/grn_snip.h:36:9`! 0 |
| 37 | #define SNIPCOND_STOPcxx . . $ `lib/grn_snip.h:37:9`! 1 |
| 38 | #define SNIPCOND_ACROSScxx . . $ `lib/grn_snip.h:38:9`! 2 |
| 39 | |
| 40 | #define GRN_QUERY_SCAN_ALLOCCONDScxx . . $ `lib/grn_snip.h:40:9`! 0x0002 |
| 41 | |
| 42 | typedef struct _snip_condcxx . . $ _snip_cond# { |
| 43 | /* initial parameters */ |
| 44 | const char *opentagcxx . . $ _snip_cond#opentag.; |
| 45 | const char *closetagcxx . . $ _snip_cond#closetag.; |
| 46 | size_t opentag_lencxx . . $ _snip_cond#opentag_len.; |
| 47 | size_t closetag_lencxx . . $ _snip_cond#closetag_len.; |
| 48 | grn_objcxx . . $ grn_obj# *keywordcxx . . $ _snip_cond#keyword.; |
| 49 | |
| 50 | /* Tuned BM pre */ |
| 51 | ptrdiff_t bmBccxx . . $ _snip_cond#bmBc.[ASIZEcxx . . $ `lib/grn_snip.h:27:9`!]; |
| 52 | ptrdiff_t shiftcxx . . $ _snip_cond#shift.; |
| 53 | |
| 54 | /* Tuned BM temporal result */ |
| 55 | ptrdiff_t foundcxx . . $ _snip_cond#found.; |
| 56 | ptrdiff_t last_foundcxx . . $ _snip_cond#last_found.; |
| 57 | size_t last_offsetcxx . . $ _snip_cond#last_offset.; |
| 58 | size_t start_offsetcxx . . $ _snip_cond#start_offset.; |
| 59 | size_t end_offsetcxx . . $ _snip_cond#end_offset.; |
| 60 | ptrdiff_t found_alpha_headcxx . . $ _snip_cond#found_alpha_head.; |
| 61 | |
| 62 | /* search result */ |
| 63 | int countcxx . . $ _snip_cond#count.; |
| 64 | |
| 65 | /* stop flag */ |
| 66 | int_least8_tcxx . . $ int_least8_t# stopflagcxx . . $ _snip_cond#stopflag.; |
| 67 | } snip_condcxx . . $ snip_cond#; |
| 68 | |
| 69 | typedef structcxx . . $ $anonymous_type_acd6ebb522869ea0_0# { |
| 70 | size_t start_offsetcxx . . $ $anonymous_type_acd6ebb522869ea0_0#start_offset.; |
| 71 | size_t end_offsetcxx . . $ $anonymous_type_acd6ebb522869ea0_0#end_offset.; |
| 72 | snip_condcxx . . $ snip_cond# *condcxx . . $ $anonymous_type_acd6ebb522869ea0_0#cond.; |
| 73 | } _snip_tag_resultcxx . . $ _snip_tag_result#; |
| 74 | |
| 75 | typedef structcxx . . $ $anonymous_type_acd6ebb522869ea0_1# { |
| 76 | size_t start_offsetcxx . . $ $anonymous_type_acd6ebb522869ea0_1#start_offset.; |
| 77 | size_t end_offsetcxx . . $ $anonymous_type_acd6ebb522869ea0_1#end_offset.; |
| 78 | unsigned int first_tag_result_idxcxx . . $ $anonymous_type_acd6ebb522869ea0_1#first_tag_result_idx.; |
| 79 | unsigned int last_tag_result_idxcxx . . $ $anonymous_type_acd6ebb522869ea0_1#last_tag_result_idx.; |
| 80 | unsigned int tag_countcxx . . $ $anonymous_type_acd6ebb522869ea0_1#tag_count.; |
| 81 | } _snip_resultcxx . . $ _snip_result#; |
| 82 | |
| 83 | typedef struct _grn_snipcxx . . $ _grn_snip# { |
| 84 | grn_db_objcxx . . $ grn_db_obj# objcxx . . $ _grn_snip#obj.; |
| 85 | grn_encodingcxx . . $ grn_encoding# encodingcxx . . $ _grn_snip#encoding.; |
| 86 | int flagscxx . . $ _grn_snip#flags.; |
| 87 | size_t widthcxx . . $ _grn_snip#width.; |
| 88 | unsigned int max_resultscxx . . $ _grn_snip#max_results.; |
| 89 | const char *defaultopentagcxx . . $ _grn_snip#defaultopentag.; |
| 90 | const char *defaultclosetagcxx . . $ _grn_snip#defaultclosetag.; |
| 91 | size_t defaultopentag_lencxx . . $ _grn_snip#defaultopentag_len.; |
| 92 | size_t defaultclosetag_lencxx . . $ _grn_snip#defaultclosetag_len.; |
| 93 | |
| 94 | grn_snip_mappingcxx . . $ grn_snip_mapping# *mappingcxx . . $ _grn_snip#mapping.; |
| 95 | |
| 96 | snip_condcxx . . $ snip_cond# *condcxx . . $ _grn_snip#cond.; |
| 97 | size_t cond_capacitycxx . . $ _grn_snip#cond_capacity.; |
| 98 | size_t cond_lencxx . . $ _grn_snip#cond_len.; |
| 99 | |
| 100 | unsigned int tag_countcxx . . $ _grn_snip#tag_count.; |
| 101 | unsigned int snip_countcxx . . $ _grn_snip#snip_count.; |
| 102 | |
| 103 | const char *stringcxx . . $ _grn_snip#string.; |
| 104 | grn_objcxx . . $ grn_obj# *nstrcxx . . $ _grn_snip#nstr.; |
| 105 | |
| 106 | _snip_resultcxx . . $ _snip_result# snip_resultcxx . . $ _grn_snip#snip_result.[MAX_SNIP_RESULT_COUNTcxx . . $ `lib/grn_snip.h:30:9`!]; |
| 107 | _snip_tag_resultcxx . . $ _snip_tag_result# tag_resultcxx . . $ _grn_snip#tag_result.[MAX_SNIP_TAG_COUNTcxx . . $ `lib/grn_snip.h:28:9`!]; |
| 108 | |
| 109 | size_t max_tagged_lencxx . . $ _grn_snip#max_tagged_len.; |
| 110 | |
| 111 | grn_objcxx . . $ grn_obj# *normalizercxx . . $ _grn_snip#normalizer.; |
| 112 | grn_objcxx . . $ grn_obj# *lexiconcxx . . $ _grn_snip#lexicon.; |
| 113 | grn_objcxx . . $ grn_obj# normalizerscxx . . $ _grn_snip#normalizers.; |
| 114 | |
| 115 | char *delimiter_patterncxx . . $ _grn_snip#delimiter_pattern.; |
| 116 | size_t delimiter_pattern_lengthcxx . . $ _grn_snip#delimiter_pattern_length.; |
| 117 | #ifdef GRN_SUPPORT_REGEXPcxx . . $ `lib/grn.h:734:11`! |
| 118 | OnigRegexcxx . . $ OnigRegex# delimiter_regexcxx . . $ _grn_snip#delimiter_regex.; |
| 119 | #endif |
| 120 | } grn_snipcxx . . $ grn_snip#; |
| 121 | |
| 122 | grn_rccxx . . $ grn_rc# |
| 123 | grn_snip_closecxx . . $ grn_snip_close(5150f6f5175b280c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_snipcxx . . $ grn_snip# *snip); |
| 124 | grn_rccxx . . $ grn_rc# |
| 125 | grn_snip_cond_closecxx . . $ grn_snip_cond_close(14d09e9a60b32ef0).(grn_ctxcxx . . $ grn_ctx# *ctx, snip_condcxx . . $ snip_cond# *cond); |
| 126 | void |
| 127 | grn_bm_tunedbmcxx . . $ grn_bm_tunedbm(a2637678f71cc9af).(grn_ctxcxx . . $ grn_ctx# *ctx, snip_condcxx . . $ snip_cond# *cond, grn_objcxx . . $ grn_obj# *string, int flags); |
| 128 | |
| 129 | #ifdef __cplusplus |
| 130 | } |
| 131 | #endif |