CYAML Internals
Functions
data.h File Reference

CYAML functions for manipulating client data structures. More...

#include "cyaml/cyaml.h"
#include "util.h"
Include dependency graph for data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static cyaml_err_t cyaml_data_write (uint64_t value, uint64_t entry_size, uint8_t *data_tgt)
 
static void cyaml_data_write_pointer (const void *ptr, uint8_t *data_target)
 
static uint64_t cyaml_data_read (uint64_t entry_size, const uint8_t *data, cyaml_err_t *error_out)
 
static uint8_t * cyaml_data_read_pointer (const uint8_t *data)
 

Detailed Description

CYAML functions for manipulating client data structures.

Function Documentation

◆ cyaml_data_read()

static uint64_t cyaml_data_read ( uint64_t  entry_size,
const uint8_t *  data,
cyaml_err_t error_out 
)
inlinestatic

Read a value of up to eight bytes from data.

Parameters
[in]entry_sizeThe number of bytes to read.
[in]dataThe address to read from.
[out]error_outReturns the error code. CYAML_OK on success, or appropriate error otherwise.
Returns
On success, returns the value read from data. On failure, returns 0.

◆ cyaml_data_read_pointer()

static uint8_t* cyaml_data_read_pointer ( const uint8_t *  data)
inlinestatic

Read a pointer from data.

This is a wrapper for cyaml_data_read that does a compile time assertion on the pointer size, so it can never return a runtime error.

Parameters
[in]dataThe address to read from.
Returns
Returns the value read from data.

◆ cyaml_data_write()

static cyaml_err_t cyaml_data_write ( uint64_t  value,
uint64_t  entry_size,
uint8_t *  data_tgt 
)
inlinestatic

Write a value of up to eight bytes to data_target.

Parameters
[in]valueThe value to write.
[in]entry_sizeThe number of bytes of value to write.
[in]data_tgtThe address to write to.
Returns
CYAML_OK on success, or appropriate error code otherwise.

◆ cyaml_data_write_pointer()

static void cyaml_data_write_pointer ( const void *  ptr,
uint8_t *  data_target 
)
inlinestatic

Write a pointer to data.

This is a wrapper for cyaml_data_write that does a compile time assertion on the pointer size, so it can never return a runtime error.

Parameters
[in]ptrThe pointer address to write.
[in]data_targetThe address to write to.