LibCYAML is a C library for reading and writing structured YAML documents. It is written in ISO C11 and licensed under the ISC licence.
Warning
The
main
branch is currently undergoing changes for version 2. You probably want to be using a tagged release instead.
The fundamental idea behind CYAML is to allow applications to construct schemas which describe both the permissible structure of the YAML documents to read/write, and the C data structure(s) in which the loaded data is arranged in memory.
libyaml
library for
low-level YAML read / write.To build the library, run:
make
You can control the optimisation and building of asserts by setting the build variant:
make VARIANT=debug
make VARIANT=release
Another debug build variant which is built with address sanitiser (incompatible with valgrind) can be built with:
make VARIANT=san
To install a release version of the library, run:
make install VARIANT=release
It will install to the PREFIX /usr/local
by default, and it will use
DESTDIR and PREFIX from the environment if set.
To run the tests, run any of the following, which generate various
levels of output verbosity (optionally setting VARIANT=release
, or
VARIANT=san
):
make test
make test-quiet
make test-verbose
make test-debug
To run the tests under valgrind
, a similar set of targets is available:
make valgrind
make valgrind-quiet
make valgrind-verbose
make valgrind-debug
To run a single test or a subset of tests, use the TESTLIST
variable, which
expects a space and/or comma separated list of test names:
make test-debug TESTLIST=test_load_mapping_without_any_fields
make valgrind-debug TESTLIST="test_load_no_log test_util_state_invalid"
To generate a test coverage report, gcovr
is required:
make coverage
To generate both public API documentation, and documentation of CYAML's
internals, doxygen
is required:
make docs
Alternatively, the read the API documentation directly from the cyaml.h header file.
There is also a tutorial.
In addition to the documentation, you can study the examples.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。