]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
flua: add ucl library
authorRyan Moeller <freqlabs@FreeBSD.org>
Mon, 22 Jun 2020 03:14:43 +0000 (03:14 +0000)
committerRyan Moeller <freqlabs@FreeBSD.org>
Mon, 22 Jun 2020 03:14:43 +0000 (03:14 +0000)
commit94a82666846d62cdff7d78f78d428df35412e50d
tree4db5a48a903d7887c246376e60c1836b266a4a56
parentf82d3b398842c43556cc1ea854e13d8de80c5d64
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