gta_img/lib.rs
1//! Library for reading from/writing to `IMG` archives (and supplementary `DIR` files) used throughout the 3D universe-era of Grand Theft Auto games.
2
3/// Contains types for errors.
4pub mod error;
5
6/// Contains types and the accompanying logic for reading from archives of different versions.
7pub mod read;
8
9/// Contains types and the accompanying logic for writing to archives of different versions.
10pub mod write;
11
12/// Represents the number of bytes of a sector.
13pub const SECTOR_SIZE: u64 = 2048;
14
15/// Represents the maximum length of the name of an entry, excluding the null-terminator.
16pub const NAME_SIZE: usize = 23;
17
18/// Represents the null terminator for the names of entries.
19pub const NULL_TERMINATOR: u8 = b'\0';
20
21/// Represents the structure for a V2-style header.
22pub const VERSION_2_HEADER: [u8; 4] = [0x56, 0x45, 0x52, 0x32]; // VER2