1/* -*- c-basic-offset: 2 -*- */
2/*
3 Copyright(C) 2015-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 version 2.1 as published by the Free Software Foundation.
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#pragma once
20
21#include "../grn.h"
22
23#include "ts_buf.h"
24#include "ts_cursor.h"
25#include "ts_expr.h"
26#include "ts_sorter.h"
27#include "ts_types.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33typedef struct {
34 int REMOVE_ME;
35} grn_ts_plan_node;
36
37typedef struct {
38 grn_obj *table;
39 grn_ts_plan_node *root;
40} grn_ts_plan;
41
42/* grn_ts_plan_open() creates a plan. */
43grn_rc grn_ts_plan_open(grn_ctx *ctx, grn_obj *table, grn_ts_plan_node *root,
44 grn_ts_plan **plan);
45
46/* grn_ts_plan_close() destroys a plan. */
47grn_rc grn_ts_plan_close(grn_ctx *ctx, grn_ts_plan *plan);
48
49/* grn_ts_plan_exec() executes a plan. */
50grn_rc grn_ts_plan_exec(grn_ctx *ctx, grn_ts_plan *plan,
51 grn_ts_rbuf *rbuf, size_t *n_hits);
52
53typedef struct {
54 grn_obj *table;
55} grn_ts_planner;
56
57/* grn_ts_planner_open() creates a planner. */
58grn_rc grn_ts_planner_open(grn_ctx *ctx, grn_obj *table,
59 grn_ts_planner **planner);
60
61/* grn_ts_planner_close() destroys a planner. */
62grn_rc grn_ts_planner_close(grn_ctx *ctx, grn_ts_planner *planner);
63
64/* grn_ts_planner_complete() completes a planner. */
65grn_rc grn_ts_planner_complete(grn_ctx *ctx, grn_ts_planner *planner,
66 grn_ts_plan **plan);
67
68/* grn_ts_planner_push_cursor() pushes a cursor. */
69grn_rc grn_ts_planner_push_cursor(grn_ctx *ctx, grn_ts_planner *planner,
70 grn_ts_cursor *cursor);
71
72/* grn_ts_planner_push_filter() pushes a filter. */
73grn_rc grn_ts_planner_push_filter(grn_ctx *ctx, grn_ts_planner *planner,
74 grn_ts_expr *expr);
75
76/* grn_ts_planner_push_scorer() pushes a scorer. */
77grn_rc grn_ts_planner_push_scorer(grn_ctx *ctx, grn_ts_planner *planner,
78 grn_ts_expr *expr);
79
80/* grn_ts_planner_push_sorter() pushes a sorter. */
81grn_rc grn_ts_planner_push_sorter(grn_ctx *ctx, grn_ts_planner *planner,
82 grn_ts_sorter *sorter);
83
84#ifdef __cplusplus
85}
86#endif
87
88