1 /* Copyright(C) 2004-2005 Brazil
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Lesser General Public License for more details.
13 You should have received a copy of the GNU Lesser General Public
14 License along with this library; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #endif /* SEN_STR_H */
29 #define MAX_SNIP_TAG_COUNT 512U
30 #define MAX_SNIP_COND_COUNT 32U
31 #define MAX_SNIP_RESULT_COUNT 16U
38 #define SNIPCOND_NONSTOP 0
39 #define SNIPCOND_STOP 1
40 #define SNIPCOND_ACROSS 2
42 #define SEN_QUERY_SCAN_ALLOCCONDS 0x0002
44 typedef struct _snip_cond
46 /* initial parameters */
57 /* Tuned BM temporal result */
62 size_t found_alpha_head;
68 int_least8_t stopflag;
82 unsigned int first_tag_result_idx;
83 unsigned int last_tag_result_idx;
84 unsigned int tag_count;
89 sen_encoding encoding;
92 unsigned int max_results;
93 const char *defaultopentag;
94 const char *defaultclosetag;
95 size_t defaultopentag_len;
96 size_t defaultclosetag_len;
98 sen_snip_mapping *mapping;
100 snip_cond cond[MAX_SNIP_COND_COUNT];
101 unsigned int cond_len;
103 unsigned int tag_count;
104 unsigned int snip_count;
109 _snip_result snip_result[MAX_SNIP_RESULT_COUNT];
110 _snip_tag_result tag_result[MAX_SNIP_TAG_COUNT];
112 size_t max_tagged_len;
115 sen_rc sen_snip_cond_init(snip_cond *sc, const char *keyword, unsigned int keyword_len,
116 sen_encoding enc, int flags);
117 void sen_snip_cond_reinit(snip_cond *cond);
118 sen_rc sen_snip_cond_close(snip_cond *cond);
119 void sen_bm_tunedbm(snip_cond *cond, sen_nstr *object, int flags);
125 #endif /* SEN_SNIP_H */