ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
unarch_tar_internal.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <stddef.h>
24#include <stdint.h>
25
26#include "ra8_attributes.h"
27#include "ra8_err.h"
28#include "unarch_tar.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
55
72
103RA8_PRIV [[nodiscard]] ra8_err_t
104priv_unarch_tar_num(const uint8_t* field, size_t len, uint64_t* out);
105
130RA8_PRIV [[nodiscard]] bool priv_unarch_tar_block_zero(const uint8_t* block);
131
157RA8_PRIV [[nodiscard]] bool priv_unarch_tar_checksum_ok(const uint8_t* block);
158
183RA8_PRIV [[nodiscard]] bool priv_unarch_tar_magic_ok(const uint8_t* block);
184
209RA8_PRIV [[nodiscard]] ra8_tar_type_t priv_unarch_tar_classify(uint8_t typeflag);
210
251RA8_PRIV [[nodiscard]] ra8_err_t priv_unarch_tar_pax_parse(const uint8_t* data,
252 size_t len,
253 char* name_buf,
254 uint16_t name_cap,
255 uint16_t* name_len,
256 bool* have_path,
257 uint64_t* size_ovr,
258 bool* have_size);
259
260#ifdef __cplusplus
261}
262#endif
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
Clean-room, read-only streaming tar walker (POSIX ustar + pax + GNU).
ra8_err_t priv_unarch_tar_pax_parse(const uint8_t *data, size_t len, char *name_buf, uint16_t name_cap, uint16_t *name_len, bool *have_path, uint64_t *size_ovr, bool *have_size)
Parse pax extended-header records, extracting path / size.
bool priv_unarch_tar_block_zero(const uint8_t *block)
Whether a header block is all zero bytes (end-of-archive marker).
ra8_tar_layout_t
Byte offsets / lengths of the ustar header fields this reader uses.
@ k_ra8_tar_len_prefix
prefix field length.
@ k_ra8_tar_off_prefix
prefix field offset.
@ k_ra8_tar_len_size
size field length.
@ k_ra8_tar_off_size
size field offset.
@ k_ra8_tar_len_chksum
chksum field length.
@ k_ra8_tar_len_magic
Compared magic length ("ustar").
@ k_ra8_tar_off_magic_term
Byte after "ustar" (NUL or ' ').
@ k_ra8_tar_off_name
name field offset.
@ k_ra8_tar_off_chksum
chksum field offset.
@ k_ra8_tar_off_type
typeflag byte offset.
@ k_ra8_tar_len_name
name field length.
@ k_ra8_tar_off_magic
magic field offset.
bool priv_unarch_tar_magic_ok(const uint8_t *block)
Whether a header block carries the ustar / GNU magic.
ra8_tar_type_t
Normalised classification of a header block's typeflag.
@ k_ra8_tar_type_pax
pax extended header ('x').
@ k_ra8_tar_type_other
Any other member kind (skipped).
@ k_ra8_tar_type_dir
Directory ('5').
@ k_ra8_tar_type_meta
Skipped meta: 'g' global, 'K' longlink.
@ k_ra8_tar_type_file
Regular file ('0' or NUL).
@ k_ra8_tar_type_longname
GNU longname data ('L').
bool priv_unarch_tar_checksum_ok(const uint8_t *block)
Verify a header block's checksum (unsigned byte sum).
ra8_err_t priv_unarch_tar_num(const uint8_t *field, size_t len, uint64_t *out)
Decode a tar numeric field (octal ASCII or GNU base-256).
ra8_tar_type_t priv_unarch_tar_classify(uint8_t typeflag)
Classify a header block's typeflag byte.