|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
What this FORM injects, and how one parsed invocation reaches a mode. More...
Go to the source code of this file.
Functions | |
| const mdl_net_provider_t * | priv_mdl_compose_net_provider (void) |
| The libcurl transport factory this form injects into every run. | |
| mdl_series_run_t | priv_mdl_compose_build_run (const mdl_args_t *a, mdl_format_t format, const mdl_run_opts_t *opts, const mdl_nums_t *n) |
| Translate validated argv state into one portable series-run value. | |
| int | priv_mdl_compose_dispatch (const mdl_args_t *a, mdl_cli_mode_t mode, mdl_format_t format, const mdl_run_opts_t *opts, const mdl_nums_t *nums, const mdl_series_run_t *run) |
| Route the one validated mode to its portable application entry point. | |
What this FORM injects, and how one parsed invocation reaches a mode.
The only place the argv grammar and the portable application layer meet. Everything here is a translation – an mdl_args_t field into a value ::mdl_app.h already names, or a concrete host backend into the seam that consumes it – so nothing above it has to know a command line exists and nothing below it names libcurl.
Definition in file mdl_compose_internal.h.
| mdl_series_run_t priv_mdl_compose_build_run | ( | const mdl_args_t * | a, |
| mdl_format_t | format, | ||
| const mdl_run_opts_t * | opts, | ||
| const mdl_nums_t * | n ) |
Translate validated argv state into one portable series-run value.
Copies only validated selections, numeric bounds, output format and policy pointers, so the application layer sees values rather than the argv-shaped structs that produced them.
| [in] | a | Parsed and validated command-line options. |
| [in] | format | Validated output format. |
| [in] | opts | Validated run policy, including the injected transport. |
| [in] | n | Validated numeric command options. |
| mdl_series_run_t | A value borrowing the caller-owned argument storage. |
a, opts and n are non-NULL and were validated. Definition at line 71 of file mdl_compose.c.
References mdl_args_t::cache_dir, mdl_args_t::cfg, mdl_nums_t::chapters, mdl_nums_t::from_num, mdl_nums_t::from_present, mdl_args_t::out, RA8_PRIV, mdl_nums_t::seed, mdl_args_t::separate, mdl_args_t::series, mdl_nums_t::timeout, and mdl_args_t::update.
Referenced by internal_main_run().
| int priv_mdl_compose_dispatch | ( | const mdl_args_t * | a, |
| mdl_cli_mode_t | mode, | ||
| mdl_format_t | format, | ||
| const mdl_run_opts_t * | opts, | ||
| const mdl_nums_t * | nums, | ||
| const mdl_series_run_t * | run ) |
Route the one validated mode to its portable application entry point.
The whole of the argv-to-application translation: every case reads the fields that mode needs out of a and nums and calls one ::mdl_app.h entry point. The mode enum already encodes the selection strictly, so no case re-derives it from option precedence.
| [in] | a | Parsed and validated command-line options. |
| [in] | mode | The one mode mdl_cli_validate selected. |
| [in] | format | Validated output format. |
| [in] | opts | Validated run policy, including the injected transport. |
| [in] | nums | Validated numeric command options. |
| [in] | run | Prepared series-run template. |
| 0 | The selected operation completed successfully. |
| 1 | The selected operation reported an execution failure. |
| 2 | The mode value was not one validation can produce. |
mode was produced by mdl_cli_validate and a context is bound. Definition at line 91 of file mdl_compose.c.
References mdl_args_t::attr, mdl_args_t::browse, mdl_args_t::cfg, mdl_args_t::init_site_url, k_mdl_cli_mode_artifact, k_mdl_cli_mode_browse, k_mdl_cli_mode_init_site, k_mdl_cli_mode_list, k_mdl_cli_mode_pack, k_mdl_cli_mode_page, k_mdl_cli_mode_remove, k_mdl_cli_mode_search, k_mdl_cli_mode_series, k_mdl_cli_mode_update_all, k_mdl_cli_mode_verify, mdl_nums_t::max_imgs, mdl_app_run_artifact(), mdl_app_run_discover(), mdl_app_run_init_site(), mdl_app_run_list(), mdl_app_run_pack(), mdl_app_run_page(), mdl_app_run_remove(), mdl_app_run_series(), mdl_app_run_update_all(), mdl_app_run_verify(), mdl_args_t::out, mdl_args_t::pack, mdl_args_t::page_url, mdl_args_t::pick, mdl_nums_t::pick, RA8_PRIV, mdl_args_t::remove_series, mdl_nums_t::seed, mdl_nums_t::timeout, and mdl_args_t::verify_dir.
Referenced by internal_main_run().
| const mdl_net_provider_t * priv_mdl_compose_net_provider | ( | void | ) |
The libcurl transport factory this form injects into every run.
Returns the one provider whose open wires mdl_net_curl_init over this form's own backend storage. A run mode receives it through mdl_run_opts_t and never names libcurl; another form returns a different provider from its own composition and the modes are unchanged.
| non-NULL | A process-lifetime provider valid for the whole run. |
Definition at line 66 of file mdl_compose.c.
References RA8_PRIV, and s_curl_provider.
Referenced by main().