Kouhei Sutou
null+****@clear*****
Wed May 18 00:16:16 JST 2016
Kouhei Sutou 2016-05-18 00:16:16 +0900 (Wed, 18 May 2016) New Revision: 8964eabbbd3feef521cb2bad2ad1552483f63cec https://github.com/groonga/groonga/commit/8964eabbbd3feef521cb2bad2ad1552483f63cec Message: Add GRN_TABLE_EACH_BEGIN/END API Modified files: include/groonga/table.h Modified: include/groonga/table.h (+18 -0) =================================================================== --- include/groonga/table.h 2016-05-17 21:59:12 +0900 (cc5389f) +++ include/groonga/table.h 2016-05-18 00:16:16 +0900 (0c57d56) @@ -113,6 +113,24 @@ GRN_API grn_posting *grn_index_cursor_next(grn_ctx *ctx, grn_obj *ic, grn_id *ti }\ } while (0) +#define GRN_TABLE_EACH_BEGIN(ctx, table, cursor, id) do {\ + if (table) {\ + grn_table_cursor *cursor;\ + cursor = grn_table_cursor_open((ctx), (table),\ + NULL, 0,\ + NULL, 0,\ + 0, -1, GRN_CURSOR_ASCENDING);\ + if (cursor) {\ + grn_id id;\ + while ((id = grn_table_cursor_next((ctx), cursor))) { + +#define GRN_TABLE_EACH_END(ctx, cursor)\ + }\ + grn_table_cursor_close((ctx), cursor);\ + }\ + }\ +} while (0) + typedef struct _grn_table_sort_key grn_table_sort_key; typedef unsigned char grn_table_sort_flags; -------------- next part -------------- HTML����������������������������...Download