Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Oct 2015 21:20:00 +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: r290069 - in vendor/libucl/20151027: . cmake doc examples include klib lua m4 python src tests tests/basic utils
Message-ID:  <201510272120.t9RLK0bJ067454@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue Oct 27 21:20:00 2015
New Revision: 290069
URL: https://svnweb.freebsd.org/changeset/base/290069

Log:
  Tag import of libucl 20151027

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

Copied: vendor/libucl/20151027/CMakeLists.txt (from r290067, vendor/libucl/dist/CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/CMakeLists.txt	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, 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")

Copied: vendor/libucl/20151027/ChangeLog.md (from r290067, vendor/libucl/dist/ChangeLog.md)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/ChangeLog.md	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, vendor/libucl/dist/ChangeLog.md)
@@ -0,0 +1,39 @@
+# 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)

Copied: vendor/libucl/20151027/README.md (from r290067, vendor/libucl/dist/README.md)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/README.md	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, 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)
+
+**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)
+	- [Commments](#commments)
+	- [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
+
+### Commments
+
+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 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:
+
+* 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 begin 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 thousands 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. Macroes logic provides an ability to extend configuration
+language (for example by including some lua code) and comments allows to disable or enable the parts of a configuration
+quickly.

Copied: vendor/libucl/20151027/configure.ac (from r290067, vendor/libucl/dist/configure.ac)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/configure.ac	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, vendor/libucl/dist/configure.ac)
@@ -0,0 +1,185 @@
+m4_define([maj_ver], [0])
+m4_define([med_ver], [7])
+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])
+AC_CONFIG_SRCDIR([configure.ac])
+AM_INIT_AUTOMAKE([1.11 foreign -Wall -Wportability no-dist-gzip dist-xz])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+UCL_VERSION=ucl_version
+SO_VERSION=so_version
+
+AC_SUBST(UCL_VERSION)
+AC_SUBST(SO_VERSION)
+
+AC_PROG_CC_C99
+AM_PROG_CC_C_O
+AM_PROG_AR
+LT_INIT
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADERS([config.h])
+
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+AC_CHECK_HEADERS_ONCE([fcntl.h unistd.h])
+AC_TYPE_OFF_T
+AC_FUNC_MMAP
+AC_CHECK_HEADERS_ONCE([fcntl.h])
+AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADERS_ONCE([sys/stat.h])
+AC_CHECK_HEADERS_ONCE([sys/param.h])
+AC_CHECK_HEADERS_ONCE([sys/mman.h])
+AC_CHECK_HEADERS_ONCE([stdlib.h])
+AC_CHECK_HEADERS_ONCE([stddef.h])
+AC_CHECK_HEADERS_ONCE([stdarg.h])
+AC_CHECK_HEADERS_ONCE([stdbool.h])
+AC_CHECK_HEADERS_ONCE([stdint.h])
+AC_CHECK_HEADERS_ONCE([string.h])
+AC_CHECK_HEADERS_ONCE([unistd.h])
+AC_CHECK_HEADERS_ONCE([ctype.h])
+AC_CHECK_HEADERS_ONCE([errno.h])
+AC_CHECK_HEADERS_ONCE([limits.h])
+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], 
+	[Enable URLs fetch (requires libfetch or libcurl) @<:@default=no@:>@]), [],
+	[enable_urls=no])
+AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], 
+	[Enable regex checking for schema @<:@default=yes@:>@]), [],
+	[enable_regex=yes])
+AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures],
+	[Enable signatures check (requires openssl) @<:@default=no@:>@]), [],
+	[enable_signatures=no])
+AC_ARG_ENABLE([lua], AS_HELP_STRING([--enable-lua],
+	[Enable lua API build (requires lua libraries and headers) @<:@default=no@:>@]), [],
+	[enable_lua=no])
+AC_ARG_ENABLE([utils],
+	AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]),
+	[case "${enableval}" in
+  		yes) utils=true ;;
+  		no)  utils=false ;;
+  		*) AC_MSG_ERROR([bad value ${enableval} for --enable-utils]) ;;
+	esac],[utils=false])
+AM_CONDITIONAL([UTILS], [test x$utils = xtrue])
+
+AS_IF([test "x$enable_signatures" = "xyes"], [
+	AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [
+		AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).])
+		LIBCRYPTO_LIB="-lcrypto"
+		LIBS_EXTRA="${LIBS_EXTRA} -lcrypto"
+		], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])])
+])
+AC_SUBST(LIBCRYPTO_LIB)
+AC_PATH_PROG(PANDOC, pandoc, [/non/existent])
+
+AC_SEARCH_LIBS([clock_gettime], [rt], [], [
+	AC_CHECK_HEADER([mach/mach_time.h], [
+		AC_DEFINE(HAVE_MACH_MACH_TIME_H, 1, [Define to 1 on Darwin])
+	], [AC_MSG_ERROR([unable to find clock_gettime or mach_absolute_time])])
+])
+AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])])
+
+AS_IF([test "x$enable_regex" = "xyes"], [
+	AC_CHECK_HEADER([regex.h], [
+		AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the <regex.h> header file.])
+		AC_SEARCH_LIBS([regexec], [regex], [
+			AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [
+				LIBREGEX_LIB="-lregex"
+				LIBS_EXTRA="${LIBS_EXTRA} -lregex"
+				]
+			)], 
+			[AC_MSG_ERROR([unable to find the regexec() function])])],
+			[AC_MSG_ERROR([unable to find the regex.h header])
+		],
+		[#include <sys/types.h>])
+])
+AC_SUBST(LIBREGEX_LIB)
+
+AS_IF([test "x$enable_lua" = "xyes"], [
+	AX_PROG_LUA([5.1], [], [
+		AX_LUA_HEADERS([
+			AX_LUA_LIBS([
+				AC_DEFINE(HAVE_LUA, 1, [Define to 1 for lua support.])
+				with_lua="yes"
+			], [AC_MSG_ERROR([unable to find the lua libraries])
+			])
+		], [AC_MSG_ERROR([unable to find the lua header files])
+		])
+	], [AC_MSG_ERROR([unable to find the lua interpreter])])
+], [with_lua="no"])
+
+AM_CONDITIONAL([LUA_SUB], [test "$with_lua" = "yes"])
+
+AS_IF([test "x$enable_urls" = "xyes"], [
+	AC_CHECK_HEADER([fetch.h], [
+		AC_DEFINE(HAVE_FETCH_H, 1, [Define to 1 if you have the <fetch.h> header file.])
+		AC_CHECK_LIB(fetch, fetchXGet, [
+			AC_DEFINE(HAVE_LIBFETCH, 1, [Define to 1 if you have the 'fetch' library (-lfetch).])
+			LIBFETCH_LIBS="-lfetch"
+			have_libfetch="yes"
+			LIBS_EXTRA="${LIBS_EXTRA} -lfetch"
+		])
+	], [],[
+	#include <stdio.h>
+	#ifdef HAVE_SYS_PARAM_H
+	#include <sys/param.h>
+	#endif
+	])
+	AC_SUBST(LIBFETCH_LIBS)
+
+	AS_IF([ test "x$have_libfetch" != "xyes"], [
+		dnl Fallback to libcurl
+		PKG_CHECK_MODULES([CURL], [libcurl], [
+			AC_DEFINE(CURL_FOUND, 1, [Use libcurl])
+			LIBS_EXTRA="${LIBS_EXTRA} -lcurl"],
+		[AC_MSG_ERROR([unable to find neither libfetch nor libcurl])])
+	])
+	AC_SUBST(CURL_FOUND)
+	AC_SUBST(CURL_LIBS)
+	AC_SUBST(CURL_CFLAGS)
+])
+
+AC_SUBST(LIBS_EXTRA)
+
+AC_MSG_CHECKING(for GCC atomic builtins)
+AC_LINK_IFELSE([
+	AC_LANG_SOURCE([[
+		int main() {
+			volatile unsigned long val = 1;
+			__sync_synchronize();
+			__sync_val_compare_and_swap(&val, 1, 0);
+			__sync_add_and_fetch(&val, 1);
+			__sync_sub_and_fetch(&val, 1);
+			return 0;
+		}
+	]])
+],
+[
+	AC_MSG_RESULT([yes])
+	AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics])
+],
+[
+	AC_MSG_RESULT([no])
+	AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics])
+	AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing])
+])
+
+AC_CONFIG_FILES(Makefile \
+	src/Makefile \
+	lua/Makefile
+	tests/Makefile \
+	utils/Makefile \
+	doc/Makefile \
+	lua/libucl.rockspec \
+	libucl.pc)
+AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
+AC_OUTPUT

