Debian Codegraph @

lib/posting.c

raw symbols SCIP
1 /*
2 Copyright(C) 2020-2022 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 "grn_ctx.h"cxx . . $ `<file>/lib/grn_ctx.h`/
20 #include "grn_posting.h"cxx . . $ `<file>/lib/grn_posting.h`/
21
22 grn_postingcxx . . $ grn_posting# *
23 grn_posting_opencxx . . $ grn_posting_open(2e656cf4ebf9c135).(grn_ctxcxx . . $ grn_ctx# *ctx)
24 {
25 GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!;
26 grn_postingcxx . . $ grn_posting# *posting = GRN_CALLOCcxx . . $ `lib/grn_alloc.h:42:9`!(sizeof(grn_posting_internal));
27 if (!posting) {
28 ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, "[posting][open] failed to allocate");
29 }
30 GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(posting);
31 }
32
33 void
34 grn_posting_closecxx . . $ grn_posting_close(de50357151a74926).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
35 {
36 GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!;
37 GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(posting);
38 GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!();
39 }
40
41 grn_idcxx . . $ grn_id#
42 grn_posting_get_record_idcxx . . $ grn_posting_get_record_id(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
43 {
44 return posting->ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid.;
45 }
46
47 uint32_tcxx . . $ uint32_t#
48 grn_posting_get_section_idcxx . . $ grn_posting_get_section_id(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
49 {
50 return posting->sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid.;
51 }
52
53 uint32_tcxx . . $ uint32_t#
54 grn_posting_get_positioncxx . . $ grn_posting_get_position(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
55 {
56 return posting->poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos.;
57 }
58
59 uint32_tcxx . . $ uint32_t#
60 grn_posting_get_tfcxx . . $ grn_posting_get_tf(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
61 {
62 return posting->tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf.;
63 }
64
65 uint32_tcxx . . $ uint32_t#
66 grn_posting_get_weightcxx . . $ grn_posting_get_weight(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
67 {
68 return posting->weightcxx . . $ $anonymous_type_abfcd92361d8c963_0#weight.;
69 }
70
71 float
72 grn_posting_get_weight_floatcxx . . $ grn_posting_get_weight_float(68b6c1d030155457).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
73 {
74 return ((grn_posting_internalcxx . . $ grn_posting_internal# *)posting)->weight_floatcxx . . $ $anonymous_type_fe7b80c5b60468ac_0#weight_float.;
75 }
76
77 uint32_tcxx . . $ uint32_t#
78 grn_posting_get_restcxx . . $ grn_posting_get_rest(462ba5da4123809c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting)
79 {
80 return posting->restcxx . . $ $anonymous_type_abfcd92361d8c963_0#rest.;
81 }
82
83 void
84 grn_posting_set_weightcxx . . $ grn_posting_set_weight(cdae123e0b59b59b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting, uint32_tcxx . . $ uint32_t# weight)
85 {
86 posting->weightcxx . . $ $anonymous_type_abfcd92361d8c963_0#weight. = weight;
87 ((grn_posting_internalcxx . . $ grn_posting_internal# *)posting)->weight_floatcxx . . $ $anonymous_type_fe7b80c5b60468ac_0#weight_float. = (float)weight;
88 }
89
90 void
91 grn_posting_set_weight_floatcxx . . $ grn_posting_set_weight_float(4923ca15f5cbce70).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_postingcxx . . $ grn_posting# *posting, float weight)
92 {
93 posting->weightcxx . . $ $anonymous_type_abfcd92361d8c963_0#weight. = (uint32_tcxx . . $ uint32_t#)weight;
94 ((grn_posting_internalcxx . . $ grn_posting_internal# *)posting)->weight_floatcxx . . $ $anonymous_type_fe7b80c5b60468ac_0#weight_float. = weight;
95 }