svn commit: r290071 - in head: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/examples contrib/libucl/include contrib/libucl/klib contrib/libucl/lua contrib/libucl/m4 contrib...

Baptiste Daroussin bapt at FreeBSD.org
Tue Oct 27 21:24:12 UTC 2015


Author: bapt
Date: Tue Oct 27 21:24:09 2015
New Revision: 290071
URL: https://svnweb.freebsd.org/changeset/base/290071

Log:
  Update libucl to latest git snapshot (20151027)

Added:
  head/contrib/libucl/CMakeLists.txt
     - copied unchanged from r290069, vendor/libucl/dist/CMakeLists.txt
  head/contrib/libucl/examples/
     - copied from r290069, vendor/libucl/dist/examples/
  head/contrib/libucl/include/ucl++.h
     - copied unchanged from r290069, vendor/libucl/dist/include/ucl++.h
  head/contrib/libucl/m4/
     - copied from r290069, vendor/libucl/dist/m4/
  head/contrib/libucl/python/
     - copied from r290069, vendor/libucl/dist/python/
  head/contrib/libucl/src/ucl_msgpack.c
     - copied unchanged from r290069, vendor/libucl/dist/src/ucl_msgpack.c
  head/contrib/libucl/src/ucl_sexp.c
     - copied unchanged from r290069, vendor/libucl/dist/src/ucl_sexp.c
  head/contrib/libucl/tests/basic/15.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.in
  head/contrib/libucl/tests/basic/15.inc
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.inc
  head/contrib/libucl/tests/basic/15.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.res
  head/contrib/libucl/tests/basic/16.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.in
  head/contrib/libucl/tests/basic/16.inc
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.inc
  head/contrib/libucl/tests/basic/16.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.res
  head/contrib/libucl/tests/basic/17.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/17.in
  head/contrib/libucl/tests/basic/17.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/17.res
  head/contrib/libucl/tests/basic/18.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/18.in
  head/contrib/libucl/tests/basic/18.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/18.res
  head/contrib/libucl/tests/basic/19-append.inc
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-append.inc
  head/contrib/libucl/tests/basic/19-merge.inc
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-merge.inc
  head/contrib/libucl/tests/basic/19-rewrite.inc
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-rewrite.inc
  head/contrib/libucl/tests/basic/19.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19.in
  head/contrib/libucl/tests/basic/19.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19.res
  head/contrib/libucl/tests/basic/20.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/20.in
  head/contrib/libucl/tests/basic/20.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/20.res
  head/contrib/libucl/tests/basic/21.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/21.in
  head/contrib/libucl/tests/basic/21.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/21.res
  head/contrib/libucl/tests/basic/22.in
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/22.in
  head/contrib/libucl/tests/basic/22.res
     - copied unchanged from r290069, vendor/libucl/dist/tests/basic/22.res
  head/contrib/libucl/tests/msgpack.test
     - copied unchanged from r290069, vendor/libucl/dist/tests/msgpack.test
  head/contrib/libucl/tests/test_msgpack.c
     - copied unchanged from r290069, vendor/libucl/dist/tests/test_msgpack.c
  head/contrib/libucl/utils/ucl-tool.c
     - copied unchanged from r290069, vendor/libucl/dist/utils/ucl-tool.c
Deleted:
  head/contrib/libucl/cmake/
Modified:
  head/contrib/libucl/ChangeLog.md
  head/contrib/libucl/README.md
  head/contrib/libucl/configure.ac
  head/contrib/libucl/doc/Makefile.am
  head/contrib/libucl/doc/lua_api.md
  head/contrib/libucl/include/ucl.h
  head/contrib/libucl/klib/kvec.h
  head/contrib/libucl/lua/lua_ucl.c
  head/contrib/libucl/src/Makefile.am
  head/contrib/libucl/src/tree.h
  head/contrib/libucl/src/ucl_chartable.h
  head/contrib/libucl/src/ucl_emitter.c
  head/contrib/libucl/src/ucl_emitter_utils.c
  head/contrib/libucl/src/ucl_hash.c
  head/contrib/libucl/src/ucl_internal.h
  head/contrib/libucl/src/ucl_parser.c
  head/contrib/libucl/src/ucl_util.c
  head/contrib/libucl/src/xxhash.c
  head/contrib/libucl/src/xxhash.h
  head/contrib/libucl/tests/Makefile.am
  head/contrib/libucl/tests/basic/13.in
  head/contrib/libucl/tests/test_basic.c
  head/contrib/libucl/tests/test_schema.c
  head/contrib/libucl/utils/Makefile.am
  head/contrib/libucl/utils/chargen.c
  head/contrib/libucl/utils/objdump.c
  head/lib/libucl/Makefile
