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

Anonymous raw-fd scratch artifacts for portable format verification. More...

#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_fmt_stream.h"
Include dependency graph for ra8_fmt_host_spool_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_fmt_host_spool_t
 Caller-owned state for one unlinked scratch file. More...

Functions

ra8_err_t priv_fmt_host_spool_open (const char *anchor_path, ra8_fmt_host_spool_t *state, ra8_fmt_spool_t *out)
 Create an anonymous scratch file beside an anchored input path.
void priv_fmt_host_spool_close (ra8_fmt_host_spool_t *state)
 Close an anonymous scratch artifact.

Detailed Description

Anonymous raw-fd scratch artifacts for portable format verification.

Defines composition-edge ownership for immediately unlinked scratch descriptors while portable engines depend only on injected spool callbacks.

Since
0.1.0

Definition in file ra8_fmt_host_spool_internal.h.

Function Documentation

◆ priv_fmt_host_spool_close()

void priv_fmt_host_spool_close ( ra8_fmt_host_spool_t * state)

Close an anonymous scratch artifact.

Releases the only owner of an already-unlinked raw descriptor.

Parameters
[in,out]statePossibly open spool state.
Precondition
state is null or was initialized by the spool-open operation.
No callback is executing through state.
Postcondition
Any owned descriptor is closed and marked -1.
Repeated cleanup leaves the state closed.
Note
Idempotent for sequential cleanup.
Since
0.1.0

Definition at line 333 of file ra8_fmt_host_spool.c.

References ra8_fmt_host_spool_t::fd, and RA8_PRIV.

Referenced by internal_cleanup().

◆ priv_fmt_host_spool_open()

ra8_err_t priv_fmt_host_spool_open ( const char * anchor_path,
ra8_fmt_host_spool_t * state,
ra8_fmt_spool_t * out )
nodiscard

Create an anonymous scratch file beside an anchored input path.

Parameters
[in]anchor_pathExisting input spelling used only to select its parent.
[out]stateReceives owned raw-fd state.
[out]outReceives portable append, seal, and positioned-read callbacks.
Returns
Host creation or bounded-path status.
Precondition
Output pointers are writable and anchor_path is NUL-terminated.
Postcondition
Success leaves no directory entry; only state owns the descriptor.
Failure owns no descriptor and creates no persistent filesystem object.
Note
Host composition edge only; the portable verifier sees callbacks.
Since
0.1.0

Definition at line 302 of file ra8_fmt_host_spool.c.

References internal_append(), internal_create(), internal_parent(), internal_read(), internal_seal(), k_ra8_err_null_ptr, k_ra8_fail, k_ra8_fmt_host_path_cap, k_ra8_ok, O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW, and RA8_PRIV.

Referenced by internal_execute().