|
typedef uint8_t | vs_storage_element_id_t[VS_STORAGE_ELEMENT_ID_MAX] |
|
typedef void * | vs_storage_impl_data_ctx_t |
| File context. More...
|
|
typedef void * | vs_storage_file_t |
| File descriptor. More...
|
|
typedef vs_status_e(* | vs_storage_deinit_hal_t) (vs_storage_impl_data_ctx_t storage_ctx) |
| Destroy storage context. More...
|
|
typedef vs_storage_file_t(* | vs_storage_open_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
| Open storage element. More...
|
|
typedef vs_status_e(* | vs_rpi_storage_sync_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file) |
| Synchronise storage element. More...
|
|
typedef vs_status_e(* | vs_storage_close_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, vs_storage_file_t file) |
| Close storage element. More...
|
|
typedef vs_status_e(* | vs_storage_save_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file, size_t offset, const uint8_t *in_data, size_t data_sz) |
| Save storage element. More...
|
|
typedef vs_status_e(* | vs_storage_load_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file, size_t offset, uint8_t *out_data, size_t data_sz) |
| Load storage element. More...
|
|
typedef ssize_t(* | vs_storage_file_size_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
| Get storage element size. More...
|
|
typedef vs_status_e(* | vs_storage_del_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
| Delete storage element. More...
|
|
Storage HAL interface.
Storage is the base helper for communication with file system. Cache mechanism can be used.
Storage HAL Usage
Storage context vs_storage_op_ctx_t has storage specific data and calls implementation.
- Warning
- vs_storage_op_ctx_t has to be implemented by user. You can see an example of Storage context implementation for *NIX systems in vs_nix_storage_impl_func() in storage-nix-impl.c
Implementation has members listed below :
- open : opens data file and returns vs_storage_file_t file descriptor.
- sync : synchronizes cache (if present) with file storage.
- close : closes file.
- del : securely deletes data on the storage and in the memory if cache is used.
- size : returns file size or negative value in case of any error from vs_status_e list.
- load : loads data from storage to the memory.
- save : saves data from memory to the storage.
- deinit : destroys storage context.