Directory Properties:
  head/contrib/libucl/   (props changed)

Copied: head/contrib/libucl/CMakeLists.txt (from r290069, vendor/libucl/dist/CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libucl/CMakeLists.txt	Tue Oct 27 21:24:09 2015	(r290071, copy of r290069, vendor/libucl/dist/CMakeLists.txt)
@@ -0,0 +1,260 @@
+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
+		src/xxhash.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")

Modified: head/contrib/libucl/ChangeLog.md
==============================================================================
--- head/contrib/libucl/ChangeLog.md	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/ChangeLog.md	Tue Oct 27 21:24:09 2015	(r290071)
@@ -32,3 +32,8 @@
 ### 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)

Modified: head/contrib/libucl/README.md
==============================================================================
--- head/contrib/libucl/README.md	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/README.md	Tue Oct 27 21:24:09 2015	(r290071)
@@ -21,7 +21,7 @@
 - [Performance](#performance)
 - [Conclusion](#conclusion)
 
-## Introduction
+## Introduction 
 
 This document describes the main features and principles of the configuration
 language called `UCL` - universal configuration language.
@@ -262,7 +262,20 @@ parser is created but before any configu
 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 patch, 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 (regardeless 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:

Modified: head/contrib/libucl/configure.ac
==============================================================================
--- head/contrib/libucl/configure.ac	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/configure.ac	Tue Oct 27 21:24:09 2015	(r290071)
@@ -1,7 +1,7 @@
 m4_define([maj_ver], [0])
 m4_define([med_ver], [7])
-m4_define([min_ver], [2])
-m4_define([so_version], [5:0:1])
+m4_define([min_ver], [3])
+m4_define([so_version], [5:0:2])
 m4_define([ucl_version], [maj_ver.med_ver.min_ver])
 
 AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl])
@@ -47,6 +47,7 @@ AC_CHECK_HEADERS_ONCE([libgen.h])
 AC_CHECK_HEADERS_ONCE([stdio.h])
 AC_CHECK_HEADERS_ONCE([float.h])
 AC_CHECK_HEADERS_ONCE([math.h])
+AC_CHECK_HEADERS_ONCE([endian.h sys/endian.h machine/endian.h])
 
 dnl Example of default-disabled feature
 AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], 

Modified: head/contrib/libucl/doc/Makefile.am
==============================================================================
--- head/contrib/libucl/doc/Makefile.am	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/doc/Makefile.am	Tue Oct 27 21:24:09 2015	(r290071)
@@ -4,6 +4,6 @@ dist_man_MANS = libucl.3
 
 gen-man: @PANDOC@
 	tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \
-	cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ 
+	cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \
 	-e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \
-	@PANDOC@ -s -f markdown -t man -o libucl.3 
+	@PANDOC@ -s -f markdown -t man -o libucl.3

Modified: head/contrib/libucl/doc/lua_api.md
==============================================================================
--- head/contrib/libucl/doc/lua_api.md	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/doc/lua_api.md	Tue Oct 27 21:24:09 2015	(r290071)
@@ -16,7 +16,7 @@ if not res then
 else
 	local obj = parser:get_object()
 	local got = ucl.to_format(obj, 'json')
-endif
+end
 
 local table = {
   str = 'value',
@@ -25,6 +25,7 @@ local table = {
   func = function ()
     return 'huh'
   end
+}
 
 
 print(ucl.to_format(table, 'ucl'))
@@ -115,6 +116,7 @@ local table = {
   func = function ()
     return 'huh'
   end
+}
 
 
 print(ucl.to_format(table, 'ucl'))

Copied: head/contrib/libucl/include/ucl++.h (from r290069, vendor/libucl/dist/include/ucl++.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libucl/include/ucl++.h	Tue Oct 27 21:24:09 2015	(r290071, copy of r290069, vendor/libucl/dist/include/ucl++.h)
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 2015, Vsevolod Stakhov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *	 * Redistributions of source code must retain the above copyright
+ *	   notice, this list of conditions and the following disclaimer.
+ *	 * Redistributions in binary form must reproduce the above copyright
+ *	   notice, this list of conditions and the following disclaimer in the
+ *	   documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR ''AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+#include <string>
+#include <memory>
+#include <iostream>
+#include <strstream>
+
+#include "ucl.h"
+
+// C++11 API inspired by json11: https://github.com/dropbox/json11/
+
+namespace ucl {
+
+struct ucl_map_construct_t { };
+constexpr ucl_map_construct_t ucl_map_construct = ucl_map_construct_t();
+struct ucl_array_construct_t { };
+constexpr ucl_array_construct_t ucl_array_construct = ucl_array_construct_t();
+
+class Ucl final {
+private:
+
+	struct ucl_deleter {
+		void operator() (ucl_object_t *obj) {
+			ucl_object_unref (obj);
+		}
+	};
+
+	static int
+	append_char (unsigned char c, size_t nchars, void *ud)
+	{
+		std::string *out = reinterpret_cast<std::string *>(ud);
+
+		out->append (nchars, (char)c);
+
+		return nchars;
+	}
+	static int
+	append_len (unsigned const char *str, size_t len, void *ud)
+	{
+		std::string *out = reinterpret_cast<std::string *>(ud);
+
+		out->append ((const char *)str, len);
+
+		return len;
+	}
+	static int
+	append_int (int64_t elt, void *ud)
+	{
+		std::string *out = reinterpret_cast<std::string *>(ud);
+		auto nstr = std::to_string (elt);
+
+		out->append (nstr);
+
+		return nstr.size ();
+	}
+	static int
+	append_double (double elt, void *ud)
+	{
+		std::string *out = reinterpret_cast<std::string *>(ud);
+		auto nstr = std::to_string (elt);
+
+		out->append (nstr);
+
+		return nstr.size ();
+	}
+
+	static struct ucl_emitter_functions default_emit_funcs()
+	{
+		struct ucl_emitter_functions func = {
+			Ucl::append_char,
+			Ucl::append_len,
+			Ucl::append_int,
+			Ucl::append_double,
+			nullptr,
+			nullptr
+		};
+
+		return func;
+	};
+
+	std::unique_ptr<ucl_object_t, ucl_deleter> obj;
+
+public:
+	class const_iterator {
+	private:
+		struct ucl_iter_deleter {
+			void operator() (ucl_object_iter_t it) {
+				ucl_object_iterate_free (it);
+			}
+		};
+		std::shared_ptr<void> it;
+		std::unique_ptr<Ucl> cur;
+	public:
+		typedef std::forward_iterator_tag iterator_category;
+
+		const_iterator(const Ucl &obj) {
+			it = std::shared_ptr<void>(ucl_object_iterate_new (obj.obj.get()),
+					ucl_iter_deleter());
+			cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true)));
+		}
+
+		const_iterator() {}
+		const_iterator(const const_iterator &other) {
+			it = other.it;
+		}
+		~const_iterator() {}
+
+		const_iterator& operator=(const const_iterator &other) {
+			it = other.it;
+			return *this;
+		}
+
+		bool operator==(const const_iterator &other) const
+		{
+			if (cur && other.cur) {
+				return cur->obj.get() == other.cur->obj.get();
+			}
+
+			return !cur && !other.cur;
+		}
+
+		bool operator!=(const const_iterator &other) const
+		{
+			return !(*this == other);
+		}
+
+		const_iterator& operator++()
+		{
+			if (it) {
+				cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true)));
+			}
+
+			if (!*cur) {
+				it.reset ();
+				cur.reset ();
+			}
+
+			return *this;
+		}
+
+		const Ucl& operator*() const
+		{
+			return *cur;
+		}
+		const Ucl* operator->() const
+		{
+			return cur.get();
+		}
+	};
+
+	// We grab ownership if get non-const ucl_object_t
+	Ucl(ucl_object_t *other) {
+		obj.reset (other);
+	}
+
+	// Shared ownership
+	Ucl(const ucl_object_t *other) {
+		obj.reset (ucl_object_ref (other));
+	}
+
+	Ucl(const Ucl &other) {
+		obj.reset (ucl_object_ref (other.obj.get()));
+	}
+
+	Ucl(Ucl &&other) {
+		obj.swap (other.obj);
+	}
+
+	Ucl() noexcept {
+		obj.reset (ucl_object_typed_new (UCL_NULL));
+	}
+	Ucl(std::nullptr_t) noexcept {
+		obj.reset (ucl_object_typed_new (UCL_NULL));
+	}
+	Ucl(double value) {
+		obj.reset (ucl_object_typed_new (UCL_FLOAT));
+		obj->value.dv = value;
+	}
+	Ucl(int64_t value) {
+		obj.reset (ucl_object_typed_new (UCL_INT));
+		obj->value.iv = value;
+	}
+	Ucl(bool value) {
+		obj.reset (ucl_object_typed_new (UCL_BOOLEAN));
+		obj->value.iv = static_cast<int64_t>(value);
+	}
+	Ucl(const std::string &value) {
+		obj.reset (ucl_object_fromstring_common (value.data (), value.size (),
+				UCL_STRING_RAW));
+	}
+	Ucl(const char * value) {
+		obj.reset (ucl_object_fromstring_common (value, 0, UCL_STRING_RAW));
+	}
+
+	// Implicit constructor: anything with a to_json() function.
+	template <class T, class = decltype(&T::to_ucl)>
+	Ucl(const T & t) : Ucl(t.to_ucl()) {}
+
+	// Implicit constructor: map-like objects (std::map, std::unordered_map, etc)
+	template <class M, typename std::enable_if<
+		std::is_constructible<std::string, typename M::key_type>::value
+		&& std::is_constructible<Ucl, typename M::mapped_type>::value,
+		int>::type = 0>
+	Ucl(const M & m) {
+		obj.reset (ucl_object_typed_new (UCL_OBJECT));
+		auto cobj = obj.get ();
+
+		for (const auto &e : m) {
+			ucl_object_insert_key (cobj, ucl_object_ref (e.second.obj.get()),
+					e.first.data (), e.first.size (), true);
+		}
+	}
+
+	// Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc)
+	template <class V, typename std::enable_if<
+		std::is_constructible<Ucl, typename V::value_type>::value,
+		int>::type = 0>
+	Ucl(const V & v) {
+		obj.reset (ucl_object_typed_new (UCL_ARRAY));
+		auto cobj = obj.get ();
+
+		for (const auto &e : v) {
+			ucl_array_append (cobj, ucl_object_ref (e.obj.get()));
+		}
+	}
+
+	ucl_type_t type () const {
+		if (obj) {
+			return ucl_object_type (obj.get ());
+		}
+		return UCL_NULL;
+	}
+
+	const std::string key () const {
+		std::string res;
+
+		if (obj->key) {
+			res.assign (obj->key, obj->keylen);
+		}
+
+		return res;
+	}
+
+	double number_value () const
+	{
+		if (obj) {
+			return ucl_object_todouble (obj.get());
+		}
+
+		return 0.0;
+	}
+
+	int64_t int_value () const
+	{
+		if (obj) {
+			return ucl_object_toint (obj.get());
+		}
+
+		return 0;
+	}
+
+	bool bool_value () const
+	{
+		if (obj) {
+			return ucl_object_toboolean (obj.get());
+		}
+
+		return false;
+	}
+
+	const std::string string_value () const
+	{
+		std::string res;
+
+		if (obj) {
+			res.assign (ucl_object_tostring (obj.get()));
+		}
+
+		return res;
+	}
+
+	const Ucl operator[] (size_t i) const
+	{
+		if (type () == UCL_ARRAY) {
+			return Ucl (ucl_array_find_index (obj.get(), i));
+		}
+
+		return Ucl (nullptr);
+	}
+
+	const Ucl operator[](const std::string &key) const
+	{
+		if (type () == UCL_OBJECT) {
+			return Ucl (ucl_object_find_keyl (obj.get(),
+					key.data (), key.size ()));
+		}
+
+		return Ucl (nullptr);
+	}
+	// Serialize.
+	void dump (std::string &out, ucl_emitter_t type = UCL_EMIT_JSON) const
+	{
+		struct ucl_emitter_functions cbdata;
+
+		cbdata = Ucl::default_emit_funcs();
+		cbdata.ud = reinterpret_cast<void *>(&out);
+
+		ucl_object_emit_full (obj.get(), type, &cbdata);
+	}
+
+	std::string dump (ucl_emitter_t type = UCL_EMIT_JSON) const
+	{
+		std::string out;
+
+		dump (out, type);
+
+		return out;
+	}
+
+	static Ucl parse (const std::string & in, std::string & err)
+	{
+		auto parser = ucl_parser_new (UCL_PARSER_DEFAULT);
+
+		if (!ucl_parser_add_chunk (parser, (const unsigned char *)in.data (),
+				in.size ())) {
+			err.assign (ucl_parser_get_error (parser));
+			ucl_parser_free (parser);
+
+			return nullptr;
+		}
+
+		auto obj = ucl_parser_get_object (parser);
+		ucl_parser_free (parser);
+
+		// Obj will handle ownership
+		return Ucl (obj);
+	}
+
+	static Ucl parse (const char * in, std::string & err)
+	{
+		if (in) {
+			return parse (std::string(in), err);
+		} else {
+			err = "null input";
+			return nullptr;
+		}
+	}
+
+	static Ucl parse (std::istream &ifs, std::string &err)
+	{
+		return Ucl::parse (std::string(std::istreambuf_iterator<char>(ifs),
+				std::istreambuf_iterator<char>()), err);
+	}
+
+	bool operator== (const Ucl &rhs) const
+	{
+		return ucl_object_compare (obj.get(), rhs.obj.get ()) == 0;
+	}
+	bool operator< (const Ucl &rhs) const
+	{
+		return ucl_object_compare (obj.get(), rhs.obj.get ()) < 0;
+	}
+	bool operator!= (const Ucl &rhs) const { return !(*this == rhs); }
+	bool operator<= (const Ucl &rhs) const { return !(rhs < *this); }
+	bool operator> (const Ucl &rhs) const { return (rhs < *this); }
+	bool operator>= (const Ucl &rhs) const { return !(*this < rhs); }
+
+	operator bool () const
+	{
+		if (!obj || type() == UCL_NULL) {
+			return false;
+		}
+
+		if (type () == UCL_BOOLEAN) {
+			return bool_value ();
+		}
+
+		return true;
+	}
+
+	const_iterator begin() const
+	{
+		return const_iterator(*this);
+	}
+	const_iterator cbegin() const
+	{
+		return const_iterator(*this);
+	}
+	const_iterator end() const
+	{
+		return const_iterator();
+	}
+	const_iterator cend() const
+	{
+		return const_iterator();
+	}
+};
+
+};

