| 1 | /* |
| 2 | Copyright (C) 2025 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.h" |
| 22 | #include "grn_ctx_impl.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | struct _grn_sorter_data { |
| 29 | grn_obj *table; |
| 30 | size_t offset; |
| 31 | size_t limit; |
| 32 | grn_table_sort_key *keys; |
| 33 | size_t n_keys; |
| 34 | grn_obj *result; |
| 35 | grn_obj *sorter; |
| 36 | grn_obj args; |
| 37 | }; |
| 38 | |
| 39 | bool |
| 40 | grn_sorter_data_init(grn_ctx *ctx, |
| 41 | grn_sorter_data *data, |
| 42 | grn_obj *table, |
| 43 | size_t offset, |
| 44 | size_t limit, |
| 45 | grn_table_sort_key *keys, |
| 46 | size_t n_keys, |
| 47 | grn_obj *result); |
| 48 | void |
| 49 | grn_sorter_data_fin(grn_ctx *ctx, grn_sorter_data *data); |
| 50 | |
| 51 | grn_rc |
| 52 | grn_sorter_data_run(grn_ctx *ctx, grn_sorter_data *data); |
| 53 | |
| 54 | #ifdef __cplusplus |
| 55 | } |
| 56 | #endif |