Kouhei Sutou 2018-10-29 15:17:04 +0900 (Mon, 29 Oct 2018) Revision: 8805ebbe55805bfd6f9197f0ffe25bd5a46eeb7c https://github.com/groonga/groonga/commit/8805ebbe55805bfd6f9197f0ffe25bd5a46eeb7c Message: grn_obj_is_vector(): add a new API Modified files: include/groonga/obj.h lib/obj.c Modified: include/groonga/obj.h (+2 -0) =================================================================== --- include/groonga/obj.h 2018-10-29 11:35:45 +0900 (3e372e1e4) +++ include/groonga/obj.h 2018-10-29 15:17:04 +0900 (50d0daf05) @@ -1,6 +1,7 @@ /* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2015-2018 Brazil + Copyright(C) 2018 Kouhei Sutou <kou****@clear*****> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -36,6 +37,7 @@ GRN_API grn_bool grn_obj_is_builtin(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_bulk(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_text_family_bulk(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_number_family_bulk(grn_ctx *ctx, grn_obj *obj); +GRN_API grn_bool grn_obj_is_vector(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_table(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_lexicon(grn_ctx *ctx, grn_obj *obj); GRN_API grn_bool grn_obj_is_column(grn_ctx *ctx, grn_obj *obj); Modified: lib/obj.c (+11 -0) =================================================================== --- lib/obj.c 2018-10-29 11:35:45 +0900 (24b66dae6) +++ lib/obj.c 2018-10-29 15:17:04 +0900 (7bd63e2b2) @@ -1,6 +1,7 @@ /* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2015-2018 Brazil + Copyright(C) 2018 Kouhei Sutou <kou****@clear*****> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -110,6 +111,16 @@ grn_obj_is_number_family_bulk(grn_ctx *ctx, grn_obj *obj) } grn_bool +grn_obj_is_vector(grn_ctx *ctx, grn_obj *obj) +{ + if (!obj) { + return GRN_FALSE; + } + + return obj->header.type == GRN_VECTOR; +} + +grn_bool grn_obj_is_table(grn_ctx *ctx, grn_obj *obj) { grn_bool is_table = GRN_FALSE; -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181029/c5c2725f/attachment-0001.html>