Kouhei Sutou
null+****@clear*****
Wed May 18 00:16:33 JST 2016
Kouhei Sutou 2016-05-18 00:16:33 +0900 (Wed, 18 May 2016) New Revision: b5570437f5bf55c72150611b29f130aa78905c25 https://github.com/groonga/groonga/commit/b5570437f5bf55c72150611b29f130aa78905c25 Message: Add GRN_ARRAY_EACH_BEGIN/END API Modified files: include/groonga/array.h Modified: include/groonga/array.h (+13 -0) =================================================================== --- include/groonga/array.h 2016-05-18 00:16:16 +0900 (cec1374) +++ include/groonga/array.h 2016-05-18 00:16:33 +0900 (9c5e5c0) @@ -71,6 +71,19 @@ GRN_API void *_grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id); }\ } while (0) +#define GRN_ARRAY_EACH_BEGIN(ctx, array, cursor, head, tail, id) do {\ + grn_array_cursor *cursor;\ + cursor = grn_array_cursor_open((ctx), (array), (head), (tail), 0, -1, 0);\ + if (cursor) {\ + grn_id id;\ + while ((id = grn_array_cursor_next(ctx, cursor))) { + +#define GRN_ARRAY_EACH_END(ctx, cursor)\ + }\ + grn_array_cursor_close(ctx, cursor);\ + }\ +} while (0) + #ifdef __cplusplus } #endif -------------- next part -------------- HTML����������������������������...下载