Modified: head/contrib/libucl/include/ucl.h
==============================================================================
--- head/contrib/libucl/include/ucl.h	Tue Oct 27 21:23:19 2015	(r290070)
+++ head/contrib/libucl/include/ucl.h	Tue Oct 27 21:24:09 2015	(r290071)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Vsevolod Stakhov
+/* Copyright (c) 2013-2015, Vsevolod Stakhov
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -135,7 +135,9 @@ typedef enum ucl_emitter {
 	UCL_EMIT_JSON = 0, /**< Emit fine formatted JSON */
 	UCL_EMIT_JSON_COMPACT, /**< Emit compacted JSON */
 	UCL_EMIT_CONFIG, /**< Emit human readable config format */
-	UCL_EMIT_YAML /**< Emit embedded YAML format */
+	UCL_EMIT_YAML, /**< Emit embedded YAML format */
+	UCL_EMIT_MSGPACK, /**< Emit msgpack output */
+	UCL_EMIT_MAX /**< Unsupported emitter type */
 } ucl_emitter_t;
 
 /**
@@ -145,6 +147,7 @@ typedef enum ucl_emitter {
  * UCL still has to perform copying implicitly.
  */
 typedef enum ucl_parser_flags {
+	UCL_PARSER_DEFAULT = 0x0,       /**< No special flags */
 	UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */
 	UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */
 	UCL_PARSER_NO_TIME = 0x4, /**< Do not parse time and treat time values as strings */
@@ -155,6 +158,7 @@ typedef enum ucl_parser_flags {
  * String conversion flags, that are used in #ucl_object_fromstring_common function.
  */
 typedef enum ucl_string_flags {
+	UCL_STRING_RAW = 0x0,     /**< Treat string as is */
 	UCL_STRING_ESCAPE = 0x1,  /**< Perform JSON escape */
 	UCL_STRING_TRIM = 0x2,    /**< Trim leading and trailing whitespaces */
 	UCL_STRING_PARSE_BOOLEAN = 0x4,    /**< Parse passed string and detect boolean */
@@ -172,15 +176,36 @@ typedef enum ucl_string_flags {
  * Basic flags for an object
  */
 typedef enum ucl_object_flags {
-	UCL_OBJECT_ALLOCATED_KEY = 0x1, /**< An object has key allocated internally */
-	UCL_OBJECT_ALLOCATED_VALUE = 0x2, /**< An object has a string value allocated internally */
-	UCL_OBJECT_NEED_KEY_ESCAPE = 0x4, /**< The key of an object need to be escaped on output */
-	UCL_OBJECT_EPHEMERAL = 0x8, /**< Temporary object that does not need to be freed really */
-	UCL_OBJECT_MULTILINE = 0x10, /**< String should be displayed as multiline string */
-	UCL_OBJECT_MULTIVALUE = 0x20 /**< Object is a key with multiple values */
+	UCL_OBJECT_ALLOCATED_KEY = (1 << 0), /**< An object has key allocated internally */
+	UCL_OBJECT_ALLOCATED_VALUE = (1 << 1), /**< An object has a string value allocated internally */
+	UCL_OBJECT_NEED_KEY_ESCAPE = (1 << 2), /**< The key of an object need to be escaped on output */
+	UCL_OBJECT_EPHEMERAL = (1 << 3), /**< Temporary object that does not need to be freed really */
+	UCL_OBJECT_MULTILINE = (1 << 4), /**< String should be displayed as multiline string */
+	UCL_OBJECT_MULTIVALUE = (1 << 5), /**< Object is a key with multiple values */
+	UCL_OBJECT_INHERITED = (1 << 6), /**< Object has been inherited from another */
+	UCL_OBJECT_BINARY = (1 << 7) /**< Object contains raw binary data */
 } ucl_object_flags_t;
 
 /**
+ * Duplicate policy types
+ */
+enum ucl_duplicate_strategy {
+	UCL_DUPLICATE_APPEND = 0, /**< Default policy to merge based on priorities */
+	UCL_DUPLICATE_MERGE,     /**< Merge new object with old one */
+	UCL_DUPLICATE_REWRITE,   /**< Rewrite old keys */
+	UCL_DUPLICATE_ERROR      /**< Stop parsing on duplicate found */
+};
+
+/**
+ * Input format type
+ */
+enum ucl_parse_type {
+	UCL_PARSE_UCL = 0, /**< Default ucl format */
+	UCL_PARSE_MSGPACK, /**< Message pack input format */
+	UCL_PARSE_CSEXP /**< Canonical S-expressions */
+};
+
+/**
  * UCL object structure. Please mention that the most of fields should not be touched by
  * UCL users. In future, this structure may be converted to private one.
  */
@@ -190,7 +215,7 @@ typedef struct ucl_object_s {
 	 */
 	union {
 		int64_t iv;							/**< Int value of an object */
-		const char *sv;					/**< String value of an object */
+		const char *sv;						/**< String value of an object */
 		double dv;							/**< Double value of an object */
 		void *av;							/**< Array					*/
 		void *ov;							/**< Object					*/
@@ -496,6 +521,15 @@ UCL_EXTERN const ucl_object_t* ucl_array
 		unsigned int index);
 
 /**
+ * Return the index of `elt` in the array `top`
+ * @param top object to get a key from (must be of type UCL_ARRAY)
+ * @param elt element to find index of (must NOT be NULL)
+ * @return index of `elt` in the array `top or (unsigned int)-1 if `elt` is not found
+ */
+UCL_EXTERN unsigned int ucl_array_index_of (ucl_object_t *top,
+		ucl_object_t *elt);
+
+/**
  * Replace an element in an array with a different element, returning the object
  * that was replaced. This object is not released, caller must unref the
  * returned object when it is no longer needed.
@@ -612,6 +646,19 @@ UCL_EXTERN const ucl_object_t* ucl_objec
 		const char *key);
 
 /**
+ * Return object identified by a key in the specified object, if the first key is
+ * not found then look for the next one. This process is repeated unless
+ * the next argument in the list is not NULL. So, `ucl_object_find_any_key(obj, key, NULL)`
+ * is equal to `ucl_object_find_key(obj, key)`
+ * @param obj object to get a key from (must be of type UCL_OBJECT)
+ * @param key key to search
+ * @param ... list of alternative keys to search (NULL terminated)
+ * @return object matching the specified key or NULL if key was not found
+ */
+UCL_EXTERN const ucl_object_t* ucl_object_find_any_key (const ucl_object_t *obj,
+		const char *key, ...);
+
+/**
  * Return object identified by a fixed size key in the specified object
  * @param obj object to get a key from (must be of type UCL_OBJECT)
  * @param key key to search
@@ -631,6 +678,16 @@ UCL_EXTERN const ucl_object_t *ucl_looku
 		const char *path);
 
 /**
+ * Return object identified by object notation string using arbitrary delimiter
+ * @param obj object to search in
+ * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays
+ * @param sep the sepatorator to use in place of . (incase keys have . in them)
+ * @return object matched the specified path or NULL if path is not found
+ */
+UCL_EXTERN const ucl_object_t *ucl_lookup_path_char (const ucl_object_t *obj,
+		const char *path, char sep);
+
+/**
  * Returns a key of an object as a NULL terminated string
  * @param obj CL object
  * @return key or NULL if there is no key
@@ -683,7 +740,7 @@ UCL_EXTERN int ucl_object_compare (const
  * @param cmp
  */
 UCL_EXTERN void ucl_object_array_sort (ucl_object_t *ar,
-		int (*cmp)(const ucl_object_t *o1, const ucl_object_t *o2));
+		int (*cmp)(const ucl_object_t **o1, const ucl_object_t **o2));
 
 /**
  * Get the priority for specific UCL object
@@ -769,6 +826,21 @@ typedef bool (*ucl_macro_handler) (const
 		const ucl_object_t *arguments,
 		void* ud);
 
+/**
+ * Context dependent macro handler for a parser
+ * @param data the content of macro
+ * @param len the length of content
+ * @param arguments arguments object
+ * @param context previously parsed context
+ * @param ud opaque user data
+ * @param err error pointer
+ * @return true if macro has been parsed
+ */
+typedef bool (*ucl_context_macro_handler) (const unsigned char *data, size_t len,
+		const ucl_object_t *arguments,
+		const ucl_object_t *context,
+		void* ud);
+
 /* Opaque parser */
 struct ucl_parser;
 
@@ -780,16 +852,38 @@ struct ucl_parser;
 UCL_EXTERN struct ucl_parser* ucl_parser_new (int flags);
 
 /**
+ * Sets the default priority for the parser applied to chunks that does not
+ * specify priority explicitly
+ * @param parser parser object
+ * @param prio default priority (0 .. 16)
+ * @return true if parser's default priority was set
+ */
+UCL_EXTERN bool ucl_parser_set_default_priority (struct ucl_parser *parser,
+		unsigned prio);
+/**
  * Register new handler for a macro
  * @param parser parser object
  * @param macro macro name (without leading dot)
  * @param handler handler (it is called immediately after macro is parsed)
  * @param ud opaque user data for a handler
  */
-UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro,
+UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser,
+		const char *macro,
 		ucl_macro_handler handler, void* ud);
 
 /**
+ * Register new context dependent handler for a macro
+ * @param parser parser object
+ * @param macro macro name (without leading dot)
+ * @param handler handler (it is called immediately after macro is parsed)
+ * @param ud opaque user data for a handler
+ */
+UCL_EXTERN void ucl_parser_register_context_macro (struct ucl_parser *parser,
+		const char *macro,
+		ucl_context_macro_handler handler,
+		void* ud);
+
+/**
  * Handler to detect unregistered variables
  * @param data variable data
  * @param len length of variable

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


More information about the svn-src-head mailing list