Copied: vendor/libucl/20151027/doc/Makefile.am (from r290067, vendor/libucl/dist/doc/Makefile.am)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/doc/Makefile.am	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, vendor/libucl/dist/doc/Makefile.am)
@@ -0,0 +1,9 @@
+EXTRA_DIST = api.md
+
+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/' \
+	-e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \
+	@PANDOC@ -s -f markdown -t man -o libucl.3

Copied: vendor/libucl/20151027/doc/lua_api.md (from r290067, vendor/libucl/dist/doc/lua_api.md)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libucl/20151027/doc/lua_api.md	Tue Oct 27 21:20:00 2015	(r290069, copy of r290067, vendor/libucl/dist/doc/lua_api.md)
@@ -0,0 +1,196 @@
+## Module `ucl`
+
+This lua module allows to parse objects from strings and to store data into
+ucl objects. It uses `libucl` C library to parse and manipulate with ucl objects.
+
+Example:
+
+~~~lua
+local ucl = require("ucl")
+
+local parser = ucl.parser()
+local res,err = parser:parse_string('{key=value}')
+
+if not res then
+	print('parser error: ' .. err)
+else
+	local obj = parser:get_object()
+	local got = ucl.to_format(obj, 'json')
+end
+
+local table = {
+  str = 'value',
+  num = 100500,
+  null = ucl.null,
+  func = function ()
+    return 'huh'
+  end
+}
+
+
+print(ucl.to_format(table, 'ucl'))
+-- Output:
+--[[
+num = 100500;
+str = "value";
+null = null;
+func = "huh";
+--]]
+~~~
+
+###Brief content:
+
+**Functions**:
+
+> [`ucl_object_push_lua(L, obj, allow_array)`](#function-ucl_object_push_lual-obj-allow_array)
+
+> [`ucl.to_format(var, format)`](#function-uclto_formatvar-format)
+
+
+
+**Methods**:
+
+> [`parser:parse_file(name)`](#method-parserparse_filename)
+
+> [`parser:parse_string(input)`](#method-parserparse_stringinput)
+
+> [`parser:get_object()`](#method-parserget_object)
+
+
+## Functions
+
+The module `ucl` defines the following functions.
+
+### Function `ucl_object_push_lua(L, obj, allow_array)`
+
+This is a `C` function to push `UCL` object as lua variable. This function
+converts `obj` to lua representation using the following conversions:
+
+- *scalar* values are directly presented by lua objects
+- *userdata* values are converted to lua function objects using `LUA_REGISTRYINDEX`,
+this can be used to pass functions from lua to c and vice-versa
+- *arrays* are converted to lua tables with numeric indicies suitable for `ipairs` iterations
+- *objects* are converted to lua tables with string indicies
+
+**Parameters:**
+
+- `L {lua_State}`: lua state pointer
+- `obj {ucl_object_t}`: object to push
+- `allow_array {bool}`: expand implicit arrays (should be true for all but partial arrays)
+
+**Returns:**
+
+- `{int}`: `1` if an object is pushed to lua
+
+Back to [module description](#module-ucl).
+
+### Function `ucl.to_format(var, format)`
+
+Converts lua variable `var` to the specified `format`. Formats supported are:
+
+- `json` - fine printed json
+- `json-compact` - compacted json
+- `config` - fine printed configuration
+- `ucl` - same as `config`
+- `yaml` - embedded yaml
+
+If `var` contains function, they are called during output formatting and if
+they return string value, then this value is used for ouptut.
+
+**Parameters:**
+
+- `var {variant}`: any sort of lua variable (if userdata then metafield `__to_ucl` is searched for output)
+- `format {string}`: any available format
+
+**Returns:**
+
+- `{string}`: string representation of `var` in the specific `format`.

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



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