Kouhei Sutou
null+****@clear*****
Mon May 2 18:16:43 JST 2016
Kouhei Sutou 2016-05-02 18:16:43 +0900 (Mon, 02 May 2016) New Revision: 7bf91380a72f30e1026a9483f20d47db47192b08 https://github.com/groonga/groonga/commit/7bf91380a72f30e1026a9483f20d47db47192b08 Message: Add internal utility function grn_p_record() Modified files: lib/grn_util.h lib/util.c Modified: lib/grn_util.h (+2 -0) =================================================================== --- lib/grn_util.h 2016-05-02 17:57:49 +0900 (24b4619) +++ lib/grn_util.h 2016-05-02 18:16:43 +0900 (08d77d1) @@ -29,6 +29,8 @@ GRN_API grn_rc grn_normalize_offset_and_limit(grn_ctx *ctx, int size, int *offse GRN_API char *grn_path_separator_to_system(char *dest, char *groonga_path); +void grn_p_record(grn_ctx *ctx, grn_obj *table, grn_id id); + /* * grn_mkstemp generates a unique filename from path_template, creates a * file with permissions 0600 and returns a open file desciptor for the file. Modified: lib/util.c (+11 -0) =================================================================== --- lib/util.c 2016-05-02 17:57:49 +0900 (beedfde) +++ lib/util.c 2016-05-02 18:16:43 +0900 (394ac1f) @@ -1324,6 +1324,17 @@ grn_p_expr_code(grn_ctx *ctx, grn_expr_code *code) grn_obj_unlink(ctx, &buffer); } +void +grn_p_record(grn_ctx *ctx, grn_obj *table, grn_id id) +{ + grn_obj record; + + GRN_RECORD_INIT(&record, 0, grn_obj_id(ctx, table)); + GRN_RECORD_SET(ctx, &record, id); + grn_p(ctx, &record); + GRN_OBJ_FIN(ctx, &record); +} + #ifdef WIN32 int grn_mkstemp(char *path_template) -------------- next part -------------- HTML����������������������������... Download