|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Sandboxed file access on the plugins FAT partition. More...
Functions | |
| int | host_fs_write (const char *name, const uint8_t *data, size_t len) |
| Create or overwrite name with len bytes. | |
| int | host_fs_read (const char *name, uint8_t *buf, size_t *len) |
| Read name into buf. | |
| int | host_fs_remove (const char *name) |
| Delete name. | |
| int | host_fs_size (const char *name, size_t *out) |
| Write the byte size of name to *out. | |
| int | host_fs_list (char *out, size_t *out_len) |
| Enumerate the plugin's own files. | |
| int | host_fs_view (const char *name) |
| Open one of the plugin's own files in a scrollable on-screen text viewer (same as opening the file in the vFAT explorer). Useful for a bundled readme / help page. | |
Sandboxed file access on the plugins FAT partition.
Each plugin can only touch files in its own private folder; the host builds and confines every path. Requires the vFAT file storage (plugin-sandboxed) capability. name is a bare filename: characters [A-Za-z0-9._-], no path separators, no leading dot, at most 64 bytes.
| int host_fs_list | ( | char * | out, |
| size_t * | out_len ) |
Enumerate the plugin's own files.
| out_len | In: capacity of out; out: bytes written (' '-separated list). |
Definition at line 121 of file host_api_fs.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_fs_list().
| int host_fs_read | ( | const char * | name, |
| uint8_t * | buf, | ||
| size_t * | len ) |
Read name into buf.
| len | In: capacity of buf; out: bytes actually read. |
Definition at line 87 of file host_api_fs.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, name, and cdc::core::openFile().
Referenced by cdc::plugin_manager::w_host_fs_read().
| int host_fs_remove | ( | const char * | name | ) |
Delete name.
Definition at line 100 of file host_api_fs.cpp.
References HOST_ERR_NOT_FOUND, HOST_OK, and name.
Referenced by cdc::plugin_manager::w_host_fs_remove().
| int host_fs_size | ( | const char * | name, |
| size_t * | out ) |
Write the byte size of name to *out.
Definition at line 108 of file host_api_fs.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, and name.
Referenced by cdc::plugin_manager::w_host_fs_size().
| int host_fs_view | ( | const char * | name | ) |
Open one of the plugin's own files in a scrollable on-screen text viewer (same as opening the file in the vFAT explorer). Useful for a bundled readme / help page.
Definition at line 147 of file host_api_fs.cpp.
References HOST_ERR_NOT_FOUND, HOST_OK, host_ui_push_info(), name, and cdc::core::openFile().
Referenced by cdc::plugin_manager::w_host_fs_view().
| int host_fs_write | ( | const char * | name, |
| const uint8_t * | data, | ||
| size_t | len ) |
Create or overwrite name with len bytes.
Definition at line 74 of file host_api_fs.cpp.
References HOST_ERR_GENERIC, HOST_ERR_INVALID_ARG, HOST_OK, name, and cdc::core::openFile().
Referenced by cdc::plugin_manager::w_host_fs_write().