Debian Codegraph @

lib/scanner.c

raw symbols SCIP
1 /*
2 Copyright(C) 2015 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 #include "grn_scanner.h"cxx . . $ `<file>/lib/grn_scanner.h`/
21
22 grn_scannercxx . . $ grn_scanner# *
23 grn_scanner_opencxx . . $ grn_scanner_open(ae11df7c1ca81200).(grn_ctxcxx . . $ grn_ctx# *ctx,
24 grn_objcxx . . $ grn_obj# *expr,
25 grn_operatorcxx . . $ grn_operator# op,
26 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! record_exist)
27 {
28 grn_scannercxx . . $ grn_scanner# *scanner;
29
30 scanner = GRN_CALLOCcxx . . $ `lib/grn_alloc.h:42:9`!(sizeof(grn_scanner));
31 if (!scanner) {
32 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
33 }
34
35 scanner->source_exprcxx . . $ _grn_scaner#source_expr. = expr;
36 scanner->exprcxx . . $ _grn_scaner#expr. = grn_expr_rewritecxx . . $ grn_expr_rewrite(e9f40e4080908c1e).(ctx, expr);
37 if (!scanner->exprcxx . . $ _grn_scaner#expr.) {
38 scanner->exprcxx . . $ _grn_scaner#expr. = expr;
39 }
40
41 scanner->siscxx . . $ _grn_scaner#sis. = grn_scan_info_buildcxx . . $ grn_scan_info_build(304ac4f45c240254).(ctx,
42 scanner->exprcxx . . $ _grn_scaner#expr.,
43 &(scanner->n_siscxx . . $ _grn_scaner#n_sis.),
44 op,
45 record_exist);
46 if (!scanner->siscxx . . $ _grn_scaner#sis.) {
47 grn_scanner_closecxx . . $ grn_scanner_close(2dbf622ff0b4532a).(ctx, scanner);
48 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
49 }
50
51 return scanner;
52 }
53
54 void
55 grn_scanner_closecxx . . $ grn_scanner_close(2dbf622ff0b4532a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_scannercxx . . $ grn_scanner# *scanner)
56 {
57 if (!scanner) {
58 return;
59 }
60
61 if (scanner->siscxx . . $ _grn_scaner#sis.) {
62 uint32_tcxx . . $ uint32_t# i;
63 for (i = 0; i < scanner->n_siscxx . . $ _grn_scaner#n_sis.; i++) {
64 grn_scan_info_closecxx . . $ grn_scan_info_close(927988dd72293474).(ctx, scanner->siscxx . . $ _grn_scaner#sis.[i]);
65 }
66 GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(scanner->sis);
67 }
68
69 if (scanner->exprcxx . . $ _grn_scaner#expr. != scanner->source_exprcxx . . $ _grn_scaner#source_expr.) {
70 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, scanner->exprcxx . . $ _grn_scaner#expr.);
71 }
72
73 GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(scanner);
74 }