ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
alphabet_soup_cli.c File Reference

Bounded POSIX file ingestion for the Alphabet Soup host CLI. More...

#include <string.h>
#include "alphabet_soup.h"
#include "alphabet_soup_cli_internal.h"
#include "fw_if_fs.h"
#include "fw_if_fs_posix.h"
Include dependency graph for alphabet_soup_cli.c:

Go to the source code of this file.

Enumerations

enum  alphabet_soup_cli_limit_t : uint32_t {
  k_cli_file_work_capacity = 64U ,
  k_cli_read_chunk_bytes = 1024U ,
  k_cli_path_buffer_capacity = 512U
}
 Buffer sizes and limits for host CLI file ingestion. More...

Functions

ra8_err_t priv_alphabet_soup_split_path (const char *filepath, char *out_root, size_t root_cap, char *out_leaf, size_t leaf_cap)
ra8_err_t priv_alphabet_soup_read_all (fw_fs_file_t *file, uint8_t *buffer, uint32_t capacity, uint32_t *out_size)
ra8_err_t priv_alphabet_soup_load_file_contents (const char *filepath, uint8_t *out_buf, uint32_t buf_cap, uint32_t *out_len)

Detailed Description

Bounded POSIX file ingestion for the Alphabet Soup host CLI.

Splits host paths, opens them through the portable filesystem facade, and reads source bytes into caller-owned bounded buffers.

Definition in file alphabet_soup_cli.c.

Enumeration Type Documentation

◆ alphabet_soup_cli_limit_t

enum alphabet_soup_cli_limit_t : uint32_t

Buffer sizes and limits for host CLI file ingestion.

Enumerator
k_cli_file_work_capacity 

File handle workspace bytes.

k_cli_read_chunk_bytes 

Bounded read chunk bytes.

k_cli_path_buffer_capacity 

Host path buffer bytes.

Definition at line 18 of file alphabet_soup_cli.c.

Function Documentation

◆ priv_alphabet_soup_load_file_contents()

ra8_err_t priv_alphabet_soup_load_file_contents ( const char * filepath,
uint8_t * out_buf,
uint32_t buf_cap,
uint32_t * out_len )
nodiscard

◆ priv_alphabet_soup_read_all()

ra8_err_t priv_alphabet_soup_read_all ( fw_fs_file_t * file,
uint8_t * buffer,
uint32_t capacity,
uint32_t * out_size )
nodiscard

◆ priv_alphabet_soup_split_path()

ra8_err_t priv_alphabet_soup_split_path ( const char * filepath,
char * out_root,
size_t root_cap,
char * out_leaf,
size_t leaf_cap )
nodiscard