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

Bounded descriptor-backed storage composition for mkfontimg. More...

#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "mkfontimg_internal.h"
#include "ra8_attributes.h"
#include "ra8_err.h"
#include "ra8_fs.h"
Include dependency graph for mkfontimg_host.c:

Go to the source code of this file.

Data Structures

struct  host_input_identity_t
 Mutation-sensitive identity for one open regular input. More...

Macros

#define O_CLOEXEC   (0)
 No-op close-on-exec fallback for hosts lacking the flag.
#define O_DIRECTORY   (0)
 No-op directory-open fallback for hosts lacking the flag.
#define O_NOFOLLOW   (0)
 No-op no-follow fallback for hosts lacking the flag.

Enumerations

enum  host_limit_t : uint32_t {
  k_host_stream_chunk = 16U * 1024U ,
  k_host_temp_attempts = 128U ,
  k_host_decimal_digits = 20U ,
  k_host_decimal_base = 10U ,
  k_host_create_mode = 0666U
}
 Fixed I/O, naming, and formatting bounds. More...

Functions

void priv_mkfontimg_diag (const char *text)
 Write one complete best-effort diagnostic fragment to standard error.
void priv_mkfontimg_diag_u64 (uint64_t value)
 Write one unsigned decimal value to standard error without stdio.
static bool internal_pread_exact (int fd, uint64_t offset, uint8_t *bytes, size_t length)
 Read an exact positioned byte range with bounded retries.
static bool internal_pwrite_exact (int fd, uint64_t offset, const uint8_t *bytes, size_t length)
 Write an exact positioned byte range with bounded retries.
static bool internal_block_range (const mkfontimg_disk_t *disk, uint64_t lba, uint32_t count, uint64_t *out_offset, size_t *out_bytes)
 Translate one sector range to a representable byte range.
static ra8_err_t internal_disk_read (void *ctx, uint64_t lba, uint32_t count, uint8_t *buffer)
 Read sectors from the sparse unpublished image.
static ra8_err_t internal_disk_write (void *ctx, uint64_t lba, uint32_t count, const uint8_t *buffer)
 Write sectors into the sparse unpublished image.
static ra8_err_t internal_disk_capacity (void *ctx, uint64_t *block_count, uint32_t *block_size)
 Report the fixed sparse-image geometry.
static bool internal_split_output (const char *path, char parent[k_mkfontimg_host_path_cap], char leaf[k_mkfontimg_host_name_cap])
 Split one output path into bounded parent and leaf components.
static bool internal_temp_name (char out[k_mkfontimg_host_name_cap], uint64_t process, uint32_t attempt)
 Build one collision-resistant hidden temporary leaf.
bool priv_mkfontimg_host_begin (const char *final_path, uint64_t block_count, uint32_t block_size, mkfontimg_host_t *host)
 Create, size, and bind one private sibling-temporary image.
bool priv_mkfontimg_host_seed (mkfontimg_host_t *host, const uint8_t *bytes, uint32_t length)
 Seed exact bytes at the beginning of the temporary image.
static host_input_identity_t internal_identity (const struct stat *metadata)
 Capture all mutation-sensitive fields from one successful fstat.
static bool internal_identity_equal (const host_input_identity_t *left, const host_input_identity_t *right)
 Compare two initialized input identities without inspecting padding.
static bool internal_input_open (const char *path, uint64_t minimum_bytes, uint64_t maximum_bytes, int *out_fd, host_input_identity_t *identity)
 Open and validate one non-symlink regular input.
static bool internal_stream (int input_fd, const host_input_identity_t *identity, ra8_fs_file_t *card)
 Stream the first pass from host input to one new card file.
static bool internal_compare (int input_fd, const host_input_identity_t *identity, ra8_fs_file_t *card)
 Compare a second host-input pass with the generated card file.
static bool internal_mkfontimg_write (ra8_fs_mount_t *mount, const char *input_path, const char *card_name, uint64_t minimum_bytes, uint64_t maximum_bytes, host_input_identity_t *out_identity)
 Open the host input and stream it into a fresh card file.
static bool internal_mkfontimg_verify (ra8_fs_mount_t *mount, const char *input_path, const char *card_name, uint64_t minimum_bytes, uint64_t maximum_bytes, const host_input_identity_t *identity)
 Reopen the host input and card file and verify byte-for-byte identity.
