1 | /* -*- c-basic-offset: 2 -*- */ |
2 | /* |
3 | Copyright(C) 2012-2016 Brazil |
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 ; |
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 | short *checks; |
39 | unsigned char *ctypes; |
40 | grn_encoding encoding; |
41 | int flags; |
42 | } grn_string; |
43 | |
44 | grn_obj *grn_string_open_(grn_ctx *ctx, const char *str, unsigned int str_len, |
45 | grn_obj *normalizer, int flags, grn_encoding encoding); |
46 | grn_rc grn_string_close(grn_ctx *ctx, grn_obj *string); |
47 | grn_rc grn_string_inspect(grn_ctx *ctx, grn_obj *buffer, grn_obj *string); |
48 | |
49 | #ifdef __cplusplus |
50 | } |
51 | #endif |
52 | |