aboutsummaryrefslogtreecommitdiff
path: root/libnres/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2023-09-17 01:45:17 +0300
committerValentin Popov <valentin@popov.link>2023-09-17 01:45:17 +0300
commit0c095125de8840d09cc825dfc241b3e4d3617335 (patch)
treece58f9bc906b08cc094b3d36f9727d6959a76233 /libnres/src/lib.rs
parent4e195ec38657605657dcbcc5b76581cbf5b8c404 (diff)
downloadfparkan-0c095125de8840d09cc825dfc241b3e4d3617335.tar.xz
fparkan-0c095125de8840d09cc825dfc241b3e4d3617335.zip
Перенос старых наработок в новый репозиторий
Diffstat (limited to 'libnres/src/lib.rs')
-rw-r--r--libnres/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/libnres/src/lib.rs b/libnres/src/lib.rs
new file mode 100644
index 0000000..40c0b32
--- /dev/null
+++ b/libnres/src/lib.rs
@@ -0,0 +1,24 @@
+/// First constant value of the NRes file ("NRes" characters in numeric)
+pub const FILE_TYPE_1: u32 = 1936020046;
+/// Second constant value of the NRes file
+pub const FILE_TYPE_2: u32 = 256;
+/// Size of the element item (in bytes)
+pub const LIST_ELEMENT_SIZE: u32 = 64;
+/// Minimum allowed file size (in bytes)
+pub const MINIMUM_FILE_SIZE: u32 = 16;
+
+static DEBUG: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+
+mod converter;
+mod error;
+pub mod reader;
+
+/// Get debug status value
+pub fn get_debug() -> bool {
+ DEBUG.load(std::sync::atomic::Ordering::Relaxed)
+}
+
+/// Change debug status value
+pub fn set_debug(value: bool) {
+ DEBUG.store(value, std::sync::atomic::Ordering::Relaxed)
+}