bool priv_mkfontimg_host_copy (const mkfontimg_host_t *host, ra8_fs_mount_t *mount, const char *input_path, const char *card_name, uint64_t minimum_bytes, uint64_t maximum_bytes, uint64_t *out_bytes)
 Stream one stable host input into a card file and verify it by reread.
bool priv_mkfontimg_host_commit (mkfontimg_host_t *host)
 Sync and atomically publish a complete temporary image.
void priv_mkfontimg_host_abort (mkfontimg_host_t *host)
 Close and unlink an unpublished temporary image.

Detailed Description

Bounded descriptor-backed storage composition for mkfontimg.

Implements exact positioned block I/O, immutable input streaming, card-file reread verification, and durable same-directory atomic publication. This is deliberately tool-private POSIX code; reusable filesystem code depends only on the ra8_fs_backend_t callbacks bound here.

Since
0.1.0

Definition in file mkfontimg_host.c.

Macro Definition Documentation

◆ O_CLOEXEC

#define O_CLOEXEC   (0)

No-op close-on-exec fallback for hosts lacking the flag.

Definition at line 34 of file mkfontimg_host.c.

◆ O_DIRECTORY

#define O_DIRECTORY   (0)

No-op directory-open fallback for hosts lacking the flag.

Definition at line 39 of file mkfontimg_host.c.

◆ O_NOFOLLOW

#define O_NOFOLLOW   (0)

No-op no-follow fallback for hosts lacking the flag.

Definition at line 44 of file mkfontimg_host.c.

Enumeration Type Documentation

◆ host_limit_t

enum host_limit_t : uint32_t

Fixed I/O, naming, and formatting bounds.

Enumerator
k_host_stream_chunk 

Bounded copy chunk bytes.

k_host_temp_attempts 

Exclusive-create retry bound.

k_host_decimal_digits 

Maximum uint64_t digits.

k_host_decimal_base 

Decimal conversion radix.

k_host_create_mode 

Hosted output creation mode.

Definition at line 48 of file mkfontimg_host.c.

Function Documentation

◆ internal_block_range()

bool internal_block_range ( const mkfontimg_disk_t * disk,
uint64_t lba,
uint32_t count,
uint64_t * out_offset,
size_t * out_bytes )
static

Translate one sector range to a representable byte range.

Checks device geometry and every host integer conversion before I/O.

Parameters
[in]diskBound image geometry.
[in]lbaFirst sector.
[in]countSector count.
[out]out_offsetHost byte offset.
[out]out_bytesHost byte count.
Returns
true only when the complete range is valid.
Return values
trueBoth outputs describe the requested range.
falseGeometry or integer bounds reject it.
Precondition
All pointers are non-NULL.
Disk geometry is non-zero.
Postcondition
Outputs are populated only on true.
No state changes.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 199 of file mkfontimg_host.c.

References mkfontimg_disk_t::block_count, mkfontimg_disk_t::block_size, and RA8_INTERNAL.

◆ internal_compare()

bool internal_compare ( int input_fd,
const host_input_identity_t * identity,
ra8_fs_file_t * card )
static

Compare a second host-input pass with the generated card file.

Verifies every byte and repeats the mutation-sensitive metadata check.

Parameters
[in]input_fdOpen stable input.
[in]identityOriginal identity.
[in,out]cardOpen card file in read mode.
Returns
true only when both streams match exactly.
Return values
trueEvery byte and final metadata match.
falseRead, size, content, or mutation validation failed.
Precondition
All arguments are valid and both handles begin at offset zero.
Card size already equals identity->size.
Postcondition
Host descriptor position remains unchanged.
Card offset advances by the verified length.
Note
Not thread-safe through the card handle.
Since
0.1.0

Definition at line 628 of file mkfontimg_host.c.

References internal_identity(), internal_identity_equal(), internal_pread_exact(), k_host_stream_chunk, k_ra8_ok, memcmp(), ra8_fs_read(), and host_input_identity_t::size.

Referenced by internal_mkfontimg_verify().

◆ internal_disk_capacity()

ra8_err_t internal_disk_capacity ( void * ctx,
uint64_t * block_count,
uint32_t * block_size )
static

Report the fixed sparse-image geometry.

Copies immutable sector count and size fields into caller outputs.

