| 1 | /* |
| 2 | Copyright(C) 2019-2021 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 | #pragma once |
| 20 | |
| 21 | #include "grn_window_function.h" |
| 22 | |
| 23 | #ifdef __cplusplus |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
| 27 | void |
| 28 | grn_window_function_executor_init_from_env(void); |
| 29 | |
| 30 | struct _grn_window_function_executor { |
| 31 | grn_obj tag; |
| 32 | grn_obj tables; |
| 33 | grn_obj is_context_tables; |
| 34 | grn_obj source; |
| 35 | grn_obj sort_keys; |
| 36 | grn_obj group_keys; |
| 37 | grn_obj output_column_name; |
| 38 | struct { |
| 39 | grn_table_sort_key *sort_keys; |
| 40 | size_t n_sort_keys; |
| 41 | grn_table_sort_key *group_keys; |
| 42 | size_t n_group_keys; |
| 43 | grn_table_sort_key *window_sort_keys; |
| 44 | size_t n_window_sort_keys; |
| 45 | grn_obj key_columns; |
| 46 | grn_obj *sorted; |
| 47 | } context; |
| 48 | struct { |
| 49 | size_t n; |
| 50 | grn_obj *previous; |
| 51 | grn_obj *current; |
| 52 | } values; |
| 53 | grn_obj window_function_calls; |
| 54 | grn_obj output_columns; |
| 55 | grn_window window; |
| 56 | }; |
| 57 | |
| 58 | grn_rc |
| 59 | grn_window_function_executor_init(grn_ctx *ctx, |
| 60 | grn_window_function_executor *executor); |
| 61 | grn_rc |
| 62 | grn_window_function_executor_fin(grn_ctx *ctx, |
| 63 | grn_window_function_executor *executor); |
| 64 | |
| 65 | |
| 66 | #ifdef __cplusplus |
| 67 | } |
| 68 | #endif |