mod decoder;
mod reader;
mod state;
pub use reader::ExplodeReader;
pub use state::ExplodeState;
use crate::Result;
use std::io::Read;
pub const IN_BUFF_SIZE: usize = 0x800;
pub const OUT_BUFF_SIZE: usize = 0x2204;
pub const CODES_SIZE: usize = 0x100;
pub const OFFSS_SIZE: usize = 0x100;
pub const OFFSS_SIZE1: usize = 0x80;
pub const CH_BITS_ASC_SIZE: usize = 0x100;
pub const DIST_SIZES: usize = 0x40;
pub const LENS_SIZES: usize = 0x10;
pub const PKDCL_OK: u32 = 0;
pub const PKDCL_STREAM_END: u32 = 1;
pub const PKDCL_NEED_DICT: u32 = 2;
pub const PKDCL_CONTINUE: u32 = 10;
pub const PKDCL_GET_INPUT: u32 = 11;
pub const LITERAL_END_OF_STREAM: u32 = 0x305;
pub const LITERAL_ERROR: u32 = 0x306;
pub fn explode_bytes(data: &[u8]) -> Result<Vec<u8>> {
let mut reader = ExplodeReader::new(std::io::Cursor::new(data))?;
let mut output = Vec::new();
reader.read_to_end(&mut output)?;
Ok(output)
}
pub fn explode_mpq_bytes(data: &[u8]) -> Result<Vec<u8>> {
explode_bytes(data)
}