Parameters
[in]ctxBound mkfontimg_disk_t context.
[out]block_countReceives the number of sectors.
[out]block_sizeReceives bytes per sector.
Returns
Canonical block-device status.
Return values
k_ra8_okBoth geometry outputs were initialized.
k_ra8_err_null_ptrA required pointer was null.
Precondition
All three pointers are non-null.
The context geometry was initialized before binding the backend.
Postcondition
Success populates both outputs.
The context and descriptor are unchanged.
Note
Read-only and thread-safe while the context remains alive.
Since
0.1.0

Definition at line 308 of file mkfontimg_host.c.

References mkfontimg_disk_t::block_count, mkfontimg_disk_t::block_size, k_ra8_err_null_ptr, and k_ra8_ok.

◆ internal_disk_read()

ra8_err_t internal_disk_read ( void * ctx,
uint64_t lba,
uint32_t count,
uint8_t * buffer )
static

Read sectors from the sparse unpublished image.

Validates the complete block range, performs exact positioned I/O, and makes the first host failure sticky for the transaction.

Parameters
[in,out]ctxBound mkfontimg_disk_t context.
[in]lbaFirst sector to read.
[in]countNumber of sectors to read.
[out]bufferDestination spanning count * block_size bytes.
Returns
Canonical block-device status.
Return values
k_ra8_okEvery requested sector was read.
k_ra8_err_out_of_rangeState, pointer, or geometry was invalid.
k_ra8_failExact host I/O failed.
Precondition
ctx and buffer are non-null.
The bound image descriptor remains open.
Postcondition
Success initializes the complete destination range.
Host failure leaves the disk error flag set.
Note
Not thread-safe through the shared sticky-error flag.
Since
0.1.0

Definition at line 239 of file mkfontimg_host.c.

References mkfontimg_disk_t::fd, internal_block_range(), internal_pread_exact(), mkfontimg_disk_t::io_failed, k_ra8_err_out_of_range, k_ra8_fail, and k_ra8_ok.

◆ internal_disk_write()

ra8_err_t internal_disk_write ( void * ctx,
uint64_t lba,
uint32_t count,
const uint8_t * buffer )
static

Write sectors into the sparse unpublished image.

Validates the complete block range, performs exact positioned I/O, and makes the first host failure sticky for the transaction.

Parameters
[in,out]ctxBound mkfontimg_disk_t context.
[in]lbaFirst sector to write.
[in]countNumber of sectors to write.
[in]bufferSource spanning count * block_size bytes.
Returns
Canonical block-device status.
Return values
k_ra8_okEvery requested sector was written.
k_ra8_err_out_of_rangeState, pointer, or geometry was invalid.
k_ra8_failExact host I/O failed.
Precondition
ctx and buffer are non-null.
The bound image descriptor remains open.
Postcondition
Success updates only the requested byte range.
Host failure leaves the disk error flag set.
Note
Not thread-safe for overlapping writes or shared error state.
Since
0.1.0

Definition at line 275 of file mkfontimg_host.c.

References mkfontimg_disk_t::fd, internal_block_range(), internal_pwrite_exact(), mkfontimg_disk_t::io_failed, k_ra8_err_out_of_range, k_ra8_fail, and k_ra8_ok.

◆ internal_identity()

host_input_identity_t internal_identity ( const struct stat * metadata)
static

Capture all mutation-sensitive fields from one successful fstat.

Normalizes Darwin and POSIX timestamp layouts into an owned value.

Parameters
[in]metadataSuccessful metadata for a regular file.
Returns
Captured device, inode, size, and nanosecond timestamps.
Return values
all-fieldsA complete identity value with no borrowed storage.
Precondition
metadata is non-null and has a non-negative size.
The platform timestamp layout matches the selected compile-time branch.
Postcondition
No state or descriptor position changes.
The returned value owns no resource.
Note
Pure and thread-safe.
Since
0.1.0

Definition at line 487 of file mkfontimg_host.c.

References RA8_INTERNAL.

Referenced by internal_compare(), internal_input_open(), and internal_stream().

◆ internal_identity_equal()

bool internal_identity_equal ( const host_input_identity_t * left,
const host_input_identity_t * right )
static

Compare two initialized input identities without inspecting padding.

Checks every mutation-sensitive value explicitly.

Parameters
[in]leftFirst captured identity.
[in]rightSecond captured identity.
Returns
Whether both identities describe the same stable file state.
Return values
trueEvery represented field is equal.
falseAt least one identity, size, or timestamp differs.
Precondition
Both pointers are non-null.
Both values came from internal_identity.
Postcondition
Neither input is changed.
Structure padding is never read.
Note
Pure and thread-safe.
Since
0.1.0

