Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 2014 22:02:07 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r264789 - in head: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/utils usr.sbin/pkg
Message-ID:  <201404222202.s3MM27X4057404@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue Apr 22 22:02:06 2014
New Revision: 264789
URL: http://svnweb.freebsd.org/changeset/base/264789

Log:
  Import libucl 0.4.0
  Adapt pkg(7) to the new libucl API

Modified:
  head/contrib/libucl/README.md
  head/contrib/libucl/configure.ac
  head/contrib/libucl/doc/api.md
  head/contrib/libucl/doc/libucl.3
  head/contrib/libucl/include/ucl.h
  head/contrib/libucl/src/Makefile.am
  head/contrib/libucl/src/ucl_emitter.c
  head/contrib/libucl/src/ucl_hash.c
  head/contrib/libucl/src/ucl_hash.h
  head/contrib/libucl/src/ucl_internal.h
  head/contrib/libucl/src/ucl_parser.c
  head/contrib/libucl/src/ucl_schema.c
  head/contrib/libucl/src/ucl_util.c
  head/contrib/libucl/tests/test_basic.c
  head/contrib/libucl/tests/test_generate.c
  head/contrib/libucl/tests/test_schema.c
  head/contrib/libucl/utils/objdump.c
  head/usr.sbin/pkg/config.c
  head/usr.sbin/pkg/pkg.c
Directory Properties:
  head/contrib/libucl/   (props changed)

Modified: head/contrib/libucl/README.md
==============================================================================
--- head/contrib/libucl/README.md	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/README.md	Tue Apr 22 22:02:06 2014	(r264789)
@@ -287,7 +287,7 @@ Each UCL object can be serialized to one
 
 ## 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, schema definition can be in UCL format instead of JSON that sinplifies 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 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 input is validated properly.
+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
 

Modified: head/contrib/libucl/configure.ac
==============================================================================
--- head/contrib/libucl/configure.ac	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/configure.ac	Tue Apr 22 22:02:06 2014	(r264789)
@@ -1,5 +1,5 @@
 m4_define([maj_ver], [0])
-m4_define([med_ver], [3])
+m4_define([med_ver], [4])
 m4_define([min_ver], [0])
 m4_define([so_version], [maj_ver:med_ver])
 m4_define([ucl_version], [maj_ver.med_ver.min_ver])
@@ -48,11 +48,17 @@ AC_CHECK_HEADERS_ONCE([float.h])
 AC_CHECK_HEADERS_ONCE([math.h])
 
 dnl Example of default-disabled feature
-AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], [Enable URLs fetch (requires libfetch or libcurl)]))
+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)]))
+	[Enable signatures check (requires openssl) @<:@default=no@:>@]), [],
+	[enable_signatures=no])
 AC_ARG_ENABLE([utils],
-	[--enable-utils Build and install utils],
+	AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]),
 	[case "${enableval}" in
   		yes) utils=true ;;
   		no)  utils=false ;;
@@ -63,11 +69,11 @@ AM_CONDITIONAL([UTILS], [test x$utils = 
 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).])
-		LIBSSL_LIB="-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], [], [
@@ -77,11 +83,21 @@ AC_SEARCH_LIBS([clock_gettime], [rt], []
 ])
 AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])])
 
