Kouhei Sutou
null+****@clear*****
Tue Jul 19 16:00:32 JST 2016
Kouhei Sutou 2016-07-19 16:00:32 +0900 (Tue, 19 Jul 2016) New Revision: 7e74ca54f65afcec648f15716a8df4790c3d1ae9 https://github.com/groonga/groonga/commit/7e74ca54f65afcec648f15716a8df4790c3d1ae9 Message: Export index constants for serialized spec internally Modified files: lib/db.c lib/grn_db.h Modified: lib/db.c (+7 -14) =================================================================== --- lib/db.c 2016-07-19 16:00:05 +0900 (094519b) +++ lib/db.c 2016-07-19 16:00:32 +0900 (4c26aee) @@ -9771,19 +9771,12 @@ grn_db_obj_init(grn_ctx *ctx, grn_obj *db, grn_id id, grn_db_obj *obj) return rc; } -#define SERIALIZED_SPEC_INDEX_SPEC 0 -#define SERIALIZED_SPEC_INDEX_PATH 1 -#define SERIALIZED_SPEC_INDEX_SOURCE 2 -#define SERIALIZED_SPEC_INDEX_HOOK 3 -#define SERIALIZED_SPEC_INDEX_TOKEN_FILTERS 4 -#define SERIALIZED_SPEC_INDEX_EXPR 4 - #define GET_PATH(spec,buffer,s,id) do {\ if (spec->header.flags & GRN_OBJ_CUSTOM_NAME) {\ const char *path;\ unsigned int size = grn_vector_get_element(ctx,\ &v,\ - SERIALIZED_SPEC_INDEX_PATH,\ + GRN_SERIALIZED_SPEC_INDEX_PATH,\ &path,\ NULL,\ NULL);\ @@ -9804,7 +9797,7 @@ grn_db_obj_init(grn_ctx *ctx, grn_obj *db, grn_id id, grn_db_obj *obj) r->db = (grn_obj *)s;\ size = grn_vector_get_element(ctx,\ &v,\ - SERIALIZED_SPEC_INDEX_SOURCE,\ + GRN_SERIALIZED_SPEC_INDEX_SOURCE,\ &p,\ NULL,\ NULL);\ @@ -9816,7 +9809,7 @@ grn_db_obj_init(grn_ctx *ctx, grn_obj *db, grn_id id, grn_db_obj *obj) }\ size = grn_vector_get_element(ctx,\ &v,\ - SERIALIZED_SPEC_INDEX_HOOK,\ + GRN_SERIALIZED_SPEC_INDEX_HOOK,\ &p,\ NULL,\ NULL);\ @@ -9833,13 +9826,13 @@ grn_token_filters_unpack(grn_ctx *ctx, unsigned int element_size; unsigned int i, n_token_filter_ids; - if (grn_vector_size(ctx, spec_vector) <= SERIALIZED_SPEC_INDEX_TOKEN_FILTERS) { + if (grn_vector_size(ctx, spec_vector) <= GRN_SERIALIZED_SPEC_INDEX_TOKEN_FILTERS) { return; } element_size = grn_vector_get_element(ctx, spec_vector, - SERIALIZED_SPEC_INDEX_TOKEN_FILTERS, + GRN_SERIALIZED_SPEC_INDEX_TOKEN_FILTERS, (const char **)(&token_filter_ids), NULL, NULL); @@ -9935,7 +9928,7 @@ grn_ctx_at(grn_ctx *ctx, grn_id id) char buffer[PATH_MAX]; size = grn_vector_get_element(ctx, &v, - SERIALIZED_SPEC_INDEX_SPEC, + GRN_SERIALIZED_SPEC_INDEX_SPEC, (const char **)&spec, NULL, NULL); @@ -10010,7 +10003,7 @@ grn_ctx_at(grn_ctx *ctx, grn_id id) uint8_t *u; size = grn_vector_get_element(ctx, &v, - SERIALIZED_SPEC_INDEX_EXPR, + GRN_SERIALIZED_SPEC_INDEX_EXPR, &p, NULL, NULL); Modified: lib/grn_db.h (+7 -0) =================================================================== --- lib/grn_db.h 2016-07-19 16:00:05 +0900 (a3baec7) +++ lib/grn_db.h 2016-07-19 16:00:32 +0900 (aa29d61) @@ -53,6 +53,13 @@ struct _grn_db { grn_critical_section lock; }; +#define GRN_SERIALIZED_SPEC_INDEX_SPEC 0 +#define GRN_SERIALIZED_SPEC_INDEX_PATH 1 +#define GRN_SERIALIZED_SPEC_INDEX_SOURCE 2 +#define GRN_SERIALIZED_SPEC_INDEX_HOOK 3 +#define GRN_SERIALIZED_SPEC_INDEX_TOKEN_FILTERS 4 +#define GRN_SERIALIZED_SPEC_INDEX_EXPR 4 + typedef struct { grn_obj_header header; grn_id range; -------------- next part -------------- HTML����������������������������... 下載