From owner-svn-src-vendor@freebsd.org Sun Dec 25 17:53:13 2016 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 871CAC9003C; Sun, 25 Dec 2016 17:53: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 23EF11D9E; Sun, 25 Dec 2016 17:53: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 uBPHrCw0036011; Sun, 25 Dec 2016 17:53:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPHrBld035996; Sun, 25 Dec 2016 17:53:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251753.uBPHrBld035996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 17:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310550 - in vendor/heirloom-doctools/dist: checknr eqn eqn/eqn.d grap mpm pic ptx refer soelim troff troff/libhnj troff/nroff.d troff/troff.d troff/troff.d/dhtml troff/troff.d/dpost.d ... 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.23 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: Sun, 25 Dec 2016 17:53:13 -0000 Author: bapt Date: Sun Dec 25 17:53:10 2016 New Revision: 310550 URL: https://svnweb.freebsd.org/changeset/base/310550 Log: Import heirloom doctools 2016-11-06 Added: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in (contents, props changed) vendor/heirloom-doctools/dist/grap/grap.1.in (contents, props changed) vendor/heirloom-doctools/dist/ptx/ptx.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/lookbib.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/refer.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/roffbib.1.in (contents, props changed) vendor/heirloom-doctools/dist/soelim/soelim.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/troff.1.in (contents, props changed) vendor/heirloom-doctools/dist/vgrind/vgrind.1.in (contents, props changed) Deleted: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7 vendor/heirloom-doctools/dist/grap/grap.1 vendor/heirloom-doctools/dist/ptx/ptx.1 vendor/heirloom-doctools/dist/refer/lookbib.1 vendor/heirloom-doctools/dist/refer/refer.1 vendor/heirloom-doctools/dist/refer/roffbib.1 vendor/heirloom-doctools/dist/soelim/soelim.1 vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1 vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1 vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7 vendor/heirloom-doctools/dist/troff/troff.d/troff.1 vendor/heirloom-doctools/dist/vgrind/vgrind.1 Modified: vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/dist/grap/grapl.l vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/dist/mpm/page.cc vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/dist/soelim/soelim.c vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/dist/troff/libhnj/test.c vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/dist/troff/ni.c vendor/heirloom-doctools/dist/troff/nii.c vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/dist/troff/troff.d/dhtml/dhtml.l vendor/heirloom-doctools/dist/troff/troff.d/dhtml/lib.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/makefont.c vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/dist/troff/troff.d/ta.c vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/troff.h vendor/heirloom-doctools/dist/vgrind/Makefile.mk vendor/heirloom-doctools/dist/vgrind/regexp.c vendor/heirloom-doctools/dist/vgrind/vgrindefs.c Modified: vendor/heirloom-doctools/dist/checknr/checknr.c ============================================================================== --- vendor/heirloom-doctools/dist/checknr/checknr.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/checknr/checknr.c Sun Dec 25 17:53:10 2016 (r310550) @@ -427,7 +427,7 @@ prop(int i) /* ARGSUSED */ static void -chkcmd(char *line, char *mac) +chkcmd(char *line __unused, char *mac) { int i; Modified: vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -8,7 +8,7 @@ FLAGS = -I. -I.. -I../../include $(DEFIN .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: eqn +all: eqn eqnchar.7 eqn: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o eqn @@ -29,10 +29,13 @@ install: $(INSTALL) -c -m 644 eqnchar.7 $(ROOT)$(MANDIR)/man7/eqnchar.7 clean: - rm -f $(OBJ) eqn e.c y.tab.* core log *~ + rm -f $(OBJ) eqn e.c y.tab.* core log *~ eqnchar.7 mrproper: clean +eqnchar.7: eqnchar.7.in + sed 's"/usr/pub/"$(ROOT)$(PUBDIR)/"' eqnchar.7.in > $@ + diacrit.o: ../diacrit.c ../e.h y.tab.h eqnbox.o: ../eqnbox.c ../e.h font.o: ../font.c ../e.h Added: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,212 @@ +'\" e +.\" Sccsid @(#)eqnchar.7b 1.2 (gritter) 12/9/05 +.\" Derived from eqnchar(7), Unix 7th edition: +.\" Copyright(C) Caldera International Inc. 2001-2002. 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 and documentation 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. +.\" All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed or owned by Caldera +.\" International, Inc. +.\" Neither the name of Caldera International, Inc. nor the names of +.\" other contributors may be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA +.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``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 CALDERA INTERNATIONAL, INC. 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. +.TH EQNCHAR 7 "12/9/05" "Heirloom Documentation Tools" "BSD System Compatibility" +.EQ +tdefine ciplus % "\o'\(pl\(ci'" % +ndefine ciplus % O+ % +tdefine citimes % "\o'\(mu\(ci'" % +ndefine citimes % Ox % +tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" % +ndefine =wig % ="~" % +tdefine bigstar % "\o'\(pl\(mu'" % +ndefine bigstar % X|- % +tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" % +ndefine =dot % = dot % +tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" % +ndefine orsign % \e/ % +tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" % +ndefine andsign % /\e % +tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" % +ndefine =del % = to DELTA % +tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" % +ndefine oppA % V- % +tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" % +ndefine oppE % E/ % +tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" % +ndefine incl % C_ % +tdefine nomem % "\o'\(mo\(sl'" % +ndefine nomem % C-/ % +tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" % +ndefine angstrom % A to o % +tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}% +ndefine star % * % +tdefine || % \(or\(or % +tdefine wig % "\z>\v'.4m'\(ap\v'-.4m'" % +ndefine >wig %{ > from "~" }% +tdefine langle % "\s-3\b'\(sl\e'\s0" % +ndefine langle %<% +tdefine rangle % "\s-3\b'\e\(sl'\s0" % +ndefine rangle %>% +tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" % +ndefine hbar % h\u-\d % +ndefine ppd % _| % +tdefine ppd % "\o'\(ru\s-2\(or\s+2'" % +tdefine <-> % "\o'\(<-\(->'" % +ndefine <-> % "<-->" % +tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" % +ndefine <=> % "<=>" % +tdefine |< % "\o'<\(or'" % +ndefine |< % <| % +tdefine |> % "\o'>\(or'" % +ndefine |> % |> % +tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" % +ndefine ang % /_ % +tdefine rang % "\z\(or\h'.15m'\(ru" % +ndefine rang % L % +tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" % +ndefine 3dot % .\u.\u.\d\d % +tdefine thf % ".\v'-.5m'.\v'.5m'." % +ndefine thf % ..\u.\d % +tdefine quarter % roman \(14 % +ndefine quarter % 1/4 % +tdefine 3quarter % roman \(34 % +ndefine 3quarter % 3/4 % +tdefine degree % \(de % +ndefine degree % nothing sup o % +tdefine square % \(sq % +ndefine square % [] % +tdefine circle % \(ci % +ndefine circle % O % +tdefine blot % "\fB\(sq\fP" % +ndefine blot % HIX % +tdefine bullet % \(bu % +ndefine bullet % oxe % +tdefine -wig % "\(~=" % +ndefine -wig % - to "~" % +tdefine wig % \(ap % +ndefine wig % "~" % +tdefine prop % \(pt % +ndefine prop % oc % +tdefine empty % \(es % +ndefine empty % O/ % +tdefine member % \(mo % +ndefine member % C- % +tdefine cup % \(cu % +ndefine cup % U % +define cap % \(ca % +define subset % \(sb % +define supset % \(sp % +define !subset % \(ib % +define !supset % \(ip % +.EN +.SH NAME +eqnchar \- special character definitions for eqn +.SH SYNOPSIS +.HP +.ad l +.nh +.B eqn /usr/pub/eqnchar +.RB [ files ] +.B | troff +.RB [ options ] +.HP +.B neqn /usr/pub/eqnchar +.RB [ files ] +.B | nroff +.RB [ options ] +.br +.hy 1 +.ad b +.SH DESCRIPTION +.I Eqnchar +contains +.I troff +and +.I nroff +character definitions for constructing characters that are not +available on the Graphic Systems typesetter. +These definitions are primarily intended for use with +.I eqn +and +.IR neqn . +It contains +definitions for the following characters +.PP +.nf +.ta \w'angstrom 'u \n(.lu/3u +\w'angstrom 'u \n(.lu*2u/3u +\w'angstrom 'u +.EQ +"ciplus" ciplus "|\||" || "square" square +.EN +.EQ +"citimes" citimes "langle" langle "circle" circle +.EN +.EQ +"wig" wig "rangle" rangle "blot" blot +.EN +.EQ +"-wig" -wig "hbar" hbar "bullet" bullet +.EN +.EQ +">wig" >wig "ppd" ppd "prop" prop +.EN +.EQ +"" <-> "empty" empty +.EN +.EQ +"=wig" =wig "<=>" <=> "member" member +.EN +.EQ +"star" star "|\|" |< "nomem" nomem +.EN +.EQ +"bigstar" bigstar "|\|>" |> "cup" cup +.EN +.EQ +"=dot" =dot "ang" ang "cap" cap +.EN +.EQ +"orsign" orsign "rang" rang "incl" incl +.EN +.EQ +"andsign" andsign "3dot" 3dot "subset" subset +.EN +.EQ +"=del" =del "thf" thf "supset" supset +.EN +.EQ +"oppA" oppA "quarter" quarter "!subset" !subset +.EN +.EQ +"oppE" oppE "3quarter" 3quarter "!supset" !supset +.EN +.EQ +"angstrom" angstrom "degree" degree +.EN +.SH FILES +/usr/pub/eqnchar +.SH SEE ALSO +troff(1), eqn(1) Modified: vendor/heirloom-doctools/dist/eqn/io.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/io.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/eqn/io.c Sun Dec 25 17:53:10 2016 (r310550) @@ -25,6 +25,7 @@ #include #include #include +#include "global.h" static char *in; /* input buffer */ static size_t insize; /* input buffer size */ @@ -283,7 +284,7 @@ setfile(int argc, char **argv) { } void -yyerror(char *unused) {;} +yyerror(char *unused __unused) {;} void init(void) { Modified: vendor/heirloom-doctools/dist/grap/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/grap/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -8,7 +8,7 @@ YFLAGS = -d .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: grap.c grapl.c grap +all: grap.c grapl.c grap grap.1 grap: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o grap @@ -23,10 +23,13 @@ install: $(INSTALL) -c -m 644 grap.1 $(ROOT)$(MANDIR)/man1/grap.1 clean: - rm -f $(OBJ) grapl.c grap.c y.tab.h grap core log *~ + rm -f $(OBJ) grapl.c grap.c y.tab.h grap core log *~ grap.1 mrproper: clean +grap.1: grap.1.in + sed 's"/usr/ucblib/"$(ROOT)$(LIBDIR)/"' grap.1.in > $@ + coord.o: coord.c grap.h y.tab.h for.o: for.c grap.h y.tab.h frame.o: frame.c grap.h y.tab.h Added: vendor/heirloom-doctools/dist/grap/grap.1.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/grap/grap.1.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,430 @@ +.\" +.\" Changes by Gunnar Ritter, Freiburg i. Br., Germany, October 2005. +.\" +.\" Derived from Plan 9 v4 /opt/unix/plan9v4/sys/man/1/grap +.\" +.\" Copyright (C) 2003, Lucent Technologies Inc. and others. +.\" All Rights Reserved. +.\" +.\" Distributed under the terms of the Lucent Public License Version 1.02. +.\" +.\" Sccsid @(#)grap.1 1.5 (gritter) 2/2/07 +.TH GRAP 1 "2/2/07" "Heirloom Documentation Tools" "User Commands" +.SH NAME +grap \- pic preprocessor for drawing graphs +.SH SYNOPSIS +\fBgrap\fR [\fB\-SU\fR] [\fIfile\fR] +.SH DESCRIPTION +.I Grap +is a +.IR pic (1) +preprocessor for drawing graphs on a typesetter. +Graphs are surrounded by the +.I troff +`commands' +.B \&.G1 +and +.BR \&.G2 . +Data are scaled and plotted, +with tick marks supplied automatically. +Commands exist to modify the frame, +add labels, override the default ticks, +change the plotting style, +define coordinate ranges and transformations, +and include data from files. +In addition, +.I grap +provides the same loops, conditionals, and macro processing that +.I pic +does. +.PP +.BI frame +.B ht +.I e +.B wid +.I e +.B top +.B dotted +.IR ... : +Set the frame around the graph to specified +.B ht +and +.BR wid ; +default is 2 by 3 (inches). +The line +.I styles +.RB ( dotted , +.BR dashed , +.BR invis , +.BR solid +(default)) +of the +.I sides +.RB ( top , +.BR bot , +.BR left , +.BR right ) +of the frame can be set +independently. +.PP +.B label +.I side +.B \&"a label" +.B \&"as a set of strings" +.IR adjust : +Place label on specified side; default side is bottom. +.I adjust +is +.B up +(or +.B down +.B left +.BR right ) +.I expr +to shift default position; +.B width +.I expr +sets the width explicitly. +.PP +.BI ticks +.I side +.B in +.B at +.IR "optname expr, expr, ..." : +Put ticks on +.I side +at +.I "expr, ..., +and label with +.I \&"expr"\f1. +If any +.I expr +is followed by "...", label tick with "...", +and turn off all automatic labels. +If "..." contains +.BR %f 's, +they will be interpreted as +.B printf +formatting instructions for the tick value. +Ticks point +.B in +or +.B out +(default out). +Tick iterator: instead of +.B at +.IR \&... , +use +.BI from +.I expr +.B to +.I expr +.B by +.I "op expr +where +.I op +is optionally +.B +\-*/ +for additive or multiplicative steps. +.B by +can be omitted, to give steps of size 1. +If no ticks are requested, they are supplied automatically; +suppress this with +.B ticks +.BR off . +Automatic ticks normally +leave a margin of 7% on each side; set this to anything by +.B margin +.B = +.IR expr . +.PP +.B grid +.I "side linedesc" +.B at +.IR "optname expr, expr, ..." : +Draw grids perpendicular to +.I side +in style +.I linedesc +at +.I "expr, ....\& +Iterators and labels work as with ticks. +.PP +.B coord +.I optname +.B x +.I "min, max" +.B y +.I "min, max" +.B "log x +.BR " log y" : +Set range of coords and optional log scaling on either or both. +This overrides computation of data range. +Default value of +.I optname +is current coordinate system +(each +.B coord +defines a new coordinate system). +.PP +.B plot +.I \&"str" +.B at +.IR point ; +.B +.I \&"str" +.B at +.IR point : +Put +.I str +at +.IR point . +Text position can be qualified with +.BR rjust , +.BR ljust , +.BR above , +.BR below +after "...". +.PP +.B line +.B from +.I point +.B to +.IR "point linedesc" : +Draw line from here to there. +.B arrow +works in place of +.BR line . +.PP +.B next +.I optname +.B at +.IR "point linedesc" : +Continue plot of data in +.I optname to +.IR point ; +default is current. +.PP +.BI draw +.IR "optname linedesc ..." : +Set mode for +.BR next : +use this style from now on, +and plot "..." at each point (if given). +.PP +.BI new +.IR "optname linedesc ..." : +Set mode for +.BR next , +but disconnect from previous. +.PP +A list of numbers +.I "x y1 y2 y3 ... +is treated as +.B plot +.B bullet +.B at +.IR x,y1 ; +.B plot +.B bullet +.B at +.IR x,y2 ; +etc., or as +.B next +.B at +.I x,y1 +etc., if +.B draw +is specified. +Abscissae of 1,2,3,... are provided if there is only one input number per line. +.PP +A +point +.I "optname expr, expr +maps the point to the named coordinate system. +A +.I linedesc +is one of +.B dot +.B dash +.B invis +.B solid +optionally followed by an expression. +.PP +.BI define +.I name +.BI { whatever } \f1: +Define a macro. +There are macros already defined for standard plotting +symbols like +.BR bullet , +.BR circle , +.BR star , +.BR plus , +etc., in +.BR /sys/lib/grap.defines , +which is included if it exists. +.PP +.I var +.B = +.IR expr : +Evaluate an expression. +Operators are +.B= +.B + +.B \- +.B * +and +.BR / . +Functions are +.B log +and +.B exp +(both base 10), +.BR sin , +.BR cos , +.BR sqrt ; +.B rand +returns random number on [0,1); +.BI max( e , e )\f1, +.BI min( e , e )\f1, +.BI int( e )\f1. +.PP +.B print +.IR expr ; +.B print +\fR"\f2...\fR"\f1: +As a debugging aid, print +.I expr +or +.I string +on the standard error. +.PP +.B copy +\fR"\fIfile name\fR"\fR: +Include this file right here. +.PP +.B copy +.B thru +.IR macro : +Pass rest of input (until +.BR \&.G2 ) +through +.IR macro , +treating each field (non-blank, or "...") as an argument. +.I macro +can be the name of a macro previously defined, +or the body of one in place, like +.BR "/plot $1 at $2,$3/" . +.PP +.B copy +.B thru +.I macro +.B until +\fR"\fIstring\fR"\fR: +Stop copy when input is +.I string +(left-justified). +.PP +.BI pic +.IR "remainder of line" : +Copy to output with leading blanks removed. +.PP +.BI graph +.IR "Name pic-position" : +Start a new frame, place it at specified position, +e.g., +.B graph +.B Thing2 +.BR "with .sw at Thing1.se + (0.1,0)" . +.I Name +must be capitalized to keep +.I pic +happy. +.PP +.BI \&. "anything at beginning of +.IR line : +Copied verbatim. +.PP +.B sh +.BI % anything +.BR % : +Pass everything between the +.BR % 's +to the shell; +as with macros, +.B % +may be any character and +.I anything +may include newlines. +The +.B \-S +option disables execution of the shell command; +the +.B \-U +option reverts the effect of a previous +.IR \-S . +.PP +.B # +.IR anything : +A comment, which is discarded. +.PP +Order is mostly irrelevant; no category is mandatory. +Any arguments on the +.B \&.G1 +line are placed on the generated +.B \&.PS +line for +.IR pic . +.\".SH EXAMPLES +.\".EX +.\".ps -1 +.\".vs -1 +.\"\&.G1 +.\"frame ht 1 top invis right invis +.\"coord x 0, 10 y 1, 3 log y +.\"ticks left in at 1 "bottommost tick", 2,3 "top tick" +.\"ticks bot in from 0 to 10 by 2 +.\"label bot "silly graph" +.\"label left "left side label" "here" +.\"grid left dashed at 2.5 +.\"copy thru / circle at $1,$2 / +.\"1 1 +.\"2 1.5 +.\"3 2 +.\"4 1.5 +.\"10 3 +.\"\&.G2 +.\".G1 +.\"frame ht 1 top invis right invis +.\"coord x 0, 10 y 1, 3 log y +.\"ticks left in at 1 "bottommost tick", 2,3 "top tick" +.\"ticks bot in from 0 to 10 by 2 +.\"label bot "silly graph" +.\"label left "left side label" "here" +.\"grid left dashed at 2.5 +.\"copy thru / circle at $1,$2 / +.\"1 1 +.\"2 1.5 +.\"3 2 +.\"4 1.5 +.\"10 3 +.\".G2 +.\".ps +.\".vs +.\".EE +.SH FILES +.TP +.B /usr/ucblib/grap.defines +definitions of standard plotting characters, e.g., bullet +.\".SH SOURCE +.\".B /sys/src/cmd/grap +.SH "SEE ALSO" +.IR pic (1), +.IR troff (1) +.br +J. L. Bentley and B. W. Kernighan, +``GRAP\(emA Language for Typesetting Graphs'', +.I +Unix Research System Programmer's Manual, +Tenth Edition, Volume 2. Modified: vendor/heirloom-doctools/dist/grap/grapl.l ============================================================================== --- vendor/heirloom-doctools/dist/grap/grapl.l Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/grapl.l Sun Dec 25 17:53:10 2016 (r310550) @@ -12,6 +12,7 @@ /* Sccsid @(#)grapl.l 1.4 (gritter) 11/22/05 */ %} +%option nounput %Start A str def thru sh %{ @@ -237,10 +238,3 @@ WS [ \t] . { CADD; } %% - -#ifdef FLEX_SCANNER -void xxcruft(void) -{ - unput(0); -} -#endif /* FLEX_SCANNER */ Modified: vendor/heirloom-doctools/dist/grap/main.c ============================================================================== --- vendor/heirloom-doctools/dist/grap/main.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/main.c Sun Dec 25 17:53:10 2016 (r310550) @@ -17,8 +17,12 @@ #include #include #include "grap.h" +#include "global.h" #include "y.tab.h" +static void onintr(int n); +static void fpecatch(int n); + int dbg = 0; #define GRAPDEFINES LIBDIR "/grap.defines" @@ -48,8 +52,6 @@ extern void getdata(void); int main(int argc, char *argv[]) { - extern void onintr(int), fpecatch(int); - if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); signal(SIGFPE, fpecatch); @@ -102,14 +104,14 @@ main(int argc, char *argv[]) } /*ARGSUSED*/ -void onintr(int n) +static void onintr(int n __unused) { if (!dbg) unlink(tempfile); exit(1); } -void fpecatch(int n) +static void fpecatch(int n) { WARNING("floating point exception"); onintr(n); Modified: vendor/heirloom-doctools/dist/mpm/page.cc ============================================================================== --- vendor/heirloom-doctools/dist/mpm/page.cc Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/mpm/page.cc Sun Dec 25 17:53:10 2016 (r310550) @@ -147,25 +147,9 @@ static void justify(stream *scratch, int } } -// If r were added to s, would the height of the composed result be at most maxht? -int wouldfit(range *r, stream *s, int maxht) -{ - if (r->rawht() + s->rawht() <= maxht) - return 1; // the conservative test succeeded - stream scratch; // local playground for costly test - for (stream cd = *s; cd.more(); cd.advance()) - scratch.append(cd.current()); - scratch.append(r); - movefloats(&scratch, ((double) scratch.rawht())/maxht); - trimspace(&scratch); - int retval = scratch.height() <= maxht; - scratch.freeall(); - return retval; -} - // If s1 were added to s, would the height of the composed result be at most maxht? // The computational structure is similar to that above. -int wouldfit(stream *s1, stream *s, int maxht) +static int wouldfit(stream *s1, stream *s, int maxht) { if (s1->rawht() + s->rawht() <= maxht) return 1; @@ -316,7 +300,7 @@ void multicol::dump() } // From the head of queue qp, peel off a piece whose raw height is at most space. -int peeloff(stream *qp, int space) +static int peeloff(stream *qp, int space) { stream *s1 = qp->current()->children(); if (!(s1 && s1->more() && s1->current()->height() <= space)) Modified: vendor/heirloom-doctools/dist/pic/input.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/input.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/input.c Sun Dec 25 17:53:10 2016 (r310550) @@ -492,8 +492,6 @@ void eprint(void) /* try to print contex ep = ebuf; } -void yywrap(void) {} - static char *newfile = 0; /* filename for file copy */ char *untilstr = 0; /* string that terminates a thru */ int thru = 0; /* 1 if copying thru macro */ Modified: vendor/heirloom-doctools/dist/pic/main.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/main.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/main.c Sun Dec 25 17:53:10 2016 (r310550) @@ -17,6 +17,7 @@ #include "pic.h" #include "y.tab.h" +static void reset(void); extern const char version[]; obj **objlist = 0; /* store the elements here */ @@ -208,7 +209,7 @@ void getdata(void) char *p, *buf = NULL, *buf1 = NULL; size_t size = 0; int ln; - void reset(void), openpl(char *), closepl(char *); + void openpl(char *), closepl(char *); int yyparse(void); curfile->lineno = 0; @@ -281,7 +282,7 @@ void getdata(void) free(buf1); } -void reset(void) +static void reset(void) { obj *op; int i; Modified: vendor/heirloom-doctools/dist/pic/picl.l ============================================================================== --- vendor/heirloom-doctools/dist/pic/picl.l Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/picl.l Sun Dec 25 17:53:10 2016 (r310550) @@ -12,6 +12,8 @@ /* Sccsid @(#)picl.l 1.9 (gritter) 8/6/06 */ %} +%option noyywrap +%option nounput %Start A str def xsc br thru sh %e 1700 %k 150 @@ -47,7 +49,6 @@ extern struct symtab symtab[]; int yyback(int *, int); int yylook(void); -int yywrap(void); #define CADD cbuf[clen++]=yytext[0]; \ if (clen>=CBUFLEN-1) { WARNING("string too long", cbuf); BEGIN A; } Modified: vendor/heirloom-doctools/dist/ptx/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/ptx/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/ptx/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -5,7 +5,7 @@ FLAGS = -DLIBDIR='"$(LIBDIR)"' $(EUC) -I .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: ptx +all: ptx ptx.1 ptx: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o ptx @@ -18,6 +18,12 @@ install: $(INSTALL) -c -m 644 eign $(ROOT)$(LIBDIR)/eign clean: - rm -f $(OBJ) ptx core log *~ + rm -f $(OBJ) ptx core log *~ ptx.1 mrproper: clean + +ptx.1: ptx.1.in + sed -e "s'/usr/5bin/sort'`which sort`'" \ + -e 's"/usr/ucblib/doctools/tmac/"$(ROOT)$(BINDIR)/"' \ + -e 's"/usr/ucblib/"$(ROOT)$(LIBDIR)/"' \ + ptx.1.in > $@ Added: vendor/heirloom-doctools/dist/ptx/ptx.1.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/ptx/ptx.1.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,158 @@ +.\" +.\" Sccsid @(#)ptx.1 1.6 (gritter) 2/2/07 +.\" Parts taken from ptx(1), Unix 7th edition: +.\" Copyright(C) Caldera International Inc. 2001-2002. 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 and documentation 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. +.\" All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed or owned by Caldera +.\" International, Inc. +.\" Neither the name of Caldera International, Inc. nor the names of +.\" other contributors may be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA +.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``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 CALDERA INTERNATIONAL, INC. 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. +.Dd February 2, 2007 +.Dt PTX 1 +.Os +.Sh NAME +.Nm ptx +.Nd permuted index +.Sh SYNOPSIS +.Nm +.Op Fl ftr +.Op Fl w Ar n +.Op Fl g Ar n +.Op Fl o Ar only +.Op Fl i Ar ignore +.Op Fl b Ar break +.Op Ar input Op Ar output +.Sh DESCRIPTION +.Nm +generates a permuted index to file +.Ar input +on file +.Ar output +(standard input and output default). +It has three phases: the first does the permutation, generating +one line for each keyword in an input line. +The keyword is rotated to the front. +The permuted file is then +sorted. +Finally, the sorted lines are rotated so the keyword +comes at the middle of the page. +.Nm +produces output in the form: +.Bd -literal -offset XXXXX +\&.xx "tail" "before keyword" "keyword and after" "head" +.Ed +.Pp +where .xx may be an +.Cm nroff +or +.Xr troff 1 +macro +for user-defined formatting. +Once choice for this macro is supplied in the +.Sq Fl mptx +macro package. +The +.Em before keyword +and +.Em keyword and after +fields incorporate as much of the line as will fit +around the keyword when it is printed at the middle of the page. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sun Dec 25 17:54:25 2016 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 5F5ADC900C0; Sun, 25 Dec 2016 17:54:25 +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 037FA1F07; Sun, 25 Dec 2016 17:54:24 +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 uBPHsO4l036102; Sun, 25 Dec 2016 17:54:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPHsN3v036095; Sun, 25 Dec 2016 17:54:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251754.uBPHsN3v036095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 17:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310551 - in vendor/heirloom-doctools/20161106: . checknr col eqn eqn/checkeq.d eqn/eqn.d eqn/eqnchar.d eqn/neqn.d grap include mpm pic picpack ptx refer soelim tbl troff troff/libhnj t... 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.23 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: Sun, 25 Dec 2016 17:54:25 -0000 Author: bapt Date: Sun Dec 25 17:54:23 2016 New Revision: 310551 URL: https://svnweb.freebsd.org/changeset/base/310551 Log: Tag import of heirloom doctools 2016-11-06 Added: vendor/heirloom-doctools/20161106/ - copied from r306788, vendor/heirloom-doctools/dist/ vendor/heirloom-doctools/20161106/compat.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/compat.c vendor/heirloom-doctools/20161106/eqn/eqn.d/eqnchar.7.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in vendor/heirloom-doctools/20161106/grap/grap.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/grap.1.in vendor/heirloom-doctools/20161106/ptx/ptx.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/ptx.1.in vendor/heirloom-doctools/20161106/refer/lookbib.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/lookbib.1.in vendor/heirloom-doctools/20161106/refer/refer.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/refer.1.in vendor/heirloom-doctools/20161106/refer/roffbib.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/roffbib.1.in vendor/heirloom-doctools/20161106/soelim/soelim.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/soelim.1.in vendor/heirloom-doctools/20161106/troff/nroff.d/nroff.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1.in vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/B.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/BI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/C.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CB.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CR.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CW.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/H.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HB.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/I.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/R.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/S.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S.in vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/mcolor.7.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7.in vendor/heirloom-doctools/20161106/troff/troff.d/troff.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/troff.1.in vendor/heirloom-doctools/20161106/vgrind/vgrind.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/vgrind.1.in Replaced: vendor/heirloom-doctools/20161106/checknr/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk vendor/heirloom-doctools/20161106/checknr/checknr.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/20161106/col/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/col/Makefile.mk vendor/heirloom-doctools/20161106/configure - copied unchanged from r307921, vendor/heirloom-doctools/dist/configure vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/checkeq.d/checkeq.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c vendor/heirloom-doctools/20161106/eqn/diacrit.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c vendor/heirloom-doctools/20161106/eqn/e.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/e.h vendor/heirloom-doctools/20161106/eqn/eqn.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/eqnbox.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnbox.c vendor/heirloom-doctools/20161106/eqn/eqnchar.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/eqnchar.d/genutf8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c vendor/heirloom-doctools/20161106/eqn/funny.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/funny.c vendor/heirloom-doctools/20161106/eqn/integral.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/integral.c vendor/heirloom-doctools/20161106/eqn/io.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/20161106/eqn/lex.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/20161106/eqn/lookup.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/lookup.c vendor/heirloom-doctools/20161106/eqn/matrix.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/matrix.c vendor/heirloom-doctools/20161106/eqn/neqn.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/paren.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/paren.c vendor/heirloom-doctools/20161106/eqn/shift.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/shift.c vendor/heirloom-doctools/20161106/eqn/text.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/text.c vendor/heirloom-doctools/20161106/grap/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/20161106/grap/coord.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/coord.c vendor/heirloom-doctools/20161106/grap/grap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/grap.h vendor/heirloom-doctools/20161106/grap/grapl.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/grapl.l vendor/heirloom-doctools/20161106/grap/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/input.c vendor/heirloom-doctools/20161106/grap/main.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/20161106/grap/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/misc.c vendor/heirloom-doctools/20161106/include/global.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/include/global.h vendor/heirloom-doctools/20161106/mk.config - copied unchanged from r307921, vendor/heirloom-doctools/dist/mk.config vendor/heirloom-doctools/20161106/mpm/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/20161106/mpm/misc.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/mpm/misc.h vendor/heirloom-doctools/20161106/mpm/page.cc - copied unchanged from r310550, vendor/heirloom-doctools/dist/mpm/page.cc vendor/heirloom-doctools/20161106/pic/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/pic/Makefile.mk vendor/heirloom-doctools/20161106/pic/arcgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/arcgen.c vendor/heirloom-doctools/20161106/pic/blockgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/blockgen.c vendor/heirloom-doctools/20161106/pic/for.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/for.c vendor/heirloom-doctools/20161106/pic/input.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/20161106/pic/main.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/20161106/pic/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/misc.c vendor/heirloom-doctools/20161106/pic/pic.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pic.h vendor/heirloom-doctools/20161106/pic/picl.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/20161106/pic/pltroff.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pltroff.c vendor/heirloom-doctools/20161106/pic/symtab.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/symtab.c vendor/heirloom-doctools/20161106/picpack/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/20161106/picpack/picpack.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/picpack/picpack.c vendor/heirloom-doctools/20161106/ptx/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/20161106/ptx/ptx.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/20161106/refer/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/20161106/refer/deliv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/deliv2.c vendor/heirloom-doctools/20161106/refer/glue1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue1.c vendor/heirloom-doctools/20161106/refer/glue3.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/20161106/refer/glue4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue4.c vendor/heirloom-doctools/20161106/refer/glue5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue5.c vendor/heirloom-doctools/20161106/refer/hunt1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt1.c vendor/heirloom-doctools/20161106/refer/hunt2.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/20161106/refer/hunt5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt5.c vendor/heirloom-doctools/20161106/refer/hunt6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt6.c vendor/heirloom-doctools/20161106/refer/hunt7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt7.c vendor/heirloom-doctools/20161106/refer/hunt8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt8.c vendor/heirloom-doctools/20161106/refer/hunt9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt9.c vendor/heirloom-doctools/20161106/refer/inv1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv1.c vendor/heirloom-doctools/20161106/refer/inv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv2.c vendor/heirloom-doctools/20161106/refer/inv3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv3.c vendor/heirloom-doctools/20161106/refer/inv5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv5.c vendor/heirloom-doctools/20161106/refer/inv6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv6.c vendor/heirloom-doctools/20161106/refer/mkey1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey1.c vendor/heirloom-doctools/20161106/refer/mkey2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey2.c vendor/heirloom-doctools/20161106/refer/refer..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer..c vendor/heirloom-doctools/20161106/refer/refer0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer0.c vendor/heirloom-doctools/20161106/refer/refer1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer1.c vendor/heirloom-doctools/20161106/refer/refer2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer2.c vendor/heirloom-doctools/20161106/refer/refer3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer3.c vendor/heirloom-doctools/20161106/refer/refer5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer5.c vendor/heirloom-doctools/20161106/refer/refer6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer6.c vendor/heirloom-doctools/20161106/refer/refer7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer7.c vendor/heirloom-doctools/20161106/refer/refer8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer8.c vendor/heirloom-doctools/20161106/refer/shell.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/shell.c vendor/heirloom-doctools/20161106/refer/sortbib.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/sortbib.c vendor/heirloom-doctools/20161106/refer/tick.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/tick.c vendor/heirloom-doctools/20161106/soelim/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/20161106/soelim/soelim.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/soelim.c vendor/heirloom-doctools/20161106/tbl/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/20161106/tbl/t..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t..c vendor/heirloom-doctools/20161106/tbl/t0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t0.c vendor/heirloom-doctools/20161106/tbl/t1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t1.c vendor/heirloom-doctools/20161106/tbl/t3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t3.c vendor/heirloom-doctools/20161106/tbl/t4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t4.c vendor/heirloom-doctools/20161106/tbl/t5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t5.c vendor/heirloom-doctools/20161106/tbl/t8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t8.c vendor/heirloom-doctools/20161106/tbl/tb.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tb.c vendor/heirloom-doctools/20161106/tbl/tc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tc.c vendor/heirloom-doctools/20161106/tbl/te.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/te.c vendor/heirloom-doctools/20161106/tbl/tg.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tg.c vendor/heirloom-doctools/20161106/tbl/tm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tm.c vendor/heirloom-doctools/20161106/tbl/ts.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/ts.c vendor/heirloom-doctools/20161106/tbl/tt.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tt.c vendor/heirloom-doctools/20161106/tbl/tu.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tu.c vendor/heirloom-doctools/20161106/tbl/tv.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tv.c vendor/heirloom-doctools/20161106/troff/ext.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/20161106/troff/libhnj/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/20161106/troff/libhnj/hnjalloc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/libhnj/hnjalloc.c vendor/heirloom-doctools/20161106/troff/libhnj/test.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/libhnj/test.c vendor/heirloom-doctools/20161106/troff/n1.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/20161106/troff/n2.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/20161106/troff/n3.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/20161106/troff/n4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n4.c vendor/heirloom-doctools/20161106/troff/n5.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/20161106/troff/n7.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/20161106/troff/n8.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/20161106/troff/n9.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/20161106/troff/ni.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/ni.c vendor/heirloom-doctools/20161106/troff/nii.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nii.c vendor/heirloom-doctools/20161106/troff/nroff.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/nroff.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/draw.c vendor/heirloom-doctools/20161106/troff/nroff.d/n10.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n10.c vendor/heirloom-doctools/20161106/troff/nroff.d/n6.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/20161106/troff/nroff.d/pt.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/20161106/troff/tdef.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/20161106/troff/troff.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/afm.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/20161106/troff/troff.d/afm.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/20161106/troff/troff.d/devaps/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/dhtml.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/dhtml.l vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/lib.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/lib.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/color.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/color.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.h vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/draw.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/gen.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/gen.h vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/misc.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/ps_include.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/request.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/request.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.h vendor/heirloom-doctools/20161106/troff/troff.d/draw.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/20161106/troff/troff.d/font/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/makefont.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/makefont.c vendor/heirloom-doctools/20161106/troff/troff.d/fontmap.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.c vendor/heirloom-doctools/20161106/troff/troff.d/fontmap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.h vendor/heirloom-doctools/20161106/troff/troff.d/otf.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/20161106/troff/troff.d/otfdump.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/20161106/troff/troff.d/pt.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/20161106/troff/troff.d/t10.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/20161106/troff/troff.d/t6.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/20161106/troff/troff.d/ta.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/ta.c vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/troff.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/troff.h vendor/heirloom-doctools/20161106/version.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/version.mk vendor/heirloom-doctools/20161106/vgrind/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/Makefile.mk vendor/heirloom-doctools/20161106/vgrind/regexp.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/regexp.c vendor/heirloom-doctools/20161106/vgrind/vfontedpr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/vgrind/vfontedpr.c vendor/heirloom-doctools/20161106/vgrind/vgrindefs.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/vgrindefs.c Deleted: vendor/heirloom-doctools/20161106/eqn/eqn.d/eqnchar.7 vendor/heirloom-doctools/20161106/grap/grap.1 vendor/heirloom-doctools/20161106/picpack/getopt.c vendor/heirloom-doctools/20161106/ptx/ptx.1 vendor/heirloom-doctools/20161106/refer/lookbib.1 vendor/heirloom-doctools/20161106/refer/refer.1 vendor/heirloom-doctools/20161106/refer/roffbib.1 vendor/heirloom-doctools/20161106/soelim/soelim.1 vendor/heirloom-doctools/20161106/troff/nroff.d/nroff.1 vendor/heirloom-doctools/20161106/troff/troff.d/devaps/getopt.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.1 vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/getopt.c vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/B vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/BI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/C vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CB vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CR vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CW vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/H vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HB vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/I vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/R vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/S vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/mcolor.7 vendor/heirloom-doctools/20161106/troff/troff.d/troff.1 vendor/heirloom-doctools/20161106/vgrind/vgrind.1 Copied: vendor/heirloom-doctools/20161106/checknr/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/checknr/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk) @@ -0,0 +1,21 @@ +OBJ = checknr.o + +FLAGS = $(DEFINES) -I../include + +.c.o: + $(CC) $(_CFLAGS) $(FLAGS) -c $< + +all: checknr + +checknr: $(OBJ) + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checknr + +install: + $(INSTALL) -c checknr $(ROOT)$(BINDIR)/checknr + $(STRIP) $(ROOT)$(BINDIR)/checknr + $(INSTALL) -c -m 644 checknr.1 $(ROOT)$(MANDIR)/man1/checknr.1 + +clean: + rm -f $(OBJ) checknr core log *~ + +mrproper: clean Copied: vendor/heirloom-doctools/20161106/checknr/checknr.c (from r310550, vendor/heirloom-doctools/dist/checknr/checknr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/checknr/checknr.c Sun Dec 25 17:54:23 2016 (r310551, copy of r310550, vendor/heirloom-doctools/dist/checknr/checknr.c) @@ -0,0 +1,637 @@ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + + +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* from OpenSolaris "checknr.c 1.8 05/06/02 SMI" */ + +/* + * Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany + */ +#if __GNUC__ >= 3 && __GNUC_MINOR__ >= 4 || __GNUC__ >= 4 +#define USED __attribute__ ((used)) +#elif defined __GNUC__ +#define USED __attribute__ ((unused)) +#else +#define USED +#endif +static const char sccsid[] USED = "@(#)/usr/ucb/checknr.sl 1.3 (gritter) 11/6/05"; + +/* + * checknr: check an nroff/troff input file for matching macro calls. + * we also attempt to match size and font changes, but only the embedded + * kind. These must end in \s0 and \fP resp. Maybe more sophistication + * later but for now think of these restrictions as contributions to + * structured typesetting. + */ +#include +#include +#include +#include +#include +#include "global.h" + +static int maxstk; /* Stack size */ +#define MAXBR 100 /* Max number of bracket pairs known */ +#define MAXCMDS 500 /* Max number of commands known */ + +/* + * The stack on which we remember what we've seen so far. + */ +static struct stkstr { + int opno; /* number of opening bracket */ + int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ + int parm; /* parm to size, font, etc */ + int lno; /* line number the thing came in in */ +} *stk; +static int stktop; + +/* + * The kinds of opening and closing brackets. + */ +static struct brstr { + char *opbr; + char *clbr; +} br[MAXBR] = { + /* A few bare bones troff commands */ +#define SZ 0 + { "sz", "sz" }, /* also \s */ +#define FT 1 + { "ft", "ft" }, /* also \f */ + /* the -mm package */ + { "AL", "LE" }, + { "AS", "AE" }, + { "BL", "LE" }, + { "BS", "BE" }, + { "DF", "DE" }, + { "DL", "LE" }, + { "DS", "DE" }, + { "FS", "FE" }, + { "ML", "LE" }, + { "NS", "NE" }, + { "RL", "LE" }, + { "VL", "LE" }, + /* the -ms package */ + { "AB", "AE" }, + { "BD", "DE" }, + { "CD", "DE" }, + { "DS", "DE" }, + { "FS", "FE" }, + { "ID", "DE" }, + { "KF", "KE" }, + { "KS", "KE" }, + { "LD", "DE" }, + { "LG", "NL" }, + { "QS", "QE" }, + { "RS", "RE" }, + { "SM", "NL" }, + { "XA", "XE" }, + { "XS", "XE" }, + /* The -me package */ + { "(b", ")b" }, + { "(c", ")c" }, + { "(d", ")d" }, + { "(f", ")f" }, + { "(l", ")l" }, + { "(q", ")q" }, + { "(x", ")x" }, + { "(z", ")z" }, + /* Things needed by preprocessors */ + { "EQ", "EN" }, + { "TS", "TE" }, + /* Refer */ + { "[", "]" }, + { NULL, NULL } +}; + +/* + * All commands known to nroff, plus macro packages. + * Used so we can complain about unrecognized commands. + */ +static char *knowncmds[MAXCMDS] = { +"$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", +"(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", +"+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", +"@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", +"AE", "AF", "AI", "AL", "AM", "AS", "AT", "AU", "AX", "B", "B1", "B2", +"BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", +"D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", +"EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", +"FQ", "FS", "FV", "FX", "H", "HC", "HD", "HM", "HO", "HU", "I", "ID", +"IE", "IH", "IM", "IP", "IX", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", +"LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", +"MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", +"P1", "PF", "PH", "PP", "PT", "PX", "PY", "QE", "QP", "QS", "R", "RA", +"RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", +"SG", "SH", "SK", "SM", "SP", "SY", "T&", "TA", "TB", "TC", "TD", "TE", +"TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", +"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", +"[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", +"][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", +"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", +"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", +"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", +"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", +"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", +"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", +"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", +"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", +"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", +"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", +"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", +"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", +"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", +"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +0 +}; + +static int lineno; /* current line number in input file */ +static char *line; /* the current line */ +static size_t linesize; /* allocated size of current line */ +static char *cfilename; /* name of current file */ +static int nfiles; /* number of files to process */ +static int fflag; /* -f: ignore \f */ +static int sflag; /* -s: ignore \s */ +static int ncmds; /* size of knowncmds */ +static int slot; /* slot in knowncmds found by binsrch */ + +static void growstk(void); +static void usage(void); +static void process(FILE *f); +static void complain(int i); +static void prop(int i); +static void chkcmd(char *line, char *mac); +static void nomatch(char *mac); +static int eq(char *s1, char *s2); +static void pe(int lineno); +static void checkknown(char *mac); +static void addcmd(char *line); +static void addmac(char *mac); +static int binsrch(char *mac); + +static void +growstk(void) +{ + stktop++; + if (stktop >= maxstk) { + maxstk *= 2; + stk = realloc(stk, sizeof *stk * maxstk); + } +} + +int +main(int argc, char **argv) +{ + FILE *f; + int i; + char *cp, *cq, c; + + stk = calloc(sizeof *stk, maxstk = 100); + /* Figure out how many known commands there are */ + while (knowncmds[ncmds]) + ncmds++; + while (argc > 1 && argv[1][0] == '-') { + switch (argv[1][1]) { + + /* -a: add pairs of macros */ + case 'a': + /* look for empty macro slots */ + for (i = 0; br[i].opbr; i++) + ; + cp = &argv[1][3]; + while (*cp) { + size_t s; + if (i >= MAXBR - 3) { + printf("Only %d known pairs allowed\n", + MAXBR/2); + exit(1); + } + for (cq = cp; *cq && *cq != '.'; cq++); + if (*cq != '.') + usage(); + *cq = 0; + s = cq - cp + 1; + br[i].opbr = malloc(s); + n_strcpy(br[i].opbr, cp, s); + *cq = '.'; + cp = &cq[1]; + for (cq = cp; *cq && *cq != '.'; cq++); + c = *cq; + *cq = 0; + s = cq - cp + 1; + br[i].clbr = malloc(s); + n_strcpy(br[i].clbr, cp, s); + *cq = c; + cp = c ? &cq[1] : cq; + /* knows pairs are also known cmds */ + addmac(br[i].opbr); + addmac(br[i].clbr); + i++; + } + break; + + /* -c: add known commands */ + case 'c': + cp = &argv[1][3]; + while (*cp) { + for (cq = cp; *cq && *cq != '.'; cq++); + c = *cq; + *cq = 0; + addmac(cp); + *cq = c; + cp = c ? &cq[1] : cq; + } + break; + + /* -f: ignore font changes */ + case 'f': + fflag = 1; + break; + + /* -s: ignore size changes */ + case 's': + sflag = 1; + break; + default: + usage(); + } + argc--; argv++; + } + + nfiles = argc - 1; + + if (nfiles > 0) { + for (i = 1; i < argc; i++) { + cfilename = argv[i]; + f = fopen(cfilename, "r"); + if (f == NULL) { + perror(cfilename); + exit(1); + } + else { + process(f); + fclose(f); + } + } + } else { + cfilename = "stdin"; + process(stdin); + } + return (0); +} + +static void +usage(void) +{ + printf("Usage: checknr -s -f -a.xx.yy.xx.yy... -c.xx.xx.xx...\n"); + exit(1); +} + +static void +process(FILE *f) +{ + int i, n; + char mac[512]; /* The current macro or nroff command */ + int pl; + + stktop = -1; + for (lineno = 1; getline(&line, &linesize, f) > 0; lineno++) { + if (line[0] == '.') { + /* + * find and isolate the macro/command name. + */ + strncpy(mac, line+1, sizeof mac-1)[sizeof mac-1] = 0; + if (isspace(mac[0]&0377)) { + pe(lineno); + printf("Empty command\n"); + } else { + for (i = 1; mac[i]; i++) + if (isspace(mac[i]&0377)) { + mac[i] = 0; + break; + } + } + + /* + * Is it a known command? + */ + checkknown(mac); + + /* + * Should we add it? + */ + if (eq(mac, "de")) + addcmd(line); + + chkcmd(line, mac); + } + + /* + * At this point we process the line looking + * for \s and \f. + */ + for (i = 0; line[i]; i++) + if (line[i] == '\\' && (i == 0 || line[i-1] != '\\')) { + if (!sflag && line[++i] == 's') { + pl = line[++i]&0377; + if (isdigit(pl)) { + n = pl - '0'; + pl = ' '; + } else + n = 0; + while (isdigit(line[++i]&0377)) + n = 10 * n + line[i] - '0'; + i--; + if (n == 0) { + if (stk[stktop].opno == SZ) { + stktop--; + } else { + pe(lineno); + printf( + "unmatched \\s0\n"); + } + } else { + growstk(); + stk[stktop].opno = SZ; + stk[stktop].pl = pl; + stk[stktop].parm = n; + stk[stktop].lno = lineno; + } + } else if (!fflag && line[i] == 'f') { + n = line[++i]; + if (n == 'P') { + if (stk[stktop].opno == FT) { + stktop--; + } else { + pe(lineno); + printf( + "unmatched \\fP\n"); + } + } else { + growstk(); + stk[stktop].opno = FT; + stk[stktop].pl = 1; + stk[stktop].parm = n; + stk[stktop].lno = lineno; + } + } + } + } + /* + * We've hit the end and look at all this stuff that hasn't been + * matched yet! Complain, complain. + */ + for (i = stktop; i >= 0; i--) { + complain(i); + } +} + +static void +complain(int i) +{ + pe(stk[i].lno); + printf("Unmatched "); + prop(i); + printf("\n"); +} + +static void +prop(int i) +{ + if (stk[i].pl == 0) + printf(".%s", br[stk[i].opno].opbr); + else switch (stk[i].opno) { + case SZ: + printf("\\s%c%d", stk[i].pl, stk[i].parm); + break; + case FT: + printf("\\f%c", stk[i].parm); + break; + default: + printf("Bug: stk[%d].opno = %d = .%s, .%s", + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); + } +} + +/* ARGSUSED */ +static void +chkcmd(char *line __unused, char *mac) +{ + int i; + + /* + * Check to see if it matches top of stack. + */ + if (stktop >= 0 && eq(mac, br[stk[stktop].opno].clbr)) + stktop--; /* OK. Pop & forget */ + else { + /* No. Maybe it's an opener */ + for (i = 0; br[i].opbr; i++) { + if (eq(mac, br[i].opbr)) { + /* Found. Push it. */ + growstk(); + stk[stktop].opno = i; + stk[stktop].pl = 0; + stk[stktop].parm = 0; + stk[stktop].lno = lineno; + break; + } + /* + * Maybe it's an unmatched closer. + * NOTE: this depends on the fact + * that none of the closers can be + * openers too. + */ + if (eq(mac, br[i].clbr)) { + nomatch(mac); + break; + } + } + } +} + +static void +nomatch(char *mac) +{ + int i, j; + + /* + * Look for a match further down on stack + * If we find one, it suggests that the stuff in + * between is supposed to match itself. + */ + for (j = stktop; j >= 0; j--) + if (eq(mac, br[stk[j].opno].clbr)) { + /* Found. Make a good diagnostic. */ + if (j == stktop-2) { + /* + * Check for special case \fx..\fR and don't + * complain. + */ + if (stk[j+1].opno == FT && + stk[j+1].parm != 'R' && + stk[j+2].opno == FT && + stk[j+2].parm == 'R') { + stktop = j -1; + return; + } + /* + * We have two unmatched frobs. Chances are + * they were intended to match, so we mention + * them together. + */ + pe(stk[j+1].lno); + prop(j+1); + printf(" does not match %d: ", stk[j+2].lno); + prop(j+2); + printf("\n"); + } else for (i = j+1; i <= stktop; i++) { + complain(i); + } + stktop = j-1; + return; + } + /* Didn't find one. Throw this away. */ + pe(lineno); + printf("Unmatched .%s\n", mac); +} + +/* eq: are two strings equal? */ +static int +eq(char *s1, char *s2) +{ + return (strcmp(s1, s2) == 0); +} + +/* print the first part of an error message, given the line number */ +static void +pe(int lineno) +{ + if (nfiles > 1) + printf("%s: ", cfilename); + printf("%d: ", lineno); +} + +static void +checkknown(char *mac) +{ + + if (eq(mac, ".")) + return; + if (binsrch(mac) >= 0) + return; + if (mac[0] == '\\' && mac[1] == '"') /* comments */ + return; + + pe(lineno); + printf("Unknown command: .%s\n", mac); +} + +/* + * We have a .de xx line in "line". Add xx to the list of known commands. + */ +static void +addcmd(char *line) +{ + char *mac; + + /* grab the macro being defined */ + mac = line+4; + while (isspace(*mac&0377)) + mac++; + if (*mac == 0) { + pe(lineno); + printf("illegal define: %s\n", line); + return; + } + mac[2] = 0; + if (isspace(mac[1]&0377) || mac[1] == '\\') + mac[1] = 0; + addmac(mac); +} + +/* + * Add mac to the list. We should really have some kind of tree + * structure here but this is a quick-and-dirty job and I just don't + * have time to mess with it. (I wonder if this will come back to haunt + * me someday?) Anyway, I claim that .de is fairly rare in user + * nroff programs, and the loop below is pretty fast. + */ +static void +addmac(char *mac) +{ + char **src, **dest, **loc; + size_t s; + + if (binsrch(mac) >= 0) { /* it's OK to redefine something */ +#ifdef DEBUG + printf("binsrch(%s) -> already in table\n", mac); +#endif + return; + } + /* binsrch sets slot as a side effect */ +#ifdef DEBUG +printf("binsrch(%s) -> %d\n", mac, slot); +#endif + if (ncmds >= MAXCMDS) { + printf("Only %d known commands allowed\n", MAXCMDS); + exit(1); + } + loc = &knowncmds[slot]; + src = &knowncmds[ncmds-1]; + dest = src+1; + while (dest > loc) + *dest-- = *src--; + s = strlen(mac) + 1; + *loc = malloc(s); + n_strcpy(*loc, mac, s); + ncmds++; +#ifdef DEBUG + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); +#endif +} + +/* + * Do a binary search in knowncmds for mac. + * If found, return the index. If not, return -1. + */ +static int +binsrch(char *mac) +{ + char *p; /* pointer to current cmd in list */ + int d; /* difference if any */ + int mid; /* mid point in binary search */ + int top, bot; /* boundaries of bin search, inclusive */ + + top = ncmds-1; + bot = 0; + while (top >= bot) { + mid = (top+bot)/2; + p = knowncmds[mid]; + d = p[0] - mac[0]; + if (d == 0) + d = strcmp(&p[1], &mac[1]); + if (d == 0) + return (mid); + if (d < 0) + bot = mid + 1; + else + top = mid - 1; + } + slot = bot; /* place it would have gone */ + return (-1); +} Copied: vendor/heirloom-doctools/20161106/col/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/col/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/col/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/col/Makefile.mk) @@ -0,0 +1,22 @@ +BIN = col + +OBJ = col.o + +FLAGS = $(DEFINES) -I../include + +all: $(BIN) + +$(BIN): $(OBJ) + $(CC) ${_CFLAGS} $(_LDFLAGS) $(OBJ) -o $(BIN) + +install: + $(INSTALL) -c $(BIN) $(ROOT)$(BINDIR)/$(BIN) + $(STRIP) $(ROOT)$(BINDIR)/$(BIN) + +clean: + rm -f $(OBJ) $(BIN) core log *~ + +mrproper: clean + +.c.o: + ${CC} ${_CFLAGS} $(FLAGS) -c $< Copied: vendor/heirloom-doctools/20161106/compat.c (from r307809, vendor/heirloom-doctools/dist/compat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/compat.c Sun Dec 25 17:54:23 2016 (r310551, copy of r307809, vendor/heirloom-doctools/dist/compat.c) @@ -0,0 +1,47 @@ +/* Carsten Kunze, 2016 */ + +#include + +#ifndef HAVE_STRLCPY +size_t +strlcpy(char *dst, const char *src, size_t dstsize) { + size_t srcsize; + /* Not conform to strlcpy, but avoids to access illegal memory in case + * of unterminated strings */ + for (srcsize = 0; srcsize < dstsize; srcsize++) + if (!src[srcsize]) + break; + if (dstsize > srcsize) + dstsize = srcsize; + else if (dstsize) + dstsize--; + if (dstsize) + /* assumes non-overlapping buffers */ + memcpy(dst, src, dstsize); + dst[dstsize] = 0; + return srcsize; +} +#endif + +#ifndef HAVE_STRLCAT +size_t +strlcat(char *dst, const char *src, size_t dstsize) { + size_t ld, ls; + for (ld = 0; ld < dstsize - 1; ld++) + if (!dst[ld]) + break; + dst += ld; + dstsize -= ld; + for (ls = 0; ls < dstsize; ls++) + if (!src[ls]) + break; + if (dstsize > ls) + dstsize = ls; + else if (dstsize) + dstsize--; + if (dstsize) + memcpy(dst, src, dstsize); + dst[dstsize] = 0; + return ld + ls; +} +#endif Copied: vendor/heirloom-doctools/20161106/configure (from r307921, vendor/heirloom-doctools/dist/configure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/configure Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/configure) @@ -0,0 +1,236 @@ +#!/bin/sh + +# Copyright (c) 2016, Carsten Kunze +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +usage () { + echo "Usage: $0 [-s]" + echo " -s Silence output" + exit $1 +} + +SFLAG= +MAKE= +DEFS= +LIB_LEX= +LIB_CURSES= +cat /dev/null > compat.h + +while [ $# -gt 0 ]; do + case $1 in + -s) SFLAG=1;; + *) + echo "$0: $1: Unknown option" >&2 + usage 1;; + esac + shift +done + +check_for () { + [ -e $LOG ] && echo >>$LOG + A="Checking for $1 ... " + echo "$A" >>$LOG + [ -z "$SFLAG" ] && printf "$A" +} + +compile () { + rm -f ${TMPNAM}.o $TMPNAM $OUT $ERR + $MAKE -f $OUTMK $TMPNAM > $OUT 2> $ERR + RESULT=$? + cat $OUT $ERR >> $LOG + if [ $RESULT -eq 0 ]; then true; else false; fi +} + +test_result () { + RESULT=$? + RESULT_TEXT=${1:-0} # 1: omit "no", 2: say nothing + if [ $RESULT -eq 0 ]; then + echo success >>$LOG + [ -z "$SFLAG" -a $RESULT_TEXT -lt 2 ] && \ + echo "yes$PASS_TEXT" + PASS_TEXT= + [ -e $TMPC ] && rm -f $TMPC + true + else + [ -z "$SFLAG" -a $RESULT_TEXT -lt 1 ] && echo no + if [ -e $TMPC ]; then + echo "Failed program:" >>$LOG + pr -n -t $TMPC >>$LOG + rm -f $TMPC + fi + false + fi +} + +gen_mk () { + [ $# -eq 0 ] && rm -f $OUTMK + [ -n "$LEX" ] && echo "LEX=$LEX" >> $OUTMK + [ -n "$FLOAT_STORE" ] && echo "FLOAT_STORE=$FLOAT_STORE" >> $OUTMK + [ -n "$DEFS" ] && echo "DEFINES=$DEFS" >> $OUTMK + [ -n "$INCDIR_CURSES" ] && echo "INCDIR_CURSES=$INCDIR_CURSES" >> $OUTMK + [ -n "$RPATH_CURSES" ] && echo "RPATH_CURSES=$RPATH_CURSES" >> $OUTMK + [ -n "$LIBDIR_CURSES" ] && echo "LIBDIR_CURSES=$LIBDIR_CURSES" \ + >> $OUTMK + [ -n "$LIB_CURSES" ] && echo "LIB_CURSES=$LIB_CURSES" >> $OUTMK + [ -n "$LIB_AVLBST" ] && echo "LIB_AVLBST=$LIB_AVLBST" >> $OUTMK + [ -n "$LIB_LEX" ] && echo "LIB_LEX=$LIB_LEX" >> $OUTMK + [ -n "$__CDBG" ] && echo "__CDBG=$__CDBG" >> $OUTMK + [ -n "$__CLDBG" ] && echo "__CLDBG=$__CLDBG" >> $OUTMK + cat $INMK >> $OUTMK || exit 1 +} +check_make () { + check_for "make(1)" + + cat <$TMPMK +all: + true +EOT + make -f $TMPMK >> $LOG 2>&1 + test_result && { + MAKE=make + return + } + + echo "Failed makefile:" >>$LOG + pr -n -t $TMPMK >>$LOG + + check_for "bmake(1)" + + cat <$TMPMK +all: + true +EOT + bmake -f $TMPMK >> $LOG 2>&1 + test_result && MAKE=bmake +} +check_lex () { + check_for '$(LEX)' + + cat <$TMPL +%% +%% +int main() { return 0; } +int yywrap(void) { return 0; } +EOT + compile + test_result && return + + check_for 'flex(1)' + + LEX=flex + gen_mk + compile + test_result && return + + check_for 'lex(1)' + + LEX=lex + gen_mk + compile + test_result && return +} +check_strlcpy () { + check_for "strlcpy(3)" + + cat <$TMPC +#include +int +main(int argc, char **argv) { + char a[10]; + (void)argc; + strlcpy(a, *argv, sizeof a); + return 0; +} +EOT + compile + if test_result; then + DEFS="$DEFS -DHAVE_STRLCPY" + else + H=compat.h + grep -q '' $H 2>/dev/null || cat <>$H +#include +EOT + cat <>$H +size_t strlcpy(char *, const char *, size_t); +EOT + fi +} +check_strlcat () { + check_for "strlcat(3)" + + cat <$TMPC +#include +int +main(int argc, char **argv) { + char a[10]; + (void)argc; + *a = 0; + strlcat(a, *argv, sizeof a); + return 0; +} +EOT + compile + if test_result; then + DEFS="$DEFS -DHAVE_STRLCAT" + else + H=compat.h + grep -q '' $H 2>/dev/null || cat <>$H +#include +EOT + cat <>$H +size_t strlcat(char *, const char *, size_t); +EOT + fi +} +check_wcslcpy () { + check_for "wcslcpy(3)" + + cat <$TMPC +#include +#include +int +main() { + wchar_t a, b; + a = getwchar(); + wcslcpy(&b, &a, 1); + return 0; +} +EOT + compile + test_result && DEFS="$DEFS -DHAVE_WCSLCPY" +} + [ ! -s compat.h ] && rm compat.h +OUTMK=cfg.mk +INMK=mk.config +CFG=config +TMPNAM=.$CFG +TMPMK=${TMPNAM}.mk +TMPC=${TMPNAM}.c +TMPL=${TMPNAM}.l +OUT=${TMPNAM}.out +ERR=${TMPNAM}.err +LOG=${CFG}.log +rm -f $LOG +gen_mk + +check_make +#check_Sanitizer +check_lex +check_strlcpy +check_strlcat +check_wcslcpy + +gen_mk +cat version.mk >> $OUTMK || exit 1 +rm -f $TMPNAM* Copied: vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk) @@ -0,0 +1,23 @@ +VPATH=.. +OBJ = checkeq.o + +FLAGS = + +.c.o: + $(CC) $(_CFLAGS) $(FLAGS) -c $< + +all: checkeq + +checkeq: $(OBJ) + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checkeq + +install: + $(INSTALL) -c checkeq $(ROOT)$(BINDIR)/checkeq + $(STRIP) $(ROOT)$(BINDIR)/checkeq + rm -f $(ROOT)$(MANDIR)/man1/checkeq.1 + ln -s eqn.1 $(ROOT)$(MANDIR)/man1/checkeq.1 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Dec 27 00:51:57 2016 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 46EC5C90CED; Tue, 27 Dec 2016 00:51:57 +0000 (UTC) (envelope-from mm@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 EB31015A1; Tue, 27 Dec 2016 00:51:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR0puxu099921; Tue, 27 Dec 2016 00:51:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR0psiH099168; Tue, 27 Dec 2016 00:51:54 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612270051.uBR0psiH099168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 27 Dec 2016 00:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310622 - in vendor/libarchive/dist: . cpio/test libarchive libarchive/test tar 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.23 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 Dec 2016 00:51:57 -0000 Author: mm Date: Tue Dec 27 00:51:53 2016 New Revision: 310622 URL: https://svnweb.freebsd.org/changeset/base/310622 Log: Update vendor/libarchive to git to 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 Vendor bugfixes: PR 844: Coverity bug fixes in tests PR 846: Spelling fixes PR 850: Fix issues with reading certain jar files PR 826: OpenSSL 1.1 support PR 830, 831, 833: Spelling fixes OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free() OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives OSS-Fuzz 286: Bugfix in archive_strncat_l() Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/cpio/test/test_owner_parse.c vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_write_disk_appledouble.c vendor/libarchive/dist/libarchive/test/test_write_format_xar_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty_zip64.c vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/Makefile.am Tue Dec 27 00:51:53 2016 (r310622) @@ -483,6 +483,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_zip_encryption_header.c \ libarchive/test/test_read_format_zip_filename.c \ libarchive/test/test_read_format_zip_high_compression.c \ + libarchive/test/test_read_format_zip_jar.c \ libarchive/test/test_read_format_zip_mac_metadata.c \ libarchive/test/test_read_format_zip_malformed.c \ libarchive/test/test_read_format_zip_msdos.c \ @@ -801,6 +802,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \ libarchive/test/test_read_format_zip_high_compression.zip.uu \ libarchive/test/test_read_format_zip_length_at_end.zip.uu \ + libarchive/test/test_read_format_zip_jar.jar.uu \ libarchive/test/test_read_format_zip_mac_metadata.zip.uu \ libarchive/test/test_read_format_zip_malformed1.zip.uu \ libarchive/test/test_read_format_zip_msdos.zip.uu \ Modified: vendor/libarchive/dist/cpio/test/test_owner_parse.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_owner_parse.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/cpio/test/test_owner_parse.c Tue Dec 27 00:51:53 2016 (r310622) @@ -38,7 +38,7 @@ static const int root_gids[] = { 0, 1 }; * its primary group membership depends on how the user set up * their /etc/passwd. Likely values are 513 (None), 545 (Users), * or 544 (Administrators). Just check for one of those... - * TODO: Handle non-English localizations...e.g. French 'Administrateur' + * TODO: Handle non-English localizations... e.g. French 'Administrateur' * Use CreateWellKnownSID() and LookupAccountName()? */ #define ROOT "Administrator" Modified: vendor/libarchive/dist/libarchive/archive_read.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read.c Tue Dec 27 00:51:53 2016 (r310622) @@ -764,7 +764,7 @@ archive_read_header_position(struct arch * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Tue Dec 27 00:51:53 2016 (r310622) @@ -1026,7 +1026,7 @@ next_entry(struct archive_read_disk *a, /* Save the times to be restored. This must be in before * calling archive_read_disk_descend() or any chance of it, - * especially, invokng a callback. */ + * especially, invoking a callback. */ t->restore_time.mtime = archive_entry_mtime(entry); t->restore_time.mtime_nsec = archive_entry_mtime_nsec(entry); t->restore_time.atime = archive_entry_atime(entry); Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Tue Dec 27 00:51:53 2016 (r310622) @@ -862,7 +862,7 @@ next_entry(struct archive_read_disk *a, /* Save the times to be restored. This must be in before * calling archive_read_disk_descend() or any chance of it, - * especially, invokng a callback. */ + * especially, invoking a callback. */ t->restore_time.lastWriteTime = st->ftLastWriteTime; t->restore_time.lastAccessTime = st->ftLastAccessTime; t->restore_time.filetype = archive_entry_filetype(entry); Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Tue Dec 27 00:51:53 2016 (r310622) @@ -293,7 +293,7 @@ lzma_bidder_bid(struct archive_read_filt /* Second through fifth bytes are dictionary size, stored in * little-endian order. The minimum dictionary size is * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option - * -d12 and the maxinam dictionary size is 1 << 27(128MiB) + * -d12 and the maximum dictionary size is 1 << 27(128MiB) * which the one uses with option -d27. * NOTE: A comment of LZMA SDK source code says this dictionary * range is from 1 << 12 to 1 << 30. */ @@ -584,9 +584,7 @@ lzip_init(struct archive_read_filter *se return (ARCHIVE_FATAL); } ret = lzma_raw_decoder(&(state->stream), filters); -#if LZMA_VERSION < 50010000 free(filters[0].options); -#endif if (ret != LZMA_OK) { set_error(self, ret); return (ARCHIVE_FATAL); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Tue Dec 27 00:51:53 2016 (r310622) @@ -263,22 +263,22 @@ struct _7zip { /* * Decompressor controllers. */ - /* Decording LZMA1 and LZMA2 data. */ + /* Decoding LZMA1 and LZMA2 data. */ #ifdef HAVE_LZMA_H lzma_stream lzstream; int lzstream_valid; #endif - /* Decording bzip2 data. */ + /* Decoding bzip2 data. */ #if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream bzstream; int bzstream_valid; #endif - /* Decording deflate data. */ + /* Decoding deflate data. */ #ifdef HAVE_ZLIB_H z_stream stream; int stream_valid; #endif - /* Decording PPMd data. */ + /* Decoding PPMd data. */ int ppmd7_stat; CPpmd7 ppmd7_context; CPpmd7z_RangeDec range_dec; @@ -1056,10 +1056,7 @@ init_decompression(struct archive_read * #endif { lzma_options_delta delta_opt; - lzma_filter filters[LZMA_FILTERS_MAX]; -#if LZMA_VERSION < 50010000 - lzma_filter *ff; -#endif + lzma_filter filters[LZMA_FILTERS_MAX], *ff; int fi = 0; if (zip->lzstream_valid) { @@ -1144,9 +1141,7 @@ init_decompression(struct archive_read * else filters[fi].id = LZMA_FILTER_LZMA1; filters[fi].options = NULL; -#if LZMA_VERSION < 50010000 ff = &filters[fi]; -#endif r = lzma_properties_decode(&filters[fi], NULL, coder1->properties, (size_t)coder1->propertiesSize); if (r != LZMA_OK) { @@ -1158,9 +1153,7 @@ init_decompression(struct archive_read * filters[fi].id = LZMA_VLI_UNKNOWN; filters[fi].options = NULL; r = lzma_raw_decoder(&(zip->lzstream), filters); -#if LZMA_VERSION < 50010000 free(ff->options); -#endif if (r != LZMA_OK) { set_error(a, r); return (ARCHIVE_FAILED); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Tue Dec 27 00:51:53 2016 (r310622) @@ -326,7 +326,7 @@ archive_read_format_cpio_options(struct cpio = (struct cpio *)(a->format->data); if (strcmp(key, "compat-2x") == 0) { - /* Handle filnames as libarchive 2.x */ + /* Handle filenames as libarchive 2.x */ cpio->init_default_conversion = (val != NULL)?1:0; return (ARCHIVE_OK); } else if (strcmp(key, "hdrcharset") == 0) { Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Tue Dec 27 00:51:53 2016 (r310622) @@ -864,29 +864,33 @@ zip_read_local_file_header(struct archiv zip_entry->mode |= AE_IFREG; } - if ((zip_entry->mode & AE_IFMT) == 0) { - /* Especially in streaming mode, we can end up - here without having seen proper mode information. - Guess from the filename. */ + /* If the mode is totally empty, set some sane default. */ + if (zip_entry->mode == 0) { + zip_entry->mode |= 0664; + } + + /* Make sure that entries with a trailing '/' are marked as directories + * even if the External File Attributes contains bogus values. If this + * is not a directory and there is no type, assume regularfile. */ + if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) { + int has_slash; + wp = archive_entry_pathname_w(entry); if (wp != NULL) { len = wcslen(wp); - if (len > 0 && wp[len - 1] == L'/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; + has_slash = len > 0 && wp[len - 1] == L'/'; } else { cp = archive_entry_pathname(entry); len = (cp != NULL)?strlen(cp):0; - if (len > 0 && cp[len - 1] == '/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; - } - if (zip_entry->mode == AE_IFDIR) { - zip_entry->mode |= 0775; - } else if (zip_entry->mode == AE_IFREG) { - zip_entry->mode |= 0664; + has_slash = len > 0 && cp[len - 1] == '/'; + } + /* Correct file type as needed. */ + if (has_slash) { + zip_entry->mode &= ~AE_IFMT; + zip_entry->mode |= AE_IFDIR; + zip_entry->mode |= 0111; + } else if ((zip_entry->mode & AE_IFMT) == 0) { + zip_entry->mode |= AE_IFREG; } } Modified: vendor/libarchive/dist/libarchive/archive_string.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_string.c Tue Dec 27 00:51:53 2016 (r310622) @@ -1827,7 +1827,7 @@ archive_string_conversion_set_opt(struct * A filename in UTF-8 was made with libarchive 2.x in a wrong * assumption that wchar_t was Unicode. * This option enables simulating the assumption in order to read - * that filname correctly. + * that filename correctly. */ case SCONV_SET_OPT_UTF8_LIBARCHIVE2X: #if (defined(_WIN32) && !defined(__CYGWIN__)) \ @@ -1939,12 +1939,19 @@ archive_strncat_l(struct archive_string struct archive_string_conv *sc) { const void *s; - size_t length; + size_t length = 0; int i, r = 0, r2; + if (_p != NULL && n > 0) { + if (sc != NULL && (sc->flag & SCONV_FROM_UTF16)) + length = utf16nbytes(_p, n); + else + length = mbsnbytes(_p, n); + } + /* We must allocate memory even if there is no data for conversion * or copy. This simulates archive_string_append behavior. */ - if (_p == NULL || n == 0) { + if (length == 0) { int tn = 1; if (sc != NULL && (sc->flag & SCONV_TO_UTF16)) tn = 2; @@ -1960,16 +1967,11 @@ archive_strncat_l(struct archive_string * If sc is NULL, we just make a copy. */ if (sc == NULL) { - length = mbsnbytes(_p, n); if (archive_string_append(as, _p, length) == NULL) return (-1);/* No memory */ return (0); } - if (sc->flag & SCONV_FROM_UTF16) - length = utf16nbytes(_p, n); - else - length = mbsnbytes(_p, n); s = _p; i = 0; if (sc->nconverter > 1) { Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Tue Dec 27 00:51:53 2016 (r310622) @@ -680,7 +680,7 @@ struct iso9660 { /* The creation time of ISO image. */ time_t birth_time; /* A file stream of a temporary file, which file contents - * save to until ISO iamge can be created. */ + * save to until ISO image can be created. */ int temp_fd; struct isofile *cur_file; @@ -1995,7 +1995,7 @@ iso9660_close(struct archive_write *a) * Write an ISO 9660 image. */ - /* Switc to start using wbuff as file buffer. */ + /* Switch to start using wbuff as file buffer. */ iso9660->wbuff_remaining = wb_buffmax(); iso9660->wbuff_type = WB_TO_STREAM; iso9660->wbuff_offset = 0; @@ -4558,7 +4558,7 @@ write_file_descriptors(struct archive_wr file->cur_content = &(file->content); do { blocks += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -4748,7 +4748,7 @@ isofile_gen_utility_names(struct archive } /* - * Converte a filename to UTF-16BE. + * Convert a filename to UTF-16BE. */ if (0 > archive_entry_pathname_l(file->entry, &u16, &u16len, iso9660->sconv_to_utf16be)) { @@ -5512,7 +5512,7 @@ isoent_setup_file_location(struct iso966 file->cur_content->location = location; location += file->cur_content->blocks; total_block += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -6164,7 +6164,7 @@ isoent_gen_iso9660_identifier(struct arc np->id_len = l = ext_off + np->ext_len; /* Make an offset of the number which is used to be set - * hexadecimal number to avoid duplicate identififier. */ + * hexadecimal number to avoid duplicate identifier. */ if (iso9660->opt.iso_level == 1) { if (ext_off >= 5) noff = 5; @@ -6742,7 +6742,7 @@ isoent_rr_move(struct archive_write *a) int r; pt = &(iso9660->primary.pathtbl[MAX_DEPTH-1]); - /* Theare aren't level 8 directories reaching a deepr level. */ + /* There aren't level 8 directories reaching a deeper level. */ if (pt->cnt == 0) return (ARCHIVE_OK); @@ -6813,7 +6813,7 @@ _compare_path_table(const void *v1, cons if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = p1->identifier; s2 = p2->identifier; l = p1->ext_off; @@ -6855,7 +6855,7 @@ _compare_path_table_joliet(const void *v if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = (const unsigned char *)p1->identifier; s2 = (const unsigned char *)p2->identifier; l = p1->ext_off; Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Tue Dec 27 00:51:53 2016 (r310622) @@ -169,6 +169,7 @@ IF(ENABLE_TEST) test_read_format_zip_encryption_partially.c test_read_format_zip_filename.c test_read_format_zip_high_compression.c + test_read_format_zip_jar.c test_read_format_zip_mac_metadata.c test_read_format_zip_malformed.c test_read_format_zip_msdos.c Modified: vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Tue Dec 27 00:51:53 2016 (r310622) @@ -500,8 +500,8 @@ test_basic(void) /* * We should be on the initial directory where we performed - * archive_read_disk_new() after we perfome archive_read_free() - * even if we broke off the directory traversals. + * archive_read_disk_new() after we perform archive_read_free() + * even if we broke off the directory traversals. */ /* Save current working directory. */ @@ -1565,11 +1565,11 @@ DEFINE_TEST(test_read_disk_directory_tra { /* Basic test. */ test_basic(); - /* Test hybird mode; follow symlink initially, then not. */ + /* Test hybrid mode; follow symlink initially, then not. */ test_symlink_hybrid(); - /* Test logcal mode; follow all symlinks. */ + /* Test logical mode; follow all symlinks. */ test_symlink_logical(); - /* Test logcal mode; prevent loop in symlinks. */ + /* Test logical mode; prevent loop in symlinks. */ test_symlink_logical_loop(); /* Test to restore atime. */ test_restore_atime(); Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c Tue Dec 27 00:51:53 2016 (r310622) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2016 Peter Wu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 THE AUTHOR(S) ``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 THE AUTHOR(S) 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. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Issue 822: jar files have an empty External File Attributes field which + * is misinterpreted as regular file type due to OS MS-DOS. + */ + +DEFINE_TEST(test_read_format_zip_jar) +{ + const char *refname = "test_read_format_zip_jar.jar"; + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + char data[16]; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip_seekable(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("somedir/", archive_entry_pathname(ae)); + assertEqualInt(AE_IFDIR | 0775, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualIntA(a, 0, archive_read_data(a, data, 16)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); + free(p); +} Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu Tue Dec 27 00:51:53 2016 (r310622) @@ -0,0 +1,6 @@ +begin 640 test_read_format_zip_jar.jar +M4$L#! H @ $AQETD ( 0 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 32432C976C9; Fri, 30 Dec 2016 01:27:29 +0000 (UTC) (envelope-from mm@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 C30E71010; Fri, 30 Dec 2016 01:27:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1RSaE009085; Fri, 30 Dec 2016 01:27:28 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1RR0E009081; Fri, 30 Dec 2016 01:27:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300127.uBU1RR0E009081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310796 - in vendor/libarchive/dist: . libarchive libarchive/test 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.23 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: Fri, 30 Dec 2016 01:27:29 -0000 Author: mm Date: Fri Dec 30 01:27:27 2016 New Revision: 310796 URL: https://svnweb.freebsd.org/changeset/base/310796 Log: Update vendor/libarchive to git to 379867ecb330b3a952fb7bfa7bffb7bbd5547205 Vendor changes: PR #771: Add NFSv4 ACL support to pax and restricted pax Added: vendor/libarchive/dist/libarchive/test/test_acl_pax_nfs4.tar.uu vendor/libarchive/dist/libarchive/test/test_acl_pax_posix1e.tar.uu - copied, changed from r310795, vendor/libarchive/dist/libarchive/test/test_acl_pax.tar.uu vendor/libarchive/dist/libarchive/test/test_acl_text.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_star_acl.c - copied, changed from r310795, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c vendor/libarchive/dist/libarchive/test/test_compat_star_acl_nfs4.tar.uu Deleted: vendor/libarchive/dist/libarchive/test/test_acl_pax.tar.uu vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_acl_private.h vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_acl.3 vendor/libarchive/dist/libarchive/archive_entry_locale.h vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/dist/libarchive/test/test_acl_freebsd_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_pax.c vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/Makefile.am Fri Dec 30 01:27:27 2016 (r310796) @@ -328,6 +328,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_acl_nfs4.c \ libarchive/test/test_acl_pax.c \ libarchive/test/test_acl_posix1e.c \ + libarchive/test/test_acl_text.c \ libarchive/test/test_archive_api_feature.c \ libarchive/test/test_archive_clear_error.c \ libarchive/test/test_archive_cmdline.c \ @@ -376,7 +377,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_plexus_archiver_tar.c \ libarchive/test/test_compat_solaris_tar_acl.c \ libarchive/test/test_compat_solaris_pax_sparse.c \ - libarchive/test/test_compat_star_acl_posix1e.c \ + libarchive/test/test_compat_star_acl.c \ libarchive/test/test_compat_tar_hardlink.c \ libarchive/test/test_compat_uudecode.c \ libarchive/test/test_compat_uudecode_large.c \ @@ -598,7 +599,8 @@ libarchive_TESTS_ENVIRONMENT= LIBARCHIVE libarchive_test_EXTRA_DIST=\ libarchive/test/list.h \ - libarchive/test/test_acl_pax.tar.uu \ + libarchive/test/test_acl_pax_posix1e.tar.uu \ + libarchive/test/test_acl_pax_nfs4.tar.uu \ libarchive/test/test_archive_string_conversion.txt.Z.uu \ libarchive/test/test_compat_bzip2_1.tbz.uu \ libarchive/test/test_compat_bzip2_2.tbz.uu \ @@ -635,6 +637,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \ libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \ libarchive/test/test_compat_solaris_tar_acl.tar.uu \ + libarchive/test/test_compat_star_acl_nfs4.tar.uu \ libarchive/test/test_compat_star_acl_posix1e.tar.uu \ libarchive/test/test_compat_tar_hardlink_1.tar.uu \ libarchive/test/test_compat_uudecode_large.tar.Z.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/NEWS Fri Dec 30 01:27:27 2016 (r310796) @@ -1,3 +1,6 @@ +Dec 27, 2016: NFSv4 ACL read and write support for pax + Deprecated functions: archive_entry_acl_text(), archive_entry_acl_text_w() + Oct 26, 2016: Remove liblzmadec support Oct 23, 2016: libarchive 3.2.2 released Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/libarchive/archive_acl.c Fri Dec 30 01:27:27 2016 (r310796) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2010 Tim Kientzle + * Copyright (c) 2016 Martin Matuska * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,23 +56,31 @@ static struct archive_acl_entry *acl_new static int archive_acl_add_entry_len_l(struct archive_acl *acl, int type, int permset, int tag, int id, const char *name, size_t len, struct archive_string_conv *sc); +static int archive_acl_text_want_type(struct archive_acl *acl, int flags); +static ssize_t archive_acl_text_len(struct archive_acl *acl, int want_type, + int flags, int wide, struct archive *a, + struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); +static int is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, + int *result); +static int is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, + int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); -static int prefix_w(const wchar_t *start, const wchar_t *end, - const wchar_t *test); -static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id); +static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); +static int is_nfs4_flags(const char *start, const char *end, + int *result); +static int is_nfs4_perms(const char *start, const char *end, + int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); -static int prefix_c(const char *start, const char *end, - const char *test); -static void append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id); +static void append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id); static void append_id(char **p, int id); void @@ -375,8 +384,8 @@ archive_acl_reset(struct archive_acl *ac * standard permissions and include them in the returned list. */ int -archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, int *type, - int *permset, int *tag, int *id, const char **name) +archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, + int *type, int *permset, int *tag, int *id, const char **name) { *name = NULL; *id = -1; @@ -441,130 +450,273 @@ archive_acl_next(struct archive *a, stru } /* - * Generate a text version of the ACL. The flags parameter controls - * the style of the generated ACL. + * Determine what type of ACL do we want */ -const wchar_t * -archive_acl_text_w(struct archive *a, struct archive_acl *acl, int flags) +static int +archive_acl_text_want_type(struct archive_acl *acl, int flags) { - int count; - size_t length; - const wchar_t *wname; - const wchar_t *prefix; - wchar_t separator; - struct archive_acl_entry *ap; - int id, r; - wchar_t *wp; + int want_type; - if (acl->acl_text_w != NULL) { - free (acl->acl_text_w); - acl->acl_text_w = NULL; + /* Check if ACL is NFSv4 */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + /* NFSv4 should never mix with POSIX.1e */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + return (0); + else + return (ARCHIVE_ENTRY_ACL_TYPE_NFS4); } - separator = L','; + /* Now deal with POSIX.1e ACLs */ + + want_type = 0; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + + /* By default we want both access and default ACLs */ + if (want_type == 0) + return (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E); + + return (want_type); +} + +/* + * Calculate ACL text string length + */ +static ssize_t +archive_acl_text_len(struct archive_acl *acl, int want_type, int flags, + int wide, struct archive *a, struct archive_string_conv *sc) { + struct archive_acl_entry *ap; + const char *name; + const wchar_t *wname; + int count, idlen, tmp, r; + ssize_t length; + size_t len; + count = 0; length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0 && wname != NULL) - length += wcslen(wname); - else if (r < 0 && errno == ENOMEM) - return (NULL); - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + count++; + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0 + && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + length += 8; /* "default:" */ + switch (ap->tag) { + case ARCHIVE_ENTRY_ACL_USER_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "owner@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_USER: + case ARCHIVE_ENTRY_ACL_MASK: + length += 4; /* "user", "mask" */ + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "group@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_GROUP: + case ARCHIVE_ENTRY_ACL_OTHER: + length += 5; /* "group", "other" */ + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + length += 9; /* "everyone@" */ + break; + } + length += 1; /* colon after tag */ + if (ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wide) { + r = archive_mstring_get_wcs(a, &ap->name, + &wname); + if (r == 0 && wname != NULL) + length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (0); + else + length += sizeof(uid_t) * 3 + 1; + } else { + r = archive_mstring_get_mbs_l(&ap->name, &name, + &len, sc); + if (r != 0) + return (0); + if (len > 0 && name != NULL) + length += len; + else + length += sizeof(uid_t) * 3 + 1; + } + length += 1; /* colon after user or group name */ + } else if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) + length += 1; /* 2nd colon empty user,group or other */ + + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) + && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + && (ap->tag == ARCHIVE_ENTRY_ACL_OTHER + || ap->tag == ARCHIVE_ENTRY_ACL_MASK)) { + /* Solaris has no colon after other: and mask: */ + length = length - 1; + } + + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* rwxpdDaARWcCos:fdinSFI:deny */ + length += 27; + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) == 0) + length += 1; /* allow, alarm, audit */ + } else length += 3; /* rwx */ + + if ((ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) && + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) != 0) { length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ + /* ID digit count */ + idlen = 1; + tmp = ap->id; + while (tmp > 9) { + tmp = tmp / 10; + idlen++; + } + length += idlen; } - ap = ap->next; + length ++; /* entry separator */ } - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + /* Add filemode-mapping access entries to the length */ + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if ((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) { + /* "user::rwx\ngroup::rwx\nother:rwx\n" */ + length += 31; + } else { + /* "user::rwx\ngroup::rwx\nother::rwx\n" */ + length += 32; + } + } else if (count == 0) + return (0); + + /* The terminating character is included in count */ + return (length); +} - if (count == 0) +/* + * Generate a wide text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +wchar_t * +archive_acl_to_text_w(struct archive_acl *acl, ssize_t *text_len, int flags, + struct archive *a) +{ + int count; + ssize_t length; + size_t len; + const wchar_t *wname; + const wchar_t *prefix; + wchar_t separator; + struct archive_acl_entry *ap; + int id, r, want_type; + wchar_t *wp, *ws; + + want_type = archive_acl_text_want_type(acl, flags); + + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) return (NULL); + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; + + length = archive_acl_text_len(acl, want_type, flags, 1, a, NULL); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = L','; + else + separator = L'\n'; + /* Now, allocate the string and actually populate it. */ - wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); - if (wp == NULL) + wp = ws = (wchar_t *)malloc(length * sizeof(wchar_t)); + if (wp == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, NULL, ap->tag, wname, - ap->permset, id); - count++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = L"default:"; else prefix = NULL; - ap = acl->acl_head; - count = 0; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - if (count > 0) - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, prefix, ap->tag, - wname, ap->permset, id); - count ++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0) { + if (count > 0) + *wp++ = separator; + if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + id = ap->id; + else + id = -1; + append_entry_w(&wp, prefix, ap->type, ap->tag, flags, + wname, ap->permset, id); + count++; + } else if (r < 0 && errno == ENOMEM) + return (NULL); } - return (acl->acl_text_w); -} + /* Add terminating character */ + *wp++ = L'\0'; + + len = wcslen(ws); + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (ws); +} static void append_id_w(wchar_t **wp, int id) @@ -577,8 +729,8 @@ append_id_w(wchar_t **wp, int id) } static void -append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id) +append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id) { if (prefix != NULL) { wcscpy(*wp, prefix); @@ -588,6 +740,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_USER_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: wcscpy(*wp, L"user"); @@ -595,6 +751,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_GROUP_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: wcscpy(*wp, L"group"); @@ -609,154 +769,209 @@ append_entry_w(wchar_t **wp, const wchar wname = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + wcscpy(*wp, L"everyone@"); + wname = NULL; + id = -1; + break; } *wp += wcslen(*wp); *(*wp)++ = L':'; - if (wname != NULL) { - wcscpy(*wp, wname); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wname != NULL) { + wcscpy(*wp, wname); + *wp += wcslen(*wp); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id_w(wp, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*wp)++ = L':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*wp)++ = (perm & 0444) ? L'r' : L'-'; + *(*wp)++ = (perm & 0222) ? L'w' : L'-'; + *(*wp)++ = (perm & 0111) ? L'x' : L'-'; + } else { + /* NFS4 ACL perms */ + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; + *(*wp)++ = L':'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; + *(*wp)++ = L':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + wcscpy(*wp, L"allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + wcscpy(*wp, L"deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + wcscpy(*wp, L"audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + wcscpy(*wp, L"alarm"); + break; + default: + break; + } *wp += wcslen(*wp); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id_w(wp, id); - id = -1; } - *(*wp)++ = L':'; - *(*wp)++ = (perm & 0444) ? L'r' : L'-'; - *(*wp)++ = (perm & 0222) ? L'w' : L'-'; - *(*wp)++ = (perm & 0111) ? L'x' : L'-'; if (id != -1) { *(*wp)++ = L':'; append_id_w(wp, id); } - **wp = L'\0'; } -int -archive_acl_text_l(struct archive_acl *acl, int flags, - const char **acl_text, size_t *acl_text_len, +/* + * Generate a text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +char * +archive_acl_to_text_l(struct archive_acl *acl, ssize_t *text_len, int flags, struct archive_string_conv *sc) { int count; - size_t length; + ssize_t length; + size_t len; const char *name; const char *prefix; char separator; struct archive_acl_entry *ap; - size_t len; - int id, r; - char *p; + int id, r, want_type; + char *p, *s; - if (acl->acl_text != NULL) { - free (acl->acl_text); - acl->acl_text = NULL; - } + want_type = archive_acl_text_want_type(acl, flags); - *acl_text = NULL; - if (acl_text_len != NULL) - *acl_text_len = 0; - separator = ','; - count = 0; - length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (len > 0 && name != NULL) - length += len; - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ - length += 3; /* rwx */ - length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ - } - ap = ap->next; - } + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) + return (NULL); - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; - if (count == 0) - return (0); + length = archive_acl_text_len(acl, want_type, flags, 0, NULL, sc); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = ','; + else + separator = '\n'; /* Now, allocate the string and actually populate it. */ - p = acl->acl_text = (char *)malloc(length); - if (p == NULL) - return (-1); + p = s = (char *)malloc(length * sizeof(char)); + if (p == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); + return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - *p++ = separator; - if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { - id = ap->id; - } else { - id = -1; - } - append_entry(&p, NULL, ap->tag, name, - ap->permset, id); - count++; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = "default:"; else prefix = NULL; - count = 0; - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (count > 0) - *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry(&p, prefix, ap->tag, - name, ap->permset, id); - count ++; + r = archive_mstring_get_mbs_l( + &ap->name, &name, &len, sc); + if (r != 0) + return (NULL); + if (count > 0) + *p++ = separator; + if (name == NULL || + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { + id = ap->id; + } else { + id = -1; } + append_entry(&p, prefix, ap->type, ap->tag, flags, name, + ap->permset, id); + count++; } - *acl_text = acl->acl_text; - if (acl_text_len != NULL) - *acl_text_len = strlen(acl->acl_text); - return (0); + /* Add terminating character */ + *p++ = '\0'; + + len = strlen(s); + + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (s); } static void @@ -770,8 +985,8 @@ append_id(char **p, int id) } static void -append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id) +append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id) { if (prefix != NULL) { strcpy(*p, prefix); @@ -781,6 +996,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_USER_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: strcpy(*p, "user"); @@ -788,6 +1007,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_GROUP_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: strcpy(*p, "group"); @@ -802,48 +1025,146 @@ append_entry(char **p, const char *prefi name = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + strcpy(*p, "everyone@"); + name = NULL; + id = -1; + break; } *p += strlen(*p); *(*p)++ = ':'; - if (name != NULL) { - strcpy(*p, name); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (name != NULL) { + strcpy(*p, name); + *p += strlen(*p); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id(p, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*p)++ = ':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*p)++ = (perm & 0444) ? 'r' : '-'; + *(*p)++ = (perm & 0222) ? 'w' : '-'; + *(*p)++ = (perm & 0111) ? 'x' : '-'; + } else { + /* NFS4 ACL perms */ + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_EXECUTE)) ? 'x' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; + *(*p)++ = ':'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; + *(*p)++ = ':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + strcpy(*p, "allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + strcpy(*p, "deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + strcpy(*p, "audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + strcpy(*p, "alarm"); + break; + } *p += strlen(*p); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id(p, id); - id = -1; } - *(*p)++ = ':'; - *(*p)++ = (perm & 0444) ? 'r' : '-'; - *(*p)++ = (perm & 0222) ? 'w' : '-'; - *(*p)++ = (perm & 0111) ? 'x' : '-'; if (id != -1) { *(*p)++ = ':'; append_id(p, id); } - **p = '\0'; } /* - * Parse a textual ACL. This automatically recognizes and supports - * extensions described above. The 'type' argument is used to - * indicate the type that should be used for any entries not - * explicitly marked as "default:". + * Parse a wide ACL text string. + * + * The want_type argument may be one of the following: + * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - text is a POSIX.1e ACL of type ACCESS + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - text is a POSIX.1e ACL of type DEFAULT + * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - text is as a NFSv4 ACL + * + * POSIX.1e ACL entries prefixed with "default:" are treated as + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is ARCHIVE_ENTRY_ACL_TYPE_NFS4 */ int -archive_acl_parse_w(struct archive_acl *acl, - const wchar_t *text, int default_type) +archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, + int want_type) { struct { const wchar_t *start; const wchar_t *end; - } field[4], name; + } field[6], name; - int fields, n; - int type, tag, permset, id; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Dec 30 01:31:04 2016 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 C723EC977D5; Fri, 30 Dec 2016 01:31:04 +0000 (UTC) (envelope-from mm@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 96A8E13B6; Fri, 30 Dec 2016 01:31:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1V3kR012074; Fri, 30 Dec 2016 01:31:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1V3pe012073; Fri, 30 Dec 2016 01:31:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300131.uBU1V3pe012073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310797 - vendor/libarchive/dist/libarchive 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.23 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: Fri, 30 Dec 2016 01:31:04 -0000 Author: mm Date: Fri Dec 30 01:31:03 2016 New Revision: 310797 URL: https://svnweb.freebsd.org/changeset/base/310797 Log: Update vendor/libarchive to git e8a9de5eaf3b79fc3d990d056343bb52c51c5ba4 Fix style typo in tar.5 Modified: vendor/libarchive/dist/libarchive/tar.5 Modified: vendor/libarchive/dist/libarchive/tar.5 ============================================================================== --- vendor/libarchive/dist/libarchive/tar.5 Fri Dec 30 01:27:27 2016 (r310796) +++ vendor/libarchive/dist/libarchive/tar.5 Fri Dec 30 01:31:03 2016 (r310797) @@ -441,7 +441,7 @@ archives to store files much larger than Vendor-specific attributes used by Joerg Schilling's .Nm star implementation. -.It Cm SCHILY.acl.access , Cm SCHILY.acl.default, .Cm SCHILY.acl.ace +.It Cm SCHILY.acl.access , Cm SCHILY.acl.default, Cm SCHILY.acl.ace Stores the access, default and NFSv4 ACLs as textual strings in a format that is an extension of the format specified by POSIX.1e draft 17. In particular, each user or group access specification can include From owner-svn-src-vendor@freebsd.org Fri Dec 30 01:34:09 2016 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 20B88C97BF3; Fri, 30 Dec 2016 01:34:09 +0000 (UTC) (envelope-from mm@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 DD448196B; Fri, 30 Dec 2016 01:34:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1Y8kV013123; Fri, 30 Dec 2016 01:34:08 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1Y6YP013108; Fri, 30 Dec 2016 01:34:06 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300134.uBU1Y6YP013108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310798 - in vendor/libarchive/dist: cpio libarchive libarchive/test 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.23 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: Fri, 30 Dec 2016 01:34:09 -0000 Author: mm Date: Fri Dec 30 01:34:06 2016 New Revision: 310798 URL: https://svnweb.freebsd.org/changeset/base/310798 Log: Update vendor/libarchive to git 2a2488a81599f9cd065a8254b16a6fd48d81c3b4 Vendor bugfixes: PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c PR #851: Spelling fixes Fix two protoypes in manual page archive_read_disk.3 Modified: vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/libarchive/archive_match.c vendor/libarchive/dist/libarchive/archive_rb.c vendor/libarchive/dist/libarchive/archive_read_disk.3 vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/cpio/cpio.c Fri Dec 30 01:34:06 2016 (r310798) @@ -703,6 +703,7 @@ file_to_archive(struct cpio *cpio, const lafe_warnc(0, "%s", archive_error_string(cpio->archive_read_disk)); if (r <= ARCHIVE_FAILED) { + archive_entry_free(entry); cpio->return_value = 1; return (r); } Modified: vendor/libarchive/dist/libarchive/archive_match.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_match.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_match.c Fri Dec 30 01:34:06 2016 (r310798) @@ -471,7 +471,7 @@ archive_match_path_excluded(struct archi } /* - * Utilty functions to get statistic information for inclusion patterns. + * Utility functions to get statistic information for inclusion patterns. */ int archive_match_path_unmatched_inclusions(struct archive *_a) @@ -1270,7 +1270,7 @@ set_timefilter_pathname_wcs(struct archi #endif /* _WIN32 && !__CYGWIN__ */ /* - * Call back funtions for archive_rb. + * Call back functions for archive_rb. */ static int cmp_node_mbs(const struct archive_rb_node *n1, @@ -1405,7 +1405,7 @@ add_entry(struct archive_match *a, int f &(a->exclusion_tree), pathname); /* - * We always overwrite comparison condision. + * We always overwrite comparison condition. * If you do not want to overwrite it, you should not * call archive_match_exclude_entry(). We cannot know * what behavior you really expect since overwriting @@ -1481,7 +1481,7 @@ time_excluded(struct archive_match *a, s if (nsec == a->older_ctime_nsec && (a->older_ctime_filter & ARCHIVE_MATCH_EQUAL) == 0) - return (1); /* Eeual, skip it. */ + return (1); /* Equal, skip it. */ } } if (a->newer_mtime_filter) { @@ -1513,7 +1513,7 @@ time_excluded(struct archive_match *a, s } } - /* If there is no excluson list, include the file. */ + /* If there is no exclusion list, include the file. */ if (a->exclusion_entry_list.count == 0) return (0); @@ -1700,7 +1700,7 @@ add_owner_id(struct archive_match *a, st break; } - /* Add oowner id. */ + /* Add owner id. */ if (i == ids->count) ids->ids[ids->count++] = id; else if (ids->ids[i] != id) { Modified: vendor/libarchive/dist/libarchive/archive_rb.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_rb.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_rb.c Fri Dec 30 01:34:06 2016 (r310798) @@ -312,7 +312,7 @@ __archive_rb_tree_insert_rebalance(struc father = RB_FATHER(self); if (RB_BLACK_P(father)) { /* - * If our greatgrandpa is black, we're done. + * If our great-grandpa is black, we're done. */ return; } Modified: vendor/libarchive/dist/libarchive/archive_read_disk.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk.3 Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_read_disk.3 Fri Dec 30 01:34:06 2016 (r310798) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2012 +.Dd December 30, 2016 .Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME @@ -54,9 +54,9 @@ Streaming Archive Library (libarchive, - .Fn archive_read_disk_set_symlink_physical "struct archive *" .Ft int .Fn archive_read_disk_set_symlink_hybrid "struct archive *" -.Ft int +.Ft const char * .Fn archive_read_disk_gname "struct archive *" "gid_t" -.Ft int +.Ft const char * .Fn archive_read_disk_uname "struct archive *" "uid_t" .Ft int .Fo archive_read_disk_set_gname_lookup Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -374,7 +374,7 @@ struct iso9660 { size_t utf16be_path_len; unsigned char *utf16be_previous_path; size_t utf16be_previous_path_len; - /* Null buufer used in bidder to improve its performance. */ + /* Null buffer used in bidder to improve its performance. */ unsigned char null[2048]; }; @@ -1199,7 +1199,7 @@ archive_read_format_iso9660_read_header( archive_string_conversion_from_charset( &(a->archive), "UTF-16BE", 1); if (iso9660->sconv_utf16be == NULL) - /* Coundn't allocate memory */ + /* Couldn't allocate memory */ return (ARCHIVE_FATAL); } if (iso9660->utf16be_path == NULL) { @@ -2407,7 +2407,7 @@ read_CE(struct archive_read *a, struct i return (ARCHIVE_FATAL); } while (heap->cnt && heap->reqs[0].offset == iso9660->current_position); - /* NOTE: Do not move this consume's code to fron of + /* NOTE: Do not move this consume's code to front of * do-while loop. Registration of nested CE extension * might cause error because of current position. */ __archive_read_consume(a, step); @@ -2729,7 +2729,7 @@ next_cache_entry(struct archive_read *a, if (file == NULL) { /* * If directory entries all which are descendant of - * rr_moved are stil remaning, expose their. + * rr_moved are still remaining, expose their. */ if (iso9660->re_files.first != NULL && iso9660->rr_moved != NULL && @@ -2852,7 +2852,7 @@ next_cache_entry(struct archive_read *a, empty_files.last = &empty_files.first; /* Collect files which has the same file serial number. * Peek pending_files so that file which number is different - * is not put bak. */ + * is not put back. */ while (iso9660->pending_files.used > 0 && (iso9660->pending_files.files[0]->number == -1 || iso9660->pending_files.files[0]->number == number)) { @@ -2860,7 +2860,7 @@ next_cache_entry(struct archive_read *a, /* This file has the same offset * but it's wrong offset which empty files * and symlink files have. - * NOTE: This wrong offse was recorded by + * NOTE: This wrong offset was recorded by * old mkisofs utility. If ISO images is * created by latest mkisofs, this does not * happen. Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Fri Dec 30 01:34:06 2016 (r310798) @@ -308,7 +308,7 @@ struct archive_write_disk { #define MAXIMUM_DIR_MODE 0775 /* - * Maxinum uncompressed size of a decmpfs block. + * Maximum uncompressed size of a decmpfs block. */ #define MAX_DECMPFS_BLOCK_SIZE (64 * 1024) /* @@ -323,7 +323,7 @@ struct archive_write_disk { #define RSRC_F_SIZE 50 /* Size of Resource fork footer. */ /* Size to write compressed data to resource fork. */ #define COMPRESSED_W_SIZE (64 * 1024) -/* decmpfs difinitions. */ +/* decmpfs definitions. */ #define MAX_DECMPFS_XATTR_SIZE 3802 #ifndef DECMPFS_XATTR_NAME #define DECMPFS_XATTR_NAME "com.apple.decmpfs" @@ -632,9 +632,9 @@ _archive_write_disk_header(struct archiv /* * NOTE: UF_COMPRESSED is ignored even if the filesystem * supports HFS+ Compression because the file should - * have at least an extended attriute "com.apple.decmpfs" + * have at least an extended attribute "com.apple.decmpfs" * before the flag is set to indicate that the file have - * been compressed. If hte filesystem does not support + * been compressed. If the filesystem does not support * HFS+ Compression the system call will fail. */ if (a->fd < 0 || fchflags(a->fd, UF_COMPRESSED) != 0) @@ -1247,7 +1247,7 @@ hfs_drive_compressor(struct archive_writ ret = hfs_write_compressed_data(a, bytes_used + rsrc_size); a->compressed_buffer_remaining = a->compressed_buffer_size; - /* If the compressed size is not enouph smaller than + /* If the compressed size is not enough smaller than * the uncompressed size. cancel HFS+ compression. * TODO: study a behavior of ditto utility and improve * the condition to fall back into no HFS+ compression. */ @@ -1352,7 +1352,7 @@ hfs_write_decmpfs_block(struct archive_w (uint32_t *)(a->resource_fork + RSRC_H_SIZE); /* Set the block count to the resource fork. */ archive_le32enc(a->decmpfs_block_info++, block_count); - /* Get the position where we are goint to set compressed + /* Get the position where we are going to set compressed * data. */ a->compressed_rsrc_position = RSRC_H_SIZE + 4 + (block_count * 8); @@ -1425,7 +1425,7 @@ hfs_write_data_block(struct archive_writ bytes_to_write = size; /* Seek if necessary to the specified offset. */ if (a->offset < a->fd_offset) { - /* Can't support backword move. */ + /* Can't support backward move. */ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek failed"); return (ARCHIVE_FATAL); Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -161,7 +161,7 @@ struct isofile { /* Used for managing struct isofile list. */ struct isofile *allnext; struct isofile *datanext; - /* Used for managing a hardlined struct isofile list. */ + /* Used for managing a hardlinked struct isofile list. */ struct isofile *hlnext; struct isofile *hardlink_target; @@ -528,7 +528,7 @@ struct iso_option { * - allow more then 8 depths of directory trees; * - disable a version number to a File Name; * - disable a forced period to the tail of a File Name; - * - the maxinum length of files and directories is raised to 193. + * - the maximum length of files and directories is raised to 193. * if rockridge option is disabled, raised to 207. */ unsigned int iso_level:3; @@ -626,7 +626,7 @@ struct iso_option { * : NOTE Our rockridge=useful option does not set a zero * : to uid and gid, you should use application * : option such as --gid,--gname,--uid and --uname - * : badtar options instead. + * : bsdtar options instead. * Type : boolean/string * Default: Enabled as rockridge=useful * COMPAT : mkisofs -r / -R @@ -660,7 +660,7 @@ struct iso_option { * : for making zisofs. * : When the file size is less than one Logical Block * : size, that file will not zisofs'ed since it does - * : reduece an ISO-image size. + * : reduce an ISO-image size. * : * : When you specify option 'boot=', that * : 'boot-image' file won't be converted to zisofs file. @@ -703,7 +703,7 @@ struct iso9660 { } all_file_list; /* A list of struct isofile entries which have its - * contents and are not a directory, a hardlined file + * contents and are not a directory, a hardlinked file * and a symlink file. */ struct { struct isofile *first; @@ -1907,9 +1907,9 @@ iso9660_close(struct archive_write *a) iso9660->primary.rootent); if (ret < 0) return (ret); - /* Make sure we have UTF-16BE convertors. - * if there is no file entry, convertors are still - * uninitilized. */ + /* Make sure we have UTF-16BE converters. + * if there is no file entry, converters are still + * uninitialized. */ if (iso9660->sconv_to_utf16be == NULL) { iso9660->sconv_to_utf16be = archive_string_conversion_to_charset( @@ -2959,7 +2959,7 @@ set_directory_record_rr(unsigned char *b gid = archive_entry_gid(file->entry); if (iso9660->opt.rr == OPT_RR_USEFUL) { /* - * This action is simular mkisofs -r option + * This action is similar to mkisofs -r option * but our rockridge=useful option does not * set a zero to uid and gid. */ @@ -3108,7 +3108,7 @@ set_directory_record_rr(unsigned char *b /* * flg len * +----+----+ - * | 02 | 00 | CURREENT component. + * | 02 | 00 | CURRENT component. * +----+----+ (".") */ if (nc != NULL) { @@ -3947,7 +3947,7 @@ write_VD(struct archive_write *a, struct "Abstract File", 0, D_CHAR); if (r != ARCHIVE_OK) return (r); - /* Bibliongraphic File Identifier */ + /* Bibliographic File Identifier */ r = set_file_identifier(bp, 777, 813, vdc, a, vdd, &(iso9660->bibliographic_file_identifier), "Bibliongraphic File", 0, D_CHAR); @@ -6135,7 +6135,7 @@ isoent_gen_iso9660_identifier(struct arc off = ffmax - extlen; if (off == 0) { /* A dot('.') character - * does't place to the first + * doesn't place to the first * byte of identifier. */ off ++; extlen --; @@ -7149,7 +7149,7 @@ isoent_create_boot_catalog(struct archiv iso9660->el_torito.catalog = isoent; /* - * Get a boot medai type. + * Get a boot media type. */ switch (iso9660->opt.boot_type) { default: Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c Fri Dec 30 01:34:06 2016 (r310798) @@ -79,7 +79,7 @@ typedef enum { WT_RVIS, /* conversion, unsupported */ WT_CONV, - /* continutation, unsupported at the moment */ + /* continuation, unsupported at the moment */ WT_CONT, /* invalid type */ LAST_WT Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Fri Dec 30 01:34:06 2016 (r310798) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * - When writing an XML element , * which is a file type a symbolic link is referencing is always marked * as "broken". Xar utility uses stat(2) to get the file type, but, in - * libarcive format writer, we should not use it; if it is needed, we + * libarchive format writer, we should not use it; if it is needed, we * should get about it at archive_read_disk.c. * - It is possible to appear both and elements. * Xar utility generates on BSD platform and on Linux @@ -1227,7 +1227,7 @@ make_file_entry(struct archive_write *a, case AE_IFLNK: /* * xar utility has checked a file type, which - * a symblic-link file has referenced. + * a symbolic-link file has referenced. * For example: * ../ref/ * The symlink target file is "../ref/" and its @@ -1237,8 +1237,8 @@ make_file_entry(struct archive_write *a, * The symlink target file is "../f" and its * file type is a regular file. * - * But our implemention cannot do it, and then we - * always record that a attribute "type" is "borken", + * But our implementation cannot do it, and then we + * always record that a attribute "type" is "broken", * for example: * foo/bar * It means "foo/bar" is not reachable. @@ -1544,7 +1544,7 @@ make_toc(struct archive_write *a) } /* - * Start recoding TOC + * Start recording TOC */ r = xmlTextWriterStartElement(writer, BAD_CAST("xar")); if (r < 0) { @@ -2484,7 +2484,7 @@ file_connect_hardlink_files(struct xar * archive_entry_set_nlink(target->entry, hl->nlink); if (hl->nlink > 1) /* It means this file is a hardlink - * targe itself. */ + * target itself. */ target->hardlink_target = target; for (nf = target->hlnext; nf != NULL; nf = nf->hlnext) { Modified: vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 01:34:06 2016 (r310798) @@ -283,7 +283,7 @@ DEFINE_TEST(test_acl_freebsd_posix1e_res } /* - * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + * Verify ACL read-from-disk. This test is FreeBSD-specific. */ DEFINE_TEST(test_acl_freebsd_posix1e_read) { Modified: vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c Fri Dec 30 01:34:06 2016 (r310798) @@ -688,7 +688,7 @@ test_symname() assertEqualInt(32, archive_read_data(a, buff, sizeof(buff))); assertEqualMem(buff, "hellohellohello\nhellohellohello\n", 32); - /* Verify symbolic-linke symlinkfile. */ + /* Verify symbolic-link symlinkfile. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt((AE_IFLNK | 0755), archive_entry_mode(ae)); assertEqualString("symlinkfile", archive_entry_pathname(ae)); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 01:34:06 2016 (r310798) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_bz2.c 201247 2009-12-30 05:59:21Z kientzle $"); /* -PLEASE use old cdrtools; mkisofs verion is 2.01. +PLEASE use old cdrtools; mkisofs version is 2.01. This version mkisofs made wrong "SL" System Use Entry of RRIP. Execute the following command to rebuild the data for this program: Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 01:34:06 2016 (r310798) @@ -1116,7 +1116,7 @@ cleanup: * - the filename of second file is stored in UTF-8. * * Whenever hdrcharset option is specified, we will correctly read the - * filename of sencod file, which is stored in UTF-8. + * filename of second file, which is stored in UTF-8. */ DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2) Modified: vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -719,7 +719,7 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(5, archive_entry_ctime(ae)); assert(archive_entry_mtime_is_set(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - /* Trim lngname to 64 characters. */ + /* Trim longname to 64 characters. */ longname[64] = '\0'; assertEqualString(longname, archive_entry_pathname(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); Modified: vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 01:34:06 2016 (r310798) @@ -25,7 +25,7 @@ #include "test.h" /* - * Check that a "zisofs" ISO 9660 imaeg is correctly created. + * Check that a "zisofs" ISO 9660 image is correctly created. */ static const unsigned char primary_id[] = { From owner-svn-src-vendor@freebsd.org Fri Dec 30 18:14:32 2016 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 09B18C97D27; Fri, 30 Dec 2016 18:14:32 +0000 (UTC) (envelope-from cognet@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 B8DA415FA; Fri, 30 Dec 2016 18:14:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUIEVO1022589; Fri, 30 Dec 2016 18:14:31 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUIEUQ5022584; Fri, 30 Dec 2016 18:14:30 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201612301814.uBUIEUQ5022584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 30 Dec 2016 18:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310843 - in vendor-sys/ck/dist: include include/gcc include/gcc/aarch64 include/gcc/arm include/gcc/ppc64 include/gcc/x86_64 src X-SVN-Group: vendor-sys 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.23 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: Fri, 30 Dec 2016 18:14:32 -0000 Author: cognet Date: Fri Dec 30 18:14:30 2016 New Revision: 310843 URL: https://svnweb.freebsd.org/changeset/base/310843 Log: Import CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mainly to add the option to disable double-related functions, as we don't want them in the kernel. Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h (contents, props changed) vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h (contents, props changed) Deleted: vendor-sys/ck/dist/src/Makefile.in Modified: vendor-sys/ck/dist/include/ck_pr.h vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h vendor-sys/ck/dist/include/gcc/arm/ck_pr.h vendor-sys/ck/dist/include/gcc/ck_pr.h vendor-sys/ck/dist/include/gcc/ppc64/ck_pr.h vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h Modified: vendor-sys/ck/dist/include/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/ck_pr.h Fri Dec 30 18:02:12 2016 (r310842) +++ vendor-sys/ck/dist/include/ck_pr.h Fri Dec 30 18:14:30 2016 (r310843) @@ -169,7 +169,9 @@ ck_pr_rfo(const void *m) #define ck_pr_store_ptr(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), ptr) #define ck_pr_store_char(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_store_double(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), double) +#endif #define ck_pr_store_uint(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), uint) #define ck_pr_store_int(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), int) #define ck_pr_store_32(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), 32) @@ -187,7 +189,9 @@ ck_pr_rfo(const void *m) #define CK_PR_LOAD_SAFE(SRC, TYPE) ck_pr_md_load_##TYPE((SRC)) #define ck_pr_load_char(SRC) CK_PR_LOAD_SAFE((SRC), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_load_double(SRC) CK_PR_LOAD_SAFE((SRC), double) +#endif #define ck_pr_load_uint(SRC) CK_PR_LOAD_SAFE((SRC), uint) #define ck_pr_load_int(SRC) CK_PR_LOAD_SAFE((SRC), int) #define ck_pr_load_32(SRC) CK_PR_LOAD_SAFE((SRC), 32) @@ -275,7 +279,8 @@ CK_PR_BIN_S(or, int, int, |) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_ADD_DOUBLE #define CK_F_PR_ADD_DOUBLE @@ -287,7 +292,7 @@ CK_PR_BIN_S(add, double, double, +) CK_PR_BIN_S(sub, double, double, -) #endif /* CK_F_PR_SUB_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -675,7 +680,8 @@ CK_PR_UNARY_Z_S(dec, int, int, -, 1) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_INC_DOUBLE #define CK_F_PR_INC_DOUBLE @@ -687,7 +693,7 @@ CK_PR_UNARY_S(inc, add, double, double) CK_PR_UNARY_S(dec, sub, double, double) #endif /* CK_F_PR_DEC_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -914,14 +920,15 @@ CK_PR_N_Z_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_NEG_DOUBLE #define CK_F_PR_NEG_DOUBLE CK_PR_N_S(neg, double, double, -) #endif /* CK_F_PR_NEG_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -1105,7 +1112,8 @@ CK_PR_FAS_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_FAA_DOUBLE #define CK_F_PR_FAA_DOUBLE @@ -1117,7 +1125,7 @@ CK_PR_FAA_S(double, double) CK_PR_FAS_S(double, double) #endif /* CK_F_PR_FAS_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) Modified: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:02:12 2016 (r310842) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:14:30 2016 (r310843) @@ -124,7 +124,9 @@ CK_PR_LOAD_S(uint, unsigned int, "ldr") CK_PR_LOAD_S(int, int, "ldr") CK_PR_LOAD_S(short, short, "ldrh") CK_PR_LOAD_S(char, char, "ldrb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_LOAD_S_64(double, double, "ldr") +#endif #undef CK_PR_LOAD_S #undef CK_PR_LOAD_S_64 @@ -167,326 +169,59 @@ CK_PR_STORE_S(uint, unsigned int, "str") CK_PR_STORE_S(int, int, "str") CK_PR_STORE_S(short, short, "strh") CK_PR_STORE_S(char, char, "strb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_STORE_S_64(double, double, "str") +#endif #undef CK_PR_STORE_S #undef CK_PR_STORE_S_64 #undef CK_PR_STORE #undef CK_PR_STORE_64 -CK_CC_INLINE static bool -ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%4];" - "mov %2, %0;" - "mov %3, %1;" - "eor %0, %0, %5;" - "eor %1, %1, %6;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %7, %8, [%4];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} - -CK_CC_INLINE static bool -ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) -{ - return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set), - CK_CPP_CAST(uint64_t *, value))); -} - -CK_CC_INLINE static bool -ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%2];" - "eor %0, %0, %3;" - "eor %1, %1, %4;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %5, %6, [%2];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} -CK_CC_INLINE static bool -ck_pr_cas_ptr_2(void *target, void *compare, void *set) -{ - return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set))); -} - - -#define CK_PR_CAS(N, M, T, W, R) \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - *(T *)value = previous; \ - return (previous == compare); \ - } \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N(M *target, T compare, T set) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__( \ - "1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - return (previous == compare); \ - } - -CK_PR_CAS(ptr, void, void *, "", "") - -#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) -CK_PR_CAS_S(64, uint64_t, "", "") -CK_PR_CAS_S(double, double, "", "") -CK_PR_CAS_S(32, uint32_t, "", "w") -CK_PR_CAS_S(uint, unsigned int, "", "w") -CK_PR_CAS_S(int, int, "", "w") -CK_PR_CAS_S(16, uint16_t, "h", "w") -CK_PR_CAS_S(8, uint8_t, "b", "w") -CK_PR_CAS_S(short, short, "h", "w") -CK_PR_CAS_S(char, char, "b", "w") - - -#undef CK_PR_CAS_S -#undef CK_PR_CAS - -#define CK_PR_FAS(N, M, T, W, R) \ - CK_CC_INLINE static T \ - ck_pr_fas_##N(M *target, T v) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "stxr" W " %w1, %" R "3, [%2];"\ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (v) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAS(64, uint64_t, uint64_t, "", "") -CK_PR_FAS(32, uint32_t, uint32_t, "", "w") -CK_PR_FAS(ptr, void, void *, "", "") -CK_PR_FAS(int, int, int, "", "w") -CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") -CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") -CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") -CK_PR_FAS(short, short, short, "h", "w") -CK_PR_FAS(char, char, char, "b", "w") - - -#undef CK_PR_FAS - -#define CK_PR_UNARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target) \ - { \ - T previous = 0; \ - T tmp = 0; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - I ";" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "", "") -CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, 64, uint64_t, uint64_t, "neg %0, %0", "", "") - -#define CK_PR_UNARY_S(S, T, W) \ - CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ - CK_PR_UNARY(neg, S, T, T, "neg %w0, %w0", W, "w") \ - -CK_PR_UNARY_S(32, uint32_t, "") -CK_PR_UNARY_S(uint, unsigned int, "") -CK_PR_UNARY_S(int, int, "") -CK_PR_UNARY_S(16, uint16_t, "h") -CK_PR_UNARY_S(8, uint8_t, "b") -CK_PR_UNARY_S(short, short, "h") -CK_PR_UNARY_S(char, char, "b") - -#undef CK_PR_UNARY_S -#undef CK_PR_UNARY - -#define CK_PR_BINARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target, T delta) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];"\ - I " %" R "0, %" R "0, %" R "3;" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") -CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") -CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") -CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") -CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") -CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") -CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") -CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") -CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") -CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") - -#define CK_PR_BINARY_S(S, T, W) \ - CK_PR_BINARY(and, S, T, T, "and", W, "w") \ - CK_PR_BINARY(add, S, T, T, "add", W, "w") \ - CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ - CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ - CK_PR_BINARY(xor, S, T, T, "eor", W, "w") - -CK_PR_BINARY_S(32, uint32_t, "") -CK_PR_BINARY_S(uint, unsigned int, "") -CK_PR_BINARY_S(int, int, "") -CK_PR_BINARY_S(16, uint16_t, "h") -CK_PR_BINARY_S(8, uint8_t, "b") -CK_PR_BINARY_S(short, short, "h") -CK_PR_BINARY_S(char, char, "b") - -#undef CK_PR_BINARY_S -#undef CK_PR_BINARY - -CK_CC_INLINE static void * -ck_pr_faa_ptr(void *target, uintptr_t delta) -{ - uintptr_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (void *)(previous); -} - -CK_CC_INLINE static uint64_t -ck_pr_faa_64(uint64_t *target, uint64_t delta) -{ - uint64_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (previous); -} - -#define CK_PR_FAA(S, T, W) \ - CK_CC_INLINE static T \ - ck_pr_faa_##S(T *target, T delta) \ - { \ - T previous, r, tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %w0, [%3];" \ - "add %w1, %w4, %w0;" \ - "stxr" W " %w2, %w1, [%3];" \ - "cbnz %w2, 1b;" \ - : "=&r" (previous), \ - "=&r" (r), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAA(32, uint32_t, "") -CK_PR_FAA(uint, unsigned int, "") -CK_PR_FAA(int, int, "") -CK_PR_FAA(16, uint16_t, "h") -CK_PR_FAA(8, uint8_t, "b") -CK_PR_FAA(short, short, "h") -CK_PR_FAA(char, char, "b") +#ifdef CK_MD_LSE_ENABLE +#include "ck_pr_lse.h" +#else +#include "ck_pr_llsc.h" +#endif + +/* + * ck_pr_neg_*() functions can only be implemented via LL/SC, as there are no + * LSE alternatives. + */ +#define CK_PR_NEG(N, M, T, W, R) \ + CK_CC_INLINE static void \ + ck_pr_neg_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "neg %" R "0, %" R "0;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_NEG(ptr, void, void *, "", "") +CK_PR_NEG(64, uint64_t, uint64_t, "", "") + +#define CK_PR_NEG_S(S, T, W) \ + CK_PR_NEG(S, T, T, W, "w") \ + +CK_PR_NEG_S(32, uint32_t, "") +CK_PR_NEG_S(uint, unsigned int, "") +CK_PR_NEG_S(int, int, "") +CK_PR_NEG_S(16, uint16_t, "h") +CK_PR_NEG_S(8, uint8_t, "b") +CK_PR_NEG_S(short, short, "h") +CK_PR_NEG_S(char, char, "b") -#undef CK_PR_FAA +#undef CK_PR_NEG_S +#undef CK_PR_NEG #endif /* CK_PR_AARCH64_H */ Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h Fri Dec 30 18:14:30 2016 (r310843) @@ -0,0 +1,352 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS 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. + */ + +#ifndef CK_PR_AARCH64_LLSC_H +#define CK_PR_AARCH64_LLSC_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%4];" + "mov %2, %0;" + "mov %3, %1;" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %7, %8, [%4];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%2];" + "eor %0, %0, %3;" + "eor %1, %1, %4;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %5, %6, [%2];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + *(T *)value = previous; \ + return (previous == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__( \ + "1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "stxr" W " %w1, %" R "3, [%2];"\ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (v) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAS(64, uint64_t, uint64_t, "", "") +CK_PR_FAS(32, uint32_t, uint32_t, "", "w") +CK_PR_FAS(ptr, void, void *, "", "") +CK_PR_FAS(int, int, int, "", "w") +CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") +CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") +CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") +CK_PR_FAS(short, short, short, "h", "w") +CK_PR_FAS(char, char, char, "b", "w") + + +#undef CK_PR_FAS + +#define CK_PR_UNARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + I ";" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") +CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") + +#define CK_PR_UNARY_S(S, T, W) \ + CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ + +CK_PR_UNARY_S(32, uint32_t, "") +CK_PR_UNARY_S(uint, unsigned int, "") +CK_PR_UNARY_S(int, int, "") +CK_PR_UNARY_S(16, uint16_t, "h") +CK_PR_UNARY_S(8, uint8_t, "b") +CK_PR_UNARY_S(short, short, "h") +CK_PR_UNARY_S(char, char, "b") + +#undef CK_PR_UNARY_S +#undef CK_PR_UNARY + +#define CK_PR_BINARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target, T delta) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];"\ + I " %" R "0, %" R "0, %" R "3;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") +CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") +CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") +CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") +CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") +CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") +CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") +CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") +CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") +CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") + +#define CK_PR_BINARY_S(S, T, W) \ + CK_PR_BINARY(and, S, T, T, "and", W, "w") \ + CK_PR_BINARY(add, S, T, T, "add", W, "w") \ + CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ + CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ + CK_PR_BINARY(xor, S, T, T, "eor", W, "w") + +CK_PR_BINARY_S(32, uint32_t, "") +CK_PR_BINARY_S(uint, unsigned int, "") +CK_PR_BINARY_S(int, int, "") +CK_PR_BINARY_S(16, uint16_t, "h") +CK_PR_BINARY_S(8, uint8_t, "b") +CK_PR_BINARY_S(short, short, "h") +CK_PR_BINARY_S(char, char, "b") + +#undef CK_PR_BINARY_S +#undef CK_PR_BINARY + +CK_CC_INLINE static void * +ck_pr_faa_ptr(void *target, uintptr_t delta) +{ + uintptr_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (void *)(previous); +} + +CK_CC_INLINE static uint64_t +ck_pr_faa_64(uint64_t *target, uint64_t delta) +{ + uint64_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (previous); +} + +#define CK_PR_FAA(S, T, W) \ + CK_CC_INLINE static T \ + ck_pr_faa_##S(T *target, T delta) \ + { \ + T previous, r, tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %w0, [%3];" \ + "add %w1, %w4, %w0;" \ + "stxr" W " %w2, %w1, [%3];" \ + "cbnz %w2, 1b;" \ + : "=&r" (previous), \ + "=&r" (r), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAA(32, uint32_t, "") +CK_PR_FAA(uint, unsigned int, "") +CK_PR_FAA(int, int, "") +CK_PR_FAA(16, uint16_t, "h") +CK_PR_FAA(8, uint8_t, "b") +CK_PR_FAA(short, short, "h") +CK_PR_FAA(char, char, "b") + +#undef CK_PR_FAA + +#endif /* CK_PR_AARCH64_LLSC_H */ Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h Fri Dec 30 18:14:30 2016 (r310843) @@ -0,0 +1,298 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * Copyright 2016 Alexey Kopytov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS 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. + */ + +#ifndef CK_PR_AARCH64_LSE_H +#define CK_PR_AARCH64_LSE_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1; + uint64_t tmp2; + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %4, %5, [%6];" + "eor %2, %0, %7;" + "eor %3, %1, %8;" + "orr %2, %2, %3;" + : "+&r" (x0), "+&r" (x1), "=&r" (tmp1), "=&r" (tmp2) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + value[0] = x0; + value[1] = x1; + + return (!!tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %2, %3, [%4];" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %0, %0, %1;" + : "+&r" (x0), "+&r" (x1) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + return (!!x0); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + *(T *)value = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (*(T *)value) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (*(T *)value == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (previous) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous; \ + __asm__ __volatile__( \ + "swp" W " %" R "2, %" R "0, [%1];" \ + : "=&r" (previous) \ + : "r" (target), \ + "r" (v) \ + : "memory"); \ + return (previous); \ + } + +CK_PR_FAS(64, uint64_t, uint64_t, "", "") +CK_PR_FAS(32, uint32_t, uint32_t, "", "w") +CK_PR_FAS(ptr, void, void *, "", "") +CK_PR_FAS(int, int, int, "", "w") +CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") +CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") +CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Dec 30 18:17:45 2016 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 73E5FC97DE8; Fri, 30 Dec 2016 18:17:45 +0000 (UTC) (envelope-from cognet@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 2A03C177E; Fri, 30 Dec 2016 18:17:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUIHiuM022735; Fri, 30 Dec 2016 18:17:44 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUIHiau022734; Fri, 30 Dec 2016 18:17:44 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201612301817.uBUIHiau022734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 30 Dec 2016 18:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310844 - vendor-sys/ck/20161230 X-SVN-Group: vendor-sys 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.23 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: Fri, 30 Dec 2016 18:17:45 -0000 Author: cognet Date: Fri Dec 30 18:17:44 2016 New Revision: 310844 URL: https://svnweb.freebsd.org/changeset/base/310844 Log: Tag CK import as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8 Added: vendor-sys/ck/20161230/ - copied from r310843, vendor-sys/ck/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 30 23:00:02 2016 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 513D9C9860A; Fri, 30 Dec 2016 23:00:02 +0000 (UTC) (envelope-from mm@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 EDD521438; Fri, 30 Dec 2016 23:00:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUN015a043923; Fri, 30 Dec 2016 23:00:01 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUN01RI043921; Fri, 30 Dec 2016 23:00:01 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612302300.uBUN01RI043921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 23:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310869 - vendor/libarchive/dist/libarchive 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.23 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: Fri, 30 Dec 2016 23:00:02 -0000 Author: mm Date: Fri Dec 30 23:00:00 2016 New Revision: 310869 URL: https://svnweb.freebsd.org/changeset/base/310869 Log: Update vendor/libarchive to git ab94a813b0f64cbc1bcb952bf55424a2d9c7f1d9 Vendor bugfixes: Use __LA_DEPRECATED macro with functions deprecated in 379867e (r310796) Modified: vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_locale.h Modified: vendor/libarchive/dist/libarchive/archive_entry.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.h Fri Dec 30 22:54:08 2016 (r310868) +++ vendor/libarchive/dist/libarchive/archive_entry.h Fri Dec 30 23:00:00 2016 (r310869) @@ -105,6 +105,12 @@ typedef int64_t la_int64_t; # define __LA_DECL #endif +#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +# define __LA_DEPRECATED __attribute__((deprecated)) +#else +# define __LA_DEPRECATED +#endif + #ifdef __cplusplus extern "C" { #endif @@ -529,9 +535,9 @@ __LA_DECL int archive_entry_acl_from_tex /* Deprecated functions */ __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; /* Return bitmask of ACL types in an archive entry */ __LA_DECL int archive_entry_acl_types(struct archive_entry *); Modified: vendor/libarchive/dist/libarchive/archive_entry_locale.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry_locale.h Fri Dec 30 22:54:08 2016 (r310868) +++ vendor/libarchive/dist/libarchive/archive_entry_locale.h Fri Dec 30 23:00:00 2016 (r310869) @@ -63,8 +63,7 @@ int _archive_entry_uname_l(struct archiv const char **, size_t *, struct archive_string_conv *); #define archive_entry_acl_text_l _archive_entry_acl_text_l int _archive_entry_acl_text_l(struct archive_entry *, int, -const char **, size_t *, struct archive_string_conv *) -__attribute__ ((deprecated)); +const char **, size_t *, struct archive_string_conv *) __LA_DEPRECATED; #define archive_entry_acl_to_text_l _archive_entry_acl_to_text_l char *_archive_entry_acl_to_text_l(struct archive_entry *, ssize_t *, int, struct archive_string_conv *);