Loading...
Searching...
No Matches
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()

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

inline static

Read a value of up to eight bytes from data.

Parameters

  [in] | entry_size | The number of bytes to read.
  [in] | data | The address to read from.
  [out] | error_out | Returns 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()

uint8_t * cyaml_data_read_pointer | ( | const uint8_t * | data | ) |

inline static

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] | data | The address to read from.

Returns
  Returns the value read from data.

## cyaml_data_write()

cyaml_err_t cyaml_data_write | ( | uint64_t | value,
|  | uint64_t | entry_size,
|  | uint8_t * | data_tgt )

inline static

Write a value of up to eight bytes to data_target.

Parameters

  [in] | value | The value to write.
  [in] | entry_size | The number of bytes of value to write.
  [in] | data_tgt | The address to write to.

Returns
  CYAML_OK on success, or appropriate error code otherwise.

## cyaml_data_write_pointer()

void cyaml_data_write_pointer | ( | const void * | ptr,
|  | uint8_t * | data_target )

inline static

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] | ptr | The pointer address to write.
  [in] | data_target | The address to write to.