Navigation Menu

Skip to content

Commit

Permalink
Share common code
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 19, 2015
1 parent 3635a6a commit d731539
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/grn_db.h
Expand Up @@ -51,11 +51,13 @@ typedef struct {

#define GRN_RSET_N_SUBRECS(ri) ((ri)->n_subrecs & ~GRN_RSET_UTIL_BIT)

#define GRN_RSET_SUBREC_SIZE(subrec_size) \
(GRN_RSET_SCORE_SIZE + subrec_size)
#define GRN_RSET_SUBRECS_CMP(a,b,dir) (((a) - (b))*(dir))
#define GRN_RSET_SUBRECS_NTH(subrecs,size,n) \
((int *)((byte *)subrecs + n * (GRN_RSET_SCORE_SIZE + size)))
((int *)((byte *)subrecs + n * GRN_RSET_SUBREC_SIZE(size)))
#define GRN_RSET_SUBRECS_COPY(subrecs,size,n,src) \
(memcpy(GRN_RSET_SUBRECS_NTH(subrecs, size, n), src, GRN_RSET_SCORE_SIZE + size))
(memcpy(GRN_RSET_SUBRECS_NTH(subrecs, size, n), src, GRN_RSET_SUBREC_SIZE(size)))

#define GRN_JSON_LOAD_OPEN_BRACKET 0x40000000
#define GRN_JSON_LOAD_OPEN_BRACE 0x40000001
Expand Down

0 comments on commit d731539

Please sign in to comment.