# mcorest_api_json_write_bool

Write a boolean value.

### For an overview see page mcorest_api_json_write_*

### Prototype

        MCO_RET mcorest_api_json_write_bool( mcorest_api_json_write_ctx_t *ctx, int b );

### Arguments

ctx | Pointer to the JSON write context structure
b | Boolean value to write; interpreted as `true` if non-zero, `false` otherwise

### Description

This function writes a boolean value.

### Return Codes

MCO_S_OK = 0 | Success
MCO_E_REST_* | Any of the Web Services Error Codes

### Example

        static void print_bool(mcorest_api_json_write_ctx_t *jctx,
                        int b)
        {
            mcorest_api_json_write_object_begin(jctx);
            mcorest_api_json_write_key(jctx, "boolean_value");
            mcorest_api_json_write_bool(jctx, b);
            ...
            mcorest_api_json_write_object_end(jctx);
            ...
        }

### Files

Header file:
mcorestapi.h
Source file:
jsonwr.c
Library:
libmcorest.a