ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_app_internal.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <inttypes.h>
17#include <limits.h>
18#include <stdio.h>
19#include <stdlib.h>
20#include <string.h>
21#include <time.h>
22
23#include "mdl_app.h"
25#include "mdl_cache.h"
26#include "mdl_config.h"
27#include "mdl_discover.h"
28#include "mdl_export.h"
29#include "mdl_extract.h"
30#include "mdl_fetch.h"
31#include "mdl_fetch_internal.h"
32#include "mdl_hash.h"
33#include "mdl_library.h"
34#include "mdl_net.h"
35#include "mdl_pack.h"
36#include "mdl_pathfs.h"
37#include "mdl_politeness.h"
38#include "mdl_report.h"
39#include "mdl_sanitize.h"
40#include "mdl_session.h"
41#include "mdl_state.h"
42#include "mdl_storage.h"
43#include "mdl_stream_internal.h"
44#include "mdl_url_guard.h"
45#include "mdl_urlname.h"
46#include "mdl_verify.h"
47#include "ra8_attributes.h"
48#include "ra8_err.h"
49#include "ra8_io_stream.h"
50
62
64typedef enum : uint16_t {
68
85
102RA8_PRIV ra8_err_t priv_mdl_app_report_cache(const char* url, const mdl_cache_result_t* result);
103
123 const char* series_directory);
124
146 const char* series_url,
147 uint32_t timeout,
148 mdl_cache_t* cache);
172 const mdl_run_opts_t* opts,
173 const char* cfg_contact,
174 char* ua,
175 size_t ua_cap);
196RA8_PRIV bool priv_mdl_app_prepare_series_dir(const char* out_dir,
197 const char* series_url,
198 char* slug,
199 size_t slug_cap,
200 char* abs_dir);
219RA8_PRIV bool priv_mdl_app_state_path_of(const char* abs_dir, char* out, size_t cap);
The downloader's portable application layer: one run mode, one call.
bool priv_mdl_app_prepare_series_dir(const char *out_dir, const char *series_url, char *slug, size_t slug_cap, char *abs_dir)
Prepare a contained canonical directory for one series.
ra8_err_t priv_mdl_app_prepare_chapters(const mdl_site_t *site, const char *series_url, uint32_t timeout, mdl_cache_t *cache)
Fetch and extract a series' bounded chapter list.
ra8_err_t priv_mdl_app_start_session(mdl_net_iface_t *net, const mdl_run_opts_t *opts, const char *cfg_contact, char *ua, size_t ua_cap)
Initialize one bounded network-policy session.
ra8_err_t priv_mdl_app_report_cache(const char *url, const mdl_cache_result_t *result)
Report corruption recovery or verified cache reuse with staleness.
mdl_polite_floor_t
Polite per-image delay floors for page mode (milliseconds).
@ k_polite_img_min_ms
Polite per-image floor.
@ k_polite_img_max_ms
Polite per-image ceiling.
mdl_app_context_t * priv_mdl_app_context(void)
The working set the composition root bound with mdl_app_bind.
Definition mdl_app.c:33
mdl_bufsize_t
On-stack string buffer sizes and page-mode delays.
@ k_ext_bytes
Image-extension buffer.
@ k_dir_path_bytes
Directory-path buffer.
@ k_page_img_delay_max
page-mode per-image ceiling, ms.
@ k_cov_bytes
Coverage summary line buffer.
@ k_page_img_delay_min
page-mode per-image floor, ms.
@ k_file_path_bytes
File-path buffer.
@ k_leaf_name_bytes
Composed archive/dir leaf name.
@ k_slug_bytes
Series slug buffer.
ra8_err_t priv_mdl_app_ensure_series_cover(mdl_fetch_ctx_t *ctx, const char *series_directory)
Ensure series state names one verified cached or freshly fetched cover.
bool priv_mdl_app_state_path_of(const char *abs_dir, char *out, size_t cap)
Compose the state-journal path within a series directory.
Private portable filesystem operations shared by CLI application modes.
Bounded per-host HTTP document cache for the media downloader.
Per-site descriptor loaded from a flat key=value config file.
Search / browse discovery: governed fetch of a results page, parse, honest presentation,...
Package a downloaded chapter folder into a reader-openable container.
Extract image URLs and anchor links from an HTML page (v1 scanner).
State-aware chapter/page download orchestrator for the media downloader.
Module-private fetch-loop decisions promoted for host unit tests and the CLI's end-of-run reporting.
Content-identity hashing (FNV-1a 64) for the media downloader's persistent library state.
Portable bounded operations over a tracked media library.
Streaming HTTP(S) GET seam (a real function-pointer vtable) for the host manga downloader (v0).
Archive packaging of downloaded page folders for the mdl CLI.
Guarded filesystem directory joins for the media downloader.
Jittered inter-request delay plus the per-host politeness governor.
Human-facing progress and failure reporting for the mdl CLI.
Neutralise untrusted names before they reach a filesystem or XML sink.
Session identity (honest User-Agent) and robots.txt gating.
Persistent per-series library state for the media downloader.
Injected portable storage resources for downloader domain code.
Private bounded text helpers over the portable byte-stream contract.
Pure URL / address safety predicates for the libcurl backend.
Bounded URL naming and portable image-classification helpers.
Bounded, no-heap structural validation of mdl artifacts.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_io targetable byte-stream facade – one writer, many destinations.
The one bounded working set every application mode shares.
Definition mdl_app.h:162
Observable outcome of one cache lookup.
Definition mdl_cache.h:105
One non-reentrant cache binding over caller storage.
Definition mdl_cache.h:92
Everything mdl_fetch_run needs, injected for testability.
Definition mdl_fetch.h:164
A network backend handle: an immutable method table plus its state.
Cross-cutting policy and injected transport threaded into every mode.
Definition mdl_app.h:73
One site's scraping rules (all data, no logic).
Definition mdl_config.h:46