Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Oct 2016 00:12:03 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r306543 - in vendor/libucl/20160812: . haskell include lua m4 python python/src python/tests src tests tests/basic tests/schema uthash utils
Message-ID:  <201610010012.u910C3dm008432@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat Oct  1 00:12:03 2016
New Revision: 306543
URL: https://svnweb.freebsd.org/changeset/base/306543

Log:
  tag import of libucl 20160812

Added:
  vendor/libucl/20160812/
     - copied from r294088, vendor/libucl/dist/
  vendor/libucl/20160812/haskell/
     - copied from r306542, vendor/libucl/dist/haskell/
  vendor/libucl/20160812/m4/gcov.m4
     - copied unchanged from r306542, vendor/libucl/dist/m4/gcov.m4
  vendor/libucl/20160812/python/tests/
     - copied from r306542, vendor/libucl/dist/python/tests/
  vendor/libucl/20160812/src/mum.h
     - copied unchanged from r306542, vendor/libucl/dist/src/mum.h
  vendor/libucl/20160812/tests/basic/escapes.in
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/escapes.in
  vendor/libucl/20160812/tests/basic/escapes.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/escapes.res
  vendor/libucl/20160812/tests/basic/load.in
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.in
  vendor/libucl/20160812/tests/basic/load.inc
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.inc
  vendor/libucl/20160812/tests/basic/load.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.res
Replaced:
  vendor/libucl/20160812/CMakeLists.txt
     - copied unchanged from r306542, vendor/libucl/dist/CMakeLists.txt
  vendor/libucl/20160812/ChangeLog.md
     - copied unchanged from r298162, vendor/libucl/dist/ChangeLog.md
  vendor/libucl/20160812/Makefile.am
     - copied unchanged from r298162, vendor/libucl/dist/Makefile.am
  vendor/libucl/20160812/Makefile.unix
     - copied unchanged from r306542, vendor/libucl/dist/Makefile.unix
  vendor/libucl/20160812/Makefile.w32
     - copied unchanged from r306542, vendor/libucl/dist/Makefile.w32
  vendor/libucl/20160812/README.md
     - copied unchanged from r306542, vendor/libucl/dist/README.md
  vendor/libucl/20160812/configure.ac
     - copied unchanged from r298162, vendor/libucl/dist/configure.ac
  vendor/libucl/20160812/include/ucl++.h
     - copied unchanged from r306542, vendor/libucl/dist/include/ucl++.h
  vendor/libucl/20160812/include/ucl.h
     - copied unchanged from r306542, vendor/libucl/dist/include/ucl.h
  vendor/libucl/20160812/lua/lua_ucl.c
     - copied unchanged from r298162, vendor/libucl/dist/lua/lua_ucl.c
  vendor/libucl/20160812/python/setup.py
     - copied unchanged from r306542, vendor/libucl/dist/python/setup.py
  vendor/libucl/20160812/python/src/uclmodule.c
     - copied unchanged from r306542, vendor/libucl/dist/python/src/uclmodule.c
  vendor/libucl/20160812/src/Makefile.am
     - copied unchanged from r301333, vendor/libucl/dist/src/Makefile.am
  vendor/libucl/20160812/src/ucl_emitter.c
     - copied unchanged from r298162, vendor/libucl/dist/src/ucl_emitter.c
  vendor/libucl/20160812/src/ucl_emitter_streamline.c
     - copied unchanged from r298162, vendor/libucl/dist/src/ucl_emitter_streamline.c
  vendor/libucl/20160812/src/ucl_hash.c
     - copied unchanged from r301333, vendor/libucl/dist/src/ucl_hash.c
  vendor/libucl/20160812/src/ucl_hash.h
     - copied unchanged from r298162, vendor/libucl/dist/src/ucl_hash.h
  vendor/libucl/20160812/src/ucl_internal.h
     - copied unchanged from r301333, vendor/libucl/dist/src/ucl_internal.h
  vendor/libucl/20160812/src/ucl_msgpack.c
     - copied unchanged from r301333, vendor/libucl/dist/src/ucl_msgpack.c
  vendor/libucl/20160812/src/ucl_parser.c
     - copied unchanged from r306542, vendor/libucl/dist/src/ucl_parser.c
  vendor/libucl/20160812/src/ucl_schema.c
     - copied unchanged from r306542, vendor/libucl/dist/src/ucl_schema.c
  vendor/libucl/20160812/src/ucl_sexp.c
     - copied unchanged from r298162, vendor/libucl/dist/src/ucl_sexp.c
  vendor/libucl/20160812/src/ucl_util.c
     - copied unchanged from r306542, vendor/libucl/dist/src/ucl_util.c
  vendor/libucl/20160812/tests/basic.test
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic.test
  vendor/libucl/20160812/tests/basic/18.in
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/18.in
  vendor/libucl/20160812/tests/basic/18.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/18.res
  vendor/libucl/20160812/tests/basic/2.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/2.res
  vendor/libucl/20160812/tests/basic/9.in
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/9.in
  vendor/libucl/20160812/tests/basic/9.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/basic/9.res
  vendor/libucl/20160812/tests/generate.res
     - copied unchanged from r298162, vendor/libucl/dist/tests/generate.res
  vendor/libucl/20160812/tests/schema.test
     - copied unchanged from r298162, vendor/libucl/dist/tests/schema.test
  vendor/libucl/20160812/tests/schema/definitions.json
     - copied unchanged from r298162, vendor/libucl/dist/tests/schema/definitions.json
  vendor/libucl/20160812/tests/schema/patternProperties.json
     - copied unchanged from r306542, vendor/libucl/dist/tests/schema/patternProperties.json
  vendor/libucl/20160812/tests/schema/ref.json
     - copied unchanged from r298162, vendor/libucl/dist/tests/schema/ref.json
  vendor/libucl/20160812/tests/schema/refRemote.json
     - copied unchanged from r306542, vendor/libucl/dist/tests/schema/refRemote.json
  vendor/libucl/20160812/tests/test_basic.c
     - copied unchanged from r298162, vendor/libucl/dist/tests/test_basic.c
  vendor/libucl/20160812/tests/test_generate.c
     - copied unchanged from r298162, vendor/libucl/dist/tests/test_generate.c
  vendor/libucl/20160812/tests/test_msgpack.c
     - copied unchanged from r298162, vendor/libucl/dist/tests/test_msgpack.c
  vendor/libucl/20160812/tests/test_schema.c
     - copied unchanged from r298162, vendor/libucl/dist/tests/test_schema.c
  vendor/libucl/20160812/uthash/uthash.h
     - copied unchanged from r301333, vendor/libucl/dist/uthash/uthash.h
  vendor/libucl/20160812/utils/objdump.c
     - copied unchanged from r298162, vendor/libucl/dist/utils/objdump.c
