Yasuhiro Horimoto
null+****@clear*****
Tue Apr 24 15:32:20 JST 2018
Yasuhiro Horimoto 2018-04-24 15:32:20 +0900 (Tue, 24 Apr 2018) New Revision: cba010cbcff39b95a3798890d667002e569e9c19 https://github.com/groonga/groonga/commit/cba010cbcff39b95a3798890d667002e569e9c19 Merged 63e0b56: ii: add log enhancements that output contents of a token (#840) Message: ii: modify to a static function Beacuse this function should not be exported. Modified files: include/groonga/ii.h lib/ii.c Modified: include/groonga/ii.h (+0 -2) =================================================================== --- include/groonga/ii.h 2018-04-23 12:42:37 +0900 (2219e8543) +++ include/groonga/ii.h 2018-04-24 15:32:20 +0900 (11452021a) @@ -55,8 +55,6 @@ GRN_API grn_rc grn_ii_posting_add(grn_ctx *ctx, grn_posting *pos, grn_hash *s, grn_operator op); GRN_API void grn_ii_resolve_sel_and(grn_ctx *ctx, grn_hash *s, grn_operator op); -GRN_API void grn_ii_get_token_from_token_id(grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_obj *token); - /* Experimental */ typedef struct _grn_ii_cursor grn_ii_cursor; GRN_API grn_ii_cursor *grn_ii_cursor_open(grn_ctx *ctx, grn_ii *ii, grn_id tid, Modified: lib/ii.c (+19 -17) =================================================================== --- lib/ii.c 2018-04-23 12:42:37 +0900 (877659caa) +++ lib/ii.c 2018-04-24 15:32:20 +0900 (a825ad0d1) @@ -104,6 +104,24 @@ static uint32_t grn_ii_max_n_segments_small = MAX_PSEG_SMALL; static uint32_t grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK_SMALL; static int64_t grn_ii_reduce_expire_threshold = 32; +static void +grn_ii_get_token_from_token_id(grn_ctx *ctx, grn_ii *ii, + grn_id tid, grn_obj *token) +{ + grn_obj key_buf; + char key[GRN_TABLE_MAX_KEY_SIZE]; + int key_size; + GRN_TEXT_INIT(token, 0); + key_size = grn_table_get_key(ctx, ii->lexicon, tid, + key, GRN_TABLE_MAX_KEY_SIZE); + if (key_size != 0) { + GRN_OBJ_INIT(&key_buf, GRN_BULK, 0, ii->lexicon->header.domain); + GRN_TEXT_SET(ctx, &key_buf, key, key_size); + grn_inspect(ctx, token, &key_buf); + GRN_OBJ_FIN(ctx, &key_buf); + } +} + void grn_ii_init_from_env(void) { @@ -13174,20 +13192,4 @@ grn_ii_build2(grn_ctx *ctx, grn_ii *ii, const grn_ii_builder_options *options) return rc; } -void -grn_ii_get_token_from_token_id(grn_ctx *ctx, grn_ii *ii, - grn_id tid, grn_obj *token) -{ - grn_obj key_buf; - char key[GRN_TABLE_MAX_KEY_SIZE]; - int key_size; - GRN_TEXT_INIT(token, 0); - key_size = grn_table_get_key(ctx, ii->lexicon, tid, - key, GRN_TABLE_MAX_KEY_SIZE); - if (key_size != 0) { - GRN_OBJ_INIT(&key_buf, GRN_BULK, 0, ii->lexicon->header.domain); - GRN_TEXT_SET(ctx, &key_buf, key, key_size); - grn_inspect(ctx, token, &key_buf); - GRN_OBJ_FIN(ctx, &key_buf); - } -} + -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180424/63d2775a/attachment-0001.htm