-AC_CHECK_HEADER([regex.h], [
-	AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the <regex.h> header file.])
-	],
-	[AC_MSG_ERROR([unable to find the regex.h header])],
-	[#include <sys/types.h>])
+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_urls" = "xyes"], [
 	AC_CHECK_HEADER([fetch.h], [
@@ -114,6 +130,29 @@ AS_IF([test "x$enable_urls" = "xyes"], [
 
 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 \
 	tests/Makefile \

Modified: head/contrib/libucl/doc/api.md
==============================================================================
--- head/contrib/libucl/doc/api.md	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/doc/api.md	Tue Apr 22 22:02:06 2014	(r264789)
@@ -282,7 +282,7 @@ Libucl provides the following functions 
 ### ucl_object_emit
 
 ~~~C
-unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type);
+unsigned char *ucl_object_emit (const ucl_object_t *obj, enum ucl_emitter emit_type);
 ~~~
 
 Allocate a string that is suitable to fit the underlying UCL object `obj` and fill it with the textual representation of the object `obj` according to style `emit_type`. The caller should free the returned string after using.
@@ -290,7 +290,7 @@ Allocate a string that is suitable to fi
 ### ucl_object_emit_full
 
 ~~~C
-bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type,
+bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type,
 		struct ucl_emitter_functions *emitter);
 ~~~
 
@@ -381,7 +381,7 @@ Iteration are used to iterate over UCL c
 
 ## ucl_iterate_object
 ~~~C
-ucl_object_t* ucl_iterate_object (ucl_object_t *obj, 
+const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, 
 	ucl_object_iter_t *iter, bool expand_values);
 ~~~
 
@@ -389,7 +389,7 @@ This function accept opaque iterator poi
 
 ~~~C
 ucl_object_iter_t it = NULL, it_obj = NULL;
-ucl_object_t *cur, *tmp;
+const ucl_object_t *cur, *tmp;
 
 /* Iterate over the object */
 while ((obj = ucl_iterate_object (top, &it, true))) {
@@ -408,8 +408,8 @@ Currently, there is only one validation 
 
 ## ucl_object_validate
 ~~~C
-bool ucl_object_validate (ucl_object_t *schema,
-	ucl_object_t *obj, struct ucl_schema_error *err);
+bool ucl_object_validate (const ucl_object_t *schema,
+	const ucl_object_t *obj, struct ucl_schema_error *err);
 ~~~
 
 This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following:

Modified: head/contrib/libucl/doc/libucl.3
==============================================================================
--- head/contrib/libucl/doc/libucl.3	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/doc/libucl.3	Tue Apr 22 22:02:06 2014	(r264789)
@@ -6,11 +6,11 @@
 \f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[],
 \f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[],
 \f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[],
-\f[B]ucl_parser_set_filevars\f[] - universal configuration library
+\f[B]ucl_parser_set_filevars\f[] \- universal configuration library
 parser and utility functions
 .SH LIBRARY
 .PP
-UCL library (libucl, -lucl)
+UCL library (libucl, \-lucl)
 .SH SYNOPSIS
 .PP
 \f[C]#include\ <ucl.h>\f[]
@@ -32,12 +32,12 @@ In future, this limitation can be remove
 Convert \f[C]ucl\f[] objects to some textual or binary representation.
 Currently, libucl supports the following exports:
 .IP \[bu] 2
-\f[C]JSON\f[] - valid json format (can possibly loose some original
+\f[C]JSON\f[] \- valid json format (can possibly loose some original
 data, such as implicit arrays)
 .IP \[bu] 2
-\f[C]Config\f[] - human-readable configuration format (losseless)
+\f[C]Config\f[] \- human\-readable configuration format (losseless)
 .IP \[bu] 2
-\f[C]YAML\f[] - embedded yaml format (has the same limitations as
+\f[C]YAML\f[] \- embedded yaml format (has the same limitations as
 \f[C]json\f[] output)
 .SS Conversion functions
 .PP
@@ -57,7 +57,7 @@ as implicit array or implicit consolidat
 .SS Validation functions
 .PP
 Validation functions are used to validate some object \f[C]obj\f[] using
-json-schema compatible object \f[C]schema\f[].
+json\-schema compatible object \f[C]schema\f[].
 Both input and schema must be UCL objects to perform validation.
 .SS Utility functions
 .PP
@@ -76,13 +76,13 @@ struct\ ucl_parser*\ ucl_parser_new\ (in
 .PP
 Creates new parser with the specified flags:
 .IP \[bu] 2
-\f[C]UCL_PARSER_KEY_LOWERCASE\f[] - lowercase keys parsed
+\f[C]UCL_PARSER_KEY_LOWERCASE\f[] \- lowercase keys parsed
 .IP \[bu] 2
-\f[C]UCL_PARSER_ZEROCOPY\f[] - try to use zero-copy mode when reading
-files (in zero-copy mode text chunk being parsed without copying strings
-so it should exist till any object parsed is used)
+\f[C]UCL_PARSER_ZEROCOPY\f[] \- try to use zero\-copy mode when reading
+files (in zero\-copy mode text chunk being parsed without copying
+strings so it should exist till any object parsed is used)
 .IP \[bu] 2
-\f[C]UCL_PARSER_NO_TIME\f[] - treat time values as strings without
+\f[C]UCL_PARSER_NO_TIME\f[] \- treat time values as strings without
 parsing them as floats
 .SS ucl_parser_register_macro
 .IP
@@ -161,7 +161,7 @@ bool\ ucl_parser_add_string\ (struct\ uc
 .PP
 This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but
 if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be
-zero-terminated and the actual length is calculated up to \f[C]\\0\f[]
+zero\-terminated and the actual length is calculated up to \f[C]\\0\f[]
 character.
 .SS ucl_parser_add_file
 .IP
@@ -229,7 +229,7 @@ bool\ ucl_pubkey_add\ (struct\ ucl_parse
 This function adds a public key from text blob \f[C]key\f[] of length
 \f[C]len\f[] to the \f[C]parser\f[] object.
 This public key should be in the \f[C]PEM\f[] format and can be used by
-\f[C].includes\f[] macro for checking signatures of files included.
+\f[C]\&.includes\f[] macro for checking signatures of files included.
 \f[C]Openssl\f[] support should be enabled to make this function
 working.
 If a key cannot be added (e.g.
@@ -247,25 +247,26 @@ bool\ ucl_parser_set_filevars\ (struct\ 
 Add the standard file variables to the \f[C]parser\f[] based on the
 \f[C]filename\f[] specified:
 .IP \[bu] 2
-\f[C]$FILENAME\f[] - a filename of \f[C]ucl\f[] input
+\f[C]$FILENAME\f[] \- a filename of \f[C]ucl\f[] input
 .IP \[bu] 2
-\f[C]$CURDIR\f[] - a current directory of the input
+\f[C]$CURDIR\f[] \- a current directory of the input
 .PP
-For example, if a \f[C]filename\f[] param is \f[C]../something.conf\f[]
-then the variables will have the following values:
+For example, if a \f[C]filename\f[] param is
+\f[C]\&../something.conf\f[] then the variables will have the following
+values:
 .IP \[bu] 2
-\f[C]$FILENAME\f[] - "../something.conf"
+\f[C]$FILENAME\f[] \- "../something.conf"
 .IP \[bu] 2
-\f[C]$CURDIR\f[] - ".."
+\f[C]$CURDIR\f[] \- ".."
 .PP
 if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative
 paths are expanded using \f[C]realpath\f[] call.
-In this example if \f[C]..\f[] is \f[C]/etc/dir\f[] then variables will
-have these values:
+In this example if \f[C]\&..\f[] is \f[C]/etc/dir\f[] then variables
+will have these values:
 .IP \[bu] 2
-\f[C]$FILENAME\f[] - "/etc/something.conf"
+\f[C]$FILENAME\f[] \- "/etc/something.conf"
 .IP \[bu] 2
-\f[C]$CURDIR\f[] - "/etc"
+\f[C]$CURDIR\f[] \- "/etc"
 .SS Parser usage example
 .PP
 The following example loads, parses and extracts \f[C]ucl\f[] object
@@ -283,7 +284,7 @@ FILE\ *in;
 in\ =\ stdin;
 parser\ =\ ucl_parser_new\ (0);
 while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ {
-\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ -\ r,\ in);
+\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ \-\ r,\ in);
 }
 ucl_parser_add_chunk\ (parser,\ inbuf,\ r);
 fclose\ (in);
@@ -309,20 +310,20 @@ return\ ret;
 .PP
 Libucl can transform UCL objects to a number of tectual formats:
 .IP \[bu] 2
-configuration (\f[C]UCL_EMIT_CONFIG\f[]) - nginx like human readable
+configuration (\f[C]UCL_EMIT_CONFIG\f[]) \- nginx like human readable
 configuration file where implicit arrays are transformed to the
 duplicate keys
 .IP \[bu] 2
-compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] - single line valid json
+compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] \- single line valid json
 without spaces
 .IP \[bu] 2
-formatted json: \f[C]UCL_EMIT_JSON\f[] - pretty formatted JSON with
+formatted json: \f[C]UCL_EMIT_JSON\f[] \- pretty formatted JSON with
 newlines and spaces
 .IP \[bu] 2
-compact yaml: \f[C]UCL_EMIT_YAML\f[] - compact YAML output
+compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output
 .PP
 Moreover, libucl API allows to select a custom set of emitting functions
-allowing efficent and zero-copy output of libucl objects.
+allowing efficent and zero\-copy output of libucl objects.
 Libucl uses the following structure to support this feature:
 .IP
 .nf
@@ -344,17 +345,17 @@ struct\ ucl_emitter_functions\ {
 .PP
 This structure defines the following callbacks:
 .IP \[bu] 2
-\f[C]ucl_emitter_append_character\f[] - a function that is called to
+\f[C]ucl_emitter_append_character\f[] \- a function that is called to
 append \f[C]nchars\f[] characters equal to \f[C]c\f[]
 .IP \[bu] 2
-\f[C]ucl_emitter_append_len\f[] - used to append a string of length
+\f[C]ucl_emitter_append_len\f[] \- used to append a string of length
 \f[C]len\f[] starting from pointer \f[C]str\f[]
 .IP \[bu] 2
-\f[C]ucl_emitter_append_int\f[] - this function applies to integer
+\f[C]ucl_emitter_append_int\f[] \- this function applies to integer
 numbers
 .IP \[bu] 2
-\f[C]ucl_emitter_append_double\f[] - this function is intended to output
-floating point variable
+\f[C]ucl_emitter_append_double\f[] \- this function is intended to
+output floating point variable
 .PP
 The set of these functions could be used to output text formats of
 \f[C]UCL\f[] objects to different structures or streams.
@@ -364,7 +365,7 @@ Libucl provides the following functions 
 .IP
 .nf
 \f[C]
-unsigned\ char\ *ucl_object_emit\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type);
+unsigned\ char\ *ucl_object_emit\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type);
 \f[]
 .fi
 .PP
@@ -376,7 +377,7 @@ The caller should free the returned stri
 .IP
 .nf
 \f[C]
-bool\ ucl_object_emit_full\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type,
+bool\ ucl_object_emit_full\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type,
 \ \ \ \ \ \ \ \ struct\ ucl_emitter_functions\ *emitter);
 \f[]
 .fi
@@ -400,26 +401,26 @@ cannot be converted then some reasonable
 strings and 0 for numbers)
 .PP
 Also there is a single \f[C]ucl_object_tostring_forced\f[] function that
-converts any UCL object (including compound types - arrays and objects)
+converts any UCL object (including compound types \- arrays and objects)
 to a string representation.
 For compound and numeric types this function performs emitting to a
 compact json format actually.
 .PP
 Here is a list of all conversion functions:
 .IP \[bu] 2
-\f[C]ucl_object_toint\f[] - returns \f[C]int64_t\f[] of UCL object
+\f[C]ucl_object_toint\f[] \- returns \f[C]int64_t\f[] of UCL object
 .IP \[bu] 2
-\f[C]ucl_object_todouble\f[] - returns \f[C]double\f[] of UCL object
+\f[C]ucl_object_todouble\f[] \- returns \f[C]double\f[] of UCL object
 .IP \[bu] 2
-\f[C]ucl_object_toboolean\f[] - returns \f[C]bool\f[] of UCL object
+\f[C]ucl_object_toboolean\f[] \- returns \f[C]bool\f[] of UCL object
 .IP \[bu] 2
-\f[C]ucl_object_tostring\f[] - returns \f[C]const\ char\ *\f[] of UCL
+\f[C]ucl_object_tostring\f[] \- returns \f[C]const\ char\ *\f[] of UCL
 object (this string is NULL terminated)
 .IP \[bu] 2
-\f[C]ucl_object_tolstring\f[] - returns \f[C]const\ char\ *\f[] and
+\f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and
 \f[C]size_t\f[] len of UCL object (string can be not NULL terminated)
 .IP \[bu] 2
-\f[C]ucl_object_tostring_forced\f[] - returns string representation of
+\f[C]ucl_object_tostring_forced\f[] \- returns string representation of
 any UCL object
 .PP
 Strings returned by these pointers are associated with the UCL object
@@ -448,26 +449,28 @@ ucl_object_t\ *\ ucl_object_typed_new\ (
 \f[]
 .fi
 .PP
-Create an object of a specified type: - \f[C]UCL_OBJECT\f[] - UCL object
-- key/value pairs - \f[C]UCL_ARRAY\f[] - UCL array - \f[C]UCL_INT\f[] -
-integer number - \f[C]UCL_FLOAT\f[] - floating point number -
-\f[C]UCL_STRING\f[] - NULL terminated string - \f[C]UCL_BOOLEAN\f[] -
-boolean value - \f[C]UCL_TIME\f[] - time value (floating point number of
-seconds) - \f[C]UCL_USERDATA\f[] - opaque userdata pointer (may be used
-in macros) - \f[C]UCL_NULL\f[] - null value
+Create an object of a specified type: \- \f[C]UCL_OBJECT\f[] \- UCL
+object \- key/value pairs \- \f[C]UCL_ARRAY\f[] \- UCL array \-
+\f[C]UCL_INT\f[] \- integer number \- \f[C]UCL_FLOAT\f[] \- floating
+point number \- \f[C]UCL_STRING\f[] \- NULL terminated string \-
+\f[C]UCL_BOOLEAN\f[] \- boolean value \- \f[C]UCL_TIME\f[] \- time value
+(floating point number of seconds) \- \f[C]UCL_USERDATA\f[] \- opaque
+userdata pointer (may be used in macros) \- \f[C]UCL_NULL\f[] \- null
+value
 .PP
 This object should be released by caller.
 .SS Primitive objects generation
 .PP
 Libucl provides the functions similar to inverse conversion functions
-called with the specific C type: - \f[C]ucl_object_fromint\f[] -
-converts \f[C]int64_t\f[] to UCL object - \f[C]ucl_object_fromdouble\f[]
-- converts \f[C]double\f[] to UCL object -
-\f[C]ucl_object_fromboolean\f[] - converts \f[C]bool\f[] to UCL object -
-\f[C]ucl_object_fromstring\f[] - converts \f[C]const\ char\ *\f[] to UCL
-object (this string is NULL terminated) -
-\f[C]ucl_object_fromlstring\f[] - converts \f[C]const\ char\ *\f[] and
-\f[C]size_t\f[] len to UCL object (string can be not NULL terminated)
+called with the specific C type: \- \f[C]ucl_object_fromint\f[] \-
+converts \f[C]int64_t\f[] to UCL object \-
+\f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object
+\- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL
+object \- \f[C]ucl_object_fromstring\f[] \- converts
+\f[C]const\ char\ *\f[] to UCL object (this string is NULL terminated)
+\- \f[C]ucl_object_fromlstring\f[] \- converts \f[C]const\ char\ *\f[]
+and \f[C]size_t\f[] len to UCL object (string can be not NULL
+terminated)
 .PP
 Also there is a function to generate UCL object from a string performing
 various parsing or conversion operations called
@@ -484,35 +487,35 @@ ucl_object_t\ *\ ucl_object_fromstring_c
 This function is used to convert a string \f[C]str\f[] of size
 \f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions.
 If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as
-NULL-terminated.
+NULL\-terminated.
 This function supports the following flags (a set of flags can be
 specified using logical \f[C]OR\f[] operation):
 .IP \[bu] 2
-\f[C]UCL_STRING_ESCAPE\f[] - perform JSON escape
+\f[C]UCL_STRING_ESCAPE\f[] \- perform JSON escape
 .IP \[bu] 2
-\f[C]UCL_STRING_TRIM\f[] - trim leading and trailing whitespaces
+\f[C]UCL_STRING_TRIM\f[] \- trim leading and trailing whitespaces
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_BOOLEAN\f[] - parse passed string and detect
+\f[C]UCL_STRING_PARSE_BOOLEAN\f[] \- parse passed string and detect
 boolean
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_INT\f[] - parse passed string and detect integer
+\f[C]UCL_STRING_PARSE_INT\f[] \- parse passed string and detect integer
 number
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_DOUBLE\f[] - parse passed string and detect
+\f[C]UCL_STRING_PARSE_DOUBLE\f[] \- parse passed string and detect
 integer or float number
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_TIME\f[] - parse time values as floating point
+\f[C]UCL_STRING_PARSE_TIME\f[] \- parse time values as floating point
 numbers
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_NUMBER\f[] - parse passed string and detect number
-(both float, integer and time types)
+\f[C]UCL_STRING_PARSE_NUMBER\f[] \- parse passed string and detect
+number (both float, integer and time types)
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE\f[] - parse passed string (and detect booleans,
+\f[C]UCL_STRING_PARSE\f[] \- parse passed string (and detect booleans,
 numbers and time values)
 .IP \[bu] 2
-\f[C]UCL_STRING_PARSE_BYTES\f[] - assume that numeric multipliers are in
-bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and not
-\f[C]10*1000\f[] as assumed without this flag
+\f[C]UCL_STRING_PARSE_BYTES\f[] \- assume that numeric multipliers are
+in bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and
+not \f[C]10*1000\f[] as assumed without this flag
 .PP
 If parsing operations fail then the resulting UCL object will be a
 \f[C]UCL_STRING\f[].
@@ -530,7 +533,7 @@ is a function \f[C]ucl_iterate_object\f[
 .IP
 .nf
 \f[C]
-ucl_object_t*\ ucl_iterate_object\ (ucl_object_t\ *obj,\ 
+const\ ucl_object_t*\ ucl_iterate_object\ (const\ ucl_object_t\ *obj,\ 
 \ \ \ \ ucl_object_iter_t\ *iter,\ bool\ expand_values);
 \f[]
 .fi
@@ -561,7 +564,7 @@ Here is an example of iteration over the
 .nf
 \f[C]
 ucl_object_iter_t\ it\ =\ NULL,\ it_obj\ =\ NULL;
-ucl_object_t\ *cur,\ *tmp;
+const\ ucl_object_t\ *cur,\ *tmp;
 
 /*\ Iterate\ over\ the\ object\ */
 while\ ((obj\ =\ ucl_iterate_object\ (top,\ &it,\ true)))\ {
@@ -584,13 +587,13 @@ This function is defined as following:
 .IP
 .nf
 \f[C]
-bool\ ucl_object_validate\ (ucl_object_t\ *schema,
-\ \ \ \ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err);
+bool\ ucl_object_validate\ (const\ ucl_object_t\ *schema,
+\ \ \ \ const\ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err);
 \f[]
 .fi
 .PP
 This function uses ucl object \f[C]schema\f[], that must be valid in
-terms of \f[C]json-schema\f[] draft v4, to validate input object
+terms of \f[C]json\-schema\f[] draft v4, to validate input object
 \f[C]obj\f[].
 If this function returns \f[C]true\f[] then validation procedure has
 been succeed.

Modified: head/contrib/libucl/include/ucl.h
==============================================================================
--- head/contrib/libucl/include/ucl.h	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/include/ucl.h	Tue Apr 22 22:02:06 2014	(r264789)
@@ -81,6 +81,14 @@ extern "C" {
 #define UCL_WARN_UNUSED_RESULT
 #endif
 
+#ifdef __GNUC__
+#define UCL_DEPRECATED(func) func __attribute__ ((deprecated))
+#elif defined(_MSC_VER)
+#define UCL_DEPRECATED(func) __declspec(deprecated) func
+#else
+#define UCL_DEPRECATED(func) func
+#endif
+
 /**
  * @defgroup structures Structures and types
  * UCL defines several enumeration types used for error reporting or specifying flags and attributes.
@@ -208,14 +216,14 @@ typedef struct ucl_object_s {
  * @param obj CL object
  * @return zero terminated key
  */
-UCL_EXTERN char* ucl_copy_key_trash (ucl_object_t *obj);
+UCL_EXTERN char* ucl_copy_key_trash (const ucl_object_t *obj);
 
 /**
  * Copy and return a string value of an object, returned key is zero-terminated
  * @param obj CL object
  * @return zero terminated string representation of object value
  */
-UCL_EXTERN char* ucl_copy_value_trash (ucl_object_t *obj);
+UCL_EXTERN char* ucl_copy_value_trash (const ucl_object_t *obj);
 
 /**
  * Creates a new object
@@ -245,7 +253,7 @@ UCL_EXTERN ucl_object_t * ucl_object_fro
  * @param str NULL terminated string, will be json escaped
  * @return new object
  */
-UCL_EXTERN ucl_object_t *ucl_object_fromstring (const char *str);
+UCL_EXTERN ucl_object_t *ucl_object_fromstring (const char *str) UCL_WARN_UNUSED_RESULT;
 
 /**
  * Create a UCL object from the specified string
@@ -253,28 +261,29 @@ UCL_EXTERN ucl_object_t *ucl_object_from
  * @param len length of a string
  * @return new object
  */
-UCL_EXTERN ucl_object_t *ucl_object_fromlstring (const char *str, size_t len);
+UCL_EXTERN ucl_object_t *ucl_object_fromlstring (const char *str,
+		size_t len) UCL_WARN_UNUSED_RESULT;
 
 /**
  * Create an object from an integer number
  * @param iv number
  * @return new object
  */
-UCL_EXTERN ucl_object_t* ucl_object_fromint (int64_t iv);
+UCL_EXTERN ucl_object_t* ucl_object_fromint (int64_t iv) UCL_WARN_UNUSED_RESULT;
 
 /**
  * Create an object from a float number
  * @param dv number
  * @return new object
  */
-UCL_EXTERN ucl_object_t* ucl_object_fromdouble (double dv);
+UCL_EXTERN ucl_object_t* ucl_object_fromdouble (double dv) UCL_WARN_UNUSED_RESULT;
 
 /**
  * Create an object from a boolean
  * @param bv bool value
  * @return new object
  */
-UCL_EXTERN ucl_object_t* ucl_object_frombool (bool bv);
+UCL_EXTERN ucl_object_t* ucl_object_frombool (bool bv) UCL_WARN_UNUSED_RESULT;
 
 /**
  * Insert a object 'elt' to the hash 'top' and associate it with key 'key'
@@ -283,10 +292,10 @@ UCL_EXTERN ucl_object_t* ucl_object_from
  * @param key key to associate with this object (either const or preallocated)
  * @param keylen length of the key (or 0 for NULL terminated keys)
  * @param copy_key make an internal copy of key
- * @return new value of top object
+ * @return true if key has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt,
-		const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN bool ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt,
+		const char *key, size_t keylen, bool copy_key);
 
 /**
  * Replace a object 'elt' to the hash 'top' and associate it with key 'key', old object will be unrefed,
@@ -296,10 +305,10 @@ UCL_EXTERN ucl_object_t* ucl_object_inse
  * @param key key to associate with this object (either const or preallocated)
  * @param keylen length of the key (or 0 for NULL terminated keys)
  * @param copy_key make an internal copy of key
- * @return new value of top object
+ * @return true if key has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt,
-		const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN bool ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt,
+		const char *key, size_t keylen, bool copy_key);
 
 /**
  * Delete a object associated with key 'key', old object will be unrefered,
@@ -307,14 +316,16 @@ UCL_EXTERN ucl_object_t* ucl_object_repl
  * @param key key associated to the object to remove
  * @param keylen length of the key (or 0 for NULL terminated keys)
  */
-UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top, const char *key, size_t keylen);
+UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top,
+		const char *key, size_t keylen);
 
 /**
  * Delete a object associated with key 'key', old object will be unrefered,
  * @param top object
  * @param key key associated to the object to remove
  */
-UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top, const char *key);
+UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top,
+		const char *key);
 
 
 /**
@@ -346,28 +357,28 @@ UCL_EXTERN ucl_object_t* ucl_object_pop_
  * @param key key to associate with this object (either const or preallocated)
  * @param keylen length of the key (or 0 for NULL terminated keys)
  * @param copy_key make an internal copy of key
- * @return new value of top object
+ * @return true if key has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt,
-		const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN bool ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt,
+		const char *key, size_t keylen, bool copy_key);
 
 /**
  * Append an element to the front of array object
  * @param top destination object (will be created automatically if top is NULL)
  * @param elt element to append (must NOT be NULL)
- * @return new value of top object
+ * @return true if value has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_array_append (ucl_object_t *top,
-		ucl_object_t *elt) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN bool ucl_array_append (ucl_object_t *top,
+		ucl_object_t *elt);
 
 /**
  * Append an element to the start of array object
  * @param top destination object (will be created automatically if top is NULL)
  * @param elt element to append (must NOT be NULL)
- * @return new value of top object
+ * @return true if value has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_array_prepend (ucl_object_t *top,
-		ucl_object_t *elt) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN bool ucl_array_prepend (ucl_object_t *top,
+		ucl_object_t *elt);
 
 /**
  * Removes an element `elt` from the array `top`. Caller must unref the returned object when it is not
@@ -376,21 +387,22 @@ UCL_EXTERN ucl_object_t* ucl_array_prepe
  * @param elt element to remove
  * @return removed element or NULL if `top` is NULL or not an array
  */
-UCL_EXTERN ucl_object_t* ucl_array_delete (ucl_object_t *top, ucl_object_t *elt);
+UCL_EXTERN ucl_object_t* ucl_array_delete (ucl_object_t *top,
+		ucl_object_t *elt);
 
 /**
  * Returns the first element of the array `top`
  * @param top array ucl object
  * @return element or NULL if `top` is NULL or not an array
  */
-UCL_EXTERN ucl_object_t* ucl_array_head (ucl_object_t *top);
+UCL_EXTERN const ucl_object_t* ucl_array_head (const ucl_object_t *top);
 
 /**
  * Returns the last element of the array `top`
  * @param top array ucl object
  * @return element or NULL if `top` is NULL or not an array
  */
-UCL_EXTERN ucl_object_t* ucl_array_tail (ucl_object_t *top);
+UCL_EXTERN const ucl_object_t* ucl_array_tail (const ucl_object_t *top);
 
 /**
  * Removes the last element from the array `top`. Caller must unref the returned object when it is not
@@ -412,10 +424,10 @@ UCL_EXTERN ucl_object_t* ucl_array_pop_f
  * Append a element to another element forming an implicit array
  * @param head head to append (may be NULL)
  * @param elt new element
- * @return new head if applicable
+ * @return true if element has been inserted
  */
-UCL_EXTERN ucl_object_t* ucl_elt_append (ucl_object_t *head,
-		ucl_object_t *elt) UCL_WARN_UNUSED_RESULT;
+UCL_EXTERN ucl_object_t * ucl_elt_append (ucl_object_t *head,
+		ucl_object_t *elt);
 
 /**
  * Converts an object to double value
@@ -423,14 +435,14 @@ UCL_EXTERN ucl_object_t* ucl_elt_append 
  * @param target target double variable
  * @return true if conversion was successful
  */
-UCL_EXTERN bool ucl_object_todouble_safe (ucl_object_t *obj, double *target);
+UCL_EXTERN bool ucl_object_todouble_safe (const ucl_object_t *obj, double *target);
 
 /**
  * Unsafe version of \ref ucl_obj_todouble_safe
  * @param obj CL object
  * @return double value
  */
-UCL_EXTERN double ucl_object_todouble (ucl_object_t *obj);
+UCL_EXTERN double ucl_object_todouble (const ucl_object_t *obj);
 
 /**
  * Converts an object to integer value
@@ -438,14 +450,14 @@ UCL_EXTERN double ucl_object_todouble (u
  * @param target target integer variable
  * @return true if conversion was successful
  */
-UCL_EXTERN bool ucl_object_toint_safe (ucl_object_t *obj, int64_t *target);
+UCL_EXTERN bool ucl_object_toint_safe (const ucl_object_t *obj, int64_t *target);
 
 /**
  * Unsafe version of \ref ucl_obj_toint_safe
  * @param obj CL object
  * @return int value
  */
-UCL_EXTERN int64_t ucl_object_toint (ucl_object_t *obj);
+UCL_EXTERN int64_t ucl_object_toint (const ucl_object_t *obj);
 
 /**
  * Converts an object to boolean value
@@ -453,14 +465,14 @@ UCL_EXTERN int64_t ucl_object_toint (ucl
  * @param target target boolean variable
  * @return true if conversion was successful
  */
-UCL_EXTERN bool ucl_object_toboolean_safe (ucl_object_t *obj, bool *target);
+UCL_EXTERN bool ucl_object_toboolean_safe (const ucl_object_t *obj, bool *target);
 
 /**
  * Unsafe version of \ref ucl_obj_toboolean_safe
  * @param obj CL object
  * @return boolean value
  */
-UCL_EXTERN bool ucl_object_toboolean (ucl_object_t *obj);
+UCL_EXTERN bool ucl_object_toboolean (const ucl_object_t *obj);
 
 /**
  * Converts an object to string value
@@ -468,21 +480,21 @@ UCL_EXTERN bool ucl_object_toboolean (uc
  * @param target target string variable, no need to free value
  * @return true if conversion was successful
  */
-UCL_EXTERN bool ucl_object_tostring_safe (ucl_object_t *obj, const char **target);
+UCL_EXTERN bool ucl_object_tostring_safe (const ucl_object_t *obj, const char **target);
 
 /**
  * Unsafe version of \ref ucl_obj_tostring_safe
  * @param obj CL object
  * @return string value
  */
-UCL_EXTERN const char* ucl_object_tostring (ucl_object_t *obj);
+UCL_EXTERN const char* ucl_object_tostring (const ucl_object_t *obj);
 
 /**
  * Convert any object to a string in JSON notation if needed
  * @param obj CL object
  * @return string value
  */
-UCL_EXTERN const char* ucl_object_tostring_forced (ucl_object_t *obj);
+UCL_EXTERN const char* ucl_object_tostring_forced (const ucl_object_t *obj);
 
 /**
  * Return string as char * and len, string may be not zero terminated, more efficient that \ref ucl_obj_tostring as it
@@ -492,7 +504,7 @@ UCL_EXTERN const char* ucl_object_tostri
  * @param tlen target length
  * @return true if conversion was successful
  */
-UCL_EXTERN bool ucl_object_tolstring_safe (ucl_object_t *obj,
+UCL_EXTERN bool ucl_object_tolstring_safe (const ucl_object_t *obj,
 		const char **target, size_t *tlen);
 
 /**
@@ -500,7 +512,7 @@ UCL_EXTERN bool ucl_object_tolstring_saf
  * @param obj CL object
  * @return string value
  */
-UCL_EXTERN const char* ucl_object_tolstring (ucl_object_t *obj, size_t *tlen);
+UCL_EXTERN const char* ucl_object_tolstring (const ucl_object_t *obj, size_t *tlen);
 
 /**
  * Return object identified by a key in the specified object
@@ -508,7 +520,8 @@ UCL_EXTERN const char* ucl_object_tolstr
  * @param key key to search
  * @return object matched the specified key or NULL if key is not found
  */
-UCL_EXTERN ucl_object_t* ucl_object_find_key (ucl_object_t *obj, const char *key);
+UCL_EXTERN const ucl_object_t* ucl_object_find_key (const ucl_object_t *obj,
+		const char *key);
 
 /**
  * Return object identified by a fixed size key in the specified object
@@ -517,14 +530,15 @@ UCL_EXTERN ucl_object_t* ucl_object_find
  * @param klen length of a key
  * @return object matched the specified key or NULL if key is not found
  */
-UCL_EXTERN ucl_object_t* ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen);
+UCL_EXTERN const ucl_object_t* ucl_object_find_keyl (const ucl_object_t *obj,
+		const char *key, size_t klen);
 
 /**
  * Returns a key of an object as a NULL terminated string
  * @param obj CL object
  * @return key or NULL if there is no key
  */
-UCL_EXTERN const char* ucl_object_key (ucl_object_t *obj);
+UCL_EXTERN const char* ucl_object_key (const ucl_object_t *obj);
 
 /**
  * Returns a key of an object as a fixed size string (may be more efficient)
@@ -532,19 +546,19 @@ UCL_EXTERN const char* ucl_object_key (u
  * @param len target key length
  * @return key pointer
  */
-UCL_EXTERN const char* ucl_object_keyl (ucl_object_t *obj, size_t *len);
+UCL_EXTERN const char* ucl_object_keyl (const ucl_object_t *obj, size_t *len);
 
 /**
- * Free ucl object
- * @param obj ucl object to free
+ * Increase reference count for an object
+ * @param obj object to ref
  */
-UCL_EXTERN void ucl_object_free (ucl_object_t *obj);
+UCL_EXTERN ucl_object_t* ucl_object_ref (const ucl_object_t *obj);
 
 /**
- * Increase reference count for an object
- * @param obj object to ref
+ * Free ucl object
+ * @param obj ucl object to free
  */
-UCL_EXTERN ucl_object_t* ucl_object_ref (ucl_object_t *obj);
+UCL_DEPRECATED(UCL_EXTERN void ucl_object_free (ucl_object_t *obj));
 
 /**
  * Decrease reference count for an object
@@ -562,7 +576,8 @@ UCL_EXTERN void ucl_object_unref (ucl_ob
  * 2) Size of objects
  * 3) Content of objects
  */
-UCL_EXTERN int ucl_object_compare (ucl_object_t *o1, ucl_object_t *o2);
+UCL_EXTERN int ucl_object_compare (const ucl_object_t *o1,
+		const ucl_object_t *o2);
 
 /**
  * Sort UCL array using `cmp` compare function
@@ -570,7 +585,7 @@ UCL_EXTERN int ucl_object_compare (ucl_o
  * @param cmp
  */
 UCL_EXTERN void ucl_object_array_sort (ucl_object_t *ar,
-		int (*cmp)(ucl_object_t *o1, ucl_object_t *o2));
+		int (*cmp)(const ucl_object_t *o1, const ucl_object_t *o2));
 
 /**
  * Opaque iterator object
@@ -585,7 +600,8 @@ typedef void* ucl_object_iter_t;
  * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ...
  * @return the next object or NULL
  */
-UCL_EXTERN ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values);
+UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj,
+		ucl_object_iter_t *iter, bool expand_values);
 /** @} */
 
 
@@ -663,10 +679,21 @@ UCL_EXTERN bool ucl_parser_add_string (s
  * @param err if *err is NULL it is set to parser error
  * @return true if chunk has been added and false in case of error
  */
-UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename);
+UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser,
+		const char *filename);
+
+/**
+ * Load and add data from a file descriptor
+ * @param parser parser structure
+ * @param filename the name of file
+ * @param err if *err is NULL it is set to parser error
+ * @return true if chunk has been added and false in case of error
+ */
+UCL_EXTERN bool ucl_parser_add_fd (struct ucl_parser *parser,
+		int fd);
 
 /**
- * Get a top object for a parser
+ * Get a top object for a parser (refcount is increased)
  * @param parser parser structure
  * @param err if *err is NULL it is set to parser error
  * @return top parser object or NULL
@@ -736,7 +763,8 @@ struct ucl_emitter_functions {
  * #UCL_EMIT_CONFIG then emit config like object
  * @return dump of an object (must be freed after using) or NULL in case of error
  */
-UCL_EXTERN unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type);
+UCL_EXTERN unsigned char *ucl_object_emit (const ucl_object_t *obj,
+		enum ucl_emitter emit_type);
 
 /**
  * Emit object to a string
@@ -745,7 +773,8 @@ UCL_EXTERN unsigned char *ucl_object_emi
  * #UCL_EMIT_CONFIG then emit config like object
  * @return dump of an object (must be freed after using) or NULL in case of error
  */
-UCL_EXTERN bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type,
+UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj,
+		enum ucl_emitter emit_type,
 		struct ucl_emitter_functions *emitter);
 /** @} */
 
