From 84e16f650d7ecfe022060c3268217cfba616c997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Sat, 11 Apr 2020 19:21:08 +0200 Subject: 0.2.3 dist files --- CMakeLists.txt | 4 +- Changes | 337 ++++++++++++++++++++++++ LICENSE | 20 -- License | 20 ++ Makefile.am | 4 +- Makefile.in | 6 +- README | 32 --- ReadMe.md | 46 ++++ configure | 26 +- configure.ac | 4 +- doc/html/annotated.html | 2 +- doc/html/classes.html | 2 +- doc/html/files.html | 2 +- doc/html/functions.html | 2 +- doc/html/functions_b.html | 2 +- doc/html/functions_c.html | 2 +- doc/html/functions_d.html | 2 +- doc/html/functions_e.html | 2 +- doc/html/functions_f.html | 2 +- doc/html/functions_h.html | 2 +- doc/html/functions_i.html | 2 +- doc/html/functions_k.html | 2 +- doc/html/functions_l.html | 2 +- doc/html/functions_m.html | 2 +- doc/html/functions_n.html | 2 +- doc/html/functions_o.html | 2 +- doc/html/functions_p.html | 2 +- doc/html/functions_q.html | 2 +- doc/html/functions_r.html | 2 +- doc/html/functions_s.html | 2 +- doc/html/functions_t.html | 11 +- doc/html/functions_u.html | 2 +- doc/html/functions_v.html | 2 +- doc/html/functions_vars.html | 2 +- doc/html/functions_vars_b.html | 2 +- doc/html/functions_vars_c.html | 2 +- doc/html/functions_vars_d.html | 2 +- doc/html/functions_vars_e.html | 2 +- doc/html/functions_vars_f.html | 2 +- doc/html/functions_vars_h.html | 2 +- doc/html/functions_vars_i.html | 2 +- doc/html/functions_vars_k.html | 2 +- doc/html/functions_vars_l.html | 2 +- doc/html/functions_vars_m.html | 2 +- doc/html/functions_vars_n.html | 2 +- doc/html/functions_vars_o.html | 2 +- doc/html/functions_vars_p.html | 2 +- doc/html/functions_vars_q.html | 2 +- doc/html/functions_vars_r.html | 2 +- doc/html/functions_vars_s.html | 2 +- doc/html/functions_vars_t.html | 11 +- doc/html/functions_vars_u.html | 2 +- doc/html/functions_vars_v.html | 2 +- doc/html/functions_vars_w.html | 2 +- doc/html/functions_w.html | 2 +- doc/html/globals.html | 16 +- doc/html/globals_defs.html | 2 +- doc/html/globals_enum.html | 2 +- doc/html/globals_eval.html | 2 +- doc/html/globals_func.html | 16 +- doc/html/globals_type.html | 2 +- doc/html/group__basic.html | 2 +- doc/html/group__emitter.html | 6 +- doc/html/group__events.html | 58 ++-- doc/html/group__export.html | 2 +- doc/html/group__nodes.html | 40 +-- doc/html/group__parser.html | 2 +- doc/html/group__styles.html | 2 +- doc/html/group__tokens.html | 2 +- doc/html/group__version.html | 2 +- doc/html/index.html | 2 +- doc/html/modules.html | 2 +- doc/html/structyaml__alias__data__s.html | 2 +- doc/html/structyaml__anchors__s.html | 2 +- doc/html/structyaml__document__s.html | 2 +- doc/html/structyaml__emitter__s.html | 6 +- doc/html/structyaml__event__s.html | 2 +- doc/html/structyaml__mark__s.html | 2 +- doc/html/structyaml__node__pair__s.html | 2 +- doc/html/structyaml__node__s.html | 2 +- doc/html/structyaml__parser__s.html | 22 +- doc/html/structyaml__simple__key__s.html | 2 +- doc/html/structyaml__tag__directive__s.html | 2 +- doc/html/structyaml__token__s.html | 2 +- doc/html/structyaml__version__directive__s.html | 2 +- doc/html/yaml_8h.html | 46 ++-- include/yaml.h | 30 +-- src/api.c | 22 +- src/emitter.c | 27 +- src/loader.c | 306 +++++++++++++-------- src/parser.c | 5 +- src/scanner.c | 5 +- tests/example-deconstructor-alt.c | 6 +- 93 files changed, 877 insertions(+), 387 deletions(-) create mode 100644 Changes delete mode 100644 LICENSE create mode 100644 License delete mode 100644 README create mode 100644 ReadMe.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 9504c3b..72a7f12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,11 @@ project (yaml C) set (YAML_VERSION_MAJOR 0) set (YAML_VERSION_MINOR 2) -set (YAML_VERSION_PATCH 2) +set (YAML_VERSION_PATCH 3) set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}") option(BUILD_SHARED_LIBS "Build libyaml as a shared library" OFF) -option(YAML_STATIC_LIB_NAME "base name of static library output" yaml) +set(YAML_STATIC_LIB_NAME "yaml" CACHE STRING "Base name of static library output") # # Output directories for a build tree diff --git a/Changes b/Changes new file mode 100644 index 0000000..a2b40d1 --- /dev/null +++ b/Changes @@ -0,0 +1,337 @@ +0.2.3 2020-04-11 + + - https://github.com/yaml/libyaml/pull/130 + Fixed typo. + + - https://github.com/yaml/libyaml/pull/144 + Fix typo in comment + + - https://github.com/yaml/libyaml/pull/140 + Use pointer to const for strings that aren't/shouldn't be modified + + - https://github.com/yaml/libyaml/pull/128 + Squash a couple of warnings in example-deconstructor-alt + + - https://github.com/yaml/libyaml/pull/151 + Fix spelling for error message + + - https://github.com/yaml/libyaml/pull/161 + Make appveyor config be a hidden file + + - https://github.com/yaml/libyaml/pull/159 + Add CHANGES file + + - https://github.com/yaml/libyaml/pull/160 + Always output document end before directive (YAML 1.2 compatibility) + + - https://github.com/yaml/libyaml/pull/162 + Output document end marker after open ended scalars + + - https://github.com/yaml/libyaml/pull/157 + change cmake target name from libOFF.a to libyaml.a + + - https://github.com/yaml/libyaml/pull/155 + include/yaml.h: fix comments + + - https://github.com/yaml/libyaml/pull/169 + Fixed missing token in example + + - https://github.com/yaml/libyaml/pull/127 + Avoid recursion in the document loader. + + - https://github.com/yaml/libyaml/pull/172 + Support %YAML 1.2 directives + + - https://github.com/yaml/libyaml/pull/66 + Change dllexport controlling macro to use _WIN32 + +0.2.2 2019-03-12 + + - https://github.com/yaml/libyaml/pull/95 + build: do not install config.h + + - https://github.com/yaml/libyaml/pull/97 + appveyor.yml: fix Release build + + - https://github.com/yaml/libyaml/pull/103 + Remove unused code in yaml_document_delete + + - https://github.com/yaml/libyaml/pull/104 + Allow colons in plain scalars inside flow collections + + - https://github.com/yaml/libyaml/pull/109 + Fix comparison in tests/run-emitter.c + + - https://github.com/yaml/libyaml/pull/117 + Fix typo error + + - https://github.com/yaml/libyaml/pull/119 + The closing single quote needs to be indented... + + - https://github.com/yaml/libyaml/pull/121 + fix token name typos in comments + + - https://github.com/yaml/libyaml/pull/122 + Revert removing of open_ended after top level plain scalar + + - https://github.com/yaml/libyaml/pull/125 + Cherry-picks from PR 27 + + - https://github.com/yaml/libyaml/pull/135 + Windows/C89 compatibility + + - https://github.com/yaml/libyaml/pull/136 + allow override of Windows static lib name + +0.2.1 2018-06-24 + + - https://github.com/yaml/libyaml/pull/10 + Support static and dynamic libraries + + - https://github.com/yaml/libyaml/pull/12 + Use .gitignore instead of .hgignore + + - https://github.com/yaml/libyaml/pull/13 + Add support for `make test` and travis + + - https://github.com/yaml/libyaml/pull/14 + Dockerfile for testing + + - https://github.com/yaml/libyaml/pull/15 + Apply old fix for `\/` that is not in master. + + - https://github.com/yaml/libyaml/pull/17 + Update license to include all years until now. + + - https://github.com/yaml/libyaml/pull/18 + Port bug fix from Perl binding + + - https://github.com/yaml/libyaml/pull/22 + Fix misspell: preceed + + - https://github.com/yaml/libyaml/pull/23 + Removed trailing-whitespaces + + - https://github.com/yaml/libyaml/pull/24 + Fix typo + + - https://github.com/yaml/libyaml/pull/25 + added an examples directory with a few yaml examples + + - https://github.com/yaml/libyaml/pull/26 + Added missing Cflags path in pkg-config file + + - https://github.com/yaml/libyaml/pull/31 + add unit tests to cmake configuration + + - https://github.com/yaml/libyaml/pull/32 + Include an example of a custom tag from Python + + - https://github.com/yaml/libyaml/pull/33 + Include an example of a %YAML tag + + - https://github.com/yaml/libyaml/pull/34 + Added an example of using a global tag + + - https://github.com/yaml/libyaml/pull/36 + Fix -Wformat compilation errors in tests + + - https://github.com/yaml/libyaml/pull/37 + Update bug report URL in LibYAML + + - https://github.com/yaml/libyaml/pull/38 + Use AM_CPPFLAGS since autotools deprecated INCLUDE + + - https://github.com/yaml/libyaml/pull/39 + Update bug report URL in README + + - https://github.com/yaml/libyaml/pull/41 + Add travis and Makefile support for libyaml-test + + - https://github.com/yaml/libyaml/pull/43 + Add Dockerfile for Fedora 25 + + - https://github.com/yaml/libyaml/pull/44 + WIP: Enable all warnings (-Wall) in libyaml and tests + + - https://github.com/yaml/libyaml/pull/45 + Fix typo + + - https://github.com/yaml/libyaml/pull/47 + Move travis script guts to separate file + + - https://github.com/yaml/libyaml/pull/48 + `yaml/libyaml-test` should become part of `yaml/libyaml` + + - https://github.com/yaml/libyaml/pull/50 + Add a GNUMakefile for immediate make targets + + - https://github.com/yaml/libyaml/pull/53 + Switch from test blacklist to whitelist + + - https://github.com/yaml/libyaml/pull/55 + Update defs for MingGW support on Windows + + - https://github.com/yaml/libyaml/pull/58 + Improve CMakeLists + + - https://github.com/yaml/libyaml/pull/64 + README: Update libyaml link + + - https://github.com/yaml/libyaml/pull/69 + Skip 5 tests in libyaml-emitter.list + + - https://github.com/yaml/libyaml/pull/74 + Forbid escaped singlequote in doublequotes + + - https://github.com/yaml/libyaml/pull/76 + Rewrite make test-suite + + - https://github.com/yaml/libyaml/pull/77 + Undefined PTRDIFF_MAX on HP-UX + + - https://github.com/yaml/libyaml/pull/78 + Fixed most compiler warnings -Wall -Wextra + + - https://github.com/yaml/libyaml/pull/82 + Move yaml-test-suite integration onto a separate branch. + + - https://github.com/yaml/libyaml/pull/86 + Fix problems in CI failures (travis and semaphore) + + - https://github.com/yaml/libyaml/pull/87 + appveyor.yml: add mingw-w64 builds + + - https://github.com/yaml/libyaml/pull/88 + add -no-undefined to src/Makefile.am + + - https://github.com/yaml/libyaml/pull/89 + Added alpine linux testing to dockerfiles + + - https://github.com/yaml/libyaml/pull/93 + remove need for PTRDIFF_MAX + + - https://github.com/yaml/libyaml/pull/94 + .gitignore: major cleanup + + - https://github.com/yaml/libyaml/pull/120 + Fix doc. + +0.1.7 2016-08-27 + + - Fixed segfault in yaml_string_write_handler. + + - Fixed invalid simple key assertion. + + - Fixed error handling in some examples (thank to Mathias Svensson). + + - Removed obsolete VS project files. + +0.1.6 2014-03-26 + + - https://github.com/yaml/libyaml/commit/d1003a9 + Fixed heap overflow in yaml_parser_scan_uri_escapes (Thanks + Ivan Fratric of the Google Security Team). + + - https://github.com/yaml/libyaml/commit/662f4be + Added tag 0.1.5 for changeset a5142b24428b + +0.1.5 2014-02-03 + + - https://github.com/yaml/libyaml/commit/303b455 + Manually define PTRDIFF_MAX for VS C compiler. + + - https://github.com/yaml/libyaml/commit/1ef1171 + Forgot to set the error state. + + - https://github.com/yaml/libyaml/commit/c9479c7 + Limit input size to SIZE_MAX/2. + + - https://github.com/yaml/libyaml/commit/c201bf6 + Guard against overflows in indent and flow_level. + + - https://github.com/yaml/libyaml/commit/bb8ab82 + Added .hgignore. + + - https://github.com/yaml/libyaml/commit/2d94fc5 + Prevent node index overflow (Reported by Florian Weimer). + + - https://github.com/yaml/libyaml/commit/df33f25 + Bumped the version number. + + - https://github.com/yaml/libyaml/commit/f56726b + Fixed invalid size_t->int cast (Thank to Florian Weimer). + + - https://github.com/yaml/libyaml/commit/01e8dad + Added a basic CMake project. + + - https://github.com/yaml/libyaml/commit/f54fc40 + Added tag 0.1.4 for changeset 3e6507fa0c26 + +0.1.4 2012-12-24 + + - Fixed a bug that prevented an empty mapping being used as a simple key + (thank to spitzak(at)rhythm(dot)com). + + - Fixed pointer overflow when calculating the position of a potential + simple key (thank to ppelletier(at)oblong(dot)com). + + - Fixed yaml.dll not exporting any symbols + (thank to pxn11432(at)nifty(dot)com). + + - Added pkg-config support (thank to rainwoodman(at)gmail(dot)com). + +0.1.3 2009-08-29 + + - This release fixes non-standard structure initialization and + a streaming-related issue. + +0.1.2 2008-12-27 + + - Minor bugfix release + +0.1.1 2006-08-01 + + - https://github.com/yaml/libyaml/commit/5e52c31 + Fixed a problem when the DOCUMENT-END event is not emitted until + the beginning of the next document is available. Fixed #51. + Thanks edward(at)sweetbytes.net for the bug report. + + - https://github.com/yaml/libyaml/commit/dd71484 + Add project files for Visual Studio 2003. + + - https://github.com/yaml/libyaml/commit/ce8a93e + Fix the example_deconstructor project. + + - https://github.com/yaml/libyaml/commit/c9b74de + Eliminate some warnings and add more doxygen definitions. + + - https://github.com/yaml/libyaml/commit/0122490 + Undefine the NDEBUG directive for the test programs. + + - https://github.com/yaml/libyaml/commit/071329a + Fix a bug in the emitter introduced while fixing warnings for VC6. + + - https://github.com/yaml/libyaml/commit/6f6bbb8 + Add VC6 projects for the test executables. + + - https://github.com/yaml/libyaml/commit/0174ed6 + Add win32 fixes and project files for VC6. + + - https://github.com/yaml/libyaml/commit/e27a3c8 + Add functions for constructing, parsing and emitting YAML documents. + + - https://github.com/yaml/libyaml/commit/a907bf8 + Add `const` qualifier for `yaml_parser_set_input_string` parameter `input`. + + - https://github.com/yaml/libyaml/commit/c83b67a + Force a new line at the end of the input stream even if there + are no a new line character. This fixes a nasty bug when libyaml hangs on + documents like `[[[[`. Thanks ciaranm for reporting the bug. + + - https://github.com/yaml/libyaml/commit/609cce0 + Older versions of gcc do not know about -Wno-pointer-sign. + +0.0.1 2006-08-01 + + - Initial release diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e8f8805..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2017-2019 Ingy döt Net -Copyright (c) 2006-2016 Kirill Simonov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/License b/License new file mode 100644 index 0000000..3d82c28 --- /dev/null +++ b/License @@ -0,0 +1,20 @@ +Copyright (c) 2017-2020 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile.am b/Makefile.am index c0cf7ce..b21549a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = include src . tests -EXTRA_DIST = README LICENSE CMakeLists.txt doc/doxygen.cfg +EXTRA_DIST = Changes ReadMe.md License CMakeLists.txt doc/doxygen.cfg pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = yaml-0.1.pc @@ -25,7 +25,7 @@ bootstrap: maintainer-clean test: all make -C tests check-TESTS -test-suite: tests/run-test-suite +test-suite: tests/run-test-suite all make -C $< test test-all: test test-suite diff --git a/Makefile.in b/Makefile.in index 51dc8f3..816f5f4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -190,7 +190,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/yaml-0.1.pc.in \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ - $(top_srcdir)/config/missing README config/compile \ + $(top_srcdir)/config/missing config/compile \ config/config.guess config/config.sub config/install-sh \ config/ltmain.sh config/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -357,7 +357,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include src . tests -EXTRA_DIST = README LICENSE CMakeLists.txt doc/doxygen.cfg +EXTRA_DIST = Changes ReadMe.md License CMakeLists.txt doc/doxygen.cfg pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = yaml-0.1.pc all: all-recursive @@ -872,7 +872,7 @@ bootstrap: maintainer-clean test: all make -C tests check-TESTS -test-suite: tests/run-test-suite +test-suite: tests/run-test-suite all make -C $< test test-all: test test-suite diff --git a/README b/README deleted file mode 100644 index 0ac53e5..0000000 --- a/README +++ /dev/null @@ -1,32 +0,0 @@ -LibYAML - A C library for parsing and emitting YAML. - -To build and install the library, run: -$ ./configure -$ make -# make install - -If you checked the source code from the Git repository, run -$ ./bootstrap -$ ./configure -$ make -# make install - -For more information, check the LibYAML homepage: -'https://github.com/yaml/libyaml'. - -Discuss LibYAML with the maintainers in IRC #libyaml irc.freenode.net. - -You may also use the YAML-Core mailing list: -'http://lists.sourceforge.net/lists/listinfo/yaml-core'. - -Submit bug reports and feature requests to the LibYAML bug tracker: -'https://github.com/yaml/libyaml/issues/new'. - -This project was developed for Python Software Foundation as a part of Google -Summer of Code under the mentorship of Clark Evans. - -The LibYAML module was written by Kirill Simonov . -It is currently maintained by the YAML community. - -LibYAML is released under the MIT license. -See the file LICENSE for more details. diff --git a/ReadMe.md b/ReadMe.md new file mode 100644 index 0000000..2dfcc44 --- /dev/null +++ b/ReadMe.md @@ -0,0 +1,46 @@ +## LibYAML - A C library for parsing and emitting YAML. + +To build and install the library, run: + + $ ./configure + $ make + # make install + +Required packages: + +- gcc +- libtool +- make + +If you checked the source code from the Git repository, run + + $ ./bootstrap + $ ./configure + $ make + # make install + +Required packages: + +- autoconf +- libtool +- make + +For more information, check the [LibYAML +homepage](https://github.com/yaml/libyaml). + +Discuss LibYAML with the maintainers in IRC #libyaml irc.freenode.net. + +You may also use the [YAML-Core mailing +list](http://lists.sourceforge.net/lists/listinfo/yaml-core). + +Submit bug reports and feature requests to the [LibYAML bug +tracker](https://github.com/yaml/libyaml/issues/new). + +This project was developed for Python Software Foundation as a part of Google +Summer of Code under the mentorship of Clark Evans. + +The LibYAML module was written by Kirill Simonov . +It is currently maintained by the YAML community. + +LibYAML is released under the MIT license. +See the file LICENSE for more details. diff --git a/configure b/configure index dc783d1..ddf4cf9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for yaml 0.2.2. +# Generated by GNU Autoconf 2.69 for yaml 0.2.3. # # Report bugs to . # @@ -589,8 +589,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='yaml' PACKAGE_TARNAME='yaml' -PACKAGE_VERSION='0.2.2' -PACKAGE_STRING='yaml 0.2.2' +PACKAGE_VERSION='0.2.3' +PACKAGE_STRING='yaml 0.2.3' PACKAGE_BUGREPORT='https://github.com/yaml/libyaml/issues/new' PACKAGE_URL='' @@ -1329,7 +1329,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures yaml 0.2.2 to adapt to many kinds of systems. +\`configure' configures yaml 0.2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1400,7 +1400,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yaml 0.2.2:";; + short | recursive ) echo "Configuration of yaml 0.2.3:";; esac cat <<\_ACEOF @@ -1510,7 +1510,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yaml configure 0.2.2 +yaml configure 0.2.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1933,7 +1933,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by yaml $as_me 0.2.2, which was +It was created by yaml $as_me 0.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2798,7 +2798,7 @@ fi # Define the identity of the package. PACKAGE='yaml' - VERSION='0.2.2' + VERSION='0.2.3' cat >>confdefs.h <<_ACEOF @@ -2900,16 +2900,16 @@ $as_echo "#define YAML_VERSION_MAJOR 0" >>confdefs.h $as_echo "#define YAML_VERSION_MINOR 2" >>confdefs.h -$as_echo "#define YAML_VERSION_PATCH 2" >>confdefs.h +$as_echo "#define YAML_VERSION_PATCH 3" >>confdefs.h -$as_echo "#define YAML_VERSION_STRING \"0.2.2\"" >>confdefs.h +$as_echo "#define YAML_VERSION_STRING \"0.2.3\"" >>confdefs.h # Define substitutions for the libtool version numbers. YAML_LT_RELEASE=0 YAML_LT_CURRENT=2 -YAML_LT_REVISION=6 +YAML_LT_REVISION=7 YAML_LT_AGE=0 @@ -12878,7 +12878,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by yaml $as_me 0.2.2, which was +This file was extended by yaml $as_me 0.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12944,7 +12944,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -yaml config.status 0.2.2 +yaml config.status 0.2.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 7e49151..f64ba13 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # Define the package version numbers and the bug reporting link. m4_define([YAML_MAJOR], 0) m4_define([YAML_MINOR], 2) -m4_define([YAML_PATCH], 2) +m4_define([YAML_PATCH], 3) m4_define([YAML_BUGS], [https://github.com/yaml/libyaml/issues/new]) # Define the libtool version numbers; check the Autobook, Section 11.4. @@ -19,7 +19,7 @@ m4_define([YAML_BUGS], [https://github.com/yaml/libyaml/issues/new]) # YAML_AGE = 0 m4_define([YAML_RELEASE], 0) m4_define([YAML_CURRENT], 2) -m4_define([YAML_REVISION], 6) +m4_define([YAML_REVISION], 7) m4_define([YAML_AGE], 0) # Initialize autoconf & automake. diff --git a/doc/html/annotated.html b/doc/html/annotated.html index b55b5de..8a176c8 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/classes.html b/doc/html/classes.html index 07e2952..8cd858b 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/files.html b/doc/html/files.html index e34c9de..f581d71 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions.html b/doc/html/functions.html index ba62df9..4329dcf 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_b.html b/doc/html/functions_b.html index 2115cef..38631ae 100644 --- a/doc/html/functions_b.html +++ b/doc/html/functions_b.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_c.html b/doc/html/functions_c.html index 8edc920..b3bcfb4 100644 --- a/doc/html/functions_c.html +++ b/doc/html/functions_c.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_d.html b/doc/html/functions_d.html index 92588a3..a70d9c7 100644 --- a/doc/html/functions_d.html +++ b/doc/html/functions_d.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_e.html b/doc/html/functions_e.html index 60f4654..97367ef 100644 --- a/doc/html/functions_e.html +++ b/doc/html/functions_e.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_f.html b/doc/html/functions_f.html index ebf2069..3f0bc25 100644 --- a/doc/html/functions_f.html +++ b/doc/html/functions_f.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_h.html b/doc/html/functions_h.html index 51efe4b..8f7af92 100644 --- a/doc/html/functions_h.html +++ b/doc/html/functions_h.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_i.html b/doc/html/functions_i.html index c91bca6..8495797 100644 --- a/doc/html/functions_i.html +++ b/doc/html/functions_i.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_k.html b/doc/html/functions_k.html index 2440805..100d18c 100644 --- a/doc/html/functions_k.html +++ b/doc/html/functions_k.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_l.html b/doc/html/functions_l.html index b914f00..8825345 100644 --- a/doc/html/functions_l.html +++ b/doc/html/functions_l.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_m.html b/doc/html/functions_m.html index 562d20d..1816c95 100644 --- a/doc/html/functions_m.html +++ b/doc/html/functions_m.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_n.html b/doc/html/functions_n.html index 70f76b7..afc6e92 100644 --- a/doc/html/functions_n.html +++ b/doc/html/functions_n.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_o.html b/doc/html/functions_o.html index 3788a93..8f964ba 100644 --- a/doc/html/functions_o.html +++ b/doc/html/functions_o.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_p.html b/doc/html/functions_p.html index c82f548..b31ad79 100644 --- a/doc/html/functions_p.html +++ b/doc/html/functions_p.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_q.html b/doc/html/functions_q.html index 5ec3382..002ab5d 100644 --- a/doc/html/functions_q.html +++ b/doc/html/functions_q.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_r.html b/doc/html/functions_r.html index 374864d..cac7c0d 100644 --- a/doc/html/functions_r.html +++ b/doc/html/functions_r.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_s.html b/doc/html/functions_s.html index 364381b..0c9a507 100644 --- a/doc/html/functions_s.html +++ b/doc/html/functions_s.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
diff --git a/doc/html/functions_t.html b/doc/html/functions_t.html index 497c4c7..dab3165 100644 --- a/doc/html/functions_t.html +++ b/doc/html/functions_t.html @@ -19,7 +19,7 @@
yaml -  0.2.2 +  0.2.3
@@ -63,6 +63,9 @@ $(function() { : yaml_emitter_s , yaml_parser_s +
  • token_available +: yaml_parser_s +
  • token_number : yaml_simple_key_s
  • @@ -74,9 +77,9 @@ $(function() {
  • top : yaml_document_s -, yaml_emitter_s -, yaml_node_s -, yaml_parser_s +, yaml_emitter_s +, yaml_node_s +, yaml_parser_s
  • type : yaml_event_s diff --git a/doc/html/functions_u.html b/doc/html/functions_u.html index ceeac93..890db1f 100644 --- a/doc/html/functions_u.html +++ b/doc/html/functions_u.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_v.html b/doc/html/functions_v.html index 1e9213c..0ad9bc8 100644 --- a/doc/html/functions_v.html +++ b/doc/html/functions_v.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index 1b51468..a9554b6 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_b.html b/doc/html/functions_vars_b.html index 0f6d7ea..21d923b 100644 --- a/doc/html/functions_vars_b.html +++ b/doc/html/functions_vars_b.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_c.html b/doc/html/functions_vars_c.html index 2f250da..c752fb0 100644 --- a/doc/html/functions_vars_c.html +++ b/doc/html/functions_vars_c.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_d.html b/doc/html/functions_vars_d.html index 910ece2..fc2ca31 100644 --- a/doc/html/functions_vars_d.html +++ b/doc/html/functions_vars_d.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_e.html b/doc/html/functions_vars_e.html index 01f9c62..678df48 100644 --- a/doc/html/functions_vars_e.html +++ b/doc/html/functions_vars_e.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_f.html b/doc/html/functions_vars_f.html index e4cfab0..7dd1679 100644 --- a/doc/html/functions_vars_f.html +++ b/doc/html/functions_vars_f.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_h.html b/doc/html/functions_vars_h.html index b6fe946..9ec80f1 100644 --- a/doc/html/functions_vars_h.html +++ b/doc/html/functions_vars_h.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_i.html b/doc/html/functions_vars_i.html index b403e4b..044461b 100644 --- a/doc/html/functions_vars_i.html +++ b/doc/html/functions_vars_i.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_k.html b/doc/html/functions_vars_k.html index 3749a14..053e9a7 100644 --- a/doc/html/functions_vars_k.html +++ b/doc/html/functions_vars_k.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_l.html b/doc/html/functions_vars_l.html index d8977d8..a67249d 100644 --- a/doc/html/functions_vars_l.html +++ b/doc/html/functions_vars_l.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_m.html b/doc/html/functions_vars_m.html index 6974773..49c7c9d 100644 --- a/doc/html/functions_vars_m.html +++ b/doc/html/functions_vars_m.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_n.html b/doc/html/functions_vars_n.html index c3209f3..b39b5d1 100644 --- a/doc/html/functions_vars_n.html +++ b/doc/html/functions_vars_n.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_o.html b/doc/html/functions_vars_o.html index 31ad41b..5a13b36 100644 --- a/doc/html/functions_vars_o.html +++ b/doc/html/functions_vars_o.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_p.html b/doc/html/functions_vars_p.html index 7d461db..bcfe6d0 100644 --- a/doc/html/functions_vars_p.html +++ b/doc/html/functions_vars_p.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_q.html b/doc/html/functions_vars_q.html index 527607c..ecc6486 100644 --- a/doc/html/functions_vars_q.html +++ b/doc/html/functions_vars_q.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_r.html b/doc/html/functions_vars_r.html index fd58db4..1656abf 100644 --- a/doc/html/functions_vars_r.html +++ b/doc/html/functions_vars_r.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_s.html b/doc/html/functions_vars_s.html index 0ae7325..c3ef2f1 100644 --- a/doc/html/functions_vars_s.html +++ b/doc/html/functions_vars_s.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_t.html b/doc/html/functions_vars_t.html index 7399d9f..3ecbabb 100644 --- a/doc/html/functions_vars_t.html +++ b/doc/html/functions_vars_t.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    @@ -63,6 +63,9 @@ $(function() { : yaml_emitter_s , yaml_parser_s
  • +
  • token_available +: yaml_parser_s +
  • token_number : yaml_simple_key_s
  • @@ -74,9 +77,9 @@ $(function() {
  • top : yaml_document_s -, yaml_emitter_s -, yaml_node_s -, yaml_parser_s +, yaml_emitter_s +, yaml_node_s +, yaml_parser_s
  • type : yaml_event_s diff --git a/doc/html/functions_vars_u.html b/doc/html/functions_vars_u.html index 24ca8ae..cef11e6 100644 --- a/doc/html/functions_vars_u.html +++ b/doc/html/functions_vars_u.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_v.html b/doc/html/functions_vars_v.html index 4ffd11c..ed87851 100644 --- a/doc/html/functions_vars_v.html +++ b/doc/html/functions_vars_v.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_vars_w.html b/doc/html/functions_vars_w.html index 5c6baa2..211c19e 100644 --- a/doc/html/functions_vars_w.html +++ b/doc/html/functions_vars_w.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/functions_w.html b/doc/html/functions_w.html index 6c60ae5..6b04daf 100644 --- a/doc/html/functions_w.html +++ b/doc/html/functions_w.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/globals.html b/doc/html/globals.html index 7d1d01b..5ed2e30 100644 --- a/doc/html/globals.html +++ b/doc/html/globals.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    @@ -49,7 +49,7 @@ $(function() { : yaml.h
  • yaml_alias_event_initialize() -: yaml.h +: yaml.h
  • YAML_ALIAS_TOKEN : yaml.h @@ -124,13 +124,13 @@ $(function() { : yaml.h
  • yaml_document_add_mapping() -: yaml.h +: yaml.h
  • yaml_document_add_scalar() -: yaml.h +: yaml.h
  • yaml_document_add_sequence() -: yaml.h +: yaml.h
  • yaml_document_append_mapping_pair() : yaml.h @@ -373,7 +373,7 @@ $(function() { : yaml.h
  • yaml_mapping_start_event_initialize() -: yaml.h +: yaml.h
  • yaml_mapping_style_e : yaml.h @@ -541,7 +541,7 @@ $(function() { : yaml.h
  • yaml_scalar_event_initialize() -: yaml.h +: yaml.h
  • YAML_SCALAR_NODE : yaml.h @@ -574,7 +574,7 @@ $(function() { : yaml.h
  • yaml_sequence_start_event_initialize() -: yaml.h +: yaml.h
  • yaml_sequence_style_e : yaml.h diff --git a/doc/html/globals_defs.html b/doc/html/globals_defs.html index 5bea7b9..2d98502 100644 --- a/doc/html/globals_defs.html +++ b/doc/html/globals_defs.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/globals_enum.html b/doc/html/globals_enum.html index 0301d41..c4899e4 100644 --- a/doc/html/globals_enum.html +++ b/doc/html/globals_enum.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/globals_eval.html b/doc/html/globals_eval.html index 82c430f..2821b40 100644 --- a/doc/html/globals_eval.html +++ b/doc/html/globals_eval.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html index e6369c9..7c91cf0 100644 --- a/doc/html/globals_func.html +++ b/doc/html/globals_func.html @@ -19,7 +19,7 @@
    yaml -  0.2.2 +  0.2.3
    @@ -43,16 +43,16 @@ $(function() {

    - y -

    • yaml_alias_event_initialize() -: yaml.h +: yaml.h
    • yaml_document_add_mapping() -: yaml.h +: yaml.h
    • yaml_document_add_scalar() -: yaml.h +: yaml.h
    • yaml_document_add_sequence() -: yaml.h +: yaml.h
    • yaml_document_append_mapping_pair() : yaml.h @@ -139,7 +139,7 @@ $(function() { : yaml.h
    • yaml_mapping_start_event_initialize() -: yaml.h +: yaml.h
    • yaml_parser_delete() : yaml.h @@ -169,13 +169,13 @@ $(function() { : yaml.h
    • yaml_scalar_event_initialize() -: yaml.h +: yaml.h
    • yaml_sequence_end_event_initialize() : yaml.h
    • yaml_sequence_start_event_initialize() -: yaml.h +: yaml.h
    • yaml_stream_end_event_initialize() : yaml.h diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html index 68fb43c..6f67cb3 100644 --- a/doc/html/globals_type.html +++ b/doc/html/globals_type.html @@ -19,7 +19,7 @@
      yaml -  0.2.2 +  0.2.3
      diff --git a/doc/html/group__basic.html b/doc/html/group__basic.html index 08cd49e..86221b9 100644 --- a/doc/html/group__basic.html +++ b/doc/html/group__basic.html @@ -19,7 +19,7 @@
      yaml -  0.2.2 +  0.2.3
      diff --git a/doc/html/group__emitter.html b/doc/html/group__emitter.html index 4e21b9b..5cc0c94 100644 --- a/doc/html/group__emitter.html +++ b/doc/html/group__emitter.html @@ -19,7 +19,7 @@
      yaml -  0.2.2 +  0.2.3
      @@ -139,7 +139,7 @@ Functions  Set if the output should be in the "canonical" format as in the YAML specification. More...
        void yaml_emitter_set_indent (yaml_emitter_t *emitter, int indent) - Set the intendation increment. More...
      + Set the indentation increment. More...
        void yaml_emitter_set_width (yaml_emitter_t *emitter, int width)  Set the preferred line width. More...
      @@ -571,7 +571,7 @@ Functions
      -

      Set the intendation increment.

      +

      Set the indentation increment.

      Parameters
      diff --git a/doc/html/group__events.html b/doc/html/group__events.html index ab27d83..dae9b59 100644 --- a/doc/html/group__events.html +++ b/doc/html/group__events.html @@ -19,7 +19,7 @@ @@ -107,21 +107,21 @@ Functions - - - - - - - - - + + + + + + + + + - - - + + + @@ -369,8 +369,8 @@ Functions - -

      ◆ yaml_alias_event_initialize()

      + +

      ◆ yaml_alias_event_initialize()

      @@ -384,7 +384,7 @@ Functions
      - + @@ -407,8 +407,8 @@ Functions - -

      ◆ yaml_scalar_event_initialize()

      + +

      ◆ yaml_scalar_event_initialize()

      @@ -422,19 +422,19 @@ Functions
      - + - + - + @@ -489,8 +489,8 @@ Functions - -

      ◆ yaml_sequence_start_event_initialize()

      + +

      ◆ yaml_sequence_start_event_initialize()

      @@ -504,13 +504,13 @@ Functions
      - + - + @@ -577,8 +577,8 @@ Functions - -

      ◆ yaml_mapping_start_event_initialize()

      + +

      ◆ yaml_mapping_start_event_initialize()

      @@ -592,13 +592,13 @@ Functions
      - + - + diff --git a/doc/html/group__export.html b/doc/html/group__export.html index c7e6c1c..876da57 100644 --- a/doc/html/group__export.html +++ b/doc/html/group__export.html @@ -19,7 +19,7 @@ diff --git a/doc/html/group__nodes.html b/doc/html/group__nodes.html index b797748..01d0d24 100644 --- a/doc/html/group__nodes.html +++ b/doc/html/group__nodes.html @@ -19,7 +19,7 @@ @@ -145,15 +145,15 @@ Functions - - - - - - - - - + + + + + + + + + @@ -609,8 +609,8 @@ Functions - -

      ◆ yaml_document_add_scalar()

      + +

      ◆ yaml_document_add_scalar()

      @@ -624,13 +624,13 @@ Functions
      - + - + @@ -669,8 +669,8 @@ Functions - -

      ◆ yaml_document_add_sequence()

      + +

      ◆ yaml_document_add_sequence()

      @@ -684,7 +684,7 @@ Functions
      - + @@ -715,8 +715,8 @@ Functions - -

      ◆ yaml_document_add_mapping()

      + +

      ◆ yaml_document_add_mapping()

      @@ -730,7 +730,7 @@ Functions
      - + diff --git a/doc/html/group__parser.html b/doc/html/group__parser.html index d9ecbfc..594821b 100644 --- a/doc/html/group__parser.html +++ b/doc/html/group__parser.html @@ -19,7 +19,7 @@ diff --git a/doc/html/group__styles.html b/doc/html/group__styles.html index 6cee4f4..df26271 100644 --- a/doc/html/group__styles.html +++ b/doc/html/group__styles.html @@ -19,7 +19,7 @@ diff --git a/doc/html/group__tokens.html b/doc/html/group__tokens.html index bb4d24d..162a4cf 100644 --- a/doc/html/group__tokens.html +++ b/doc/html/group__tokens.html @@ -19,7 +19,7 @@ diff --git a/doc/html/group__version.html b/doc/html/group__version.html index 1318a25..a97edb5 100644 --- a/doc/html/group__version.html +++ b/doc/html/group__version.html @@ -19,7 +19,7 @@ diff --git a/doc/html/index.html b/doc/html/index.html index 2e6ebb7..d183a14 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -19,7 +19,7 @@ diff --git a/doc/html/modules.html b/doc/html/modules.html index a0f15d8..711c59f 100644 --- a/doc/html/modules.html +++ b/doc/html/modules.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__alias__data__s.html b/doc/html/structyaml__alias__data__s.html index 4e54ea3..d2cd672 100644 --- a/doc/html/structyaml__alias__data__s.html +++ b/doc/html/structyaml__alias__data__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__anchors__s.html b/doc/html/structyaml__anchors__s.html index 90d3dae..3d20df5 100644 --- a/doc/html/structyaml__anchors__s.html +++ b/doc/html/structyaml__anchors__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__document__s.html b/doc/html/structyaml__document__s.html index b55e138..6d11f31 100644 --- a/doc/html/structyaml__document__s.html +++ b/doc/html/structyaml__document__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__emitter__s.html b/doc/html/structyaml__emitter__s.html index 50e36ee..c290f23 100644 --- a/doc/html/structyaml__emitter__s.html +++ b/doc/html/structyaml__emitter__s.html @@ -19,7 +19,7 @@ @@ -202,7 +202,7 @@ int  - + @@ -521,7 +521,7 @@ int  diff --git a/doc/html/structyaml__mark__s.html b/doc/html/structyaml__mark__s.html index 271b9d0..0615e98 100644 --- a/doc/html/structyaml__mark__s.html +++ b/doc/html/structyaml__mark__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__node__pair__s.html b/doc/html/structyaml__node__pair__s.html index 644f961..a8c4158 100644 --- a/doc/html/structyaml__node__pair__s.html +++ b/doc/html/structyaml__node__pair__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__node__s.html b/doc/html/structyaml__node__s.html index 9bd1b47..91785fe 100644 --- a/doc/html/structyaml__node__s.html +++ b/doc/html/structyaml__node__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__parser__s.html b/doc/html/structyaml__parser__s.html index b34b8f2..2dfffc2 100644 --- a/doc/html/structyaml__parser__s.html +++ b/doc/html/structyaml__parser__s.html @@ -19,7 +19,7 @@ @@ -294,8 +294,8 @@ int  - + + @@ -953,6 +953,22 @@ int  diff --git a/doc/html/structyaml__tag__directive__s.html b/doc/html/structyaml__tag__directive__s.html index 8cb5270..984ba79 100644 --- a/doc/html/structyaml__tag__directive__s.html +++ b/doc/html/structyaml__tag__directive__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__token__s.html b/doc/html/structyaml__token__s.html index 25f5fa5..2f8a5ed 100644 --- a/doc/html/structyaml__token__s.html +++ b/doc/html/structyaml__token__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/structyaml__version__directive__s.html b/doc/html/structyaml__version__directive__s.html index 5c960d8..e63fadf 100644 --- a/doc/html/structyaml__version__directive__s.html +++ b/doc/html/structyaml__version__directive__s.html @@ -19,7 +19,7 @@ diff --git a/doc/html/yaml_8h.html b/doc/html/yaml_8h.html index 1706a34..bf358bf 100644 --- a/doc/html/yaml_8h.html +++ b/doc/html/yaml_8h.html @@ -19,7 +19,7 @@ @@ -510,21 +510,21 @@ Functions - - - - - - - - - + + + + + + + + + - - - + + + @@ -543,15 +543,15 @@ Functions - - - - - - - - - + + + + + + + + + @@ -607,7 +607,7 @@ Functions - + diff --git a/include/yaml.h b/include/yaml.h index c225908..06e5560 100644 --- a/include/yaml.h +++ b/include/yaml.h @@ -28,7 +28,7 @@ extern "C" { #if defined(__MINGW32__) # define YAML_DECLARE(type) type -#elif defined(WIN32) +#elif defined(_WIN32) # if defined(YAML_DECLARE_STATIC) # define YAML_DECLARE(type) type # elif defined(YAML_DECLARE_EXPORT) @@ -552,7 +552,7 @@ yaml_document_end_event_initialize(yaml_event_t *event, int implicit); */ YAML_DECLARE(int) -yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor); +yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor); /** * Create a SCALAR event. @@ -578,8 +578,8 @@ yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor); YAML_DECLARE(int) yaml_scalar_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, - yaml_char_t *value, int length, + const yaml_char_t *anchor, const yaml_char_t *tag, + const yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style); @@ -601,7 +601,7 @@ yaml_scalar_event_initialize(yaml_event_t *event, YAML_DECLARE(int) yaml_sequence_start_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, int implicit, + const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_sequence_style_t style); /** @@ -633,7 +633,7 @@ yaml_sequence_end_event_initialize(yaml_event_t *event); YAML_DECLARE(int) yaml_mapping_start_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, int implicit, + const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_mapping_style_t style); /** @@ -896,7 +896,7 @@ yaml_document_get_root_node(yaml_document_t *document); YAML_DECLARE(int) yaml_document_add_scalar(yaml_document_t *document, - yaml_char_t *tag, yaml_char_t *value, int length, + const yaml_char_t *tag, const yaml_char_t *value, int length, yaml_scalar_style_t style); /** @@ -913,7 +913,7 @@ yaml_document_add_scalar(yaml_document_t *document, YAML_DECLARE(int) yaml_document_add_sequence(yaml_document_t *document, - yaml_char_t *tag, yaml_sequence_style_t style); + const yaml_char_t *tag, yaml_sequence_style_t style); /** * Create a MAPPING node and attach it to the document. @@ -929,7 +929,7 @@ yaml_document_add_sequence(yaml_document_t *document, YAML_DECLARE(int) yaml_document_add_mapping(yaml_document_t *document, - yaml_char_t *tag, yaml_mapping_style_t style); + const yaml_char_t *tag, yaml_mapping_style_t style); /** * Add an item to a SEQUENCE node. @@ -937,7 +937,7 @@ yaml_document_add_mapping(yaml_document_t *document, * @param[in,out] document A document object. * @param[in] sequence The sequence node id. * @param[in] item The item node id. -* + * * @returns @c 1 if the function succeeded, @c 0 on error. */ @@ -952,7 +952,7 @@ yaml_document_append_sequence_item(yaml_document_t *document, * @param[in] mapping The mapping node id. * @param[in] key The key node id. * @param[in] value The value node id. -* + * * @returns @c 1 if the function succeeded, @c 0 on error. */ @@ -1205,7 +1205,7 @@ typedef struct yaml_parser_s { /** The number of tokens fetched from the queue. */ size_t tokens_parsed; - /* Does the tokens queue contain a token ready for dequeueing. */ + /** Does the tokens queue contain a token ready for dequeueing. */ int token_available; /** The indentation levels stack. */ @@ -1446,7 +1446,7 @@ yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event); * @param[in,out] parser A parser object. * @param[out] document An empty document object. * - * @return @c 1 if the function succeeded, @c 0 on error. + * @returns @c 1 if the function succeeded, @c 0 on error. */ YAML_DECLARE(int) @@ -1560,7 +1560,7 @@ typedef struct yaml_emitter_s { /** Write handler. */ yaml_write_handler_t *write_handler; - /** A pointer for passing to the white handler. */ + /** A pointer for passing to the write handler. */ void *write_handler_data; /** Standard (string or file) output data. */ @@ -1858,7 +1858,7 @@ YAML_DECLARE(void) yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical); /** - * Set the intendation increment. + * Set the indentation increment. * * @param[in,out] emitter An emitter object. * @param[in] indent The indentation increment (1 < . < 10). diff --git a/src/api.c b/src/api.c index e793b08..16f88bd 100644 --- a/src/api.c +++ b/src/api.c @@ -623,10 +623,10 @@ yaml_token_delete(yaml_token_t *token) */ static int -yaml_check_utf8(yaml_char_t *start, size_t length) +yaml_check_utf8(const yaml_char_t *start, size_t length) { - yaml_char_t *end = start+length; - yaml_char_t *pointer = start; + const yaml_char_t *end = start+length; + const yaml_char_t *pointer = start; while (pointer < end) { unsigned char octet; @@ -794,7 +794,7 @@ yaml_document_end_event_initialize(yaml_event_t *event, int implicit) */ YAML_DECLARE(int) -yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor) +yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor) { yaml_mark_t mark = { 0, 0, 0 }; yaml_char_t *anchor_copy = NULL; @@ -819,8 +819,8 @@ yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor) YAML_DECLARE(int) yaml_scalar_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, - yaml_char_t *value, int length, + const yaml_char_t *anchor, const yaml_char_t *tag, + const yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style) { @@ -873,7 +873,7 @@ error: YAML_DECLARE(int) yaml_sequence_start_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, int implicit, + const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_sequence_style_t style) { yaml_mark_t mark = { 0, 0, 0 }; @@ -928,7 +928,7 @@ yaml_sequence_end_event_initialize(yaml_event_t *event) YAML_DECLARE(int) yaml_mapping_start_event_initialize(yaml_event_t *event, - yaml_char_t *anchor, yaml_char_t *tag, int implicit, + const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_mapping_style_t style) { yaml_mark_t mark = { 0, 0, 0 }; @@ -1193,7 +1193,7 @@ yaml_document_get_root_node(yaml_document_t *document) YAML_DECLARE(int) yaml_document_add_scalar(yaml_document_t *document, - yaml_char_t *tag, yaml_char_t *value, int length, + const yaml_char_t *tag, const yaml_char_t *value, int length, yaml_scalar_style_t style) { struct { @@ -1243,7 +1243,7 @@ error: YAML_DECLARE(int) yaml_document_add_sequence(yaml_document_t *document, - yaml_char_t *tag, yaml_sequence_style_t style) + const yaml_char_t *tag, yaml_sequence_style_t style) { struct { yaml_error_type_t error; @@ -1288,7 +1288,7 @@ error: YAML_DECLARE(int) yaml_document_add_mapping(yaml_document_t *document, - yaml_char_t *tag, yaml_mapping_style_t style) + const yaml_char_t *tag, yaml_mapping_style_t style) { struct { yaml_error_type_t error; diff --git a/src/emitter.c b/src/emitter.c index b9392e4..a22c6b1 100644 --- a/src/emitter.c +++ b/src/emitter.c @@ -594,6 +594,7 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter, { if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0)) return 0; + emitter->open_ended = 0; if (!yaml_emitter_write_indent(emitter)) return 0; } @@ -644,12 +645,25 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter, emitter->state = YAML_EMIT_DOCUMENT_CONTENT_STATE; + emitter->open_ended = 0; return 1; } else if (event->type == YAML_STREAM_END_EVENT) { + /** + * This can happen if a block scalar with trailing empty lines + * is at the end of the stream + */ + if (emitter->open_ended) + { + if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0)) + return 0; + emitter->open_ended = 0; + if (!yaml_emitter_write_indent(emitter)) + return 0; + } if (!yaml_emitter_flush(emitter)) return 0; @@ -691,6 +705,7 @@ yaml_emitter_emit_document_end(yaml_emitter_t *emitter, if (!event->data.document_end.implicit) { if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0)) return 0; + emitter->open_ended = 0; if (!yaml_emitter_write_indent(emitter)) return 0; } @@ -1227,7 +1242,7 @@ yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event) } /* - * Write an achor. + * Write an anchor. */ static int @@ -1326,7 +1341,10 @@ static int yaml_emitter_analyze_version_directive(yaml_emitter_t *emitter, yaml_version_directive_t version_directive) { - if (version_directive.major != 1 || version_directive.minor != 1) { + if (version_directive.major != 1 || ( + version_directive.minor != 1 + && version_directive.minor != 2 + )) { return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive"); } @@ -1796,7 +1814,6 @@ yaml_emitter_write_indicator(yaml_emitter_t *emitter, emitter->whitespace = is_whitespace; emitter->indention = (emitter->indention && is_indention); - emitter->open_ended = 0; return 1; } @@ -1939,10 +1956,6 @@ yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter, emitter->whitespace = 0; emitter->indention = 0; - if (emitter->root_context) - { - emitter->open_ended = 1; - } return 1; } diff --git a/src/loader.c b/src/loader.c index db8501a..dea8ac4 100644 --- a/src/loader.c +++ b/src/loader.c @@ -37,27 +37,47 @@ yaml_parser_register_anchor(yaml_parser_t *parser, static void yaml_parser_delete_aliases(yaml_parser_t *parser); +/* + * Document loading context. + */ +struct loader_ctx { + int *start; + int *end; + int *top; +}; + /* * Composer functions. */ +static int +yaml_parser_load_nodes(yaml_parser_t *parser, struct loader_ctx *ctx); + +static int +yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *event); static int -yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); static int -yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); static int -yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); static int -yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); static int -yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_sequence_end(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); static int -yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event); +yaml_parser_load_mapping_end(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx); /* * Load the next document of the stream. @@ -162,59 +182,78 @@ yaml_parser_delete_aliases(yaml_parser_t *parser) */ static int -yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *event) { - yaml_event_t event; + struct loader_ctx ctx = { NULL, NULL, NULL }; - assert(first_event->type == YAML_DOCUMENT_START_EVENT); + assert(event->type == YAML_DOCUMENT_START_EVENT); /* DOCUMENT-START is expected. */ parser->document->version_directive - = first_event->data.document_start.version_directive; + = event->data.document_start.version_directive; parser->document->tag_directives.start - = first_event->data.document_start.tag_directives.start; + = event->data.document_start.tag_directives.start; parser->document->tag_directives.end - = first_event->data.document_start.tag_directives.end; + = event->data.document_start.tag_directives.end; parser->document->start_implicit - = first_event->data.document_start.implicit; - parser->document->start_mark = first_event->start_mark; - - if (!yaml_parser_parse(parser, &event)) return 0; - - if (!yaml_parser_load_node(parser, &event)) return 0; - - if (!yaml_parser_parse(parser, &event)) return 0; - assert(event.type == YAML_DOCUMENT_END_EVENT); - /* DOCUMENT-END is expected. */ + = event->data.document_start.implicit; + parser->document->start_mark = event->start_mark; - parser->document->end_implicit = event.data.document_end.implicit; - parser->document->end_mark = event.end_mark; + if (!STACK_INIT(parser, ctx, int*)) return 0; + if (!yaml_parser_load_nodes(parser, &ctx)) { + STACK_DEL(parser, ctx); + return 0; + } + STACK_DEL(parser, ctx); return 1; } /* - * Compose a node. + * Compose a node tree. */ static int -yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_nodes(yaml_parser_t *parser, struct loader_ctx *ctx) { - switch (first_event->type) { - case YAML_ALIAS_EVENT: - return yaml_parser_load_alias(parser, first_event); - case YAML_SCALAR_EVENT: - return yaml_parser_load_scalar(parser, first_event); - case YAML_SEQUENCE_START_EVENT: - return yaml_parser_load_sequence(parser, first_event); - case YAML_MAPPING_START_EVENT: - return yaml_parser_load_mapping(parser, first_event); - default: - assert(0); /* Could not happen. */ - return 0; - } + yaml_event_t event; - return 0; + do { + if (!yaml_parser_parse(parser, &event)) return 0; + + switch (event.type) { + case YAML_ALIAS_EVENT: + if (!yaml_parser_load_alias(parser, &event, ctx)) return 0; + break; + case YAML_SCALAR_EVENT: + if (!yaml_parser_load_scalar(parser, &event, ctx)) return 0; + break; + case YAML_SEQUENCE_START_EVENT: + if (!yaml_parser_load_sequence(parser, &event, ctx)) return 0; + break; + case YAML_SEQUENCE_END_EVENT: + if (!yaml_parser_load_sequence_end(parser, &event, ctx)) + return 0; + break; + case YAML_MAPPING_START_EVENT: + if (!yaml_parser_load_mapping(parser, &event, ctx)) return 0; + break; + case YAML_MAPPING_END_EVENT: + if (!yaml_parser_load_mapping_end(parser, &event, ctx)) + return 0; + break; + default: + assert(0); /* Could not happen. */ + return 0; + case YAML_DOCUMENT_END_EVENT: + break; + } + } while (event.type != YAML_DOCUMENT_END_EVENT); + + parser->document->end_implicit = event.data.document_end.implicit; + parser->document->end_mark = event.end_mark; + + return 1; } /* @@ -252,27 +291,80 @@ yaml_parser_register_anchor(yaml_parser_t *parser, return 1; } +/* + * Compose node into its parent in the stree. + */ + +static int +yaml_parser_load_node_add(yaml_parser_t *parser, struct loader_ctx *ctx, + int index) +{ + struct yaml_node_s *parent; + int parent_index; + + if (STACK_EMPTY(parser, *ctx)) { + /* This is the root node, there's no tree to add it to. */ + return 1; + } + + parent_index = *((*ctx).top - 1); + parent = &parser->document->nodes.start[parent_index-1]; + + switch (parent->type) { + case YAML_SEQUENCE_NODE: + if (!STACK_LIMIT(parser, parent->data.sequence.items, INT_MAX-1)) + return 0; + if (!PUSH(parser, parent->data.sequence.items, index)) + return 0; + break; + case YAML_MAPPING_NODE: { + yaml_node_pair_t pair; + if (!STACK_EMPTY(parser, parent->data.mapping.pairs)) { + yaml_node_pair_t *p = parent->data.mapping.pairs.top - 1; + if (p->key != 0 && p->value == 0) { + p->value = index; + break; + } + } + + pair.key = index; + pair.value = 0; + if (!STACK_LIMIT(parser, parent->data.mapping.pairs, INT_MAX-1)) + return 0; + if (!PUSH(parser, parent->data.mapping.pairs, pair)) + return 0; + + break; + } + default: + assert(0); /* Could not happen. */ + return 0; + } + return 1; +} + /* * Compose a node corresponding to an alias. */ static int -yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) { - yaml_char_t *anchor = first_event->data.alias.anchor; + yaml_char_t *anchor = event->data.alias.anchor; yaml_alias_data_t *alias_data; for (alias_data = parser->aliases.start; alias_data != parser->aliases.top; alias_data ++) { if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) { yaml_free(anchor); - return alias_data->index; + return yaml_parser_load_node_add(parser, ctx, alias_data->index); } } yaml_free(anchor); return yaml_parser_set_composer_error(parser, "found undefined alias", - first_event->start_mark); + event->start_mark); } /* @@ -280,11 +372,12 @@ yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event) */ static int -yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) { yaml_node_t node; int index; - yaml_char_t *tag = first_event->data.scalar.tag; + yaml_char_t *tag = event->data.scalar.tag; if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error; @@ -294,23 +387,23 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event) if (!tag) goto error; } - SCALAR_NODE_INIT(node, tag, first_event->data.scalar.value, - first_event->data.scalar.length, first_event->data.scalar.style, - first_event->start_mark, first_event->end_mark); + SCALAR_NODE_INIT(node, tag, event->data.scalar.value, + event->data.scalar.length, event->data.scalar.style, + event->start_mark, event->end_mark); if (!PUSH(parser, parser->document->nodes, node)) goto error; index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, - first_event->data.scalar.anchor)) return 0; + event->data.scalar.anchor)) return 0; - return index; + return yaml_parser_load_node_add(parser, ctx, index); error: yaml_free(tag); - yaml_free(first_event->data.scalar.anchor); - yaml_free(first_event->data.scalar.value); + yaml_free(event->data.scalar.anchor); + yaml_free(event->data.scalar.value); return 0; } @@ -319,17 +412,17 @@ error: */ static int -yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) { - yaml_event_t event; yaml_node_t node; struct { yaml_node_item_t *start; yaml_node_item_t *end; yaml_node_item_t *top; } items = { NULL, NULL, NULL }; - int index, item_index; - yaml_char_t *tag = first_event->data.sequence_start.tag; + int index; + yaml_char_t *tag = event->data.sequence_start.tag; if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error; @@ -342,48 +435,54 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event) if (!STACK_INIT(parser, items, yaml_node_item_t*)) goto error; SEQUENCE_NODE_INIT(node, tag, items.start, items.end, - first_event->data.sequence_start.style, - first_event->start_mark, first_event->end_mark); + event->data.sequence_start.style, + event->start_mark, event->end_mark); if (!PUSH(parser, parser->document->nodes, node)) goto error; index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, - first_event->data.sequence_start.anchor)) return 0; - - if (!yaml_parser_parse(parser, &event)) return 0; - - while (event.type != YAML_SEQUENCE_END_EVENT) { - if (!STACK_LIMIT(parser, - parser->document->nodes.start[index-1].data.sequence.items, - INT_MAX-1)) return 0; - item_index = yaml_parser_load_node(parser, &event); - if (!item_index) return 0; - if (!PUSH(parser, - parser->document->nodes.start[index-1].data.sequence.items, - item_index)) return 0; - if (!yaml_parser_parse(parser, &event)) return 0; - } + event->data.sequence_start.anchor)) return 0; + + if (!yaml_parser_load_node_add(parser, ctx, index)) return 0; - parser->document->nodes.start[index-1].end_mark = event.end_mark; + if (!STACK_LIMIT(parser, *ctx, INT_MAX-1)) return 0; + if (!PUSH(parser, *ctx, index)) return 0; - return index; + return 1; error: yaml_free(tag); - yaml_free(first_event->data.sequence_start.anchor); + yaml_free(event->data.sequence_start.anchor); return 0; } +static int +yaml_parser_load_sequence_end(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) +{ + int index; + + assert(((*ctx).top - (*ctx).start) > 0); + + index = *((*ctx).top - 1); + assert(parser->document->nodes.start[index-1].type == YAML_SEQUENCE_NODE); + parser->document->nodes.start[index-1].end_mark = event->end_mark; + + (void)POP(parser, *ctx); + + return 1; +} + /* * Compose a mapping node. */ static int -yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event) +yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) { - yaml_event_t event; yaml_node_t node; struct { yaml_node_pair_t *start; @@ -391,8 +490,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event) yaml_node_pair_t *top; } pairs = { NULL, NULL, NULL }; int index; - yaml_node_pair_t pair; - yaml_char_t *tag = first_event->data.mapping_start.tag; + yaml_char_t *tag = event->data.mapping_start.tag; if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error; @@ -405,40 +503,42 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event) if (!STACK_INIT(parser, pairs, yaml_node_pair_t*)) goto error; MAPPING_NODE_INIT(node, tag, pairs.start, pairs.end, - first_event->data.mapping_start.style, - first_event->start_mark, first_event->end_mark); + event->data.mapping_start.style, + event->start_mark, event->end_mark); if (!PUSH(parser, parser->document->nodes, node)) goto error; index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, - first_event->data.mapping_start.anchor)) return 0; + event->data.mapping_start.anchor)) return 0; - if (!yaml_parser_parse(parser, &event)) return 0; - - while (event.type != YAML_MAPPING_END_EVENT) { - if (!STACK_LIMIT(parser, - parser->document->nodes.start[index-1].data.mapping.pairs, - INT_MAX-1)) return 0; - pair.key = yaml_parser_load_node(parser, &event); - if (!pair.key) return 0; - if (!yaml_parser_parse(parser, &event)) return 0; - pair.value = yaml_parser_load_node(parser, &event); - if (!pair.value) return 0; - if (!PUSH(parser, - parser->document->nodes.start[index-1].data.mapping.pairs, - pair)) return 0; - if (!yaml_parser_parse(parser, &event)) return 0; - } + if (!yaml_parser_load_node_add(parser, ctx, index)) return 0; - parser->document->nodes.start[index-1].end_mark = event.end_mark; + if (!STACK_LIMIT(parser, *ctx, INT_MAX-1)) return 0; + if (!PUSH(parser, *ctx, index)) return 0; - return index; + return 1; error: yaml_free(tag); - yaml_free(first_event->data.mapping_start.anchor); + yaml_free(event->data.mapping_start.anchor); return 0; } +static int +yaml_parser_load_mapping_end(yaml_parser_t *parser, yaml_event_t *event, + struct loader_ctx *ctx) +{ + int index; + + assert(((*ctx).top - (*ctx).start) > 0); + + index = *((*ctx).top - 1); + assert(parser->document->nodes.start[index-1].type == YAML_MAPPING_NODE); + parser->document->nodes.start[index-1].end_mark = event->end_mark; + + (void)POP(parser, *ctx); + + return 1; +} \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 1198c73..ec2f8d3 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1261,7 +1261,10 @@ yaml_parser_process_directives(yaml_parser_t *parser, goto error; } if (token->data.version_directive.major != 1 - || token->data.version_directive.minor != 1) { + || ( + token->data.version_directive.minor != 1 + && token->data.version_directive.minor != 2 + )) { yaml_parser_set_parser_error(parser, "found incompatible YAML document", token->start_mark); goto error; diff --git a/src/scanner.c b/src/scanner.c index ceee749..765f286 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -348,6 +348,7 @@ * SCALAR("another value",plain) * KEY * SCALAR("a mapping",plain) + * VALUE * BLOCK-MAPPING-START * KEY * SCALAR("key 1",plain) @@ -3518,12 +3519,12 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token) { if (IS_BLANK(parser->buffer)) { - /* Check for tab character that abuse indentation. */ + /* Check for tab characters that abuse indentation. */ if (leading_blanks && (int)parser->mark.column < indent && IS_TAB(parser->buffer)) { yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate indentation"); + start_mark, "found a tab character that violates indentation"); goto error; } diff --git a/tests/example-deconstructor-alt.c b/tests/example-deconstructor-alt.c index f7b06d6..b29c077 100644 --- a/tests/example-deconstructor-alt.c +++ b/tests/example-deconstructor-alt.c @@ -635,10 +635,10 @@ main(int argc, char *argv[]) /* Display the style information. */ - if (input_event.data.sequence_start.style) + if (input_event.data.mapping_start.style) { - yaml_sequence_style_t style - = (yaml_sequence_style_t) input_event.data.mapping_start.style; + yaml_mapping_style_t style + = input_event.data.mapping_start.style; /* Add 'style':
      [in,out]emitterAn emitter object.
      yaml -  0.2.2 +  0.2.3
      int yaml_document_end_event_initialize (yaml_event_t *event, int implicit)
       Create the DOCUMENT-END event. More...
       
      int yaml_alias_event_initialize (yaml_event_t *event, yaml_char_t *anchor)
       Create an ALIAS event. More...
       
      int yaml_scalar_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style)
       Create a SCALAR event. More...
       
      int yaml_sequence_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_sequence_style_t style)
       Create a SEQUENCE-START event. More...
       
      int yaml_alias_event_initialize (yaml_event_t *event, const yaml_char_t *anchor)
       Create an ALIAS event. More...
       
      int yaml_scalar_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, const yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style)
       Create a SCALAR event. More...
       
      int yaml_sequence_start_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_sequence_style_t style)
       Create a SEQUENCE-START event. More...
       
      int yaml_sequence_end_event_initialize (yaml_event_t *event)
       Create a SEQUENCE-END event. More...
       
      int yaml_mapping_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_mapping_style_t style)
       Create a MAPPING-START event. More...
       
      int yaml_mapping_start_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_mapping_style_t style)
       Create a MAPPING-START event. More...
       
      int yaml_mapping_end_event_initialize (yaml_event_t *event)
       Create a MAPPING-END event. More...
       
      yaml_char_tconst yaml_char_t anchor 
      yaml_char_tconst yaml_char_t anchor,
      yaml_char_tconst yaml_char_t tag,
      yaml_char_tconst yaml_char_t value,
      yaml_char_tconst yaml_char_t anchor,
      yaml_char_tconst yaml_char_t tag,
      yaml_char_tconst yaml_char_t anchor,
      yaml_char_tconst yaml_char_t tag,
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml_node_tyaml_document_get_root_node (yaml_document_t *document)
       Get the root of a YAML document node. More...
       
      int yaml_document_add_scalar (yaml_document_t *document, yaml_char_t *tag, yaml_char_t *value, int length, yaml_scalar_style_t style)
       Create a SCALAR node and attach it to the document. More...
       
      int yaml_document_add_sequence (yaml_document_t *document, yaml_char_t *tag, yaml_sequence_style_t style)
       Create a SEQUENCE node and attach it to the document. More...
       
      int yaml_document_add_mapping (yaml_document_t *document, yaml_char_t *tag, yaml_mapping_style_t style)
       Create a MAPPING node and attach it to the document. More...
       
      int yaml_document_add_scalar (yaml_document_t *document, const yaml_char_t *tag, const yaml_char_t *value, int length, yaml_scalar_style_t style)
       Create a SCALAR node and attach it to the document. More...
       
      int yaml_document_add_sequence (yaml_document_t *document, const yaml_char_t *tag, yaml_sequence_style_t style)
       Create a SEQUENCE node and attach it to the document. More...
       
      int yaml_document_add_mapping (yaml_document_t *document, const yaml_char_t *tag, yaml_mapping_style_t style)
       Create a MAPPING node and attach it to the document. More...
       
      int yaml_document_append_sequence_item (yaml_document_t *document, int sequence, int item)
       Add an item to a SEQUENCE node. More...
       
      yaml_char_tconst yaml_char_t tag,
      yaml_char_tconst yaml_char_t value,
      yaml_char_tconst yaml_char_t tag,
      yaml_char_tconst yaml_char_t tag,
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
       Write handler. More...
       
      void * write_handler_data
       A pointer for passing to the white handler. More...
       A pointer for passing to the write handler. More...
       
      union {
         struct {
      -

      A pointer for passing to the white handler.

      +

      A pointer for passing to the write handler.

      diff --git a/doc/html/structyaml__event__s.html b/doc/html/structyaml__event__s.html index 9ee6162..8105489 100644 --- a/doc/html/structyaml__event__s.html +++ b/doc/html/structyaml__event__s.html @@ -19,7 +19,7 @@
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      size_t tokens_parsed
       The number of tokens fetched from the queue. More...
       
      -int token_available
      int token_available
       Does the tokens queue contain a token ready for dequeueing. More...
       
      struct {
         int *   start
      +

      ◆ token_available

      + +
      +
      + + + + +
      int yaml_parser_s::token_available
      +
      + +

      Does the tokens queue contain a token ready for dequeueing.

      +
      diff --git a/doc/html/structyaml__simple__key__s.html b/doc/html/structyaml__simple__key__s.html index d76eceb..440e3d3 100644 --- a/doc/html/structyaml__simple__key__s.html +++ b/doc/html/structyaml__simple__key__s.html @@ -19,7 +19,7 @@
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      yaml -  0.2.2 +  0.2.3
      int yaml_document_end_event_initialize (yaml_event_t *event, int implicit)
       Create the DOCUMENT-END event. More...
       
      int yaml_alias_event_initialize (yaml_event_t *event, yaml_char_t *anchor)
       Create an ALIAS event. More...
       
      int yaml_scalar_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style)
       Create a SCALAR event. More...
       
      int yaml_sequence_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_sequence_style_t style)
       Create a SEQUENCE-START event. More...
       
      int yaml_alias_event_initialize (yaml_event_t *event, const yaml_char_t *anchor)
       Create an ALIAS event. More...
       
      int yaml_scalar_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, const yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style)
       Create a SCALAR event. More...
       
      int yaml_sequence_start_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_sequence_style_t style)
       Create a SEQUENCE-START event. More...
       
      int yaml_sequence_end_event_initialize (yaml_event_t *event)
       Create a SEQUENCE-END event. More...
       
      int yaml_mapping_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_mapping_style_t style)
       Create a MAPPING-START event. More...
       
      int yaml_mapping_start_event_initialize (yaml_event_t *event, const yaml_char_t *anchor, const yaml_char_t *tag, int implicit, yaml_mapping_style_t style)
       Create a MAPPING-START event. More...
       
      int yaml_mapping_end_event_initialize (yaml_event_t *event)
       Create a MAPPING-END event. More...
       
      yaml_node_tyaml_document_get_root_node (yaml_document_t *document)
       Get the root of a YAML document node. More...
       
      int yaml_document_add_scalar (yaml_document_t *document, yaml_char_t *tag, yaml_char_t *value, int length, yaml_scalar_style_t style)
       Create a SCALAR node and attach it to the document. More...
       
      int yaml_document_add_sequence (yaml_document_t *document, yaml_char_t *tag, yaml_sequence_style_t style)
       Create a SEQUENCE node and attach it to the document. More...
       
      int yaml_document_add_mapping (yaml_document_t *document, yaml_char_t *tag, yaml_mapping_style_t style)
       Create a MAPPING node and attach it to the document. More...
       
      int yaml_document_add_scalar (yaml_document_t *document, const yaml_char_t *tag, const yaml_char_t *value, int length, yaml_scalar_style_t style)
       Create a SCALAR node and attach it to the document. More...
       
      int yaml_document_add_sequence (yaml_document_t *document, const yaml_char_t *tag, yaml_sequence_style_t style)
       Create a SEQUENCE node and attach it to the document. More...
       
      int yaml_document_add_mapping (yaml_document_t *document, const yaml_char_t *tag, yaml_mapping_style_t style)
       Create a MAPPING node and attach it to the document. More...
       
      int yaml_document_append_sequence_item (yaml_document_t *document, int sequence, int item)
       Add an item to a SEQUENCE node. More...
       
       Set if the output should be in the "canonical" format as in the YAML specification. More...
       
      void yaml_emitter_set_indent (yaml_emitter_t *emitter, int indent)
       Set the intendation increment. More...
       Set the indentation increment. More...
       
      void yaml_emitter_set_width (yaml_emitter_t *emitter, int width)
       Set the preferred line width. More...