mcl_custom_data.h File Reference

Custom data module interface header file. More...

#include "mcl_common.h"
Include dependency graph for mcl_custom_data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct mcl_custom_data_t mcl_custom_data_t
 This struct is used for building the custom data type. More...
 
typedef struct mcl_json_t mcl_json_t
 This struct is used for json handling. More...
 

Functions

MCL_EXPORT E_MCL_ERROR_CODE mcl_custom_data_set_meta_details (mcl_custom_data_t *custom_data, const mcl_json_t *details)
 Adds a custom details object to custom_data. More...
 
MCL_EXPORT E_MCL_ERROR_CODE mcl_custom_data_set_payload (mcl_custom_data_t *custom_data, const mcl_uint8_t *content, mcl_size_t content_size)
 Sets payload contents. More...
 

Detailed Description

Custom data module interface header file.


Date
Jul 27, 2016 Meta and payload parts of custom data type are initialized and set by this module.

Definition in file mcl_custom_data.h.

Typedef Documentation

This struct is used for building the custom data type.

Definition at line 29 of file mcl_custom_data.h.

typedef struct mcl_json_t mcl_json_t

This struct is used for json handling.

Definition at line 34 of file mcl_custom_data.h.

Function Documentation

MCL_EXPORT E_MCL_ERROR_CODE mcl_custom_data_set_meta_details ( mcl_custom_data_t custom_data,
const mcl_json_t details 
)

Adds a custom details object to custom_data.

Parameters
[in]custom_dataAll meta and payload details, content etc. stored in this data struct.
[in]detailsA custom json object to form meta details of custom_data. New memory space will be allocated for this parameter. Ownership passed to caller. Caller must free the space.
Returns

Definition at line 42 of file custom_data.c.

References ASSERT_NOT_NULL, DEBUG_ENTRY, DEBUG_LEAVE, json_util_duplicate(), and MCL_TRUE.

Referenced by mcl_stream_data_set_meta_details().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_EXPORT E_MCL_ERROR_CODE mcl_custom_data_set_payload ( mcl_custom_data_t custom_data,
const mcl_uint8_t content,
mcl_size_t  content_size 
)

Sets payload contents.

Warning
Destroying content is user's own responsibility. Avoid destroying content unless at least one of the following conditions are met.
  • Successful exchange.
  • Destroying store (mcl_store_destroy(&store)).
  • Destroying communication (mcl_communication_destroy(&communication)).
Parameters
[in]custom_dataAll meta and payload details, content etc. stored in this data struct.
[in]contentPayload content. Payload can contain binary data as well
[in]content_sizePayload content size.
Returns

Definition at line 57 of file custom_data.c.

References ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, DEBUG_ENTRY, DEBUG_LEAVE, MCL_INVALID_PARAMETER, and MCL_OK.