17 "# Copyright (c) 2026 Brighton Sikarskie\n"
18 "# SPDX-License-Identifier: MIT\n"
20 "# Site descriptor for %s (%s).\n"
21 "# Generated by mdl --init-site\n"
27 "# --- chapter list (on a series page) ---\n"
28 "chapter_url_contains = /chapter-\n"
29 "# chapter_url_prefix = https://%s/path/to/series/chapters/\n"
30 "chapter_order = asc\n"
32 "# --- search / discovery ---\n"
33 "search_url = https://%s/?s={q}\n"
34 "search_result_contains = /manga/\n"
35 "browse_url = https://%s/\n"
37 "# --- page images (on a chapter page) ---\n"
38 "page_img_attr = data-src\n"
39 "page_img_url_contains = /uploads/\n"
41 "# --- politeness (milliseconds; jittered in [min,max]) ---\n"
42 "img_delay_min = 500\n"
43 "img_delay_max = 1200\n"
44 "chapter_delay_min = 1500\n"
45 "chapter_delay_max = 3000\n";
49 if ((storage ==
nullptr) || (storage->
fs ==
nullptr) || (path ==
nullptr) || (path[0] !=
'/')) {
81 if ((storage ==
nullptr) || (storage->
fs ==
nullptr) || (path ==
nullptr) || (path[0] !=
'/') ||
82 (out_removed ==
nullptr)) {
108 const char* destination,
113 if ((storage ==
nullptr) || (storage->
fs ==
nullptr) || (storage->
io_buffer ==
nullptr) ||
114 (storage->
io_buffer_bytes == 0U) || (destination ==
nullptr) || (url ==
nullptr) ||
115 (host ==
nullptr) || (name ==
nullptr)) {
118 const char* hptr = (
strncmp(host,
"www.", 4U) == 0) ? host + 4 : host;
119 const int rendered = snprintf((
char*)storage->
io_buffer,
129 if ((rendered < 0) || ((uint64_t)rendered >= (uint64_t)storage->
io_buffer_bytes)) {
ra8_err_t fw_fs_stat(const fw_fs_namespace_t *names, const char *path, fw_fs_stat_t *out)
Query a path; a miss is success with out->exists == false.
ra8_err_t fw_fs_unlink(const fw_fs_namespace_t *names, const char *path)
Remove one regular file; directories require fw_fs_rmdir.
ra8_err_t fw_fs_mkdir(const fw_fs_namespace_t *names, const char *path)
Create exactly one directory; parents must already exist.
@ k_fw_fs_node_directory
Directory.
@ k_fw_fs_node_file
Regular byte stream.
@ k_fw_fs_node_symlink
Symbolic link, if observable.
static const char s_site_descriptor_format[]
Complete starter descriptor template written by init-site mode.
ra8_err_t priv_mdl_app_storage_unlink_regular(mdl_storage_t *storage, const char *path, bool *out_removed)
Remove one regular file while refusing symbolic or special nodes.
ra8_err_t priv_mdl_app_storage_ensure_directory(mdl_storage_t *storage, const char *path)
Ensure one canonical portable path names a real directory.
ra8_err_t priv_mdl_app_storage_publish_site(mdl_storage_t *storage, const char *destination, const char *url, const char *host, const char *name)
Render and create one starter site descriptor transactionally.
Private portable filesystem operations shared by CLI application modes.
ra8_err_t mdl_storage_txn_write(mdl_storage_txn_t *writer, const uint8_t *bytes, uint32_t length)
Append one complete caller chunk, tolerating bounded short writes.
ra8_err_t mdl_storage_txn_begin_new(mdl_storage_txn_t *writer, mdl_storage_t *storage, const char *destination)
Begin one streamed create-new publication without replacement.
ra8_err_t mdl_storage_txn_abort(mdl_storage_txn_t *writer)
Abort and clear one streamed transaction.
ra8_err_t mdl_storage_txn_commit(mdl_storage_txn_t *writer)
Independently validate and publish a completed streamed transaction.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_exists
Item already exists – cannot create again.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_access_denied
Operation refused because the target is protected against it.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
int strncmp(const char *s1, const char *s2, size_t n)
Compare two strings up to a specified length.
Result of a portable metadata query.
bool exists
False means a clean lookup miss.
fw_fs_node_type_t type
Kind of node at the path.
fw_fs_namespace_t names
Namespace operations.
bool active
Begin succeeded.
One non-reentrant downloader filesystem dependency bundle.
uint8_t * io_buffer
Caller-owned stream scratch.
const fw_fs_t * fs
Injected portable filesystem.
uint32_t io_buffer_bytes
Stream scratch extent.
Caller-owned streaming publication transaction with running identity.
fw_fs_transaction_t transaction
Active private filesystem stage.