SavedStruct - data serialization/de-serialization.
More...
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
|
bool | saved_struct_load (const char *path, void *data, size_t size, uint8_t magic, uint8_t version) |
| Load data from the file in saved structure format.
|
|
bool | saved_struct_save (const char *path, const void *data, size_t size, uint8_t magic, uint8_t version) |
| Save data in saved structure format.
|
|
bool | saved_struct_get_metadata (const char *path, uint8_t *magic, uint8_t *version, size_t *payload_size) |
| Get SavedStructure file metadata.
|
|
SavedStruct - data serialization/de-serialization.
◆ saved_struct_get_metadata()
bool saved_struct_get_metadata |
( |
const char * | path, |
|
|
uint8_t * | magic, |
|
|
uint8_t * | version, |
|
|
size_t * | payload_size ) |
Get SavedStructure file metadata.
- Parameters
-
[in] | path | The path to the file |
[out] | magic | Pointer to store magic or NULL if you don't need it |
[out] | version | Pointer to store version or NULL if you don't need it |
[out] | payload_size | Pointer to store payload size or NULL if you don't need it |
- Returns
- true on success, false otherwise
◆ saved_struct_load()
bool saved_struct_load |
( |
const char * | path, |
|
|
void * | data, |
|
|
size_t | size, |
|
|
uint8_t | magic, |
|
|
uint8_t | version ) |
Load data from the file in saved structure format.
- Parameters
-
[in] | path | The path to the file |
[out] | data | Pointer to the memory where to load data |
[in] | size | The size of the data |
[in] | magic | The magic to embed into metadata |
[in] | version | The version to embed into metadata |
- Returns
- true on success, false otherwise
◆ saved_struct_save()
bool saved_struct_save |
( |
const char * | path, |
|
|
const void * | data, |
|
|
size_t | size, |
|
|
uint8_t | magic, |
|
|
uint8_t | version ) |
Save data in saved structure format.
- Parameters
-
[in] | path | The path to the file |
[in] | data | Pointer to the memory where data |
[in] | size | The size of the data |
[in] | magic | The magic to embed into metadata |
[in] | version | The version to embed into metadata |
- Returns
- true on success, false otherwise