mdictlib 0.2.2

Library-first Rust parser for MDict .mdx and .mdd dictionaries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Narrow adapters used by the out-of-package fuzz harness.

use crate::format::common::compression::decode_block;
use crate::format::common::header::parse_header_bytes;
use crate::types::{ContainerKind, Limits};

/// Exercises both supported top-level header tags without exposing parser
/// implementation types as public API.
pub fn exercise_header_bytes(data: &[u8]) {
    let _ = parse_header_bytes(data, ContainerKind::Mdx);
    let _ = parse_header_bytes(data, ContainerKind::Mdd);
}

/// Exercises compressed-block decoding without exposing codec internals.
pub fn exercise_compressed_block(data: &[u8], expected_len: usize) {
    let _ = decode_block("fuzz block", data, expected_len, &Limits::new());
}