Debian Codegraph @

lib/grn_string.h

raw symbols SCIP
1 /*
2 Copyright(C) 2012-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 #include "grn_ctx.h"
24 #include "grn_db.h"
25 #include "grn_str.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef struct {
32 grn_obj_header header;
33 const char *original;
34 unsigned int original_length_in_bytes;
35 char *normalized;
36 unsigned int normalized_length_in_bytes;
37 unsigned int n_characters;
38 int16_t *checks;
39 uint8_t *ctypes;
40 uint64_t *offsets;
41 grn_encoding encoding;
42 int flags;
43 grn_obj *lexicon;
44 uint32_t normalizer_index;
45 } grn_string;
46
47 grn_rc grn_string_init(grn_ctx *ctx,
48 grn_obj *string,
49 grn_obj *lexicon_or_normalizer,
50 int flags,
51 grn_encoding encoding);
52 grn_obj *grn_string_open_(grn_ctx *ctx,
53 const char *str,
54 unsigned int str_len,
55 grn_obj *lexicon_or_normalizer,
56 int flags,
57 grn_encoding encoding);
58 grn_rc grn_string_fin(grn_ctx *ctx, grn_obj *string);
59 grn_rc grn_string_close(grn_ctx *ctx, grn_obj *string);
60 grn_rc grn_string_set_original(grn_ctx *ctx,
61 grn_obj *string,
62 const char *original,
63 unsigned int length_in_bytes);
64 grn_rc grn_string_inspect(grn_ctx *ctx, grn_obj *buffer, grn_obj *string);
65
66 #ifdef __cplusplus
67 }
68 #endif