26#define GRN_HASH_TINY (0x01 << 6)
34 unsigned int key_size,
35 unsigned int value_size,
48 unsigned int key_size,
55 unsigned int key_size,
78 unsigned int key_size,
88 unsigned int min_size,
90 unsigned int max_size,
113 unsigned int *key_size,
121#define GRN_HASH_EACH(ctx, hash, id, key, key_size, value, block) \
123 grn_hash_cursor *_sc = NULL; \
124 if (hash && grn_hash_size(ctx, hash) > 0) { \
125 _sc = grn_hash_cursor_open(ctx, hash, NULL, 0, NULL, 0, 0, -1, 0); \
129 while ((id = grn_hash_cursor_next(ctx, _sc))) { \
130 grn_hash_cursor_get_key_value(ctx, \
137 grn_hash_cursor_close(ctx, _sc); \
141#define GRN_HASH_EACH_BEGIN(ctx, hash, cursor, id) \
143 grn_hash_cursor *cursor = NULL; \
144 if (hash && grn_hash_size(ctx, hash) > 0) { \
145 cursor = grn_hash_cursor_open((ctx), \
157 while ((id = grn_hash_cursor_next((ctx), cursor)) != GRN_ID_NIL) {
159#define GRN_HASH_EACH_END(ctx, cursor) \
161 grn_hash_cursor_close((ctx), cursor); \
grn_rc
Definition groonga.h:61
uint32_t grn_id
Definition groonga.h:44
#define GRN_API
Definition groonga.h:39
GRN_API int grn_hash_cursor_get_key(grn_ctx *ctx, grn_hash_cursor *c, void **key)
GRN_API grn_id grn_hash_get(grn_ctx *ctx, grn_hash *hash, const void *key, unsigned int key_size, void **value)
GRN_API uint32_t grn_hash_size(grn_ctx *ctx, grn_hash *hash)
GRN_API void grn_hash_cursor_close(grn_ctx *ctx, grn_hash_cursor *c)
GRN_API int grn_hash_cursor_get_value(grn_ctx *ctx, grn_hash_cursor *c, void **value)
GRN_API int grn_hash_get_key(grn_ctx *ctx, grn_hash *hash, grn_id id, void *keybuf, int bufsize)
GRN_API grn_hash_cursor * grn_hash_cursor_open(grn_ctx *ctx, grn_hash *hash, const void *min, unsigned int min_size, const void *max, unsigned int max_size, int offset, int limit, int flags)
GRN_API grn_rc grn_hash_cursor_delete(grn_ctx *ctx, grn_hash_cursor *c, grn_table_delete_optarg *optarg)
GRN_API grn_rc grn_hash_set_value(grn_ctx *ctx, grn_hash *hash, grn_id id, const void *value, int flags)
GRN_API int grn_hash_get_key2(grn_ctx *ctx, grn_hash *hash, grn_id id, grn_obj *bulk)
struct _grn_hash_cursor grn_hash_cursor
Definition hash.h:29
GRN_API int grn_hash_cursor_get_key_value(grn_ctx *ctx, grn_hash_cursor *c, void **key, unsigned int *key_size, void **value)
GRN_API grn_rc grn_hash_delete(grn_ctx *ctx, grn_hash *hash, const void *key, unsigned int key_size, grn_table_delete_optarg *optarg)
GRN_API grn_id grn_hash_add(grn_ctx *ctx, grn_hash *hash, const void *key, unsigned int key_size, void **value, int *added)
GRN_API grn_rc grn_hash_close(grn_ctx *ctx, grn_hash *hash)
GRN_API grn_hash * grn_hash_open(grn_ctx *ctx, const char *path)
GRN_API grn_rc grn_hash_delete_by_id(grn_ctx *ctx, grn_hash *hash, grn_id id, grn_table_delete_optarg *optarg)
GRN_API grn_rc grn_hash_cursor_set_value(grn_ctx *ctx, grn_hash_cursor *c, const void *value, int flags)
GRN_API grn_id grn_hash_cursor_next(grn_ctx *ctx, grn_hash_cursor *c)
GRN_API grn_hash * grn_hash_create(grn_ctx *ctx, const char *path, unsigned int key_size, unsigned int value_size, unsigned int flags)
struct _grn_hash grn_hash
Definition hash.h:28
GRN_API int grn_hash_get_value(grn_ctx *ctx, grn_hash *hash, grn_id id, void *valuebuf)
Definition groonga.h:3329