Oliver Hamlet 5aa61abc10 Remove pelite dependency
The advantages of using the built-in implementation instead of pelite are:

- It's much faster on average: for Starfield.exe (~ 100 MB) it is 2.8x
  faster and 4% slower reading file and product versions respectively,
  and for sfse_1_15_222.dll it is 3.35x faster and < 1% slower
  respectively.
- It reduces the transitive dependency count by 8
- It uses ~ 700 lines of first-party code that only depends on the
  standard library, instead of 240715 lines of unaudited third-party code
- pelite hasn't had a release in 3 years, and my PR for replacing winapi
  hasn't had any response in the month and a half it's been open, so the
  built-in implementation is probably less of a maintenance risk.
2025-12-03 18:39:27 +00:00
2025-08-01 18:07:36 +01:00
2025-08-01 18:07:36 +01:00
2025-12-03 18:39:27 +00:00
2025-12-03 18:39:27 +00:00
2024-04-30 22:45:59 +01:00
2025-12-03 18:39:27 +00:00
2025-12-03 18:39:27 +00:00
2018-10-05 20:21:14 +01:00

loot-condition-interpreter

CI Coverage Status

A library for parsing and evaluating LOOT's metadata condition strings. It provides:

  • Support for metadata syntax v0.26 condition strings.
  • Condition string parsing without evaluation, for checking syntax.
  • Evaluation of parsed condition strings.
  • Efficient and safe concurrent condition evaluation thanks to Rust's safety guarantees.
  • Caching of individual function evaluation results and calculated CRCs.
  • Executable version parsing without any external runtime dependencies.
  • Lots of tests, and benchmarks.
  • A C FFI library that wraps the Rust library.

Build

Make sure you have Rust installed.

To build the Rust and C FFI libraries, run:

cargo build --release --package loot-condition-interpreter-ffi

Use cbindgen to generate a C++ header file:

cbindgen ffi/ -o ffi/include/loot_condition_interpreter.h

Tests & Benchmarks

The tests and benchmarks need the testing-plugins and the LOOT API v0.13.8 Windows archives to be extracted and present in the repo root. See the GitHub Actions CI workflow for examples on what should be extracted where.

To run the Rust tests:

cargo test --workspace

To run the benchmarks:

cargo bench

There are also C++ tests for the FFI library, they require a C++ toolchain and CMake to be installed. To run the C++ tests:

mkdir ffi/build
cd ffi/build
cmake ..
cmake --build .
ctest
S
Description
No description provided
Readme MIT
833 KiB
Languages
Rust 97.2%
C++ 2.5%
CMake 0.3%