ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fmt_host_fd_internal.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <stdint.h>
14
15#include "ra8_attributes.h"
16#include "ra8_fmt_stream.h"
17
19typedef enum : uint32_t {
23
25typedef struct {
26 uint64_t device;
27 uint64_t inode;
28 uint64_t size;
29 int64_t mtime_sec;
30 int64_t mtime_nsec;
31 int64_t ctime_sec;
32 int64_t ctime_nsec;
34
41
43typedef struct {
44 int fd;
46
57
59RA8_PRIV [[nodiscard]] ra8_err_t
60priv_fmt_host_source_open(const char* path, uint64_t max_size, ra8_fmt_host_source_t* out);
61
72RA8_PRIV [[nodiscard]] bool priv_fmt_host_sources_same(const ra8_fmt_host_source_t* first,
73 const ra8_fmt_host_source_t* second);
74
87RA8_PRIV [[nodiscard]] ra8_err_t
89
102
105
119RA8_PRIV void priv_fmt_host_log_byte(void* ctx, uint8_t byte);
120
122RA8_PRIV [[nodiscard]] ra8_err_t priv_fmt_host_transaction_begin(const char* path,
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
ra8_err_t priv_fmt_host_transaction_begin(const char *path, ra8_fmt_host_transaction_t *state, ra8_fmt_transaction_t *out)
Begin a sibling-temp durable replacement transaction.
bool priv_fmt_host_sources_same(const ra8_fmt_host_source_t *first, const ra8_fmt_host_source_t *second)
Confirm two opens captured the same unchanged regular-file object.
ra8_err_t priv_fmt_host_source_open(const char *path, uint64_t max_size, ra8_fmt_host_source_t *out)
Open a bounded, regular, non-symlink input object.
void priv_fmt_host_log_byte(void *ctx, uint8_t byte)
Adapt a logging byte to an injected raw-fd sink.
ra8_fmt_sink_t priv_fmt_host_fd_sink(ra8_fmt_host_fd_sink_t *state)
Obtain the exact-write portable sink for a raw descriptor.
ra8_fmt_host_limit_t
Bounded host path and transaction-name capacities.
@ k_ra8_fmt_host_path_cap
Parent-path storage including NUL.
@ k_ra8_fmt_host_name_cap
One leaf name including NUL.
void priv_fmt_host_source_close(ra8_fmt_host_source_t *source)
Close an open host source; safe after failed open.
ra8_err_t priv_fmt_host_source_unchanged(const ra8_fmt_host_source_t *source)
Revalidate one open descriptor against its captured snapshot.
Caller-workspace I/O contracts for portable format-tool engines.
Append sink backed by a caller-owned descriptor.
int fd
Borrowed writable descriptor.
Captured regular-file identity and mutation evidence.
int64_t ctime_nsec
Metadata-change timestamp nanoseconds.
int64_t ctime_sec
Metadata-change timestamp seconds.
uint64_t device
Filesystem device identifier.
int64_t mtime_sec
Modification timestamp seconds.
int64_t mtime_nsec
Modification timestamp nanoseconds.
uint64_t size
Captured regular-file extent.
uint64_t inode
File object identifier.
Open raw-fd source and its portable view.
ra8_fmt_source_t source
Portable positioned-read view.
int fd
Owned descriptor, or -1 when closed.
ra8_fmt_host_snapshot_t snapshot
Immutable-open evidence.
Caller-owned state for one sibling-file transaction.
char stage_name[k_ra8_fmt_host_name_cap]
Staging leaf name.
char final_name[k_ra8_fmt_host_name_cap]
Destination leaf name.
int parent_fd
Owned parent directory.
bool stage_exists
Stage still needs unlink.
int stage_fd
Owned staging descriptor.
bool active
Transaction is usable.
uint64_t position
Bytes appended so far.
Injected append-only sink.
Immutable, randomly readable input object.
One caller-owned artifact transaction.