libfyaml v0.9.6
A release focused on API completeness and robustness: the public header is split into focused sub-headers, a new sequence sort API is added, the entire public API is hardened against NULL arguments, and a range of emitter, parser, walk, and threading bugs are fixed.
Major: Public Header Split
The monolithic libfyaml.h has been reorganized into focused sub-headers under include/libfyaml/. Existing code requires no changes — the main header still includes everything. Projects that want faster compilation can now include only the parts they need:
// Still works exactly as before
#include <libfyaml.h>
// Or include only what you need
#include <libfyaml/libfyaml-core.h> // parser, emitter, document, node, path
#include <libfyaml/libfyaml-composer.h> // composer interface
#include <libfyaml/libfyaml-docbuild.h> // document builder
#include <libfyaml/libfyaml-allocator.h> // allocator APIAll previously missing API documentation has been filled in as part of this work.
New API
fy_node_sequence_sort()
Sort a sequence node's items using a custom comparator, mirroring fy_node_mapping_sort() added in v0.9.5:
int fy_node_sequence_sort(struct fy_node *fyn_seq,
fy_node_mapping_sort_fn key_cmp, void *arg);API Hardening
The public API is now consistently guarded against NULL arguments throughout fy_token_*, fy_emit_*, and fy_doc_* functions. Previously, passing NULL to certain functions could cause crashes. This is now handled gracefully.
Bug Fixes
Emitter
- Folded block scalar line breaks no longer get lost during emission
- Fix comment indentation loss for block sequences inside mappings
- Fix memory leak in
fy_emit_mapping()
Parser
- Fix failure on empty merge key (
<<: ~) - Fix
fy_parser_event_resolve_hook_merge_key_start()error path - Fix extent check in
fy_reader_fetch_flow_scalar_handle()
Walk (YPath)
- Cap pathological YPath execution to prevent runaway resource use
- Guard numeric expression conversion against integer overflow
Document API
- Avoid rehashing anchors during document cleanup
- Fix
fy_node_copy_to_scalar()handling - Fix bogus condition in
fy_node_by_path_internal() - Keep remove-by-key lookup nodes caller-owned
Threading
- Fix threading bug triggered when thread count reaches 64
fy-tool Improvements
- Usage text rewritten and cleaned up
- Colored help output when stdout is a TTY
Build / Portability
- cmake: Install canned man pages when Sphinx is unavailable
- cmake: Respect
DESTDIRwhen creating symlinks to fy-tool - cmake: Reworked Windows CMake support
- cmake: Fixed docs build after public header move
- windows: Fixed compilation issues
- autotools: Link libm explicitly
- utils: Fix overflow utility implementations
.gitattributes: Mark all text files as LF-terminated
Platform Support
Supported platforms: Linux, macOS, FreeBSD, OpenBSD, NetBSD, and Windows.
Statistics
Installation
From Source
# CMake (all platforms including Windows)
mkdir build && cd build
cmake ..
cmake --build .
cmake --install .
# Autotools (Unix-like systems)
./bootstrap.sh
./configure
make
sudo make installUsing CMake
find_package(libfyaml 0.9.6 REQUIRED)
target_link_libraries(your_app PRIVATE libfyaml::libfyaml)Resources
- Changelog: CHANGELOG.md
- Documentation: https://pantoniou.github.io/libfyaml/
- Repository: https://github.com/pantoniou/libfyaml
- Issues: https://github.com/pantoniou/libfyaml/issues