1 /*
2   Copyright(C) 2009-2018  Brazil
3   Copyright(C) 2020  Sutou Kouhei <kou@clear-code.com>
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 module groonga_d.posting;
20 
21 
22 private static import groonga_d.groonga;
23 
24 extern(C):
25 nothrow @nogc:
26 
27 struct grn_posting
28 {
29 	groonga_d.groonga.grn_id rid;
30 	uint sid;
31 	uint pos;
32 	uint tf;
33 	uint weight;
34 	uint rest;
35 }
36 
37 //GRN_API
38 grn_posting* grn_posting_open(groonga_d.groonga.grn_ctx* ctx);
39 
40 //GRN_API
41 void grn_posting_close(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
42 
43 //GRN_API
44 groonga_d.groonga.grn_id grn_posting_get_record_id(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
45 
46 //GRN_API
47 uint grn_posting_get_section_id(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
48 
49 //GRN_API
50 uint grn_posting_get_position(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
51 
52 //GRN_API
53 uint grn_posting_get_tf(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
54 
55 //GRN_API
56 uint grn_posting_get_weight(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
57 
58 //GRN_API
59 float grn_posting_get_weight_float(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
60 
61 //GRN_API
62 uint grn_posting_get_rest(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting);
63 
64 //GRN_API
65 void grn_posting_set_weight(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting, uint weight);
66 
67 //GRN_API
68 void grn_posting_set_weight_float(groonga_d.groonga.grn_ctx* ctx, grn_posting* posting, float weight);