Kouhei Sutou
null+****@clear*****
Wed Feb 1 11:55:22 JST 2017
Kouhei Sutou 2017-02-01 11:55:22 +0900 (Wed, 01 Feb 2017) New Revision: 068963737e74c1f1763f96a11a844042d50c8449 https://github.com/groonga/groonga/commit/068963737e74c1f1763f96a11a844042d50c8449 Message: Add grn_window_is_sorted() predicate It returns true iif the window is sorted. Modified files: include/groonga/window_function.h lib/window_function.c Modified: include/groonga/window_function.h (+2 -0) =================================================================== --- include/groonga/window_function.h 2017-02-01 10:42:20 +0900 (500638f) +++ include/groonga/window_function.h 2017-02-01 11:55:22 +0900 (b01fb5e) @@ -38,6 +38,8 @@ GRN_API grn_rc grn_window_set_direction(grn_ctx *ctx, grn_window_direction direction); GRN_API grn_obj *grn_window_get_table(grn_ctx *ctx, grn_window *window); +GRN_API grn_bool grn_window_is_sorted(grn_ctx *ctx, + grn_window *window); typedef struct _grn_window_definition { grn_table_sort_key *sort_keys; Modified: lib/window_function.c (+9 -0) =================================================================== --- lib/window_function.c 2017-02-01 10:42:20 +0900 (4989ce8) +++ lib/window_function.c 2017-02-01 11:55:22 +0900 (faade68) @@ -241,6 +241,15 @@ grn_window_set_sort_keys(grn_ctx *ctx, GRN_API_RETURN(GRN_SUCCESS); } +grn_bool +grn_window_is_sorted(grn_ctx *ctx, grn_window *window) +{ + grn_bool is_sorted; + GRN_API_ENTER; + is_sorted = (window && window->n_sort_keys > 0); + GRN_API_RETURN(is_sorted); +} + grn_obj * grn_window_function_create(grn_ctx *ctx, const char *name, -------------- next part -------------- HTML����������������������������... Descargar