|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The card. More...
#include <kst_store.h>
Data Fields | |
| void * | ctx |
| bool(*) | mounted (void *ctx) |
| Whether a card is mounted. | |
| bool(*) | walk (void *ctx, kst_store_visit_fn visit, void *visit_ctx) |
Call visit for every entry of the directory, files and directories, once each. | |
| int32_t(*) | size (void *ctx, const char *name) |
| Size of a file in bytes; -1 when no file has that name. | |
| int32_t(*) | read (void *ctx, const char *name, char *buf, size_t cap) |
Up to cap bytes from the start of the file. | |
| kst_store_io_result_t(*) | create (void *ctx, const char *name, const char *data, size_t len) |
Create the directory when it is missing, create the file and fail when the name exists, write len bytes, commit them to the card and close. | |
The card.
Every name is a name inside KST_STORE_DIR. All 5 functions are set.
| void* kst_store_io_t::ctx |
passed to every function
| int32_t(*) kst_store_io_t::read(void *ctx, const char *name, char *buf, size_t cap) |
Up to cap bytes from the start of the file.
Returns the count, -1 on a failure.
| bool(*) kst_store_io_t::walk(void *ctx, kst_store_visit_fn visit, void *visit_ctx) |
Call visit for every entry of the directory, files and directories, once each.
A directory that does not exist has no entry. False when the directory does not read to its end.