affs_read/
lib.rs

1//! # affs-read
2//!
3//! A `no_std` compatible crate for reading Amiga Fast File System (AFFS) disk images.
4//!
5//! This crate provides zero-allocation reading of ADF (Amiga Disk File) images,
6//! supporting both OFS (Original File System) and FFS (Fast File System) variants.
7//!
8//! ## Features
9//!
10//! - `no_std` compatible by default
11//! - Zero heap allocations in core functionality
12//! - Support for OFS and FFS filesystems
13//! - Support for INTL and DIRCACHE modes
14//! - Streaming file reading
15//! - Directory traversal
16//!
17//! ## Example
18//!
19//! ```ignore
20//! use affs_read::{AffsReader, BlockDevice};
21//!
22//! // Implement BlockDevice for your storage
23//! struct MyDevice { /* ... */ }
24//!
25//! impl BlockDevice for MyDevice {
26//!     fn read_block(&self, block: u32, buf: &mut [u8; 512]) -> Result<(), ()> {
27//!         // Read block from storage
28//!         Ok(())
29//!     }
30//! }
31//!
32//! let device = MyDevice { /* ... */ };
33//! let reader = AffsReader::new(&device)?;
34//!
35//! // List root directory
36//! for entry in reader.read_dir(reader.root_block())? {
37//!     println!("{}", entry.name());
38//! }
39//! ```
40
41#![no_std]
42#![deny(unsafe_op_in_unsafe_fn)]
43#![warn(missing_docs)]
44#![warn(clippy::all)]
45
46#[cfg(feature = "std")]
47extern crate std;
48
49#[cfg(feature = "alloc")]
50extern crate alloc;
51
52mod block;
53mod checksum;
54mod constants;
55mod date;
56mod dir;
57mod error;
58mod file;
59mod reader;
60mod symlink;
61mod types;
62mod varblock;
63
64pub use block::*;
65pub use checksum::{bitmap_sum, boot_sum, normal_sum, normal_sum_slice, read_u16_be};
66pub use constants::*;
67pub use date::AmigaDate;
68pub use dir::{DirEntry, DirIter};
69pub use error::AffsError;
70pub use file::FileReader;
71pub use reader::AffsReader;
72pub use symlink::{
73    MAX_SYMLINK_LEN, max_utf8_len, read_symlink_target, read_symlink_target_with_block_size,
74};
75pub use types::*;
76pub use varblock::{AffsReaderVar, MAX_BLOCK_SIZE, VarDirEntry, VarDirIter};