@@ -775,7 +804,7 @@ enum ucl_schema_error_code {
 struct ucl_schema_error {
 	enum ucl_schema_error_code code;	/**< error code */
 	char msg[128];						/**< error message */
-	ucl_object_t *obj;					/**< object where error occured */
+	const ucl_object_t *obj;			/**< object where error occured */
 };
 
 /**
@@ -786,8 +815,8 @@ struct ucl_schema_error {
  * occured, then `err` is filled with the exact error definition.
  * @return true if `obj` is valid using `schema`
  */
-UCL_EXTERN bool ucl_object_validate (ucl_object_t *schema,
-		ucl_object_t *obj, struct ucl_schema_error *err);
+UCL_EXTERN bool ucl_object_validate (const ucl_object_t *schema,
+		const ucl_object_t *obj, struct ucl_schema_error *err);
 
 /** @} */
 

Modified: head/contrib/libucl/src/Makefile.am
==============================================================================
--- head/contrib/libucl/src/Makefile.am	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/src/Makefile.am	Tue Apr 22 22:02:06 2014	(r264789)
@@ -13,6 +13,8 @@ libucl_la_CFLAGS=	$(libucl_common_cflags
 					@CURL_CFLAGS@
 libucl_la_LDFLAGS = -version-info @SO_VERSION@
 libucl_la_LIBADD=	@LIBFETCH_LIBS@ \
+					@LIBCRYPTO_LIB@ \
+					@LIBREGEX_LIB@ \
 					@CURL_LIBS@
 
 include_HEADERS=	$(top_srcdir)/include/ucl.h

Modified: head/contrib/libucl/src/ucl_emitter.c
==============================================================================
--- head/contrib/libucl/src/ucl_emitter.c	Tue Apr 22 21:57:13 2014	(r264788)
+++ head/contrib/libucl/src/ucl_emitter.c	Tue Apr 22 22:02:06 2014	(r264789)
@@ -41,29 +41,29 @@
  */
 
 
-static void ucl_obj_write_json (ucl_object_t *obj,
+static void ucl_obj_write_json (const ucl_object_t *obj,
 		struct ucl_emitter_functions *func,
 		unsigned int tabs,
 		bool start_tabs,
 		bool compact);
-static void ucl_elt_write_json (ucl_object_t *obj,
+static void ucl_elt_write_json (const ucl_object_t *obj,
 		struct ucl_emitter_functions *func,
 		unsigned int tabs,
 		bool start_tabs,
 		bool compact);
-static void ucl_elt_write_config (ucl_object_t *obj,
+static void ucl_elt_write_config (const ucl_object_t *obj,
 		struct ucl_emitter_functions *func,
 		unsigned int tabs,
 		bool start_tabs,
 		bool is_top,
 		bool expand_array);
-static void ucl_elt_write_yaml (ucl_object_t *obj,
+static void ucl_elt_write_yaml (const ucl_object_t *obj,
 		struct ucl_emitter_functions *func,
 		unsigned int tabs,
 		bool start_tabs,
 		bool compact,

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



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