1 .TH "LIBUCL" "3" "27 December, 2014" "Libucl manual" ""
4 \f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[],
5 \f[B]ucl_parser_register_variable\f[], \f[B]ucl_parser_add_chunk\f[],
6 \f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[],
7 \f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[],
8 \f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[],
9 \f[B]ucl_parser_set_filevars\f[] \- universal configuration library
10 parser and utility functions
13 UCL library (libucl, \-lucl)
16 \f[C]#include\ <ucl.h>\f[]
19 Libucl is a parser and \f[C]C\f[] API to parse and generate \f[C]ucl\f[]
21 Libucl consist of several groups of functions:
24 Used to parse \f[C]ucl\f[] files and provide interface to extract
26 Currently, \f[C]libucl\f[] can parse only full \f[C]ucl\f[] documents,
27 for instance, it is impossible to parse a part of document and therefore
28 it is impossible to use \f[C]libucl\f[] as a streaming parser.
29 In future, this limitation can be removed.
30 .SS Emitting functions
32 Convert \f[C]ucl\f[] objects to some textual or binary representation.
33 Currently, libucl supports the following exports:
35 \f[C]JSON\f[] \- valid json format (can possibly lose some original
36 data, such as implicit arrays)
38 \f[C]Config\f[] \- human\-readable configuration format (lossless)
40 \f[C]YAML\f[] \- embedded yaml format (has the same limitations as
42 .SS Conversion functions
44 Help to convert \f[C]ucl\f[] objects to C types.
45 These functions are used to convert \f[C]ucl_object_t\f[] to C primitive
46 types, such as numbers, strings or boolean values.
47 .SS Generation functions
49 Allow creation of \f[C]ucl\f[] objects from C types and creating of
50 complex \f[C]ucl\f[] objects, such as hashes or arrays from primitive
51 \f[C]ucl\f[] objects, such as numbers or strings.
52 .SS Iteration functions
54 Iterate over \f[C]ucl\f[] complex objects or over a chain of values, for
55 example when a key in an object has multiple values (that can be treated
56 as implicit array or implicit consolidation).
57 .SS Validation functions
59 Validation functions are used to validate some object \f[C]obj\f[] using
60 json\-schema compatible object \f[C]schema\f[].
61 Both input and schema must be UCL objects to perform validation.
64 Provide basic utilities to manage \f[C]ucl\f[] objects: creating,
65 removing, retaining and releasing reference count and so on.
68 Parser functions operates with \f[C]struct\ ucl_parser\f[].
73 struct\ ucl_parser*\ ucl_parser_new\ (int\ flags);
77 Creates new parser with the specified flags:
79 \f[C]UCL_PARSER_KEY_LOWERCASE\f[] \- lowercase keys parsed
81 \f[C]UCL_PARSER_ZEROCOPY\f[] \- try to use zero\-copy mode when reading
82 files (in zero\-copy mode text chunk being parsed without copying
83 strings so it should exist till any object parsed is used)
85 \f[C]UCL_PARSER_NO_TIME\f[] \- treat time values as strings without
86 parsing them as floats
87 .SS ucl_parser_register_macro
91 void\ ucl_parser_register_macro\ (struct\ ucl_parser\ *parser,
92 \ \ \ \ const\ char\ *macro,\ ucl_macro_handler\ handler,\ void*\ ud);
96 Register new macro with name .\f[C]macro\f[] parsed by handler
97 \f[C]handler\f[] that accepts opaque data pointer \f[C]ud\f[].
98 Macro handler should be of the following type:
102 bool\ (*ucl_macro_handler)\ (const\ unsigned\ char\ *data,
103 \ \ \ \ size_t\ len,\ void*\ ud);`
107 Handler function accepts macro text \f[C]data\f[] of length \f[C]len\f[]
108 and the opaque pointer \f[C]ud\f[].
109 If macro is parsed successfully the handler should return \f[C]true\f[].
110 \f[C]false\f[] indicates parsing failure and the parser can be
112 .SS ucl_parser_register_variable
116 void\ ucl_parser_register_variable\ (struct\ ucl_parser\ *parser,
117 \ \ \ \ const\ char\ *var,\ const\ char\ *value);
121 Register new variable $\f[C]var\f[] that should be replaced by the
122 parser to the \f[C]value\f[] string.
123 .SS ucl_parser_add_chunk
127 bool\ ucl_parser_add_chunk\ (struct\ ucl_parser\ *parser,\
128 \ \ \ \ const\ unsigned\ char\ *data,\ size_t\ len);
132 Add new text chunk with \f[C]data\f[] of length \f[C]len\f[] to the
134 At the moment, \f[C]libucl\f[] parser is not a streamlined parser and
135 chunk \f[I]must\f[] contain the \f[I]valid\f[] ucl object.
136 For example, this object should be valid:
140 {\ "var":\ "value"\ }
144 while this one won\[aq]t be parsed correctly:
152 This limitation may possible be removed in future.
153 .SS ucl_parser_add_string
157 bool\ ucl_parser_add_string\ (struct\ ucl_parser\ *parser,\
158 \ \ \ \ const\ char\ *data,\ size_t\ len);
162 This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but
163 if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be
164 zero\-terminated and the actual length is calculated up to \f[C]\\0\f[]
166 .SS ucl_parser_add_file
170 bool\ ucl_parser_add_file\ (struct\ ucl_parser\ *parser,\
171 \ \ \ \ const\ char\ *filename);
175 Load file \f[C]filename\f[] and parse it with the specified
177 This function uses \f[C]mmap\f[] call to load file, therefore, it should
178 not be \f[C]shrunk\f[] during parsing.
179 Otherwise, \f[C]libucl\f[] can cause memory corruption and terminate the
181 This function is also used by the internal handler of \f[C]include\f[]
182 macro, hence, this macro has the same limitation.
183 .SS ucl_parser_get_object
187 ucl_object_t*\ ucl_parser_get_object\ (struct\ ucl_parser\ *parser);
191 If the \f[C]ucl\f[] data has been parsed correctly this function returns
192 the top object for the parser.
193 Otherwise, this function returns the \f[C]NULL\f[] pointer.
194 The reference count for \f[C]ucl\f[] object returned is increased by
195 one, therefore, a caller should decrease reference by using
196 \f[C]ucl_object_unref\f[] to free object after usage.
197 .SS ucl_parser_get_error
201 const\ char\ *ucl_parser_get_error(struct\ ucl_parser\ *parser);
205 Returns the constant error string for the parser object.
206 If no error occurred during parsing a \f[C]NULL\f[] object is returned.
207 A caller should not try to free or modify this string.
212 void\ ucl_parser_free\ (struct\ ucl_parser\ *parser);
216 Frees memory occupied by the parser object.
217 The reference count for top object is decreased as well, however if the
218 function \f[C]ucl_parser_get_object\f[] was called previously then the
219 top object won\[aq]t be freed.
224 bool\ ucl_pubkey_add\ (struct\ ucl_parser\ *parser,\
225 \ \ \ \ const\ unsigned\ char\ *key,\ size_t\ len);
229 This function adds a public key from text blob \f[C]key\f[] of length
230 \f[C]len\f[] to the \f[C]parser\f[] object.
231 This public key should be in the \f[C]PEM\f[] format and can be used by
232 \f[C]\&.includes\f[] macro for checking signatures of files included.
233 \f[C]Openssl\f[] support should be enabled to make this function
235 If a key cannot be added (e.g.
236 due to format error) or \f[C]openssl\f[] was not linked to
237 \f[C]libucl\f[] then this function returns \f[C]false\f[].
238 .SS ucl_parser_set_filevars
242 bool\ ucl_parser_set_filevars\ (struct\ ucl_parser\ *parser,\
243 \ \ \ \ const\ char\ *filename,\ bool\ need_expand);
247 Add the standard file variables to the \f[C]parser\f[] based on the
248 \f[C]filename\f[] specified:
250 \f[C]$FILENAME\f[] \- a filename of \f[C]ucl\f[] input
252 \f[C]$CURDIR\f[] \- a current directory of the input
254 For example, if a \f[C]filename\f[] param is
255 \f[C]\&../something.conf\f[] then the variables will have the following
258 \f[C]$FILENAME\f[] \- "../something.conf"
260 \f[C]$CURDIR\f[] \- ".."
262 if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative
263 paths are expanded using \f[C]realpath\f[] call.
264 In this example if \f[C]\&..\f[] is \f[C]/etc/dir\f[] then variables
265 will have these values:
267 \f[C]$FILENAME\f[] \- "/etc/something.conf"
269 \f[C]$CURDIR\f[] \- "/etc"
270 .SS Parser usage example
272 The following example loads, parses and extracts \f[C]ucl\f[] object
273 from stdin using \f[C]libucl\f[] parser functions (the length of input
279 struct\ ucl_parser\ *parser\ =\ NULL;
280 int\ ret\ =\ 0,\ r\ =\ 0;
281 ucl_object_t\ *obj\ =\ NULL;
285 parser\ =\ ucl_parser_new\ (0);
286 while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ {
287 \ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ \-\ r,\ in);
289 ucl_parser_add_chunk\ (parser,\ inbuf,\ r);
292 if\ (ucl_parser_get_error\ (parser))\ {
293 \ \ \ \ printf\ ("Error\ occurred:\ %s\\n",\ ucl_parser_get_error\ (parser));
297 \ \ \ \ obj\ =\ ucl_parser_get_object\ (parser);
300 if\ (parser\ !=\ NULL)\ {
301 \ \ \ \ ucl_parser_free\ (parser);
303 if\ (obj\ !=\ NULL)\ {
304 \ \ \ \ ucl_object_unref\ (obj);
309 .SH EMITTING FUNCTIONS
311 Libucl can transform UCL objects to a number of tectual formats:
313 configuration (\f[C]UCL_EMIT_CONFIG\f[]) \- nginx like human readable
314 configuration file where implicit arrays are transformed to the
317 compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] \- single line valid json
320 formatted json: \f[C]UCL_EMIT_JSON\f[] \- pretty formatted JSON with
323 compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output
325 Moreover, libucl API allows to select a custom set of emitting functions
326 allowing efficient and zero\-copy output of libucl objects.
327 Libucl uses the following structure to support this feature:
331 struct\ ucl_emitter_functions\ {
332 \ \ \ \ /**\ Append\ a\ single\ character\ */
333 \ \ \ \ int\ (*ucl_emitter_append_character)\ (unsigned\ char\ c,\ size_t\ nchars,\ void\ *ud);
334 \ \ \ \ /**\ Append\ a\ string\ of\ a\ specified\ length\ */
335 \ \ \ \ int\ (*ucl_emitter_append_len)\ (unsigned\ const\ char\ *str,\ size_t\ len,\ void\ *ud);
336 \ \ \ \ /**\ Append\ a\ 64\ bit\ integer\ */
337 \ \ \ \ int\ (*ucl_emitter_append_int)\ (int64_t\ elt,\ void\ *ud);
338 \ \ \ \ /**\ Append\ floating\ point\ element\ */
339 \ \ \ \ int\ (*ucl_emitter_append_double)\ (double\ elt,\ void\ *ud);
340 \ \ \ \ /**\ Opaque\ userdata\ pointer\ */
346 This structure defines the following callbacks:
348 \f[C]ucl_emitter_append_character\f[] \- a function that is called to
349 append \f[C]nchars\f[] characters equal to \f[C]c\f[]
351 \f[C]ucl_emitter_append_len\f[] \- used to append a string of length
352 \f[C]len\f[] starting from pointer \f[C]str\f[]
354 \f[C]ucl_emitter_append_int\f[] \- this function applies to integer
357 \f[C]ucl_emitter_append_double\f[] \- this function is intended to
358 output floating point variable
360 The set of these functions could be used to output text formats of
361 \f[C]UCL\f[] objects to different structures or streams.
363 Libucl provides the following functions for emitting UCL objects:
368 unsigned\ char\ *ucl_object_emit\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type);
372 Allocate a string that is suitable to fit the underlying UCL object
373 \f[C]obj\f[] and fill it with the textual representation of the object
374 \f[C]obj\f[] according to style \f[C]emit_type\f[].
375 The caller should free the returned string after using.
376 .SS ucl_object_emit_full
380 bool\ ucl_object_emit_full\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type,
381 \ \ \ \ \ \ \ \ struct\ ucl_emitter_functions\ *emitter);
385 This function is similar to the previous with the exception that it
386 accepts the additional argument \f[C]emitter\f[] that defines the
387 concrete set of output functions.
388 This emit function could be useful for custom structures or streams
389 emitters (including C++ ones, for example).
390 .SH CONVERSION FUNCTIONS
392 Conversion functions are used to convert UCL objects to primitive types,
393 such as strings, numbers, or boolean values.
394 There are two types of conversion functions:
396 safe: try to convert an ucl object to a primitive type and fail if such
397 a conversion is not possible
399 unsafe: return primitive type without additional checks, if the object
400 cannot be converted then some reasonable default is returned (NULL for
401 strings and 0 for numbers)
403 Also there is a single \f[C]ucl_object_tostring_forced\f[] function that
404 converts any UCL object (including compound types \- arrays and objects)
405 to a string representation.
406 For objects, arrays, booleans and numeric types this function performs
407 emitting to a compact json format actually.
409 Here is a list of all conversion functions:
411 \f[C]ucl_object_toint\f[] \- returns \f[C]int64_t\f[] of UCL object
413 \f[C]ucl_object_todouble\f[] \- returns \f[C]double\f[] of UCL object
415 \f[C]ucl_object_toboolean\f[] \- returns \f[C]bool\f[] of UCL object
417 \f[C]ucl_object_tostring\f[] \- returns \f[C]const\ char\ *\f[] of UCL
418 object (this string is NULL terminated)
420 \f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and
421 \f[C]size_t\f[] len of UCL object (string does not need to be NULL
424 \f[C]ucl_object_tostring_forced\f[] \- returns string representation of
427 Strings returned by these pointers are associated with the UCL object
428 and exist over its lifetime.
429 A caller should not free this memory.
430 .SH GENERATION FUNCTIONS
432 It is possible to generate UCL objects from C primitive types.
433 Moreover, libucl allows creation and modifying complex UCL objects, such
434 as arrays or associative objects.
439 ucl_object_t\ *\ ucl_object_new\ (void)
443 Creates new object of type \f[C]UCL_NULL\f[].
444 This object should be released by caller.
445 .SS ucl_object_typed_new
449 ucl_object_t\ *\ ucl_object_typed_new\ (unsigned\ int\ type)
453 Create an object of a specified type: \- \f[C]UCL_OBJECT\f[] \- UCL
454 object \- key/value pairs \- \f[C]UCL_ARRAY\f[] \- UCL array \-
455 \f[C]UCL_INT\f[] \- integer number \- \f[C]UCL_FLOAT\f[] \- floating
456 point number \- \f[C]UCL_STRING\f[] \- NULL terminated string \-
457 \f[C]UCL_BOOLEAN\f[] \- boolean value \- \f[C]UCL_TIME\f[] \- time value
458 (floating point number of seconds) \- \f[C]UCL_USERDATA\f[] \- opaque
459 userdata pointer (may be used in macros) \- \f[C]UCL_NULL\f[] \- null
462 This object should be released by caller.
463 .SS Primitive objects generation
465 Libucl provides the functions similar to inverse conversion functions
466 called with the specific C type: \- \f[C]ucl_object_fromint\f[] \-
467 converts \f[C]int64_t\f[] to UCL object \-
468 \f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object
469 \- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL
470 object \- \f[C]ucl_object_fromstring\f[] \- converts
471 \f[C]const\ char\ *\f[] to UCL object (this string should be NULL
472 terminated) \- \f[C]ucl_object_fromlstring\f[] \- converts
473 \f[C]const\ char\ *\f[] and \f[C]size_t\f[] len to UCL object (string
474 does not need to be NULL terminated)
476 Also there is a function to generate UCL object from a string performing
477 various parsing or conversion operations called
478 \f[C]ucl_object_fromstring_common\f[].
479 .SS ucl_object_fromstring_common
483 ucl_object_t\ *\ ucl_object_fromstring_common\ (const\ char\ *str,\
484 \ \ \ \ size_t\ len,\ enum\ ucl_string_flags\ flags)
488 This function is used to convert a string \f[C]str\f[] of size
489 \f[C]len\f[] to a UCL object applying \f[C]flags\f[] conversions.
490 If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as
492 This function supports the following flags (a set of flags can be
493 specified using logical \f[C]OR\f[] operation):
495 \f[C]UCL_STRING_ESCAPE\f[] \- perform JSON escape
497 \f[C]UCL_STRING_TRIM\f[] \- trim leading and trailing whitespaces
499 \f[C]UCL_STRING_PARSE_BOOLEAN\f[] \- parse passed string and detect
502 \f[C]UCL_STRING_PARSE_INT\f[] \- parse passed string and detect integer
505 \f[C]UCL_STRING_PARSE_DOUBLE\f[] \- parse passed string and detect
506 integer or float number
508 \f[C]UCL_STRING_PARSE_TIME\f[] \- parse time values as floating point
511 \f[C]UCL_STRING_PARSE_NUMBER\f[] \- parse passed string and detect
512 number (both float, integer and time types)
514 \f[C]UCL_STRING_PARSE\f[] \- parse passed string (and detect booleans,
515 numbers and time values)
517 \f[C]UCL_STRING_PARSE_BYTES\f[] \- assume that numeric multipliers are
518 in bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and
519 not \f[C]10*1000\f[] as assumed without this flag
521 If parsing operations fail then the resulting UCL object will be a
523 A caller should always check the type of the returned object and release
525 .SH ITERATION FUNCTIONS
527 Iteration are used to iterate over UCL compound types: arrays and
529 Moreover, iterations could be performed over the keys with multiple
530 values (implicit arrays).
531 There are two types of iterators API: old and unsafe one via
532 \f[C]ucl_iterate_object\f[] and the proposed interface of safe
534 .SS ucl_iterate_object
538 const\ ucl_object_t*\ ucl_iterate_object\ (const\ ucl_object_t\ *obj,\
539 \ \ \ \ ucl_object_iter_t\ *iter,\ bool\ expand_values);
543 This function accepts opaque iterator pointer \f[C]iter\f[].
544 In the first call this iterator \f[I]must\f[] be initialized to
546 Iterator is changed by this function call.
547 \f[C]ucl_iterate_object\f[] returns the next UCL object in the compound
548 object \f[C]obj\f[] or \f[C]NULL\f[] if all objects have been iterated.
549 The reference count of the object returned is not increased, so a caller
550 should not unref the object or modify its content (e.g.
551 by inserting to another compound object).
552 The object \f[C]obj\f[] should not be changed during the iteration
554 \f[C]expand_values\f[] flag speicifies whether
555 \f[C]ucl_iterate_object\f[] should expand keys with multiple values.
556 The general rule is that if you need to iterate through the
557 \f[I]object\f[] or \f[I]explicit array\f[], then you always need to set
558 this flag to \f[C]true\f[].
559 However, if you get some key in the object and want to extract all its
560 values then you should set \f[C]expand_values\f[] to \f[C]false\f[].
561 Mixing of iteration types is not permitted since the iterator is set
562 according to the iteration type and cannot be reused.
563 Here is an example of iteration over the objects using libucl API
564 (assuming that \f[C]top\f[] is \f[C]UCL_OBJECT\f[] in this example):
568 ucl_object_iter_t\ it\ =\ NULL,\ it_obj\ =\ NULL;
569 const\ ucl_object_t\ *cur,\ *tmp;
571 /*\ Iterate\ over\ the\ object\ */
572 while\ ((obj\ =\ ucl_iterate_object\ (top,\ &it,\ true)))\ {
573 \ \ \ \ printf\ ("key:\ \\"%s\\"\\n",\ ucl_object_key\ (obj));
574 \ \ \ \ /*\ Iterate\ over\ the\ values\ of\ a\ key\ */
575 \ \ \ \ while\ ((cur\ =\ ucl_iterate_object\ (obj,\ &it_obj,\ false)))\ {
576 \ \ \ \ \ \ \ \ printf\ ("value:\ \\"%s\\"\\n",\
577 \ \ \ \ \ \ \ \ \ \ \ \ ucl_object_tostring_forced\ (cur));
582 .SS Safe iterators API
584 Safe iterators are defined to clarify iterating over UCL objects and
585 simplify flattening of UCL objects in non\-trivial cases.
586 For example, if there is an implicit array that contains another array
587 and a boolean value it is extremely unclear how to iterate over such an
589 Safe iterators are desinged to define two sorts of iteration:
591 Iteration over complex objects with expanding all values
593 Iteration over complex objects without expanding of values
595 The following example demonstrates the difference between these two
603 Iteration\ with\ expansion:
607 Iteration\ without\ expansion:
613 UCL defines the following functions to manage safe iterators:
615 \f[C]ucl_object_iterate_new\f[] \- creates new safe iterator
617 \f[C]ucl_object_iterate_reset\f[] \- resets iterator to a new object
619 \f[C]ucl_object_iterate_safe\f[] \- safely iterate the object inside
622 \f[C]ucl_object_iterate_free\f[] \- free memory associated with the safe
625 Please note that unlike unsafe iterators, safe iterators \f[I]must\f[]
626 be explicitly initialized and freed.
627 An assert is likely generated if you use uninitialized or \f[C]NULL\f[]
628 iterator in all safe iterators functions.
632 ucl_object_iter_t\ it;
633 const\ ucl_object_t\ *cur;
635 it\ =\ ucl_object_iterate_new\ (obj);
637 while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ {
638 \ \ \ \ /*\ Do\ something\ */
641 /*\ Switch\ to\ another\ object\ */
642 it\ =\ ucl_object_iterate_reset\ (it,\ another_obj);
644 while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ {
645 \ \ \ \ /*\ Do\ something\ else\ */
648 ucl_object_iterate_free\ (it);
651 .SH VALIDATION FUNCTIONS
653 Currently, there is only one validation function called
654 \f[C]ucl_object_validate\f[].
655 It performs validation of object using the specified schema.
656 This function is defined as following:
657 .SS ucl_object_validate
661 bool\ ucl_object_validate\ (const\ ucl_object_t\ *schema,
662 \ \ \ \ const\ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err);
666 This function uses ucl object \f[C]schema\f[], that must be valid in
667 terms of \f[C]json\-schema\f[] draft v4, to validate input object
669 If this function returns \f[C]true\f[] then validation procedure has
671 Otherwise, \f[C]false\f[] is returned and \f[C]err\f[] is set to a
673 If a caller sets \f[C]err\f[] to NULL then this function does not set
674 any error just returning \f[C]false\f[].
675 Error is the structure defined as following:
679 struct\ ucl_schema_error\ {
680 \ \ \ \ enum\ ucl_schema_error_code\ code;\ \ \ \ /*\ error\ code\ */
681 \ \ \ \ char\ msg[128];\ \ \ \ \ \ \ \ \ \ \ \ \ \ /*\ error\ message\ */
682 \ \ \ \ ucl_object_t\ *obj;\ \ \ \ \ \ \ \ \ \ /*\ object\ where\ error\ occurred\ */
687 Caller may use \f[C]code\f[] field to get a numeric error code:
691 enum\ ucl_schema_error_code\ {
692 \ \ \ \ UCL_SCHEMA_OK\ =\ 0,\ \ \ \ \ \ \ \ \ \ /*\ no\ error\ */
693 \ \ \ \ UCL_SCHEMA_TYPE_MISMATCH,\ \ \ /*\ type\ of\ object\ is\ incorrect\ */
694 \ \ \ \ UCL_SCHEMA_INVALID_SCHEMA,\ \ /*\ schema\ is\ invalid\ */
695 \ \ \ \ UCL_SCHEMA_MISSING_PROPERTY,/*\ missing\ properties\ */
696 \ \ \ \ UCL_SCHEMA_CONSTRAINT,\ \ \ \ \ \ /*\ constraint\ found\ */
697 \ \ \ \ UCL_SCHEMA_MISSING_DEPENDENCY,\ /*\ missing\ dependency\ */
698 \ \ \ \ UCL_SCHEMA_UNKNOWN\ \ \ \ \ \ \ \ \ \ /*\ generic\ error\ */
703 \f[C]msg\f[] is a string description of an error and \f[C]obj\f[] is an
704 object where error has occurred.
705 Error object is not allocated by libucl, so there is no need to free it
706 after validation (a static object should thus be used).
708 Vsevolod Stakhov <vsevolod@highsecure.ru>.