As of v1.0.4, version numbers are shared between esplugin and esplugin-ffi.
- Releases are now published to crates.io using Trusted Publishing.
- The accepted dependency version ranges have been widened to include older versions. The oldest accepted version for each dependency is the oldest that esplugin will build and pass its tests with on x86-64 Windows and Linux.
- Most of the Cargo.toml package fields are now inherited from workspace fields that are now shared with esplugin-ffi.
- Most of the lint configuration has been moved from Rust attributes to workspace configuration, leaving only the configuration that is specific to esplugin.
- Several cases where mismatches between buffer sizes and their expected sizes could cause panics now cause errors instead.
- If a malformed plugin has more than 256 masters, those past that limit will be ignored during parsing instead of causing a panic.
- Binary content in error messages (including paths) will now be output as ASCII strings with character escapes instead of hexadecimal byte arrays.
- Many code quality improvements.
- Updated encoding_rs to 0.8.35.
- Updated flate2 to 1.1.1.
- Updated nom to 8.0.0.
- Updated unicase to 2.8.1.
- Improved the performance of
Plugin::is_master_file(),Plugin::is_light_plugin(), andPlugin::is_medium_plugin()when the file extension is checked. - Updated flate2 to 1.0.34.
Plugin::is_blueprint_plugin()returns true if the plugin is a Starfield plugin that has the0x800flag set in its TES4 header record.
Plugin::masters()andPlugin::description()now truncate the strings that they return up to (and not including) their first null byte, to match the behaviour of supported games and their official modding tools.
- Support for the new medium plugin type introduced by Starfield 1.12.30.0.
- Support for comparing FormIDs between Starfield plugins.
- Support for counting the number of override records in Morrowind and Starfield plugins.
Plugin::is_medium_plugin(), which checks if the given plugin is a medium plugin.Plugin::is_valid_as_medium_plugin(), which checks if the given plugin's FormIDs fall within the valid range for a medium plugin.Error::UnresolvedFormIdsas a new error variant.Error::PluginMetadataNotFoundas a new error variant.plugins_metadata(), which outputs an opaque struct that holds metadata for all the given plugins that can be passed toPlugin::resolve_record_ids().PluginMetadataas an opaque struct that holds metadata about a plugin.Plugin::resolve_record_ids(), which is used to resolve Morrowind and Starfield records using the metadata of their masters, which is provided by the output ofplugins_metadata().Plugin::parse_reader()as a more generic replacement forPlugin::parse()andPlugin::parse_open_file().ParseOptionsas an opaque struct holding configuration options for parsing a plugin.
Plugin::count_override_records()now returns aResult<usize, Error>. It will error if called on a Morrowind or Starfield plugin that has not hadPlugin::resolve_record_ids()run on it.Plugin::overlaps_with()now returns aResult<bool, Error>. It will error if called on a Starfield plugin that has not hadPlugin::resolve_record_ids()run on it.Plugin::overlap_size()now returns aResult<usize, Error>. It will error if called on a Starfield plugin that has not hadPlugin::resolve_record_ids()run on it.Plugin::is_valid_as_light_plugin()now returns aResult<bool, Error>. It will error if called on a Starfield plugin that has not hadPlugin::resolve_record_ids()run on it.Plugin::is_valid_as_override_plugin()now returns aResult<bool, Error>. It will error if called on a Starfield plugin that has not hadPlugin::resolve_record_ids()run on it.Plugin::game_id()now returns aGameIdinstead of a&GameId.Plugin::is_override_plugin()has been renamed toPlugin::is_update_plugin()to reflect the terminology used by Starfield's Creation Kit.Plugin::is_valid_as_override_plugin()has been renamed toPlugin::is_valid_as_update_plugin()to reflect the terminology used by Starfield's Creation Kit.Plugin::parse_file()andPlugin::is_valid()now take aParseOptionsparameter object instead of a boolean indicating whether or not to only load the plugin's header.Error::ParsingError's first field is now aBox<[u8]>instead of aVec<u8>.Error::DecodeError's first field is now aBox<[u8]>instead of aVec<u8>.
Plugin::is_master_file()incorrectly used the file extension instead of the header flag for Morrowind plugins.
Plugin::is_light_master(): usePlugin::is_light_plugin()instead.Plugin::is_valid_as_light_master(): usePlugin::is_valid_as_light_plugin()instead.Plugin::parse(): usePlugin::parse_reader()with astd::io::Cursorinstead.Plugin::parse_open_file(): usePlugin::parse_reader()instead.
- Updated to Rust's 2021 edition.
Cargo.lockis no longer ignored by Git.
Error::NoFilename,Error::ParsingIncompleteandError::DecodeErrornow hold contextual data.
- Support for the expanded FormID range introduced in Skyrim Special Edition
v1.6.1130.0 for light plugins with a
HEDRversion of 1.71.
Plugin::is_valid_as_light_plugin()now takes into account the plugin'sHEDRversion when determining the valid FormID range. This means that Fallout 4 light plugins with aHEDRversion below1.0now use the correct range of object indexes, starting at0x800.
- Support for parsing Starfield plugins.
GameId::supports_light_plugins(), which returns true for Skyrim SE, Fallout 4 and Starfield.Plugin::is_override_plugin(), which checks if a Starfield plugin is loaded as an override plugin.Plugin::is_valid_as_override_plugin(), which checks if a Starfield plugin contains no new records.
- Internal code quality improvements.
- Avoid unnecessary path copy when checking if a plugin is valid.
- Updated to nom v7.0.0.
Plugin::is_light_plugin()is the preferred alias ofPlugin::is_light_master_file()as it reflects that not all plugins with the light flag set are masters.Plugin::is_valid_as_light_plugin()is the preferred alias ofPlugin::is_valid_as_light_master().
- Updated to nom v6.0.0.
Plugin::is_light_master_file(): use the aliasPlugin::is_light_plugin()instead.Plugin::is_valid_as_light_master(): use the aliasPlugin::is_valid_as_light_plugin()instead.
- Removed the
std::error::Error::description()implementation onError, to avoid CMake build errors due to the deprecation warning fordescription().
- The range of FormIDs that are recognised as valid in light masters has been
extended for Fallout 4 plugins, from between
0x800and0xFFFinclusive to between0x001and0xFFFinclusive, to reflect the extended range supported by Fallout 4 v1.10.162.0.0. The valid range for Skyrim Special Edition plugins is unchanged.
Plugin::overlap_size()for counting how many of the plugin's records are also present in the given plugins.
Plugin::overlaps_with()could fail to detect an overlap between Morrowind plugins.
- The
Error::DecodeErrorvariant no longer has any fields. - The
Error::ParsingErrorvariant is nowError::ParsingError(Vec<u8>, ParsingErrorKind)to provide more detail about why parsing failed. - Replaced the encoding dependency with encoding_rs, as the former is unmaintained.
- Updated to nom v5.0.0.
- The byteorder dependency, as Rust standard library additions have made it unnecessary.
- The unicase dependency as Unicode-aware case-insensitive string comparison was not strictly required.
- The memmap dependency. Its use was unsafe, but this was not exposed
correctly. The performance gained from reading memory-mapped files was
outweighed by the negative impact on usability that exposing the unsafety
correctly would have. There is now no use of
unsafein esplugin itself.
Plugin::overlaps_with()now detects overlaps between Morrowind plugins. It would previously always returnfalsefor all pairs of Morrowind plugins because it was checking for record FormIDs present in both plugins, but Morrowind records don't have FormIDs. Instead, record IDs are calculated from record data and used for the same purpose.Plugin::count_override_records()now always returns0for Morrowind plugins, as it's impossible to tell which records a plugin contains are new and which are overrides without comparing against its masters. The function would previously return the total number of records in the plugin.
Plugin::description(),Plugin::header_version()andPlugin::record_and_group_count()could panic if the TES4 subrecords they read were smaller than expected. Instead, the former will now error, and the latter two will now returnNone.
Plugin::header_version()for getting the value of version field in the TES3/TES4 header record'sHEDRsubrecord.Plugin::is_valid_as_light_master()for checking if it is safe to convert the plugin to a light master. This is true for Skyrim SE and Fallout 4 plugins that only add records with FormIDs with object indices between 0x800 and 0xFFF inclusive, and false otherwise.
- Error on top-level records by failing group parsing if the group type is not
GRUP. Top-level records would previously cause errors later in parsing, this change makes it more obvious where the issue lies.
Plugin::overlaps_with()for checking if two plugins edit the same records.
Plugin::parse_file()andPlugin::parse_open_file()now use memory mapping when fully parsing plugin files that are larger than 1 MB.- Improved performance when parsing plugin headers and full plugin files by reducing allocations.
FormIdandPlugin::form_ids(), there is now no public interface for representing or getting a plugin's FormIDs.Plugin::parse_mmapped_file(), usePlugin::parse_file()instead.
- Updated to nom v4.0.0.
- Updated byteorder, memmap and flate2 dependencies.
ESP_ERROR_PANICKEDreturn code for indicating that a panic was caught.
- Unwinding panics are now caught at the FFI boundary.
ESP_ERROR_PARSE_ERRORandESP_ERROR_INVALID_GAME_IDhad the same value.
- Support for Skyrim SE to correctly recognise ESL (light master) plugins when calling
Plugin::is_light_master_file(). GameId::SkyrimSEto distinguish between Skyrim and Skyrim SE plugins (the only difference in handling is ESL support).
- Updated to nom v3.2.0.
Plugin::parse_open_file()for better performance when a file handle is already open.
- Fix some invalid files being parsed successfully or failing inefficiently by validating the file header's type field as soon as possible.
Initial release