Definition at line 520 of file mkfontimg_host.c.

References host_input_identity_t::changed_nsec, host_input_identity_t::changed_sec, host_input_identity_t::device, host_input_identity_t::inode, host_input_identity_t::modified_nsec, host_input_identity_t::modified_sec, RA8_INTERNAL, and host_input_identity_t::size.

Referenced by internal_compare(), internal_mkfontimg_verify(), and internal_stream().

◆ internal_input_open()

bool internal_input_open ( const char * path,
uint64_t minimum_bytes,
uint64_t maximum_bytes,
int * out_fd,
host_input_identity_t * identity )
static

Open and validate one non-symlink regular input.

Captures identity through the opened no-follow descriptor.

Parameters
[in]pathInput path.
[in]minimum_bytesInclusive lower size bound.
[in]maximum_bytesInclusive upper size bound.
[out]out_fdReceives owned descriptor.
[out]identityReceives stable metadata.
Returns
true only for a bounded regular file.
Return values
trueBoth outputs are populated.
falseOpen, type, or size validation failed.
Precondition
All pointers are non-NULL.
Minimum does not exceed maximum.
Postcondition
On true caller owns out_fd.
On false no descriptor remains open.
Note
Thread-safe for independent outputs.
Since
0.1.0

Definition at line 547 of file mkfontimg_host.c.

References internal_identity(), O_CLOEXEC, O_NOFOLLOW, and RA8_INTERNAL.

Referenced by internal_mkfontimg_verify(), and internal_mkfontimg_write().

◆ internal_mkfontimg_verify()

bool internal_mkfontimg_verify ( ra8_fs_mount_t * mount,
const char * input_path,
const char * card_name,
uint64_t minimum_bytes,
uint64_t maximum_bytes,
const host_input_identity_t * identity )
static

Reopen the host input and card file and verify byte-for-byte identity.

Reopens the host input, confirms it is unchanged since the write pass, then opens the card copy, confirms its size, and compares every byte.

Parameters
[in,out]mountMounted card filesystem holding the written copy.
[in]input_pathHost source path.
[in]card_nameCard basename written by internal_mkfontimg_write.
[in]minimum_bytesSmallest accepted host input size.
[in]maximum_bytesLargest accepted host input size.
[in]identityIdentity observed during the write pass.
Returns
Whether the reopened input and card contents match exactly.
Return values
trueHost and card contents match and the host input is unchanged.
falseReopen, identity, open, size, or byte comparison failed.
Precondition
identity was populated by a prior internal_mkfontimg_write call.
All strings are valid and mount still holds card_name.
Postcondition
Every handle this call opened is closed regardless of outcome.
Neither the host input nor the card file is modified; both open read-only.
Note
Not thread-safe through the shared ra8_fs card handle.
Since
0.1.0

Definition at line 724 of file mkfontimg_host.c.

References internal_compare(), internal_identity_equal(), internal_input_open(), k_ra8_fs_mode_read, k_ra8_ok, ra8_fs_close(), ra8_fs_open(), ra8_fs_size(), RA8_INTERNAL, and host_input_identity_t::size.

Referenced by priv_mkfontimg_host_copy().

◆ internal_mkfontimg_write()

bool internal_mkfontimg_write ( ra8_fs_mount_t * mount,
const char * input_path,
const char * card_name,
uint64_t minimum_bytes,
uint64_t maximum_bytes,
host_input_identity_t * out_identity )
static

Open the host input and stream it into a fresh card file.

Opens and size-validates the host input, then streams every byte into a newly created card file, closing both handles regardless of outcome.

Parameters
[in,out]mountMounted destination card filesystem.
[in]input_pathHost source path.
[in]card_nameCard basename to create.
[in]minimum_bytesSmallest accepted host input size.
[in]maximum_bytesLargest accepted host input size.
[out]out_identityReceives the host input's observed identity.
Returns
Whether the complete stream write succeeded.
Return values
trueout_identity is populated and the card file is written.
falseOpen, size validation, streaming, or close failed.
Precondition
All strings are valid and mount is mounted.
minimum_bytes does not exceed maximum_bytes.
Postcondition
Every handle this call opened is closed regardless of outcome.
The host input is opened read-only and is never modified.
Note
Not thread-safe through the shared ra8_fs card handle.
Since
0.1.0

Definition at line 678 of file mkfontimg_host.c.