Deleted:
  vendor/libucl/20160812/python/test.sh
  vendor/libucl/20160812/python/test_uclmodule.py
  vendor/libucl/20160812/src/xxhash.c
  vendor/libucl/20160812/src/xxhash.h

Copied: vendor/libucl/20160812/CMakeLists.txt (from r306542, vendor/libucl/dist/CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/CMakeLists.txt	Sat Oct  1 00:12:03 2016	(r306543, copy of r306542, vendor/libucl/dist/CMakeLists.txt)
@@ -0,0 +1,259 @@
+PROJECT(libucl C)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
+
+SET(LIBUCL_VERSION_MAJOR 0)
+SET(LIBUCL_VERSION_MINOR 5)
+SET(LIBUCL_VERSION_PATCH 0)
+
+SET(LIBUCL_VERSION
+        "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}")
+
+INCLUDE(CheckCCompilerFlag)
+INCLUDE(FindOpenSSL)
+
+OPTION(ENABLE_URL_INCLUDE  "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF)
+OPTION(ENABLE_URL_SIGN  "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF)
+OPTION(BUILD_SHARED_LIBS "Build Shared Libraries [default: OFF]" OFF)
+OPTION(ENABLE_LUA "Enable lua support [default: OFF]" OFF)
+OPTION(ENABLE_LUAJIT "Enable luajit support [default: OFF]" OFF)
+
+# Find lua installation
+MACRO(FindLua)
+	# Find lua libraries
+	UNSET(LUA_INCLUDE_DIR CACHE)
+	UNSET(LUA_LIBRARY CACHE)
+	CMAKE_PARSE_ARGUMENTS(LUA "" "VERSION_MAJOR;VERSION_MINOR;ROOT" "" ${ARGN})
+
+	IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
+		MESSAGE(FATAL_ERROR "Invalid FindLua invocation: ${ARGN}")
+	ENDIF()
+
+	IF(ENABLE_LUAJIT MATCHES "ON")
+		MESSAGE(STATUS "Check for luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+		FIND_PATH(LUA_INCLUDE_DIR luajit.h
+				HINTS
+				"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+				$ENV{LUA_DIR}
+				PATH_SUFFIXES "include/luajit-2.0"
+				"include/luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+				"include/luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"include/luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"include/luajit"
+				"include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+				"include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				include/lua include
+				PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS}
+		)
+		FIND_LIBRARY(LUA_LIBRARY
+				NAMES luajit
+				"luajit-2.0"
+				"luajit2.0"
+				"luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+				"luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				HINTS
+				"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+				$ENV{LUA_DIR}
+				PATH_SUFFIXES lib64 lib
+				PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
+				DOC "Lua library"
+		)
+
+		IF(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
+			MESSAGE(STATUS "Fallback from luajit to plain lua")
+			SET(ENABLE_LUAJIT "OFF")
+			MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+			FIND_PATH(LUA_INCLUDE_DIR lua.h
+					HINTS
+					"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+					$ENV{LUA_DIR}
+					PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+					"include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+					"include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+					include/lua include
+					PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS}
+			)
+			FIND_LIBRARY(LUA_LIBRARY
+					NAMES lua
+					"lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+					"lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+					"lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+					HINTS
+					"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+					$ENV{LUA_DIR}
+					PATH_SUFFIXES lib64 lib
+					PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
+					DOC "Lua library"
+			)
+		ENDIF()
+	ELSE(ENABLE_LUAJIT MATCHES "ON")
+		MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+		FIND_PATH(LUA_INCLUDE_DIR lua.h
+				HINTS
+				"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+				$ENV{LUA_DIR}
+				PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+				"include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				include/lua include
+				PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS}
+		)
+		FIND_LIBRARY(LUA_LIBRARY
+				NAMES lua
+				"lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
+				"lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				"lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+				HINTS
+				"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
+				$ENV{LUA_DIR}
+				PATH_SUFFIXES lib64 lib
+				PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
+				DOC "Lua library"
+		)
+	ENDIF(ENABLE_LUAJIT MATCHES "ON")
+
+	IF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
+		SET(LUA_FOUND 1)
+		IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
+			SET(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR})
+			SET(LUA_VERSION_MINOR ${LUA_VERSION_MINOR})
+		ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
+		IF(ENABLE_LUAJIT MATCHES "ON")
+			MESSAGE(STATUS "Found luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+		ELSE(ENABLE_LUAJIT MATCHES "ON")
+			MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+		ENDIF(ENABLE_LUAJIT MATCHES "ON")
+	ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
+ENDMACRO()
+
+IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+	LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt)
+ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+
+IF(ENABLE_URL_INCLUDE MATCHES "ON")
+    FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS	PATH_SUFFIXES lib64 lib
+                      PATHS
+                          ~/Library/Frameworks
+                          /Library/Frameworks
+                          /usr/local
+                          /usr
+                          /sw
+                          /opt/local
+                          /opt/csw
+                          /opt
+                     DOC "Path where the libfetch library can be found")
+    IF(LIBFETCH_LIBRARY)
+    	FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include
+    											   /opt/include
+    											   /usr/local/include
+    				DOC "Path to libfetch header")
+    ELSE(LIBFETCH_LIBRARY)
+    	# Try to find libcurl
+    	ProcessPackage(CURL libcurl)
+    	IF(NOT CURL_FOUND)
+    		MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration")
+    	ENDIF(NOT CURL_FOUND)
+    ENDIF(LIBFETCH_LIBRARY)
+ENDIF(ENABLE_URL_INCLUDE MATCHES "ON")
+
+SET(CMAKE_C_WARN_FLAGS "")
+CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL)
+CHECK_C_COMPILER_FLAG(-W SUPPORT_W)
+CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM)
+CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN)
+CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES)
+IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
+	CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG)
+ENDIF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
+IF(SUPPORT_W)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W")
+ENDIF(SUPPORT_W)
+IF(SUPPORT_WALL)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wall")
+ENDIF(SUPPORT_WALL)
+IF(SUPPORT_WPARAM)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-unused-parameter")
+ENDIF(SUPPORT_WPARAM)
+IF(SUPPORT_WPOINTER_SIGN)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign")
+ENDIF(SUPPORT_WPOINTER_SIGN)
+IF(SUPPORT_WSTRICT_PROTOTYPES)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes")
+ENDIF(SUPPORT_WSTRICT_PROTOTYPES)
+IF(SUPPORT_STD_FLAG)
+	SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c99")
+ENDIF(SUPPORT_STD_FLAG)
+
+IF(ENABLE_URL_SIGN MATCHES "ON")
+	IF(OPENSSL_FOUND)
+		SET(HAVE_OPENSSL 1)
+		INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}")
+	ENDIF(OPENSSL_FOUND)
+ENDIF(ENABLE_URL_SIGN MATCHES "ON")
+
+INCLUDE_DIRECTORIES("src")
+INCLUDE_DIRECTORIES("include")
+INCLUDE_DIRECTORIES("uthash")
+INCLUDE_DIRECTORIES("klib")
+
+SET(UCLSRC src/ucl_util.c
+		src/ucl_parser.c
+		src/ucl_emitter.c
+		src/ucl_emitter_streamline.c
+		src/ucl_emitter_utils.c
+		src/ucl_hash.c
+		src/ucl_schema.c
+		src/ucl_msgpack.c
+		src/ucl_sexp.c)
+
+
+SET (LIB_TYPE STATIC)
+IF (BUILD_SHARED_LIBS)
+  SET (LIB_TYPE SHARED)
+ENDIF (BUILD_SHARED_LIBS)
+ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC})
+SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR})
+
+IF(ENABLE_LUA MATCHES "ON")
+	IF(ENABLE_LUAJIT MATCHES "ON")
+		FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}")
+		IF(NOT LUA_FOUND)
+			MESSAGE(FATAL_ERROR "Lua not found, lua support is required")
+		ELSE(NOT LUA_FOUND)
+			INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}")
+		ENDIF(NOT LUA_FOUND)
+	ELSE(ENABLE_LUAJIT MATCHES "ON")
+		FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}")
+		IF(NOT LUA_FOUND)
+			FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}")
+		ENDIF(NOT LUA_FOUND)
+		IF(NOT LUA_FOUND)
+			MESSAGE(FATAL_ERROR "Lua not found, lua support is required")
+		ELSE(NOT LUA_FOUND)
+			INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}")
+		ENDIF(NOT LUA_FOUND)
+	ENDIF(ENABLE_LUAJIT MATCHES "ON")
+	SET(UCL_LUA_SRC lua/lua_ucl.c)
+	ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC})
+	IF(ENABLE_LUAJIT MATCHES "ON")
+		TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}")
+	ELSE(ENABLE_LUAJIT MATCHES "ON")
+		TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}")
+	ENDIF(ENABLE_LUAJIT MATCHES "ON")
+	TARGET_LINK_LIBRARIES(lua-ucl ucl)
+	SET_TARGET_PROPERTIES(lua-ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR})
+ENDIF()
+
+IF(HAVE_FETCH_H)
+    TARGET_LINK_LIBRARIES(ucl fetch)
+ELSE(HAVE_FETCH_H)
+    IF(CURL_FOUND)
+        TARGET_LINK_LIBRARIES(ucl ${CURL_LIBRARIES})
+    ENDIF(CURL_FOUND)
+ENDIF(HAVE_FETCH_H)
+IF(ENABLE_URL_SIGN MATCHES "ON")
+	IF(OPENSSL_FOUND)
+		TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES})
+	ENDIF(OPENSSL_FOUND)
+ENDIF(ENABLE_URL_SIGN MATCHES "ON")

