Debian Codegraph @

lib/extractor.c

raw symbols SCIP
1 /*
2 Copyright (C) 2026 Sutou Kouhei <[email protected]>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include <string.h>
20
21 #include "grn.h"cxx . . $ `<file>/lib/grn.h`/
22 #include "grn_db.h"cxx . . $ `<file>/lib/grn_db.h`/
23 #include "grn_extractor.h"cxx . . $ `<file>/lib/grn_extractor.h`/
24
25 grn_rccxx . . $ grn_rc#
26 grn_extract_data_initcxx . . $ grn_extract_data_init(4817a86cf0a5c862).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_extract_datacxx . . $ grn_extract_data# *data)
27 {
28 data->tablecxx . . $ grn_extract_data#table. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
29 data->indexcxx . . $ grn_extract_data#index. = 0;
30 data->valuecxx . . $ grn_extract_data#value. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
31 return GRN_SUCCESScxx . . $ GRN_SUCCESS.;
32 }
33
34 grn_objcxx . . $ grn_obj# *
35 grn_extract_data_get_valuecxx . . $ grn_extract_data_get_value(2462385ca73b1fa3).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_extract_datacxx . . $ grn_extract_data# *data)
36 {
37 return data->valuecxx . . $ grn_extract_data#value.;
38 }
39
40 grn_objcxx . . $ grn_obj# *
41 grn_extract_data_get_tablecxx . . $ grn_extract_data_get_table(2462385ca73b1fa3).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_extract_datacxx . . $ grn_extract_data# *data)
42 {
43 return data->tablecxx . . $ grn_extract_data#table.;
44 }
45
46 uint32_tcxx . . $ uint32_t#
47 grn_extract_data_get_indexcxx . . $ grn_extract_data_get_index(fef2bf04b7ea1182).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_extract_datacxx . . $ grn_extract_data# *data)
48 {
49 return data->indexcxx . . $ grn_extract_data#index.;
50 }
51
52 grn_objcxx . . $ grn_obj# *
53 grn_extractor_createcxx . . $ grn_extractor_create(70fde0087014f9ea).(grn_ctxcxx . . $ grn_ctx# *ctx, const char *name, int length)
54 {
55 GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!;
56 grn_objcxx . . $ grn_obj# *extractor = grn_proc_createcxx . . $ grn_proc_create(195df001e5324f57).(ctx,
57 name,
58 length,
59 GRN_PROC_EXTRACTORcxx . . $ GRN_PROC_EXTRACTOR.,
60 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
61 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
62 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
63 0,
64 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
65 if (!extractor) {
66 if (length < 0) {
67 length = (int)strlencxx . . $ strlen(751346f8406fd082).(name);
68 }
69 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
70 GRN_EXTRACTOR_ERROR,
71 "[extractor][create] failed to create: <%.*s>",
72 length,
73 name);
74 }
75
76 GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(extractor);
77 }
78
79 grn_rccxx . . $ grn_rc#
80 grn_extractor_set_extract_funccxx . . $ grn_extractor_set_extract_func(46a734684d5d447b).(grn_ctxcxx . . $ grn_ctx# *ctx,
81 grn_objcxx . . $ grn_obj# *extractor,
82 grn_extractor_extract_funccxx . . $ grn_extractor_extract_func# *extract)
83 {
84 GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!;
85 if (extractor) {
86 ((grn_proccxx . . $ grn_proc# *)extractor)->callbackscxx . . $ _grn_proc#callbacks..extractorcxx . . $ _grn_proc#$anonymous_type_5#extractor..extractcxx . . $ _grn_proc#$anonymous_type_5#$anonymous_type_12#extract. = extract;
87 } else {
88 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
89 GRN_INVALID_ARGUMENT,
90 "[extractor][extract][set] extractor is NULL");
91 }
92 GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc);
93 }
94
95 grn_objcxx . . $ grn_obj# *
96 grn_extractor_extractcxx . . $ grn_extractor_extract(d93ab684c9722620).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *extractor, grn_extract_datacxx . . $ grn_extract_data# *data)
97 {
98 GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!;
99 grn_objcxx . . $ grn_obj# *value =
100 ((grn_proccxx . . $ grn_proc# *)extractor)->callbackscxx . . $ _grn_proc#callbacks..extractorcxx . . $ _grn_proc#$anonymous_type_5#extractor..extractcxx . . $ _grn_proc#$anonymous_type_5#$anonymous_type_12#extract.(ctx, extractor, data);
101 GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(value);
102 }