References internal_input_open(), internal_stream(), k_ra8_fs_mode_write, k_ra8_ok, ra8_fs_close(), ra8_fs_open(), and RA8_INTERNAL.

Referenced by priv_mkfontimg_host_copy().

◆ internal_pread_exact()

bool internal_pread_exact ( int fd,
uint64_t offset,
uint8_t * bytes,
size_t length )
static

Read an exact positioned byte range with bounded retries.

Retries interruptions and rejects EOF before the requested length.

Parameters
[in]fdOpen regular-file descriptor.
[in]offsetAbsolute byte offset.
[out]bytesExact-size destination.
[in]lengthRequired byte count.
Returns
true only when every byte was read.
Return values
trueThe destination is complete.
falseOverflow, EOF, or host I/O failure occurred.
Precondition
bytes spans length writable bytes.
fd remains open.
Postcondition
Descriptor position is unchanged.
On false the destination may hold a strict prefix.
Note
Thread-safe for independent buffers.
Since
0.1.0

Definition at line 117 of file mkfontimg_host.c.

Referenced by internal_compare(), internal_disk_read(), and internal_stream().

◆ internal_pwrite_exact()

bool internal_pwrite_exact ( int fd,
uint64_t offset,
const uint8_t * bytes,
size_t length )
static

Write an exact positioned byte range with bounded retries.

Retries interruptions and treats a zero write as terminal failure.

Parameters
[in]fdOpen regular-file descriptor.
[in]offsetAbsolute byte offset.
[in]bytesExact-size source.
[in]lengthRequired byte count.
Returns
true only when every byte was written.
Return values
trueThe complete range reached the page cache.
falseOverflow or host I/O failure occurred.
Precondition
bytes spans length readable bytes.
fd remains open.
Postcondition
Descriptor position is unchanged.
On false only the unpublished temporary may be partial.
Note
Not thread-safe for overlapping ranges.
Since
0.1.0

Definition at line 158 of file mkfontimg_host.c.

Referenced by internal_disk_write(), and priv_mkfontimg_host_seed().

◆ internal_split_output()

bool internal_split_output ( const char * path,
char parent[k_mkfontimg_host_path_cap],
char leaf[k_mkfontimg_host_name_cap] )
static

Split one output path into bounded parent and leaf components.

Rejects truncation, empty leaves, and dot traversal components.

Parameters
[in]pathRequested output.
[out]parentParent path.
[out]leafDestination leaf.
Returns
true when both components are safe and bounded.
Return values
trueOutputs are populated.
falsePath is empty, overlong, or names ./../a directory.
Precondition
All arguments are non-NULL.
Output arrays have their declared capacities.
Postcondition
No filesystem object is touched.
On true parent plus leaf reconstruct path.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 335 of file mkfontimg_host.c.

References k_mkfontimg_host_name_cap, k_mkfontimg_host_path_cap, memcpy(), RA8_INTERNAL, strcmp(), and strlen().

Referenced by priv_mkfontimg_host_begin().

◆ internal_stream()

bool internal_stream ( int input_fd,
const host_input_identity_t * identity,
ra8_fs_file_t * card )
static

Stream the first pass from host input to one new card file.

Copies bounded chunks and rechecks metadata before returning success.

Parameters
[in]input_fdOpen host input.
[in]identityInitial stable metadata.
[in,out]cardOpen card file in write mode.
Returns
true only when every byte was written and metadata stayed stable.
Return values
trueCard file received exactly identity->size bytes.
falseRead, write, or mutation validation failed.
Precondition
All arguments are valid and both handles remain open.
Card offset and input positioned offset both begin at zero.
Postcondition
Host descriptor position remains unchanged.
On false only the unpublished image may contain a partial card file.
Note
Not thread-safe through the card handle.
Since
0.1.0

Definition at line 585 of file mkfontimg_host.c.

References internal_identity(), internal_identity_equal(), internal_pread_exact(), k_host_stream_chunk, k_ra8_ok, ra8_fs_write(), and host_input_identity_t::size.

Referenced by internal_mkfontimg_write().

◆ internal_temp_name()

bool internal_temp_name ( char out[k_mkfontimg_host_name_cap],
uint64_t process,
uint32_t attempt )
static

Build one collision-resistant hidden temporary leaf.

Uses fixed decimal conversion buffers and no process-global state.

