Function anjay_ret_bytes

Function Documentation

int anjay_ret_bytes(anjay_output_ctx_t *ctx, const void *data, size_t length)

Returns a blob of data from the data model handler.

Note: this should be used only for small, self-contained chunks of data. See anjay_ret_bytes_begin documentation for a recommended method of returning large data blobs.

Parameters:
  • ctx – Context to operate on.

  • data – Data buffer.

  • length – Number of bytes available in the data buffer.

Returns:

0 on success, a negative value in case of error.