# mcorest_api_json_read_long

Read a numeric JSON value and convert it to a `long`.

### For an overview see page mcorest_api_json_read_*

### Prototype

        MCO_RET mcorest_api_json_read_long( mcorest_api_json_read_ctx_t *ctx, long *val );

### Arguments

ctx | Pointer to the JSON read context structure
val | The address of a `long`

### Description

> This function reads a numeric JSON value and converts it to a `long`. It is a convenience wrapper for `mcorest_api_json_read_numeric()` and `mcorest_api_json_numeric_as_long().`

### Return Codes

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

### Example

        static void read_long(mcorest_api_json_write_ctx_t *jctx,
                        long *pL)
        {
            ...
            mcorest_api_json_read_object_begin(jctx);
            ...
            mcorest_api_json_read_long(jctx, pL);
            ...
            mcorest_api_json_read_object_end(jctx);
            ...
        }

### Files

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