Parameters
[out]outTemporary-name buffer.
[in]processProcess identifier.
[in]attemptCollision retry index.
Returns
true when the fixed buffer holds the complete name.
Return values
trueA NUL-terminated slash-free leaf was built.
falseCapacity was insufficient.
Precondition
out has k_mkfontimg_host_name_cap bytes.
Numeric arguments are finite.
Postcondition
No filesystem object is touched.
Name contents depend only on the arguments.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 387 of file mkfontimg_host.c.

References k_host_decimal_base, k_host_decimal_digits, k_mkfontimg_host_name_cap, memcpy(), and s_prefix.

Referenced by priv_mkfontimg_host_begin().

◆ priv_mkfontimg_diag()

void priv_mkfontimg_diag ( const char * text)

Write one complete best-effort diagnostic fragment to standard error.

Retries interrupted and short raw-descriptor writes without stdio.

Parameters
[in]textNUL-terminated diagnostic fragment.
Precondition
text is non-null and NUL-terminated.
The standard-error descriptor may accept or reject output.
Postcondition
The complete fragment was attempted.
No image or filesystem state changed.
Note
Fragments can interleave with diagnostics from another process.
Since
0.1.0

Definition at line 67 of file mkfontimg_host.c.

References RA8_PRIV, and strlen().

Referenced by internal_run_blank(), internal_run_font(), main(), and priv_mkfontimg_diag_u64().

◆ priv_mkfontimg_diag_u64()

void priv_mkfontimg_diag_u64 ( uint64_t value)

Write one unsigned decimal value to standard error without stdio.

Converts through fixed local buffers and delegates one bounded string.

Parameters
[in]valueUnsigned value to render in base ten.
Precondition
The fixed digit buffer covers every uint64_t value.
The standard-error descriptor may accept or reject output.
Postcondition
The complete decimal spelling was attempted.
No image or filesystem state changed.
Note
Fragments can interleave with diagnostics from another process.
Since
0.1.0

Definition at line 83 of file mkfontimg_host.c.

References k_host_decimal_base, k_host_decimal_digits, priv_mkfontimg_diag(), and RA8_PRIV.

Referenced by internal_run_font().

◆ priv_mkfontimg_host_abort()

void priv_mkfontimg_host_abort ( mkfontimg_host_t * host)

Close and unlink an unpublished temporary image.

Idempotently releases every partially acquired host resource.

Parameters
[in,out]hostPublication state returned by the begin operation.
Precondition
host is non-null and may be only partially initialized.
No mounted filesystem still uses host->image_fd.
Postcondition
Every owned descriptor is closed.
Any owned sibling temporary is removed; the final file is unchanged.
Note
Not thread-safe through the same state object.
Since
0.1.0

Definition at line 815 of file mkfontimg_host.c.

References mkfontimg_host_t::directory_fd, mkfontimg_host_t::image_fd, RA8_PRIV, mkfontimg_host_t::temp_exists, and mkfontimg_host_t::temp_name.

Referenced by internal_finish_image(), internal_mount_image(), internal_run_font(), and priv_mkfontimg_host_begin().

◆ priv_mkfontimg_host_begin()

◆ priv_mkfontimg_host_commit()

bool priv_mkfontimg_host_commit ( mkfontimg_host_t * host)
nodiscard

◆ priv_mkfontimg_host_copy()

bool priv_mkfontimg_host_copy ( const mkfontimg_host_t * host,
ra8_fs_mount_t * mount,
const char * input_path,
const char * card_name,
uint64_t minimum_bytes,
uint64_t maximum_bytes,
uint64_t * out_bytes )
nodiscard

Stream one stable host input into a card file and verify it by reread.

Definition at line 756 of file mkfontimg_host.c.

References mkfontimg_host_t::disk, internal_mkfontimg_verify(), internal_mkfontimg_write(), mkfontimg_disk_t::io_failed, RA8_PRIV, and host_input_identity_t::size.

Referenced by internal_run_font().

◆ priv_mkfontimg_host_seed()

bool priv_mkfontimg_host_seed ( mkfontimg_host_t * host,
const uint8_t * bytes,
uint32_t length )
nodiscard

Seed exact bytes at the beginning of the temporary image.

Definition at line 461 of file mkfontimg_host.c.

References mkfontimg_disk_t::block_count, mkfontimg_disk_t::block_size, mkfontimg_host_t::disk, mkfontimg_host_t::image_fd, internal_pwrite_exact(), and mkfontimg_disk_t::io_failed.

Referenced by internal_mount_image().