]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
flua: add ucl library
authorfreqlabs <freqlabs@FreeBSD.org>
Mon, 22 Jun 2020 03:14:43 +0000 (03:14 +0000)
committerfreqlabs <freqlabs@FreeBSD.org>
Mon, 22 Jun 2020 03:14:43 +0000 (03:14 +0000)
commitd959f368aa12e7577738ed8e6a5231d854dfeb79
tree4db5a48a903d7887c246376e60c1836b266a4a56
parent2c85cc56b5ac221fb1b68885dfb4ce59e6644d14
flua: add ucl library

libucl comes with a Lua library binding.  Build it into flua.

This lets us parse/generate config files in the various formats supported by
libucl with flua.  For example, the following script will detect the format of
an object written to stdin as one of UCL config, JSON, or YAML and write it to
stdout as pretty-printed JSON:

local ucl = require('ucl')
local parser = ucl.parser()
parser:parse_string(io.read('*a'))
local obj = parser:get_object()
print(ucl.to_format(obj, 'json'))

Reviewed by: kevans, pstef
Approved by: mmacy (mentor)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25009
Makefile.inc1
libexec/flua/Makefile
libexec/flua/linit_flua.c
tools/build/Makefile