chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,8 +1,8 @@
|
||||
//! HFS+ / HFSX (inclusive volumes embutidos num wrapper HFS clássico).
|
||||
//! HFS+ / HFSX (including volumes embedded inside a classic HFS wrapper).
|
||||
//!
|
||||
//! Lê o catálogo (árvore B+) para nomes e caminhos, o bitmap de alocação para o mapa de
|
||||
//! espaço livre e procura arquivos apagados em três lugares: sobras dentro dos nós folha do
|
||||
//! catálogo, cópias antigas de nós no diário (journal) e registros de arquivo "soltos".
|
||||
//! Reads the catalog B-tree for names and paths, the allocation bitmap for free-space
|
||||
//! mapping, and searches for deleted files in three places: slack space inside catalog leaf
|
||||
//! nodes, older leaf node copies in the journal, and orphaned file records.
|
||||
|
||||
use super::{make_found, merge_extents, Ctx, NewFound, VolumeScan};
|
||||
use crate::source::{read_vec, Source};
|
||||
@@ -49,7 +49,7 @@ fn parse_fork(b: &[u8]) -> Fork {
|
||||
f
|
||||
}
|
||||
|
||||
/// Posição do volume HFS+ dentro da partição (wrapper HFS clássico) ou `None` se não for HFS+.
|
||||
/// Byte offset of the HFS+ volume inside the partition (handles HFS wrapper), or `None`.
|
||||
pub fn locate(src: &dyn Source, base: u64) -> Option<u64> {
|
||||
let h = read_vec(src, base + 1024, 512).ok()?;
|
||||
if h.len() < 512 {
|
||||
@@ -106,7 +106,7 @@ impl<'a> Vol<'a> {
|
||||
self.base + b * self.bs
|
||||
}
|
||||
|
||||
/// Todas as extensões de um fork (inclusive as do arquivo de overflow).
|
||||
/// Returns all extents of a fork (including overflow extents from the extents B-tree).
|
||||
fn fork_extents(&self, f: &Fork, file_id: u32, fork_type: u8) -> Vec<Extent> {
|
||||
let mut ex: Vec<(u32, u32)> = f.extents.clone();
|
||||
let mut have: u64 = ex.iter().map(|e| e.1 as u64).sum();
|
||||
@@ -124,7 +124,7 @@ impl<'a> Vol<'a> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Extensões além das oito iniciais, procuradas no arquivo de overflow (árvore B+).
|
||||
/// Looks up extents beyond the first eight in the extents overflow B-tree.
|
||||
fn overflow_extents(&self, file_id: u32, fork_type: u8, mut start: u32) -> Vec<(u32, u32)> {
|
||||
let mut out = vec![];
|
||||
let node_size = match self.tree_node_size(&self.extents_file) {
|
||||
@@ -140,7 +140,7 @@ impl<'a> Vol<'a> {
|
||||
continue;
|
||||
}
|
||||
for r in records(&node) {
|
||||
// chave: keyLength u16, forkType u8, pad u8, fileID u32, startBlock u32
|
||||
// key: keyLength u16, forkType u8, pad u8, fileID u32, startBlock u32
|
||||
if r.len() < 12 + 64 || be16(r, 0) != 10 {
|
||||
continue;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ impl<'a> Vol<'a> {
|
||||
self.read_fork_bytes(f, n as u64 * ns as u64, ns)
|
||||
}
|
||||
|
||||
/// Lê bytes de um fork que tem só extensões iniciais ou overflow já resolvido (para árvores).
|
||||
/// Reads bytes from a fork using its resolved extent list (used for system B-trees).
|
||||
fn read_fork_bytes(&self, f: &Fork, off: u64, len: usize) -> Option<Vec<u8>> {
|
||||
let mut out = Vec::with_capacity(len);
|
||||
let mut pos = 0u64;
|
||||
@@ -190,7 +190,7 @@ impl<'a> Vol<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Registros de um nó B+ (fatias, da chave em diante).
|
||||
/// Returns the record slices of a B-tree node (each starting at its key).
|
||||
fn records(node: &[u8]) -> Vec<&[u8]> {
|
||||
let n = be16(node, 10) as usize;
|
||||
let mut offs = vec![];
|
||||
@@ -233,7 +233,7 @@ fn date(d: u32) -> Option<i64> {
|
||||
(d != 0).then(|| d as i64 - HFS_EPOCH)
|
||||
}
|
||||
|
||||
/// Decodifica um registro do catálogo (chave + dados). `max_id` descarta lixo.
|
||||
/// Decodes a catalog record (key + data). `max_id` filters out garbage CNIDs.
|
||||
fn decode_record(
|
||||
r: &[u8],
|
||||
max_id: u32,
|
||||
@@ -265,7 +265,7 @@ fn decode_record(
|
||||
}
|
||||
}
|
||||
3 if rec.len() >= 10 => {
|
||||
// thread de pasta: chave = (id da pasta, ""); dados = (pai, nome)
|
||||
// folder thread record: key = (folder_id, ""); data = (parent_id, folder_name)
|
||||
let pn = be16(rec, 8) as usize;
|
||||
if pn <= 255 {
|
||||
threads.entry(parent).or_insert((
|
||||
@@ -304,7 +304,7 @@ fn decode_record(
|
||||
}
|
||||
}
|
||||
|
||||
/// Procura registros de arquivo nas sobras de um nó (entre os dados e a tabela de offsets).
|
||||
/// Carves deleted catalog file records from B-tree node slack space (between active records and offset table).
|
||||
fn scan_slack(
|
||||
node: &[u8],
|
||||
max_id: u32,
|
||||
@@ -346,7 +346,7 @@ pub fn scan(ctx: &mut Ctx, base: u64, part_len: u64) -> VolumeScan {
|
||||
return res;
|
||||
};
|
||||
|
||||
// Mapa de espaço livre.
|
||||
// Free-space map from the allocation file.
|
||||
if let Some(bm) = vol.read_fork_all(&vol.alloc, (vol.total / 8 + 1) as usize) {
|
||||
let mut free = vec![];
|
||||
let mut run: Option<u64> = None;
|
||||
@@ -409,7 +409,7 @@ pub fn scan(ctx: &mut Ctx, base: u64, part_len: u64) -> VolumeScan {
|
||||
n = be32(&node, 0);
|
||||
}
|
||||
|
||||
// Diário: cópias antigas de nós folha do catálogo.
|
||||
// Journal: older copies of catalog leaf nodes.
|
||||
if vol.journal_info != 0 {
|
||||
scan_journal(
|
||||
&vol,
|
||||
@@ -422,7 +422,7 @@ pub fn scan(ctx: &mut Ctx, base: u64, part_len: u64) -> VolumeScan {
|
||||
);
|
||||
}
|
||||
|
||||
// Caminho de cada pasta a partir dos threads.
|
||||
// Reconstruct folder paths from folder thread records.
|
||||
let path_of = |parent: u32| -> String {
|
||||
let mut parts = vec![];
|
||||
let mut cur = parent;
|
||||
@@ -462,9 +462,9 @@ pub fn scan(ctx: &mut Ctx, base: u64, part_len: u64) -> VolumeScan {
|
||||
if !seen.insert((f.id, ex[0].offset)) {
|
||||
continue;
|
||||
}
|
||||
// Mantém só os bytes do arquivo.
|
||||
// Trim extents to the logical file size.
|
||||
let extents = super::fat::trim_extents(ex, f.data.size);
|
||||
// Blocos já reaproveitados?
|
||||
// Check whether any blocks have already been reallocated.
|
||||
let reused = extents.iter().filter(|e| !covered_by(&free_set, e)).count();
|
||||
let (conf, note) = if reused == 0 {
|
||||
(
|
||||
@@ -523,7 +523,7 @@ impl Vol<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Procura nós folha do catálogo nas transações guardadas no diário.
|
||||
/// Scans the HFS+ journal buffer for historical catalog leaf nodes.
|
||||
fn scan_journal(
|
||||
vol: &Vol,
|
||||
ns: usize,
|
||||
@@ -556,7 +556,7 @@ fn scan_journal(
|
||||
let mut i = 0;
|
||||
while i + ns <= buf.len().min(n + ns) && i < n {
|
||||
let nd = &buf[i..i + ns];
|
||||
// nó folha do catálogo: kind = -1, altura 1, registros plausíveis
|
||||
// catalog leaf node: kind = -1, height = 1, plausible record offsets
|
||||
if nd[8] == 0xFF && nd[9] == 1 && be16(nd, 10) > 0 && (be16(nd, 10) as usize) < ns / 8 {
|
||||
let table = ns - 2 * (be16(nd, 10) as usize + 1);
|
||||
if (be16(nd, ns - 2) as usize) == 14
|
||||
|
||||
Reference in new issue
Block a user