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

One parsed conversion specification. More...

#include <ra8_esp_hosted_fmt_internal.h>

Data Fields

uint16_t width
 Minimum field width; zero if absent.
uint8_t consumed
 Characters consumed after the per-cent.
char conv
 Conversion character, zero on failure.
ra8_esp_hosted_fmt_len_t len
 Argument width from the length modifier.
bool zero_pad
 The 0 flag was present.
bool left_justify
 The - flag was present.

Detailed Description

One parsed conversion specification.

Produced by priv_ra8_esp_hosted_fmt_parse from the characters following a per-cent sign, and consumed by the formatter driver. Splitting parsing from emission is what keeps both functions inside the project's function length limit and lets the parser be tested on its own.

Invariant
consumed counts the characters after the per-cent sign, including the conversion character, and is zero only when the specification is malformed.
conv is zero when, and only when, parsing failed.
Example:
if (priv_ra8_esp_hosted_fmt_parse("08x rest", &spec)) { emit(&spec); }
bool priv_ra8_esp_hosted_fmt_parse(const char *after_percent, ra8_esp_hosted_fmt_spec_t *out)
Parse one conversion specification.
struct ra8_esp_hosted_fmt_spec ra8_esp_hosted_fmt_spec_t
See also
priv_ra8_esp_hosted_fmt_parse
Since
0.1.0

Definition at line 136 of file ra8_esp_hosted_fmt_internal.h.

Field Documentation

◆ consumed

uint8_t ra8_esp_hosted_fmt_spec::consumed

Characters consumed after the per-cent.

Definition at line 138 of file ra8_esp_hosted_fmt_internal.h.

Referenced by priv_ra8_esp_hosted_fmt_parse(), and priv_ra8_esp_hosted_fmt_vformat().

◆ conv

char ra8_esp_hosted_fmt_spec::conv

Conversion character, zero on failure.

Definition at line 139 of file ra8_esp_hosted_fmt_internal.h.

Referenced by internal_emit_conv(), and priv_ra8_esp_hosted_fmt_parse().

◆ left_justify

bool ra8_esp_hosted_fmt_spec::left_justify

The - flag was present.

Definition at line 142 of file ra8_esp_hosted_fmt_internal.h.

Referenced by internal_emit_token(), and internal_parse_flags().

◆ len

ra8_esp_hosted_fmt_len_t ra8_esp_hosted_fmt_spec::len

Argument width from the length modifier.

Definition at line 140 of file ra8_esp_hosted_fmt_internal.h.

Referenced by internal_emit_conv(), and priv_ra8_esp_hosted_fmt_parse().

◆ width

uint16_t ra8_esp_hosted_fmt_spec::width

Minimum field width; zero if absent.

Definition at line 137 of file ra8_esp_hosted_fmt_internal.h.

Referenced by internal_emit_token(), and priv_ra8_esp_hosted_fmt_parse().

◆ zero_pad

bool ra8_esp_hosted_fmt_spec::zero_pad

The 0 flag was present.

Definition at line 141 of file ra8_esp_hosted_fmt_internal.h.

Referenced by internal_emit_token(), and internal_parse_flags().


The documentation for this struct was generated from the following file: