As of v1.0.4, version numbers are shared between esplugin and esplugin-ffi.
- 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 the0x800
flag 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::UnresolvedFormIds
as a new error variant.Error::PluginMetadataNotFound
as 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()
.PluginMetadata
as 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()
.ParseOptions
as 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 aGameId
instead 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 aParseOptions
parameter 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::Cursor
instead.Plugin::parse_open_file()
: usePlugin::parse_reader()
instead.
- Updated to Rust's 2021 edition.
Cargo.lock
is no longer ignored by Git.
Error::NoFilename
,Error::ParsingIncomplete
andError::DecodeError
now hold contextual data.
- Support for the expanded FormID range introduced in Skyrim Special Edition
v1.6.1130.0 for light plugins with a
HEDR
version of 1.71.
Plugin::is_valid_as_light_plugin()
now takes into account the plugin'sHEDR
version when determining the valid FormID range. This means that Fallout 4 light plugins with aHEDR
version below1.0
now 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
0x800
and0xFFF
inclusive to between0x001
and0xFFF
inclusive, 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::DecodeError
variant no longer has any fields. - The
Error::ParsingError
variant 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
unsafe
in esplugin itself.
Plugin::overlaps_with()
now detects overlaps between Morrowind plugins. It would previously always returnfalse
for 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 returns0
for 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'sHEDR
subrecord.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.
FormId
andPlugin::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_PANICKED
return code for indicating that a panic was caught.
- Unwinding panics are now caught at the FFI boundary.
ESP_ERROR_PARSE_ERROR
andESP_ERROR_INVALID_GAME_ID
had the same value.
- Support for Skyrim SE to correctly recognise ESL (light master) plugins when calling
Plugin::is_light_master_file()
. GameId::SkyrimSE
to 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