ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_state_internal.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include "mdl_state.h"
14#include "ra8_attributes.h"
15
17typedef enum : uint16_t {
19 (uint16_t)k_mdl_chapter_id_max + 192U,
21
35RA8_PRIV void priv_mdl_state_set_opt(char* dst, size_t cap, const char* val);
36
49RA8_PRIV bool priv_mdl_state_field_valid(const char* text, size_t cap);
50
63RA8_PRIV bool priv_mdl_state_relative_path_valid(const char* path, size_t cap);
64
79
96RA8_PRIV bool priv_mdl_state_decimal_to_binary64(uint64_t mantissa,
97 int32_t decimal_scale,
98 bool negative,
99 double* out);
100
121 fw_fs_file_t* file,
122 uint64_t offset,
123 uint64_t length,
124 uint16_t max_schema_version,
125 mdl_state_t* st);
@ k_mdl_url_max
Max bytes per URL, including the NUL.
Definition mdl_extract.h:25
Persistent per-series library state for the media downloader.
@ k_mdl_chapter_id_max
Chapter identifier bytes (sanitised).
Definition mdl_state.h:97
@ k_mdl_title_max
Series title bytes.
Definition mdl_state.h:98
void priv_mdl_state_set_opt(char *dst, size_t cap, const char *val)
Copy one optional value into a bounded state field.
Definition mdl_state.c:62
bool priv_mdl_state_valid(const mdl_state_t *st)
Validate all persisted state bounds and cross-field invariants.
Definition mdl_state.c:142
ra8_err_t priv_mdl_state_parse_file(mdl_storage_t *storage, fw_fs_file_t *file, uint64_t offset, uint64_t length, uint16_t max_schema_version, mdl_state_t *st)
Parse one exact state payload from an open portable file.
bool priv_mdl_state_relative_path_valid(const char *path, size_t cap)
Validate a bounded relative path stored in state.
Definition mdl_state.c:95
mdl_state_internal_limit_t
Largest complete serialized record including its terminator.
@ k_mdl_state_line_max
Serialized line cap.
bool priv_mdl_state_field_valid(const char *text, size_t cap)
Validate one delimiter-free bounded state field.
Definition mdl_state.c:70
bool priv_mdl_state_decimal_to_binary64(uint64_t mantissa, int32_t decimal_scale, bool negative, double *out)
Convert one exact bounded decimal rational to binary64.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Caller-owned open file; fields are private to the facade.
One series' complete persistent state (declare at file scope).
Definition mdl_state.h:175
One non-reentrant downloader filesystem dependency bundle.
Definition mdl_storage.h:40