Copied: vendor/libucl/20160812/ChangeLog.md (from r298162, vendor/libucl/dist/ChangeLog.md)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/ChangeLog.md	Sat Oct  1 00:12:03 2016	(r306543, copy of r298162, vendor/libucl/dist/ChangeLog.md)
@@ -0,0 +1,67 @@
+# Version history
+
+## Libucl 0.5
+
+- Streamline emitter has been added, so it is now possible to output partial `ucl` objects
+- Emitter now is more flexible due to emitter_context structure
+
+### 0.5.1
+- Fixed number of bugs and memory leaks
+
+### 0.5.2
+
+- Allow userdata objects to be emitted and destructed
+- Use userdata objects to store lua function references
+
+### Libucl 0.6
+
+- Reworked macro interface
+
+### Libucl 0.6.1
+
+- Various utilities fixes
+
+### Libucl 0.7.0
+
+- Move to klib library from uthash to reduce memory overhead and increase performance
+
+### Libucl 0.7.1
+
+- Added safe iterators API
+
+### Libucl 0.7.2
+
+- Fixed serious bugs in schema and arrays iteration
+
+### Libucl 0.7.3
+
+- Fixed a bug with macroes that come after an empty object
+- Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free)
+
+### Libucl 0.8.0
+
+- Allow to save comments and macros when parsing UCL documents
+- C++ API
+- Python bindings (by Eitan Adler)
+- Add msgpack support for parser and emitter
+- Add Canonical S-expressions parser for libucl
+- CLI interface for parsing and validation (by Maxim Ignatenko)
+- Implement include with priority
+- Add 'nested' functionality to .include macro (by Allan Jude)
+- Allow searching an array of paths for includes (by Allan Jude)
+- Add new .load macro (by Allan Jude)
+- Implement .inherit macro (#100)
+- Add merge strategies
+- Add schema validation to lua API
+- Add support for external references to schema validation
+- Add coveralls integration to libucl
+- Implement tests for 80% of libucl code lines
+- Fix tonns of minor and major bugs
+- Improve documentation
+- Rework function names to the common conventions (old names are preserved for backwards compatibility)
+- Add Coverity scan integration
+- Add fuzz tests
+
+**Incompatible changes**:
+
+- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output
\ No newline at end of file

Copied: vendor/libucl/20160812/Makefile.am (from r298162, vendor/libucl/dist/Makefile.am)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/Makefile.am	Sat Oct  1 00:12:03 2016	(r306543, copy of r298162, vendor/libucl/dist/Makefile.am)
@@ -0,0 +1,81 @@
+ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = uthash klib README.md
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libucl.pc
+
+if LUA_SUB
+  LUA_SUBDIR = lua
+endif
+
+COVERAGE_INFO_FILE = $(top_builddir)/coverage.info
+COVERAGE_REPORT_DIR = $(top_builddir)/coverage
+
+.PHONY = coverage-requirement-check clean-coverage-report
+
+coverage-requirement-check:
+	@if test ! -e $(GCOV); then \
+		echo "Cannot find $(GCOV). Please install gcov."; \
+		exit 1; \
+	fi
+
+coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report
+	@echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data."
+
+coverage-build: coverage-requirement-check
+	@if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \
+		echo "Start to remove old non-instrumented object files..."; \
+		$(MAKE) $(AM_MAKEFLAGS) clean; \
+		echo "Successfully removed old non-instrumented object files."; \
+	fi
+	@echo "Start to build libraries with coverage options..."
+	$(MAKE) $(AM_MAKEFLAGS) \
+		CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \
+		CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \
+		LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \
+		LIBS="$(LIBS) $(COVERAGE_LIBS)"
+	@echo "Successfully built libraries with coverage options."
+
+coverage-check: coverage-requirement-check
+	@echo "Start to run tests with instrumented libraries..."
+	$(MAKE) $(AM_MAKEFLAGS) check \
+		CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \
+		CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \
+		LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \
+		LIBS="$(LIBS) $(COVERAGE_LIBS)"
+	@echo "Successfully run tests with instrumented libraries."
+
+coverage-lcov: coverage-check coverage-requirement-check
+	$(LCOV) --capture \
+		--directory "$(top_builddir)/" \
+		--output-file $(COVERAGE_INFO_FILE) \
+		--gcov-tool $(GCOV) \
+		--compat-libtool --checksum
+	$(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \
+		--output-file $(COVERAGE_INFO_FILE)
+
+coverage-report: coverage-lcov
+	@echo "Start to create coverage reports..."
+	$(GENHTML) --prefix "$(top_srcdir)" \
+		--output-directory $(COVERAGE_REPORT_DIR) \
+		--title $(PACKAGE_NAME) \
+		--legend --show-details \
+		$(GENHTML_OPTIONS) \
+		$(COVERAGE_INFO_FILE)
+	@echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory."
+
+clean-coverage-report:
+	-rm -rf $(COVERAGE_INFO_FILE)
+	-rm -rf $(COVERAGE_REPORT_DIR)
+
+clean-coverage: clean-coverage-report
+	-$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir)
+	@if xargs --version 2>/dev/null; then \
+		find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \
+	else \
+		find $(top_builddir) -name "*.gcno" | xargs rm; \
+	fi
+
+clean-local: clean-coverage
+
+SUBDIRS = src tests utils doc $(LUA_SUBDIR)

Copied: vendor/libucl/20160812/Makefile.unix (from r306542, vendor/libucl/dist/Makefile.unix)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/Makefile.unix	Sat Oct  1 00:12:03 2016	(r306543, copy of r306542, vendor/libucl/dist/Makefile.unix)
@@ -0,0 +1,89 @@
+CC ?= gcc
+DESTDIR ?= /usr/local
+LD ?= gcc
+C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src -I./klib
+MAJOR_VERSION = 0
+MINOR_VERSION = 2
+PATCH_VERSION = 9
+VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)"
+SONAME = libucl.so
+SONAME_FULL = $(SONAME).$(MAJOR_VERSION)
+OBJDIR ?= .obj
+TESTDIR ?= tests
+SRCDIR ?= src
+INCLUDEDIR ?= include
+MKDIR ?= mkdir
+INSTALL ?= install
+RM ?= rm
+RMDIR ?= rmdir
+LN ?= ln
+LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
+LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
+LD_ADD ?= -lrt
+COPT_FLAGS ?= -O2
+HDEPS = $(SRCDIR)/ucl_hash.h \
+		$(SRCDIR)/ucl_chartable.h \
+		$(SRCDIR)/ucl_internal.h \
+		$(INCLUDEDIR)/ucl.h \
+		$(SRCDIR)/mum.h
+OBJECTS = $(OBJDIR)/ucl_hash.o \
+		$(OBJDIR)/ucl_util.o \
+		$(OBJDIR)/ucl_parser.o \
+		$(OBJDIR)/ucl_emitter.o \
+		$(OBJDIR)/ucl_schema.o
+
+all: $(OBJDIR) $(OBJDIR)/$(SONAME)
+
+$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL)
+	$(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME)
+
+$(OBJDIR)/$(SONAME_FULL): $(OBJECTS)
+	$(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS)
+
+$(OBJDIR):
+	@$(MKDIR) -p $(OBJDIR)
+
+# Compile rules
+$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c
+$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c
+$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c
+$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c
+$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c
+
+clean:
+	$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true
+	$(RMDIR) $(OBJDIR)
+	
+# Utils
+
+chargen: utils/chargen.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c
+objdump: utils/objdump.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS)
+
+# Tests
+
+test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema
+
+run-test: test
+	TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema
+	
+$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS)
+$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS)
+$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD)
+$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD)
+
+install: $(OBJDIR)/$(SONAME)
+	$(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME)
+	$(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h
+
+.PHONY: clean $(OBJDIR)

Copied: vendor/libucl/20160812/Makefile.w32 (from r306542, vendor/libucl/dist/Makefile.w32)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/Makefile.w32	Sat Oct  1 00:12:03 2016	(r306543, copy of r306542, vendor/libucl/dist/Makefile.w32)
@@ -0,0 +1,92 @@
+CC ?= gcc
+DESTDIR ?= /usr/local
+LD ?= gcc
+C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src
+MAJOR_VERSION = 0
+MINOR_VERSION = 2
+PATCH_VERSION = 9
+VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)"
+SONAME = libucl.dll
+OBJDIR ?= .obj
+TESTDIR ?= tests
+SRCDIR ?= src
+INCLUDEDIR ?= include
+MKDIR ?= mkdir
+INSTALL ?= install
+RM ?= rm
+RMDIR ?= rmdir
+ifeq (Windows_NT, $(OS))
+LN ?= ln
+else
+LN ?= rem ln
+endif
+LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
+LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
+LD_ADD ?= -lrt
+COPT_FLAGS ?= -O2
+HDEPS = $(SRCDIR)/ucl_hash.h \
+		$(SRCDIR)/ucl_chartable.h \
+		$(SRCDIR)/ucl_internal.h \
+		$(INCLUDEDIR)/ucl.h \
+		$(SRCDIR)/mum.h
+OBJECTS = $(OBJDIR)/ucl_hash.o \
+		$(OBJDIR)/ucl_util.o \
+		$(OBJDIR)/ucl_parser.o \
+		$(OBJDIR)/ucl_emitter.o \
+		$(OBJDIR)/ucl_emitter_utils.o \
+		$(OBJDIR)/ucl_schema.o
+
+all: $(OBJDIR) $(OBJDIR)/$(SONAME)
+
+$(OBJDIR)/$(SONAME): $(OBJECTS)
+	$(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS)
+
+$(OBJDIR):
+	@$(MKDIR) -p $(OBJDIR)
+
+# Compile rules
+$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c
+$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c
+$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c
+$(OBJDIR)/ucl_emitter_utils.o: $(SRCDIR)/ucl_emitter_utils.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_emitter_utils.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter_utils.c
+$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c
+$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c
+$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS)
+	$(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c
+
+clean:
+	$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate
+	$(RMDIR) $(OBJDIR)
+
+# Utils
+
+chargen: utils/chargen.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c
+objdump: utils/objdump.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS)
+
+# Tests
+
+test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate
+
+run-test: test
+	TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate
+
+$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS)
+$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD)
+$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME)
+	$(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD)
+
+install: $(OBJDIR)/$(SONAME)
+	$(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME)
+	$(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h
+
+.PHONY: clean $(OBJDIR)

Copied: vendor/libucl/20160812/README.md (from r306542, vendor/libucl/dist/README.md)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/README.md	Sat Oct  1 00:12:03 2016	(r306543, copy of r306542, vendor/libucl/dist/README.md)
@@ -0,0 +1,382 @@
+# LIBUCL
+
+[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master)
+
+**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*
+
+- [Introduction](#introduction)
+- [Basic structure](#basic-structure)
+- [Improvements to the json notation](#improvements-to-the-json-notation)
+	- [General syntax sugar](#general-syntax-sugar)
+	- [Automatic arrays creation](#automatic-arrays-creation)
+	- [Named keys hierarchy](#named-keys-hierarchy)
+	- [Convenient numbers and booleans](#convenient-numbers-and-booleans)
+- [General improvements](#general-improvements)
+	- [Comments](#comments)
+	- [Macros support](#macros-support)
+	- [Variables support](#variables-support)
+	- [Multiline strings](#multiline-strings)
+- [Emitter](#emitter)
+- [Validation](#validation)
+- [Performance](#performance)
+- [Conclusion](#conclusion)
+
+## Introduction
+
+This document describes the main features and principles of the configuration
+language called `UCL` - universal configuration language.
+
+If you are looking for the libucl API documentation you can find it at [this page](doc/api.md).
+
+## Basic structure
+
+UCL is heavily infused by `nginx` configuration as the example of a convenient configuration
+system. However, UCL is fully compatible with `JSON` format and is able to parse json files.
+For example, you can write the same configuration in the following ways:
+
+* in nginx like:
+
+```nginx
+param = value;
+section {
+    param = value;
+    param1 = value1;
+    flag = true;
+    number = 10k;
+    time = 0.2s;
+    string = "something";
+    subsection {
+        host = {
+            host = "hostname";
+            port = 900;
+        }
+        host = {
+            host = "hostname";
+            port = 901;
+        }
+    }
+}
+```
+
+* or in JSON:
+
+```json
+{
+    "param": "value",
+    "param1": "value1",
+    "flag": true,
+    "subsection": {
+        "host": [
+        {
+            "host": "hostname",
+            "port": 900
+        },
+        {
+            "host": "hostname",
+            "port": 901
+        }
+        ]
+    }
+}
+```
+
+## Improvements to the json notation.
+
+There are various things that make ucl configuration more convenient for editing than strict json:
+
+### General syntax sugar
+
+* Braces are not necessary to enclose a top object: it is automatically treated as an object:
+
+```json
+"key": "value"
+```
+is equal to:
+```json
+{"key": "value"}
+```
+
+* There is no requirement of quotes for strings and keys, moreover, `:` may be replaced `=` or even be skipped for objects:
+
+```nginx
+key = value;
+section {
+    key = value;
+}
+```
+is equal to:
+```json
+{
+    "key": "value",
+    "section": {
+        "key": "value"
+    }
+}
+```
+
+* No commas mess: you can safely place a comma or semicolon for the last element in an array or an object:
+
+```json
+{
+    "key1": "value",
+    "key2": "value",
+}
+```
+### Automatic arrays creation
+
+* Non-unique keys in an object are allowed and are automatically converted to the arrays internally:
+
+```json
+{
+    "key": "value1",
+    "key": "value2"
+}
+```
+is converted to:
+```json
+{
+    "key": ["value1", "value2"]
+}
+```
+
+### Named keys hierarchy
+
+UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process:
+```nginx
+section "blah" {
+	key = value;
+}
+section foo {
+	key = value;
+}
+```
+
+is converted to the following object:
+
+```nginx
+section {
+	blah {
+		key = value;
+	}
+	foo {
+		key = value;
+	}
+}
+```
+
+Plain definitions may be more complex and contain more than a single level of nested objects:
+
+```nginx
+section "blah" "foo" {
+	key = value;
+}
+```
+
+is presented as:
+
+```nginx
+section {
+	blah {
+		foo {
+			key = value;
+		}
+	}
+}
+```
+
+### Convenient numbers and booleans
+
+* Numbers can have suffixes to specify standard multipliers:
+    + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000)
+    + `[kKmMgG]b` - 2 power multipliers (so `1kb` is translated to 1024)
+    + `[s|min|d|w|y]` - time multipliers, all time values are translated to float number of seconds, for example `10min` is translated to 600.0 and `10ms` is translated to 0.01
+* Hexadecimal integers can be used by `0x` prefix, for example `key = 0xff`. However, floating point values can use decimal base only.
+* Booleans can be specified as `true` or `yes` or `on` and `false` or `no` or `off`.
+* It is still possible to treat numbers and booleans as strings by enclosing them in double quotes.
+
+## General improvements
+
+### Comments
+
+UCL supports different style of comments:
+
+* single line: `#`
+* multiline: `/* ... */`
+
+Multiline comments may be nested:
+```c
+# Sample single line comment
+/*
+ some comment
+ /* nested comment */
+ end of comment
+*/
+```
+
+### Macros support
+
+UCL supports external macros both multiline and single line ones:
+```nginx
+.macro "sometext";
+.macro {
+    Some long text
+    ....
+};
+```
+
+Moreover, each macro can accept an optional list of arguments in braces. These
+arguments themselves are the UCL object that is parsed and passed to a macro as
+options:
+
+```nginx
+.macro(param=value) "something";
+.macro(param={key=value}) "something";
+.macro(.include "params.conf") "something";
+.macro(#this is multiline macro
+param = [value1, value2]) "something";
+.macro(key="()") "something";
+```
+
+UCL also provide a convenient `include` macro to load content from another files
+to the current UCL object. This macro accepts either path to file:
+
+```nginx
+.include "/full/path.conf"
+.include "./relative/path.conf"
+.include "${CURDIR}/path.conf"
+```
+
+or URL (if ucl is built with url support provided by either `libcurl` or `libfetch`):
+
+	.include "http://example.com/file.conf"
+
+`.include` macro supports a set of options:
+
+* `try` (default: **false**) - if this option is `true` than UCL treats errors on loading of
+this file as non-fatal. For example, such a file can be absent but it won't stop the parsing
+of the top-level document.
+* `sign` (default: **false**) - if this option is `true` UCL loads and checks the signature for
+a file from path named `<FILEPATH>.sig`. Trusted public keys should be provided for UCL API after
+parser is created but before any configurations are parsed.
+* `glob` (default: **false**) - if this option is `true` UCL treats the filename as GLOB pattern and load
+all files that matches the specified pattern (normally the format of patterns is defined in `glob` manual page
+for your operating system). This option is meaningless for URL includes.
+* `url` (default: **true**) - allow URL includes.
+* `path` (default: empty) - A UCL_ARRAY of directories to search for the include file.
+Search ends after the first match, unless `glob` is true, then all matches are included.
+* `prefix` (default false) - Put included contents inside an object, instead
+of loading them into the root. If no `key` is provided, one is automatically generated based on each files basename()
+* `key` (default: <empty string>) - Key to load contents of include into. If
+the key already exists, it must be the correct type
+* `target` (default: object) - Specify if the `prefix` `key` should be an
+object or an array.
+* `priority` (default: 0) - specify priority for the include (see below).
+* `duplicate` (default: 'append') - specify policy of duplicates resolving:
+	- `append` - default strategy, if we have new object of higher priority then it replaces old one, if we have new object with less priority it is ignored completely, and if we have two duplicate objects with the same priority then we have a multi-value key (implicit array)
+	- `merge` - if we have object or array, then new keys are merged inside, if we have a plain object then an implicit array is formed (regardless of priorities)
+	- `error` - create error on duplicate keys and stop parsing
+	- `rewrite` - always rewrite an old value with new one (ignoring priorities)
+
+Priorities are used by UCL parser to manage the policy of objects rewriting during including other files
+as following:
+
+* If we have two objects with the same priority then we form an implicit array
+* If a new object has bigger priority then we overwrite an old one
+* If a new object has lower priority then we ignore it
+
+By default, the priority of top-level object is set to zero (lowest priority). Currently,
+you can define up to 16 priorities (from 0 to 15). Includes with bigger priorities will
+rewrite keys from the objects with lower priorities as specified by the policy.
+
+### Variables support
+
+UCL supports variables in input. Variables are registered by a user of the UCL parser and can be presented in the following forms:
+
+* `${VARIABLE}`
+* `$VARIABLE`
+
+UCL currently does not support nested variables. To escape variables one could use double dollar signs:
+
+* `$${VARIABLE}` is converted to `${VARIABLE}`
+* `$$VARIABLE` is converted to `$VARIABLE`
+
+However, if no valid variables are found in a string, no expansion will be performed (and `$$` thus remains unchanged). This may be a subject
+to change in future libucl releases.
+
+### Multiline strings
+
+UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects:
+```
+key = <<EOD
+some text
+splitted to
+lines
+EOD
+```
+
+In this example `key` will be interpreted as the following string: `some text\nsplitted to\nlines`.
+Here are some rules for this syntax:
+
+* Multiline terminator must start just after `<<` symbols and it must consist of capital letters only (e.g. `<<eof` or `<< EOF` won't work);
+* Terminator must end with a single newline character (and no spaces are allowed between terminator and newline character);
+* To finish multiline string you need to include a terminator string just after newline and followed by a newline (no spaces or other characters are allowed as well);
+* The initial and the final newlines are not inserted to the resulting string, but you can still specify newlines at the beginning and at the end of a value, for example:
+
+```
+key <<EOD
+
+some
+text
+
+EOD
+```
+
+## Emitter
+
+Each UCL object can be serialized to one of the three supported formats:
+
+* `JSON` - canonic json notation (with spaces indented structure);
+* `Compacted JSON` - compact json notation (without spaces or newlines);
+* `Configuration` - nginx like notation;
+* `YAML` - yaml inlined notation.
+
+## Validation
+
+UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, a schema definition can be in UCL format instead of JSON that simplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values count in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that the input objects are validated properly.
+
+## Performance
+
+Are UCL parser and emitter fast enough? Well, there are some numbers.
+I got a 19Mb file that consist of ~700 thousand lines of json (obtained via
+http://www.json-generator.com/). Then I checked jansson library that performs json
+parsing and emitting and compared it with UCL. Here are results:
+
+```
+jansson: parsed json in 1.3899 seconds
+jansson: emitted object in 0.2609 seconds
+
+ucl: parsed input in 0.6649 seconds
+ucl: emitted config in 0.2423 seconds
+ucl: emitted json in 0.2329 seconds
+ucl: emitted compact json in 0.1811 seconds
+ucl: emitted yaml in 0.2489 seconds
+```
+
+So far, UCL seems to be significantly faster than jansson on parsing and slightly faster on emitting. Moreover,
+UCL compiled with optimizations (-O3) performs significantly faster:
+```
+ucl: parsed input in 0.3002 seconds
+ucl: emitted config in 0.1174 seconds
+ucl: emitted json in 0.1174 seconds
+ucl: emitted compact json in 0.0991 seconds
+ucl: emitted yaml in 0.1354 seconds
+```
+
+You can do your own benchmarks by running `make check` in libucl top directory.
+
+## Conclusion
+
+UCL has clear design that should be very convenient for reading and writing. At the same time it is compatible with
+JSON language and therefore can be used as a simple JSON parser. Macro logic provides an ability to extend configuration
+language (for example by including some lua code) and comments allow to disable or enable the parts of a configuration
+quickly.

Copied: vendor/libucl/20160812/configure.ac (from r298162, vendor/libucl/dist/configure.ac)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20160812/configure.ac	Sat Oct  1 00:12:03 2016	(r306543, copy of r298162, vendor/libucl/dist/configure.ac)
@@ -0,0 +1,187 @@
+m4_define([maj_ver], [0])
+m4_define([med_ver], [8])
+m4_define([min_ver], [0])
+m4_define([so_version], [6:0:0])
+m4_define([ucl_version], [maj_ver.med_ver.min_ver])
+
+AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl])
+AC_CONFIG_SRCDIR([configure.ac])

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610010012.u910C3dm008432>