From owner-svn-src-vendor@freebsd.org Mon Oct 26 14:50:37 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E841A1C99A; Mon, 26 Oct 2015 14:50:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8E11383; Mon, 26 Oct 2015 14:50:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QEoavc099834; Mon, 26 Oct 2015 14:50:36 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QEoaka099833; Mon, 26 Oct 2015 14:50:36 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201510261450.t9QEoaka099833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 26 Oct 2015 14:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2015 14:50:37 -0000 Author: royger Date: Mon Oct 26 14:50:35 2015 New Revision: 290005 URL: https://svnweb.freebsd.org/changeset/base/290005 Log: x86/dma_bounce: revert r289834 and r289836 The new load_ma implementation can cause dereferences when used with certain drivers, back it out until the reason is found: Fatal trap 12: page fault while in kernel mode cpuid = 11; apic id = 03 fault virtual address = 0x30 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff808a2d22 stack pointer = 0x28:0xfffffe07cc737710 frame pointer = 0x28:0xfffffe07cc737790 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 13 (g_down) trap number = 12 panic: page fault cpuid = 11 KDB: stack backtrace: #0 0xffffffff80641647 at kdb_backtrace+0x67 #1 0xffffffff80606762 at vpanic+0x182 #2 0xffffffff806067e3 at panic+0x43 #3 0xffffffff8084eef1 at trap_fatal+0x351 #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 #5 0xffffffff8084e82f at trap+0x4bf #6 0xffffffff80830d57 at calltrap+0x8 #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 #9 0xffffffff8042dcad at ata_dmaload+0x11d #10 0xffffffff8042df7e at ata_begin_transaction+0x7e #11 0xffffffff8042c18e at ataaction+0x9ce #12 0xffffffff802a220f at xpt_run_devq+0x5bf #13 0xffffffff802a17ad at xpt_action_default+0x94d #14 0xffffffff802c0024 at adastart+0x8b4 #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 #16 0xffffffff802c0735 at adastrategy+0xf5 #17 0xffffffff80554206 at g_disk_start+0x426 Uptime: 2m29s Modified: Directory Properties: vendor/ (props changed) Changes in other areas also in this revision: Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/x86/x86/busdma_bounce.c Directory Properties: svnadmin/tools/checkacl/Makefile (props changed) svnadmin/tools/checkacl/checkacl.c (props changed) From owner-svn-src-vendor@freebsd.org Mon Oct 26 15:38:59 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94D5AA1D92D; Mon, 26 Oct 2015 15:38:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52D0A1950; Mon, 26 Oct 2015 15:38:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFcwHg014562; Mon, 26 Oct 2015 15:38:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFcwog014561; Mon, 26 Oct 2015 15:38:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201510261538.t9QFcwog014561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 26 Oct 2015 15:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290010 - vendor/ntp X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2015 15:38:59 -0000 Author: glebius Date: Mon Oct 26 15:38:58 2015 New Revision: 290010 URL: https://svnweb.freebsd.org/changeset/base/290010 Log: Document NTP import procedure, using experience from the last one. Sponsored by: Nginx, Inc. Deleted: vendor/ntp/FREEBSD-Xlist Modified: vendor/ntp/FREEBSD-upgrade Modified: vendor/ntp/FREEBSD-upgrade ============================================================================== --- vendor/ntp/FREEBSD-upgrade Mon Oct 26 15:20:45 2015 (r290009) +++ vendor/ntp/FREEBSD-upgrade Mon Oct 26 15:38:58 2015 (r290010) @@ -1,55 +1,128 @@ -# ex:ts=8 -# # $FreeBSD$ -NTP 4.2.8 - originals can be found on http://www.ntp.org/downloads.html +Last import was NTP 4.2.8p4. Below are steps taken for the import, +to ease the next one. And don't forget to update this file afterwards. Import ------ -For the import of NTP the following files were removed: +# tar xzf ntp-4.2.8p4.tar.gz +# mv ntp-4.2.8p4 4.2.8p4 - ports/* NT files - html/pic/* GIF files - html/build/hints/solaris.xtra.4095849 Trigger merge conflict script +Edit your ~/.subversion/config to avoid adding fbsd:* properties to +vendor files. The golden rules for properties are: +- All text files should have svn:eol-style set to native. +- All binary files should have svn:mime-type set to application/octet-stream, + unless there is a more appropriate media type. +- There should be no other properties on any file. -The stripped down version was created using FREEBSD-Xlist during -extraction: +Note that some files (documentation in Japanese) conflict with FreeBSD +repo commit hooks, and for now there is no better choice than give them +application/octet-stream mime-type. - tar -X FREEBSD-Xlist -xvzf ntp-4.2.8.tar.gz - mv ntp-4.2.8 4.2.8 +# svn add 4.2.8p4 +# svn commit -Imported by: - See procedure on -https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html +Now we got vanilla 4.2.8p4 in the tree, and we need to update dist. + +# cd 4.2.8p4/ +# rsync --archive --delete . ../dist/ +# cd ../dist/ +# svn rm $(svn stat | awk '$1 == "!" { print $2 }') +# svn add --no-auto-props $(svn stat | awk '$1 == "?" { print $2 }') + +The dist is prepared for commit. Check that there is no difference +to vanilla version and commit: + +# diff -ru ../4.2.8p4 . +# svn commit + +Upgrade +------- + +Record the revision from the last commit. We are going to merge +it to head/. + +# cd ${head}/contrib/ntp +# svn merge -c rXXXXXX svn+ssh://repo.freebsd.org/base/vendor/ntp/dist + +Here is our exclusion list for NTP: + +# svn rm ports +# svn rm ntpd/ntp_parser.y + +The ports dir is just not needed. The ntp_parser.y is harmful. Our build +system will regenerate ntp_parser.c from it, which will produce bad ntpd. +We should consider not importing the tests dir with next NTP upgrade, it +is getting quite huge. + +Now it is time to compare vendor/ntp/dist and head/contrib/ntp with +help of diff -ru. This is list of differencies, that should be there: + +r276071 + ntpd/ntp_crypto.c + +r243933 + libntp/Makefile.in + ntp/libparse/Makefile.in + ntpd/Makefile.in + +Only in vendor/ntp: ports +Only in vendor/ntp: ntpd/ntp_parse.y + +If new import brings in new legitimate differencies, document them +right here. Don't commit contrib/ntp yet. Updating usr.sbin/ntp --------------------- +The config.h wasn't regenerated for a long time. It could be a good +idea to do it with next upgrade. According to older documentation, +last time it was regenerated with this command line: + ./configure --disable-all-clocks --enable-NMEA --enable-ONCORE --enable-RAWDCF --with-crypto --disable-debugging --enable-LOCAL-CLOCK --with-sntp --with-arlib --prefix=/usr -config.h was generated by running configure and excluding almost all clock -drivers (what is included is DCF77 -- what I use --, NMEA, Motorola OnCORE -and local clocks). - +Quoting roberto@: "config.h was generated by running configure and +excluding almost all clock drivers (what is included is DCF77 -- what +I use --, NMEA, Motorola OnCORE and local clocks). The file is then edited to edit the value of "NO_PARENB_IGNPAR" because we need to set no parity on the serial port (needed for DCF77). All clock drivers are then disabled (some of them are included by default by ntpd). Note that there are two #ifdef to support other architectures (WRT to long size and endianness). They'll need to be redone for each upgrade to the -vendor branch to keep config.h in sync. - -ntpd/ntp_control.c is now the only file that is different from the vendor -branch for unsigned char/int fixes and removal of a DoS. +vendor branch to keep config.h in sync." -Documentation in /usr/share/doc/ntp is generated from the HTML files with -lynx (without the GIF files of course). +Updating usr.sbin/ntp/doc +------------------------- +Paste this script into your shell. This will update manual pages. + +while read dst src; do + sed -E -e '5a\ +.\\" $FreeBSD$\ +.\\"' \ + -e 's/1ntp(d|dc|q|date)mdoc/8/' \ + -e 's/1sntpmdoc/8/' \ + -e 's/5mdoc/5/' \ + -e 's/1ntp-keygenmdoc/8/' \ + ../../../contrib/ntp/${src} > ${dst} +done < Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5324A1DDEB; Mon, 26 Oct 2015 15:40:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E3F51B58; Mon, 26 Oct 2015 15:40:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFelM1014674; Mon, 26 Oct 2015 15:40:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFelC2014673; Mon, 26 Oct 2015 15:40:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201510261540.t9QFelC2014673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 26 Oct 2015 15:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290011 - in vendor/ntp/dist: html/drivers include libjsmn/example libntp ntpd ports/winnt/include ports/winnt/include/arpa ports/winnt/include/sys ports/winnt/instsrv ports/winnt/libnt... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2015 15:40:48 -0000 Author: glebius Date: Mon Oct 26 15:40:47 2015 New Revision: 290011 URL: https://svnweb.freebsd.org/changeset/base/290011 Log: Remove svn:keywords from contributed files. Modified: Directory Properties: vendor/ntp/dist/html/drivers/driver40-ja.html (props changed) vendor/ntp/dist/include/refidsmear.h (props changed) vendor/ntp/dist/libjsmn/example/jsondump.c (props changed) vendor/ntp/dist/libjsmn/example/simple.c (props changed) vendor/ntp/dist/libntp/refidsmear.c (props changed) vendor/ntp/dist/ntpd/rc_cmdlength.c (props changed) vendor/ntp/dist/ports/winnt/include/arpa/inet.h (props changed) vendor/ntp/dist/ports/winnt/include/clockstuff.h (props changed) vendor/ntp/dist/ports/winnt/include/config.h (props changed) vendor/ntp/dist/ports/winnt/include/gaa_compat.h (props changed) vendor/ntp/dist/ports/winnt/include/hopf_PCI_io.h (props changed) vendor/ntp/dist/ports/winnt/include/netdb.h (props changed) vendor/ntp/dist/ports/winnt/include/ntp_iocompletionport.h (props changed) vendor/ntp/dist/ports/winnt/include/ntp_timer.h (props changed) vendor/ntp/dist/ports/winnt/include/ntservice.h (props changed) vendor/ntp/dist/ports/winnt/include/stdint.h (props changed) vendor/ntp/dist/ports/winnt/include/stdnoreturn.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/ioctl.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/param.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/resource.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/signal.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/time.h (props changed) vendor/ntp/dist/ports/winnt/include/sys/wait.h (props changed) vendor/ntp/dist/ports/winnt/include/syslog.h (props changed) vendor/ntp/dist/ports/winnt/include/termios.h (props changed) vendor/ntp/dist/ports/winnt/include/timepps.h (props changed) vendor/ntp/dist/ports/winnt/include/unistd.h (props changed) vendor/ntp/dist/ports/winnt/include/win32_io.h (props changed) vendor/ntp/dist/ports/winnt/instsrv/instsrv.c (props changed) vendor/ntp/dist/ports/winnt/libntp/SetSystemTime.c (props changed) vendor/ntp/dist/ports/winnt/libntp/arc4wrap.c (props changed) vendor/ntp/dist/ports/winnt/libntp/getclock.c (props changed) vendor/ntp/dist/ports/winnt/libntp/messages.h (props changed) vendor/ntp/dist/ports/winnt/libntp/randfile.c (props changed) vendor/ntp/dist/ports/winnt/libntp/setpriority.c (props changed) vendor/ntp/dist/ports/winnt/libntp/syslog.c (props changed) vendor/ntp/dist/ports/winnt/libntp/termios.c (props changed) vendor/ntp/dist/ports/winnt/libntp/util_clockstuff.c (props changed) vendor/ntp/dist/ports/winnt/libntp/win32_io.c (props changed) vendor/ntp/dist/ports/winnt/ntpd/hopf_PCI_io.c (props changed) vendor/ntp/dist/ports/winnt/ntpd/nt_clockstuff.c (props changed) vendor/ntp/dist/ports/winnt/ntpd/ntp_iocompletionport.c (props changed) vendor/ntp/dist/ports/winnt/ntpd/ntservice.c (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/sys/time.h (props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/timepps.h (props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c (props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h (props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/sys/time.h (props changed) vendor/ntp/dist/scripts/update-leap/Makefile.am (props changed) vendor/ntp/dist/scripts/update-leap/Makefile.in (props changed) vendor/ntp/dist/scripts/update-leap/update-leap.html (props changed) vendor/ntp/dist/scripts/update-leap/update-leap.in (props changed) vendor/ntp/dist/scripts/update-leap/update-leap.man.in (props changed) vendor/ntp/dist/scripts/update-leap/update-leap.mdoc.in (props changed) vendor/ntp/dist/scripts/update-leap/update-leap.sh (props changed) vendor/ntp/dist/sntp/ag-tpl/Mdoc.pm (props changed) vendor/ntp/dist/sntp/libpkgver/colcomp.c (props changed) vendor/ntp/dist/sntp/libpkgver/pkgver.h (props changed) vendor/ntp/dist/sntp/tests/crypto.c (props changed) vendor/ntp/dist/sntp/tests/fileHandlingTest.h.in (props changed) vendor/ntp/dist/sntp/tests/keyFile.c (props changed) vendor/ntp/dist/sntp/tests/kodDatabase.c (props changed) vendor/ntp/dist/sntp/tests/kodFile.c (props changed) vendor/ntp/dist/sntp/tests/networking.c (props changed) vendor/ntp/dist/sntp/tests/packetHandling.c (props changed) vendor/ntp/dist/sntp/tests/packetProcessing.c (props changed) vendor/ntp/dist/sntp/tests/run-crypto.c (props changed) vendor/ntp/dist/sntp/tests/run-keyFile.c (props changed) vendor/ntp/dist/sntp/tests/run-kodDatabase.c (props changed) vendor/ntp/dist/sntp/tests/run-kodFile.c (props changed) vendor/ntp/dist/sntp/tests/run-networking.c (props changed) vendor/ntp/dist/sntp/tests/run-packetHandling.c (props changed) vendor/ntp/dist/sntp/tests/run-packetProcessing.c (props changed) vendor/ntp/dist/sntp/tests/run-utilities.c (props changed) vendor/ntp/dist/sntp/tests/utilities.c (props changed) vendor/ntp/dist/sntp/unity/Makefile.am (props changed) vendor/ntp/dist/sntp/unity/Makefile.in (props changed) vendor/ntp/dist/sntp/unity/auto/colour_prompt.rb (props changed) vendor/ntp/dist/sntp/unity/auto/colour_reporter.rb (props changed) vendor/ntp/dist/sntp/unity/auto/generate_module.rb (props changed) vendor/ntp/dist/sntp/unity/auto/generate_test_runner.rb (props changed) vendor/ntp/dist/sntp/unity/auto/runner_maybe.c (props changed) vendor/ntp/dist/sntp/unity/auto/test_file_filter.rb (props changed) vendor/ntp/dist/sntp/unity/auto/unity_test_summary.rb (props changed) vendor/ntp/dist/sntp/unity/unity.c (props changed) vendor/ntp/dist/sntp/unity/unity.h (props changed) vendor/ntp/dist/sntp/unity/unity_fixture.c (props changed) vendor/ntp/dist/sntp/unity/unity_fixture.h (props changed) vendor/ntp/dist/sntp/unity/unity_fixture_internals.h (props changed) vendor/ntp/dist/sntp/unity/unity_fixture_malloc_overrides.h (props changed) vendor/ntp/dist/sntp/unity/unity_internals.h (props changed) vendor/ntp/dist/sntp/version.c (props changed) vendor/ntp/dist/tests/bug-2803/Makefile.am (props changed) vendor/ntp/dist/tests/bug-2803/Makefile.in (props changed) vendor/ntp/dist/tests/bug-2803/bug-2803.c (props changed) vendor/ntp/dist/tests/bug-2803/run-bug-2803.c (props changed) vendor/ntp/dist/tests/libntp/a_md5encrypt.c (props changed) vendor/ntp/dist/tests/libntp/atoint.c (props changed) vendor/ntp/dist/tests/libntp/atouint.c (props changed) vendor/ntp/dist/tests/libntp/authkeys.c (props changed) vendor/ntp/dist/tests/libntp/buftvtots.c (props changed) vendor/ntp/dist/tests/libntp/calendar.c (props changed) vendor/ntp/dist/tests/libntp/caljulian.c (props changed) vendor/ntp/dist/tests/libntp/caltontp.c (props changed) vendor/ntp/dist/tests/libntp/calyearstart.c (props changed) vendor/ntp/dist/tests/libntp/clocktime.c (props changed) vendor/ntp/dist/tests/libntp/decodenetnum.c (props changed) vendor/ntp/dist/tests/libntp/hextoint.c (props changed) vendor/ntp/dist/tests/libntp/hextolfp.c (props changed) vendor/ntp/dist/tests/libntp/humandate.c (props changed) vendor/ntp/dist/tests/libntp/lfpfunc.c (props changed) vendor/ntp/dist/tests/libntp/lfptostr.c (props changed) vendor/ntp/dist/tests/libntp/modetoa.c (props changed) vendor/ntp/dist/tests/libntp/msyslog.c (props changed) vendor/ntp/dist/tests/libntp/netof.c (props changed) vendor/ntp/dist/tests/libntp/numtoa.c (props changed) vendor/ntp/dist/tests/libntp/numtohost.c (props changed) vendor/ntp/dist/tests/libntp/octtoint.c (props changed) vendor/ntp/dist/tests/libntp/prettydate.c (props changed) vendor/ntp/dist/tests/libntp/recvbuff.c (props changed) vendor/ntp/dist/tests/libntp/refidsmear.c (props changed) vendor/ntp/dist/tests/libntp/refnumtoa.c (props changed) vendor/ntp/dist/tests/libntp/run-a_md5encrypt.c (props changed) vendor/ntp/dist/tests/libntp/run-atoint.c (props changed) vendor/ntp/dist/tests/libntp/run-atouint.c (props changed) vendor/ntp/dist/tests/libntp/run-authkeys.c (props changed) vendor/ntp/dist/tests/libntp/run-buftvtots.c (props changed) vendor/ntp/dist/tests/libntp/run-calendar.c (props changed) vendor/ntp/dist/tests/libntp/run-caljulian.c (props changed) vendor/ntp/dist/tests/libntp/run-caltontp.c (props changed) vendor/ntp/dist/tests/libntp/run-calyearstart.c (props changed) vendor/ntp/dist/tests/libntp/run-clocktime.c (props changed) vendor/ntp/dist/tests/libntp/run-decodenetnum.c (props changed) vendor/ntp/dist/tests/libntp/run-hextoint.c (props changed) vendor/ntp/dist/tests/libntp/run-hextolfp.c (props changed) vendor/ntp/dist/tests/libntp/run-humandate.c (props changed) vendor/ntp/dist/tests/libntp/run-lfpfunc.c (props changed) vendor/ntp/dist/tests/libntp/run-lfptostr.c (props changed) vendor/ntp/dist/tests/libntp/run-modetoa.c (props changed) vendor/ntp/dist/tests/libntp/run-msyslog.c (props changed) vendor/ntp/dist/tests/libntp/run-netof.c (props changed) vendor/ntp/dist/tests/libntp/run-numtoa.c (props changed) vendor/ntp/dist/tests/libntp/run-numtohost.c (props changed) vendor/ntp/dist/tests/libntp/run-octtoint.c (props changed) vendor/ntp/dist/tests/libntp/run-prettydate.c (props changed) vendor/ntp/dist/tests/libntp/run-recvbuff.c (props changed) vendor/ntp/dist/tests/libntp/run-refidsmear.c (props changed) vendor/ntp/dist/tests/libntp/run-refnumtoa.c (props changed) vendor/ntp/dist/tests/libntp/run-sfptostr.c (props changed) vendor/ntp/dist/tests/libntp/run-socktoa.c (props changed) vendor/ntp/dist/tests/libntp/run-ssl_init.c (props changed) vendor/ntp/dist/tests/libntp/run-statestr.c (props changed) vendor/ntp/dist/tests/libntp/run-strtolfp.c (props changed) vendor/ntp/dist/tests/libntp/run-timespecops.c (props changed) vendor/ntp/dist/tests/libntp/run-timevalops.c (props changed) vendor/ntp/dist/tests/libntp/run-tstotv.c (props changed) vendor/ntp/dist/tests/libntp/run-tvtots.c (props changed) vendor/ntp/dist/tests/libntp/run-uglydate.c (props changed) vendor/ntp/dist/tests/libntp/run-vi64ops.c (props changed) vendor/ntp/dist/tests/libntp/run-ymd2yd.c (props changed) vendor/ntp/dist/tests/libntp/sfptostr.c (props changed) vendor/ntp/dist/tests/libntp/socktoa.c (props changed) vendor/ntp/dist/tests/libntp/ssl_init.c (props changed) vendor/ntp/dist/tests/libntp/statestr.c (props changed) vendor/ntp/dist/tests/libntp/strtolfp.c (props changed) vendor/ntp/dist/tests/libntp/test-libntp.c (props changed) vendor/ntp/dist/tests/libntp/test-libntp.h (props changed) vendor/ntp/dist/tests/libntp/timespecops.c (props changed) vendor/ntp/dist/tests/libntp/timevalops.c (props changed) vendor/ntp/dist/tests/libntp/tstotv.c (props changed) vendor/ntp/dist/tests/libntp/tvtots.c (props changed) vendor/ntp/dist/tests/libntp/uglydate.c (props changed) vendor/ntp/dist/tests/libntp/vi64ops.c (props changed) vendor/ntp/dist/tests/libntp/ymd2yd.c (props changed) vendor/ntp/dist/tests/sandbox/Makefile.am (props changed) vendor/ntp/dist/tests/sandbox/Makefile.in (props changed) vendor/ntp/dist/tests/sandbox/bug-2803.c (props changed) vendor/ntp/dist/tests/sandbox/modetoa.c (props changed) vendor/ntp/dist/tests/sandbox/run-modetoa.c (props changed) vendor/ntp/dist/tests/sandbox/run-uglydate.c (props changed) vendor/ntp/dist/tests/sandbox/run-ut-2803.c (props changed) vendor/ntp/dist/tests/sandbox/smeartest.c (props changed) vendor/ntp/dist/tests/sandbox/uglydate.c (props changed) vendor/ntp/dist/tests/sandbox/ut-2803.c (props changed) vendor/ntp/dist/tests/sec-2853/Makefile.am (props changed) vendor/ntp/dist/tests/sec-2853/Makefile.in (props changed) vendor/ntp/dist/tests/sec-2853/run-sec-2853.c (props changed) vendor/ntp/dist/tests/sec-2853/sec-2853.c (props changed) From owner-svn-src-vendor@freebsd.org Tue Oct 27 14:40:23 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5497FA1F42F; Tue, 27 Oct 2015 14:40:23 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF6B813AA; Tue, 27 Oct 2015 14:40:22 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t9REeBmT037491; Tue, 27 Oct 2015 17:40:11 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 27 Oct 2015 17:40:11 +0300 (MSK) From: Dmitry Morozovsky To: Gleb Smirnoff cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r290010 - vendor/ntp In-Reply-To: <201510261538.t9QFcwog014561@repo.freebsd.org> Message-ID: References: <201510261538.t9QFcwog014561@repo.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 27 Oct 2015 17:40:11 +0300 (MSK) X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 14:40:23 -0000 On Mon, 26 Oct 2015, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Oct 26 15:38:58 2015 > New Revision: 290010 > URL: https://svnweb.freebsd.org/changeset/base/290010 > > Log: > Document NTP import procedure, using experience from the last one. BTW: marck@freefall:~> ntpq -c pe remote refid st t when poll reach delay offset jitter ============================================================================== +ntp0.ysv.freebs 95.87.161.134 4 u 296 1024 377 0.422 -0.620 0.598 *ntp1.ysv.freebs 39.86.174.157 3 u 443 1024 377 0.405 0.904 0.239 +ntp2.ysv.freebs 65.182.224.39 3 u 617 1024 377 0.434 1.225 1.014 marck@freefall:~> ntpdc -c pe localhost: timed out, nothing received ***Request timed out I did not bisect to find when this brokes, but it is for quite some time. [snip] -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-vendor@freebsd.org Tue Oct 27 15:46:21 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C09D7A1F79F for ; Tue, 27 Oct 2015 15:46:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C47D1132 for ; Tue, 27 Oct 2015 15:46:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 27 Oct 2015 15:46:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t9RFkDFu030082; Tue, 27 Oct 2015 09:46:13 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1445960773.91534.89.camel@freebsd.org> Subject: Re: svn commit: r290010 - vendor/ntp From: Ian Lepore To: Dmitry Morozovsky , Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Date: Tue, 27 Oct 2015 09:46:13 -0600 In-Reply-To: References: <201510261538.t9QFcwog014561@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 15:46:21 -0000 On Tue, 2015-10-27 at 17:40 +0300, Dmitry Morozovsky wrote: > On Mon, 26 Oct 2015, Gleb Smirnoff wrote: > > > Author: glebius > > Date: Mon Oct 26 15:38:58 2015 > > New Revision: 290010 > > URL: https://svnweb.freebsd.org/changeset/base/290010 > > > > Log: > > Document NTP import procedure, using experience from the last > one. > > BTW: > > marck@freefall:~> ntpq -c pe > remote refid st t when poll reach delay > offset jitter > ===================================================================== > ========= > +ntp0.ysv.freebs 95.87.161.134 4 u 296 1024 377 0.422 > -0.620 0.598 > *ntp1.ysv.freebs 39.86.174.157 3 u 443 1024 377 0.405 > 0.904 0.239 > +ntp2.ysv.freebs 65.182.224.39 3 u 617 1024 377 0.434 > 1.225 1.014 > marck@freefall:~> ntpdc -c pe > localhost: timed out, nothing received > ***Request timed out > > I did not bisect to find when this brokes, but it is for quite some > time. > > [snip] > > That's not broken, it's a "feature" of the newer ntpd. The ntpd folks decided to stop supporting the old mode-7 control packets because they say the mode-6 packets used by ntpq can do everything necessary. That means we all have to learn some new commands within ntpq to get the info and controls we're used to with ntpdc. There are things I'm used to doing with ntpdc that I haven't figured out how to do with ntpq yet, foremost being 'addserver'. -- Ian From owner-svn-src-vendor@freebsd.org Tue Oct 27 16:45:16 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B70FA1F4D2; Tue, 27 Oct 2015 16:45:16 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EDC91BE7; Tue, 27 Oct 2015 16:45:15 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t9RGjBo4041408; Tue, 27 Oct 2015 19:45:11 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 27 Oct 2015 19:45:11 +0300 (MSK) From: Dmitry Morozovsky To: Ian Lepore cc: Gleb Smirnoff , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r290010 - vendor/ntp In-Reply-To: <1445960773.91534.89.camel@freebsd.org> Message-ID: References: <201510261538.t9QFcwog014561@repo.freebsd.org> <1445960773.91534.89.camel@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 27 Oct 2015 19:45:11 +0300 (MSK) X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 16:45:16 -0000 On Tue, 27 Oct 2015, Ian Lepore wrote: > > > Log: > > > Document NTP import procedure, using experience from the last > > one. > > > > BTW: > > > > marck@freefall:~> ntpq -c pe > > remote refid st t when poll reach delay > > offset jitter > > ===================================================================== > > ========= > > +ntp0.ysv.freebs 95.87.161.134 4 u 296 1024 377 0.422 > > -0.620 0.598 > > *ntp1.ysv.freebs 39.86.174.157 3 u 443 1024 377 0.405 > > 0.904 0.239 > > +ntp2.ysv.freebs 65.182.224.39 3 u 617 1024 377 0.434 > > 1.225 1.014 > > marck@freefall:~> ntpdc -c pe > > localhost: timed out, nothing received > > ***Request timed out > > > > I did not bisect to find when this brokes, but it is for quite some > > time. > > > > [snip] > > > > > > That's not broken, it's a "feature" of the newer ntpd. The ntpd folks > decided to stop supporting the old mode-7 control packets because they > say the mode-6 packets used by ntpq can do everything necessary. That > means we all have to learn some new commands within ntpq to get the > info and controls we're used to with ntpdc. There are things I'm used > to doing with ntpdc that I haven't figured out how to do with ntpq yet, > foremost being 'addserver'. well, why not to exclude ntpdc from building then? A least for 11.* -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-vendor@freebsd.org Tue Oct 27 17:04:07 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06FAFA1F9AB for ; Tue, 27 Oct 2015 17:04:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB5F51CAF for ; Tue, 27 Oct 2015 17:04:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 27 Oct 2015 17:03:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t9RH3war030282; Tue, 27 Oct 2015 11:03:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1445965438.91534.97.camel@freebsd.org> Subject: Re: svn commit: r290010 - vendor/ntp From: Ian Lepore To: Dmitry Morozovsky Cc: Gleb Smirnoff , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org Date: Tue, 27 Oct 2015 11:03:58 -0600 In-Reply-To: References: <201510261538.t9QFcwog014561@repo.freebsd.org> <1445960773.91534.89.camel@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 17:04:07 -0000 On Tue, 2015-10-27 at 19:45 +0300, Dmitry Morozovsky wrote: > On Tue, 27 Oct 2015, Ian Lepore wrote: > > > > > Log: > > > > Document NTP import procedure, using experience from the last > > > one. > > > > > > BTW: > > > > > > marck@freefall:~> ntpq -c pe > > > remote refid st t when poll reach delay > > > offset jitter > > > > ===================================================================== > > > ========= > > > +ntp0.ysv.freebs 95.87.161.134 4 u 296 1024 377 0.422 > > > -0.620 0.598 > > > *ntp1.ysv.freebs 39.86.174.157 3 u 443 1024 377 0.405 > > > 0.904 0.239 > > > +ntp2.ysv.freebs 65.182.224.39 3 u 617 1024 377 0.434 > > > 1.225 1.014 > > > marck@freefall:~> ntpdc -c pe > > > localhost: timed out, nothing received > > > ***Request timed out > > > > > > I did not bisect to find when this brokes, but it is for quite > some > > > time. > > > > > > [snip] > > > > > > > > > > That's not broken, it's a "feature" of the newer ntpd. The ntpd > folks > > decided to stop supporting the old mode-7 control packets because > they > > say the mode-6 packets used by ntpq can do everything necessary. > That > > means we all have to learn some new commands within ntpq to get the > > info and controls we're used to with ntpdc. There are things I'm > used > > to doing with ntpdc that I haven't figured out how to do with ntpq > yet, > > foremost being 'addserver'. > > well, why not to exclude ntpdc from building then? A least for 11.* > I think it's because you may be running on 10-stable or 11 but still need to administer downrev ntpd running on 8.2 or whatever, so you would still need ntpdc to talk to those. Note that this is speculation... I don't know for sure that they had to add anything to ntpd itself to help ntpq take over all the functionality of ntpdc. -- Ian From owner-svn-src-vendor@freebsd.org Tue Oct 27 21:19:13 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF7EA1CA9E; Tue, 27 Oct 2015 21:19:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A57A1C2A; Tue, 27 Oct 2015 21:19:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLJC1Z067296; Tue, 27 Oct 2015 21:19:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLJBAk067284; Tue, 27 Oct 2015 21:19:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510272119.t9RLJBAk067284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 27 Oct 2015 21:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290067 - in vendor/libucl/dist: . cmake doc examples include klib lua m4 python python/src src tests tests/basic utils X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 21:19:13 -0000 Author: bapt Date: Tue Oct 27 21:19:11 2015 New Revision: 290067 URL: https://svnweb.freebsd.org/changeset/base/290067 Log: Update libucl to git snapshot 20151027 (77d9d33) Added: vendor/libucl/dist/CMakeLists.txt (contents, props changed) vendor/libucl/dist/examples/ vendor/libucl/dist/examples/ucl_cpp.cc (contents, props changed) vendor/libucl/dist/include/ucl++.h (contents, props changed) vendor/libucl/dist/m4/ vendor/libucl/dist/m4/ax_lua.m4 vendor/libucl/dist/python/ vendor/libucl/dist/python/setup.py (contents, props changed) vendor/libucl/dist/python/src/ vendor/libucl/dist/python/src/uclmodule.c (contents, props changed) vendor/libucl/dist/python/test.sh (contents, props changed) vendor/libucl/dist/python/test_uclmodule.py (contents, props changed) vendor/libucl/dist/src/ucl_msgpack.c (contents, props changed) vendor/libucl/dist/src/ucl_sexp.c (contents, props changed) vendor/libucl/dist/tests/basic/15.in (contents, props changed) vendor/libucl/dist/tests/basic/15.inc (contents, props changed) vendor/libucl/dist/tests/basic/15.res vendor/libucl/dist/tests/basic/16.in (contents, props changed) vendor/libucl/dist/tests/basic/16.inc (contents, props changed) vendor/libucl/dist/tests/basic/16.res vendor/libucl/dist/tests/basic/17.in (contents, props changed) vendor/libucl/dist/tests/basic/17.res vendor/libucl/dist/tests/basic/18.in (contents, props changed) vendor/libucl/dist/tests/basic/18.res vendor/libucl/dist/tests/basic/19-append.inc (contents, props changed) vendor/libucl/dist/tests/basic/19-merge.inc (contents, props changed) vendor/libucl/dist/tests/basic/19-rewrite.inc (contents, props changed) vendor/libucl/dist/tests/basic/19.in (contents, props changed) vendor/libucl/dist/tests/basic/19.res vendor/libucl/dist/tests/basic/20.in (contents, props changed) vendor/libucl/dist/tests/basic/20.res vendor/libucl/dist/tests/basic/21.in (contents, props changed) vendor/libucl/dist/tests/basic/21.res vendor/libucl/dist/tests/basic/22.in (contents, props changed) vendor/libucl/dist/tests/basic/22.res vendor/libucl/dist/tests/msgpack.test (contents, props changed) vendor/libucl/dist/tests/test_msgpack.c (contents, props changed) vendor/libucl/dist/utils/ucl-tool.c (contents, props changed) Deleted: vendor/libucl/dist/cmake/ Modified: vendor/libucl/dist/ChangeLog.md vendor/libucl/dist/README.md vendor/libucl/dist/configure.ac vendor/libucl/dist/doc/Makefile.am vendor/libucl/dist/doc/lua_api.md vendor/libucl/dist/include/ucl.h vendor/libucl/dist/klib/kvec.h vendor/libucl/dist/lua/lua_ucl.c vendor/libucl/dist/src/Makefile.am vendor/libucl/dist/src/tree.h vendor/libucl/dist/src/ucl_chartable.h vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/dist/src/ucl_emitter_utils.c vendor/libucl/dist/src/ucl_hash.c vendor/libucl/dist/src/ucl_internal.h vendor/libucl/dist/src/ucl_parser.c vendor/libucl/dist/src/ucl_util.c vendor/libucl/dist/src/xxhash.c vendor/libucl/dist/src/xxhash.h vendor/libucl/dist/tests/Makefile.am vendor/libucl/dist/tests/basic/13.in vendor/libucl/dist/tests/test_basic.c vendor/libucl/dist/tests/test_schema.c vendor/libucl/dist/utils/Makefile.am vendor/libucl/dist/utils/chargen.c vendor/libucl/dist/utils/objdump.c Added: vendor/libucl/dist/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/CMakeLists.txt Tue Oct 27 21:19:11 2015 (r290067) @@ -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") Modified: vendor/libucl/dist/ChangeLog.md ============================================================================== --- vendor/libucl/dist/ChangeLog.md Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/ChangeLog.md Tue Oct 27 21:19:11 2015 (r290067) @@ -32,3 +32,8 @@ ### 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) Modified: vendor/libucl/dist/README.md ============================================================================== --- vendor/libucl/dist/README.md Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/README.md Tue Oct 27 21:19:11 2015 (r290067) @@ -21,7 +21,7 @@ - [Performance](#performance) - [Conclusion](#conclusion) -## Introduction +## Introduction This document describes the main features and principles of the configuration language called `UCL` - universal configuration language. @@ -262,7 +262,20 @@ parser is created but before any configu 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: ) - 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: Modified: vendor/libucl/dist/configure.ac ============================================================================== --- vendor/libucl/dist/configure.ac Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/configure.ac Tue Oct 27 21:19:11 2015 (r290067) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) m4_define([med_ver], [7]) -m4_define([min_ver], [2]) -m4_define([so_version], [5:0:1]) +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]) @@ -47,6 +47,7 @@ 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], Modified: vendor/libucl/dist/doc/Makefile.am ============================================================================== --- vendor/libucl/dist/doc/Makefile.am Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/doc/Makefile.am Tue Oct 27 21:19:11 2015 (r290067) @@ -4,6 +4,6 @@ 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/' \ + 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 \ No newline at end of file + @PANDOC@ -s -f markdown -t man -o libucl.3 Modified: vendor/libucl/dist/doc/lua_api.md ============================================================================== --- vendor/libucl/dist/doc/lua_api.md Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/doc/lua_api.md Tue Oct 27 21:19:11 2015 (r290067) @@ -16,7 +16,7 @@ if not res then else local obj = parser:get_object() local got = ucl.to_format(obj, 'json') -endif +end local table = { str = 'value', @@ -25,6 +25,7 @@ local table = { func = function () return 'huh' end +} print(ucl.to_format(table, 'ucl')) @@ -115,6 +116,7 @@ local table = { func = function () return 'huh' end +} print(ucl.to_format(table, 'ucl')) Added: vendor/libucl/dist/examples/ucl_cpp.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/examples/ucl_cpp.cc Tue Oct 27 21:19:11 2015 (r290067) @@ -0,0 +1,26 @@ +#include +#include +#include "ucl++.h" + +int main(int argc, char **argv) +{ + std::string input, err; + + input.assign((std::istreambuf_iterator(std::cin)), + std::istreambuf_iterator()); + + auto obj = ucl::Ucl::parse(input, err); + + if (obj) { + std::cout << obj.dump(UCL_EMIT_CONFIG) << std::endl; + + for (const auto &o : obj) { + std::cout << o.dump(UCL_EMIT_CONFIG) << std::endl; + } + } + else { + std::cerr << "Error: " << err << std::endl; + + return 1; + } +} Added: vendor/libucl/dist/include/ucl++.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/include/ucl++.h Tue Oct 27 21:19:11 2015 (r290067) @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2015, Vsevolod Stakhov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once +#include +#include +#include +#include + +#include "ucl.h" + +// C++11 API inspired by json11: https://github.com/dropbox/json11/ + +namespace ucl { + +struct ucl_map_construct_t { }; +constexpr ucl_map_construct_t ucl_map_construct = ucl_map_construct_t(); +struct ucl_array_construct_t { }; +constexpr ucl_array_construct_t ucl_array_construct = ucl_array_construct_t(); + +class Ucl final { +private: + + struct ucl_deleter { + void operator() (ucl_object_t *obj) { + ucl_object_unref (obj); + } + }; + + static int + append_char (unsigned char c, size_t nchars, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append (nchars, (char)c); + + return nchars; + } + static int + append_len (unsigned const char *str, size_t len, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append ((const char *)str, len); + + return len; + } + static int + append_int (int64_t elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + static int + append_double (double elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + + static struct ucl_emitter_functions default_emit_funcs() + { + struct ucl_emitter_functions func = { + Ucl::append_char, + Ucl::append_len, + Ucl::append_int, + Ucl::append_double, + nullptr, + nullptr + }; + + return func; + }; + + std::unique_ptr obj; + +public: + class const_iterator { + private: + struct ucl_iter_deleter { + void operator() (ucl_object_iter_t it) { + ucl_object_iterate_free (it); + } + }; + std::shared_ptr it; + std::unique_ptr cur; + public: + typedef std::forward_iterator_tag iterator_category; + + const_iterator(const Ucl &obj) { + it = std::shared_ptr(ucl_object_iterate_new (obj.obj.get()), + ucl_iter_deleter()); + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + } + + const_iterator() {} + const_iterator(const const_iterator &other) { + it = other.it; + } + ~const_iterator() {} + + const_iterator& operator=(const const_iterator &other) { + it = other.it; + return *this; + } + + bool operator==(const const_iterator &other) const + { + if (cur && other.cur) { + return cur->obj.get() == other.cur->obj.get(); + } + + return !cur && !other.cur; + } + + bool operator!=(const const_iterator &other) const + { + return !(*this == other); + } + + const_iterator& operator++() + { + if (it) { + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + } + + if (!*cur) { + it.reset (); + cur.reset (); + } + + return *this; + } + + const Ucl& operator*() const + { + return *cur; + } + const Ucl* operator->() const + { + return cur.get(); + } + }; + + // We grab ownership if get non-const ucl_object_t + Ucl(ucl_object_t *other) { + obj.reset (other); + } + + // Shared ownership + Ucl(const ucl_object_t *other) { + obj.reset (ucl_object_ref (other)); + } + + Ucl(const Ucl &other) { + obj.reset (ucl_object_ref (other.obj.get())); + } + + Ucl(Ucl &&other) { + obj.swap (other.obj); + } + + Ucl() noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(std::nullptr_t) noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(double value) { + obj.reset (ucl_object_typed_new (UCL_FLOAT)); + obj->value.dv = value; + } + Ucl(int64_t value) { + obj.reset (ucl_object_typed_new (UCL_INT)); + obj->value.iv = value; + } + Ucl(bool value) { + obj.reset (ucl_object_typed_new (UCL_BOOLEAN)); + obj->value.iv = static_cast(value); + } + Ucl(const std::string &value) { + obj.reset (ucl_object_fromstring_common (value.data (), value.size (), + UCL_STRING_RAW)); + } + Ucl(const char * value) { + obj.reset (ucl_object_fromstring_common (value, 0, UCL_STRING_RAW)); + } + + // Implicit constructor: anything with a to_json() function. + template + Ucl(const T & t) : Ucl(t.to_ucl()) {} + + // Implicit constructor: map-like objects (std::map, std::unordered_map, etc) + template ::value + && std::is_constructible::value, + int>::type = 0> + Ucl(const M & m) { + obj.reset (ucl_object_typed_new (UCL_OBJECT)); + auto cobj = obj.get (); + + for (const auto &e : m) { + ucl_object_insert_key (cobj, ucl_object_ref (e.second.obj.get()), + e.first.data (), e.first.size (), true); + } + } + + // Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc) + template ::value, + int>::type = 0> + Ucl(const V & v) { + obj.reset (ucl_object_typed_new (UCL_ARRAY)); + auto cobj = obj.get (); + + for (const auto &e : v) { + ucl_array_append (cobj, ucl_object_ref (e.obj.get())); + } + } + + ucl_type_t type () const { + if (obj) { + return ucl_object_type (obj.get ()); + } + return UCL_NULL; + } + + const std::string key () const { + std::string res; + + if (obj->key) { + res.assign (obj->key, obj->keylen); + } + + return res; + } + + double number_value () const + { + if (obj) { + return ucl_object_todouble (obj.get()); + } + + return 0.0; + } + + int64_t int_value () const + { + if (obj) { + return ucl_object_toint (obj.get()); + } + + return 0; + } + + bool bool_value () const + { + if (obj) { + return ucl_object_toboolean (obj.get()); + } + + return false; + } + + const std::string string_value () const + { + std::string res; + + if (obj) { + res.assign (ucl_object_tostring (obj.get())); + } + + return res; + } + + const Ucl operator[] (size_t i) const + { + if (type () == UCL_ARRAY) { + return Ucl (ucl_array_find_index (obj.get(), i)); + } + + return Ucl (nullptr); + } + + const Ucl operator[](const std::string &key) const + { + if (type () == UCL_OBJECT) { + return Ucl (ucl_object_find_keyl (obj.get(), + key.data (), key.size ())); + } + + return Ucl (nullptr); + } + // Serialize. + void dump (std::string &out, ucl_emitter_t type = UCL_EMIT_JSON) const + { + struct ucl_emitter_functions cbdata; + + cbdata = Ucl::default_emit_funcs(); + cbdata.ud = reinterpret_cast(&out); + + ucl_object_emit_full (obj.get(), type, &cbdata); + } + + std::string dump (ucl_emitter_t type = UCL_EMIT_JSON) const + { + std::string out; + + dump (out, type); + + return out; + } + + static Ucl parse (const std::string & in, std::string & err) + { + auto parser = ucl_parser_new (UCL_PARSER_DEFAULT); + + if (!ucl_parser_add_chunk (parser, (const unsigned char *)in.data (), + in.size ())) { + err.assign (ucl_parser_get_error (parser)); + ucl_parser_free (parser); + + return nullptr; + } + + auto obj = ucl_parser_get_object (parser); + ucl_parser_free (parser); + + // Obj will handle ownership + return Ucl (obj); + } + + static Ucl parse (const char * in, std::string & err) + { + if (in) { + return parse (std::string(in), err); + } else { + err = "null input"; + return nullptr; + } + } + + static Ucl parse (std::istream &ifs, std::string &err) + { + return Ucl::parse (std::string(std::istreambuf_iterator(ifs), + std::istreambuf_iterator()), err); + } + + bool operator== (const Ucl &rhs) const + { + return ucl_object_compare (obj.get(), rhs.obj.get ()) == 0; + } + bool operator< (const Ucl &rhs) const + { + return ucl_object_compare (obj.get(), rhs.obj.get ()) < 0; + } + bool operator!= (const Ucl &rhs) const { return !(*this == rhs); } + bool operator<= (const Ucl &rhs) const { return !(rhs < *this); } + bool operator> (const Ucl &rhs) const { return (rhs < *this); } + bool operator>= (const Ucl &rhs) const { return !(*this < rhs); } + + operator bool () const + { + if (!obj || type() == UCL_NULL) { + return false; + } + + if (type () == UCL_BOOLEAN) { + return bool_value (); + } + + return true; + } + + const_iterator begin() const + { + return const_iterator(*this); + } + const_iterator cbegin() const + { + return const_iterator(*this); + } + const_iterator end() const + { + return const_iterator(); + } + const_iterator cend() const + { + return const_iterator(); + } +}; + +}; Modified: vendor/libucl/dist/include/ucl.h ============================================================================== --- vendor/libucl/dist/include/ucl.h Tue Oct 27 21:17:37 2015 (r290066) +++ vendor/libucl/dist/include/ucl.h Tue Oct 27 21:19:11 2015 (r290067) @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, Vsevolod Stakhov +/* Copyright (c) 2013-2015, Vsevolod Stakhov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -135,7 +135,9 @@ typedef enum ucl_emitter { UCL_EMIT_JSON = 0, /**< Emit fine formatted JSON */ UCL_EMIT_JSON_COMPACT, /**< Emit compacted JSON */ UCL_EMIT_CONFIG, /**< Emit human readable config format */ - UCL_EMIT_YAML /**< Emit embedded YAML format */ + UCL_EMIT_YAML, /**< Emit embedded YAML format */ + UCL_EMIT_MSGPACK, /**< Emit msgpack output */ + UCL_EMIT_MAX /**< Unsupported emitter type */ } ucl_emitter_t; /** @@ -145,6 +147,7 @@ typedef enum ucl_emitter { * UCL still has to perform copying implicitly. */ typedef enum ucl_parser_flags { + UCL_PARSER_DEFAULT = 0x0, /**< No special flags */ UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */ UCL_PARSER_NO_TIME = 0x4, /**< Do not parse time and treat time values as strings */ @@ -155,6 +158,7 @@ typedef enum ucl_parser_flags { * String conversion flags, that are used in #ucl_object_fromstring_common function. */ typedef enum ucl_string_flags { + UCL_STRING_RAW = 0x0, /**< Treat string as is */ UCL_STRING_ESCAPE = 0x1, /**< Perform JSON escape */ UCL_STRING_TRIM = 0x2, /**< Trim leading and trailing whitespaces */ UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ @@ -172,15 +176,36 @@ typedef enum ucl_string_flags { * Basic flags for an object */ typedef enum ucl_object_flags { - UCL_OBJECT_ALLOCATED_KEY = 0x1, /**< An object has key allocated internally */ - UCL_OBJECT_ALLOCATED_VALUE = 0x2, /**< An object has a string value allocated internally */ - UCL_OBJECT_NEED_KEY_ESCAPE = 0x4, /**< The key of an object need to be escaped on output */ - UCL_OBJECT_EPHEMERAL = 0x8, /**< Temporary object that does not need to be freed really */ - UCL_OBJECT_MULTILINE = 0x10, /**< String should be displayed as multiline string */ - UCL_OBJECT_MULTIVALUE = 0x20 /**< Object is a key with multiple values */ + UCL_OBJECT_ALLOCATED_KEY = (1 << 0), /**< An object has key allocated internally */ + UCL_OBJECT_ALLOCATED_VALUE = (1 << 1), /**< An object has a string value allocated internally */ + UCL_OBJECT_NEED_KEY_ESCAPE = (1 << 2), /**< The key of an object need to be escaped on output */ + UCL_OBJECT_EPHEMERAL = (1 << 3), /**< Temporary object that does not need to be freed really */ + UCL_OBJECT_MULTILINE = (1 << 4), /**< String should be displayed as multiline string */ + UCL_OBJECT_MULTIVALUE = (1 << 5), /**< Object is a key with multiple values */ + UCL_OBJECT_INHERITED = (1 << 6), /**< Object has been inherited from another */ + UCL_OBJECT_BINARY = (1 << 7) /**< Object contains raw binary data */ } ucl_object_flags_t; /** + * Duplicate policy types + */ +enum ucl_duplicate_strategy { + UCL_DUPLICATE_APPEND = 0, /**< Default policy to merge based on priorities */ + UCL_DUPLICATE_MERGE, /**< Merge new object with old one */ + UCL_DUPLICATE_REWRITE, /**< Rewrite old keys */ + UCL_DUPLICATE_ERROR /**< Stop parsing on duplicate found */ +}; + +/** + * Input format type + */ +enum ucl_parse_type { + UCL_PARSE_UCL = 0, /**< Default ucl format */ + UCL_PARSE_MSGPACK, /**< Message pack input format */ + UCL_PARSE_CSEXP /**< Canonical S-expressions */ +}; + +/** * UCL object structure. Please mention that the most of fields should not be touched by * UCL users. In future, this structure may be converted to private one. */ @@ -190,7 +215,7 @@ typedef struct ucl_object_s { */ union { int64_t iv; /**< Int value of an object */ - const char *sv; /**< String value of an object */ + const char *sv; /**< String value of an object */ double dv; /**< Double value of an object */ void *av; /**< Array */ void *ov; /**< Object */ @@ -496,6 +521,15 @@ UCL_EXTERN const ucl_object_t* ucl_array unsigned int index); /** + * Return the index of `elt` in the array `top` + * @param top object to get a key from (must be of type UCL_ARRAY) + * @param elt element to find index of (must NOT be NULL) + * @return index of `elt` in the array `top or (unsigned int)-1 if `elt` is not found + */ +UCL_EXTERN unsigned int ucl_array_index_of (ucl_object_t *top, + ucl_object_t *elt); + +/** * Replace an element in an array with a different element, returning the object * that was replaced. This object is not released, caller must unref the * returned object when it is no longer needed. @@ -612,6 +646,19 @@ UCL_EXTERN const ucl_object_t* ucl_objec const char *key); /** + * Return object identified by a key in the specified object, if the first key is + * not found then look for the next one. This process is repeated unless + * the next argument in the list is not NULL. So, `ucl_object_find_any_key(obj, key, NULL)` + * is equal to `ucl_object_find_key(obj, key)` + * @param obj object to get a key from (must be of type UCL_OBJECT) + * @param key key to search + * @param ... list of alternative keys to search (NULL terminated) + * @return object matching the specified key or NULL if key was not found + */ +UCL_EXTERN const ucl_object_t* ucl_object_find_any_key (const ucl_object_t *obj, + const char *key, ...); + +/** * Return object identified by a fixed size key in the specified object * @param obj object to get a key from (must be of type UCL_OBJECT) * @param key key to search @@ -631,6 +678,16 @@ UCL_EXTERN const ucl_object_t *ucl_looku const char *path); /** + * Return object identified by object notation string using arbitrary delimiter + * @param obj object to search in + * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays + * @param sep the sepatorator to use in place of . (incase keys have . in them) + * @return object matched the specified path or NULL if path is not found + */ +UCL_EXTERN const ucl_object_t *ucl_lookup_path_char (const ucl_object_t *obj, + const char *path, char sep); + +/** * Returns a key of an object as a NULL terminated string * @param obj CL object * @return key or NULL if there is no key @@ -683,7 +740,7 @@ UCL_EXTERN int ucl_object_compare (const * @param cmp */ UCL_EXTERN void ucl_object_array_sort (ucl_object_t *ar, - int (*cmp)(const ucl_object_t *o1, const ucl_object_t *o2)); + int (*cmp)(const ucl_object_t **o1, const ucl_object_t **o2)); /** * Get the priority for specific UCL object @@ -769,6 +826,21 @@ typedef bool (*ucl_macro_handler) (const const ucl_object_t *arguments, void* ud); +/** + * Context dependent macro handler for a parser + * @param data the content of macro + * @param len the length of content + * @param arguments arguments object + * @param context previously parsed context + * @param ud opaque user data + * @param err error pointer + * @return true if macro has been parsed + */ +typedef bool (*ucl_context_macro_handler) (const unsigned char *data, size_t len, + const ucl_object_t *arguments, + const ucl_object_t *context, + void* ud); + /* Opaque parser */ struct ucl_parser; @@ -780,16 +852,38 @@ struct ucl_parser; UCL_EXTERN struct ucl_parser* ucl_parser_new (int flags); /** + * Sets the default priority for the parser applied to chunks that does not + * specify priority explicitly + * @param parser parser object + * @param prio default priority (0 .. 16) + * @return true if parser's default priority was set + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Oct 27 21:20:02 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C84CA1CB0C; Tue, 27 Oct 2015 21:20:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C53C1D6D; Tue, 27 Oct 2015 21:20:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLK12J067469; Tue, 27 Oct 2015 21:20:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLK0bJ067454; Tue, 27 Oct 2015 21:20:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510272120.t9RLK0bJ067454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 27 Oct 2015 21:20:00 +0000 (UTC) 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 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 21:20:02 -0000 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 `.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: ) - 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 = <@]), [], + [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 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 ]) +]) +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 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 + #ifdef HAVE_SYS_PARAM_H + #include + #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 ***