Navigation Menu

Skip to content

Commit

Permalink
Export NULL output feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 20, 2015
1 parent 79c7ddb commit ea0f065
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/groonga/output.h
Expand Up @@ -76,6 +76,7 @@ GRN_API void grn_ctx_output_array_close(grn_ctx *ctx);
GRN_API void grn_ctx_output_map_open(grn_ctx *ctx,
const char *name, int nelements);
GRN_API void grn_ctx_output_map_close(grn_ctx *ctx);
GRN_API void grn_ctx_output_null(grn_ctx *ctx);
GRN_API void grn_ctx_output_int32(grn_ctx *ctx, int value);
GRN_API void grn_ctx_output_int64(grn_ctx *ctx, int64_t value);
GRN_API void grn_ctx_output_uint64(grn_ctx *ctx, uint64_t value);
Expand Down
6 changes: 6 additions & 0 deletions lib/ctx.c
Expand Up @@ -2755,6 +2755,12 @@ grn_ctx_output_map_close(grn_ctx *ctx)
grn_output_map_close(ctx, ctx->impl->outbuf, ctx->impl->output_type);
}

void
grn_ctx_output_null(grn_ctx *ctx)
{
grn_output_null(ctx, ctx->impl->outbuf, ctx->impl->output_type);
}

void
grn_ctx_output_int32(grn_ctx *ctx, int value)
{
Expand Down
4 changes: 4 additions & 0 deletions lib/grn_output.h
Expand Up @@ -32,6 +32,8 @@ GRN_API void grn_output_array_close(grn_ctx *ctx, grn_obj *outbuf, grn_content_t
GRN_API void grn_output_map_open(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
const char *name, int nelements);
GRN_API void grn_output_map_close(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type);
GRN_API void grn_output_null(grn_ctx *ctx, grn_obj *outbuf,
grn_content_type output_type);
void grn_output_int32(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
int32_t value);
GRN_API void grn_output_int64(grn_ctx *ctx, grn_obj *outbuf,
Expand Down Expand Up @@ -74,6 +76,8 @@ grn_rc grn_output_format_set_columns(grn_ctx *ctx, grn_obj_format *format,
(grn_ctx_output_map_open(ctx, name, nelements))
#define GRN_OUTPUT_MAP_CLOSE() \
(grn_ctx_output_map_close(ctx))
#define GRN_OUTPUT_NULL() \
(grn_ctx_output_null(ctx))
#define GRN_OUTPUT_INT32(value) \
(grn_ctx_output_int32(ctx, value))
#define GRN_OUTPUT_INT64(value) \
Expand Down
2 changes: 1 addition & 1 deletion lib/output.c
Expand Up @@ -397,7 +397,7 @@ grn_output_bool(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn
INCR_LENGTH;
}

static inline void
void
grn_output_null(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type)
{
put_delimiter(ctx, outbuf, output_type);
Expand Down

0 comments on commit ea0f065

Please sign in to comment.