From owner-svn-src-vendor@freebsd.org Sun Oct 23 00:24:29 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 85E35C1DDBA; Sun, 23 Oct 2016 00:24:29 +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 4A178F85; Sun, 23 Oct 2016 00:24:29 +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 u9N0OS3g094168; Sun, 23 Oct 2016 00:24:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9N0OPPh094137; Sun, 23 Oct 2016 00:24:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610230024.u9N0OPPh094137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 23 Oct 2016 00:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307809 - in vendor/heirloom-doctools/dist: . checknr eqn eqn/checkeq.d eqn/eqnchar.d grap include mpm pic picpack ptx refer tbl troff troff/libhnj troff/nroff.d troff/troff.d troff/tro... 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, 23 Oct 2016 00:24:29 -0000 Author: bapt Date: Sun Oct 23 00:24:25 2016 New Revision: 307809 URL: https://svnweb.freebsd.org/changeset/base/307809 Log: Import heirloom doctools snapshot 20161016 Added: vendor/heirloom-doctools/dist/compat.c (contents, props changed) Deleted: vendor/heirloom-doctools/dist/picpack/getopt.c vendor/heirloom-doctools/dist/troff/troff.d/devaps/getopt.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/getopt.c Modified: vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c vendor/heirloom-doctools/dist/eqn/diacrit.c vendor/heirloom-doctools/dist/eqn/e.h vendor/heirloom-doctools/dist/eqn/eqnbox.c vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c vendor/heirloom-doctools/dist/eqn/funny.c vendor/heirloom-doctools/dist/eqn/integral.c vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/dist/eqn/lookup.c vendor/heirloom-doctools/dist/eqn/matrix.c vendor/heirloom-doctools/dist/eqn/paren.c vendor/heirloom-doctools/dist/eqn/shift.c vendor/heirloom-doctools/dist/eqn/text.c vendor/heirloom-doctools/dist/grap/coord.c vendor/heirloom-doctools/dist/grap/grap.h vendor/heirloom-doctools/dist/grap/input.c vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/dist/grap/misc.c vendor/heirloom-doctools/dist/include/global.h vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/dist/mpm/misc.h vendor/heirloom-doctools/dist/pic/arcgen.c vendor/heirloom-doctools/dist/pic/blockgen.c vendor/heirloom-doctools/dist/pic/for.c vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/dist/pic/misc.c vendor/heirloom-doctools/dist/pic/pic.h vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/dist/pic/pltroff.c vendor/heirloom-doctools/dist/pic/symtab.c vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/dist/picpack/picpack.c 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/deliv2.c vendor/heirloom-doctools/dist/refer/glue1.c vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/dist/refer/glue4.c vendor/heirloom-doctools/dist/refer/glue5.c vendor/heirloom-doctools/dist/refer/hunt1.c vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/dist/refer/hunt5.c vendor/heirloom-doctools/dist/refer/hunt6.c vendor/heirloom-doctools/dist/refer/hunt7.c vendor/heirloom-doctools/dist/refer/hunt8.c vendor/heirloom-doctools/dist/refer/hunt9.c vendor/heirloom-doctools/dist/refer/inv1.c vendor/heirloom-doctools/dist/refer/inv2.c vendor/heirloom-doctools/dist/refer/inv3.c vendor/heirloom-doctools/dist/refer/inv5.c vendor/heirloom-doctools/dist/refer/inv6.c vendor/heirloom-doctools/dist/refer/mkey1.c vendor/heirloom-doctools/dist/refer/mkey2.c vendor/heirloom-doctools/dist/refer/refer..c vendor/heirloom-doctools/dist/refer/refer0.c vendor/heirloom-doctools/dist/refer/refer1.c vendor/heirloom-doctools/dist/refer/refer2.c vendor/heirloom-doctools/dist/refer/refer3.c vendor/heirloom-doctools/dist/refer/refer5.c vendor/heirloom-doctools/dist/refer/refer6.c vendor/heirloom-doctools/dist/refer/refer7.c vendor/heirloom-doctools/dist/refer/refer8.c vendor/heirloom-doctools/dist/refer/shell.c vendor/heirloom-doctools/dist/refer/sortbib.c vendor/heirloom-doctools/dist/refer/tick.c vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/dist/tbl/t..c vendor/heirloom-doctools/dist/tbl/t0.c vendor/heirloom-doctools/dist/tbl/t1.c vendor/heirloom-doctools/dist/tbl/t3.c vendor/heirloom-doctools/dist/tbl/t4.c vendor/heirloom-doctools/dist/tbl/t5.c vendor/heirloom-doctools/dist/tbl/t8.c vendor/heirloom-doctools/dist/tbl/tb.c vendor/heirloom-doctools/dist/tbl/tc.c vendor/heirloom-doctools/dist/tbl/te.c vendor/heirloom-doctools/dist/tbl/tg.c vendor/heirloom-doctools/dist/tbl/tm.c vendor/heirloom-doctools/dist/tbl/ts.c vendor/heirloom-doctools/dist/tbl/tt.c vendor/heirloom-doctools/dist/tbl/tu.c vendor/heirloom-doctools/dist/tbl/tv.c vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/dist/troff/libhnj/hnjalloc.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/n4.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/nroff.d/draw.c vendor/heirloom-doctools/dist/troff/nroff.d/n10.c 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/devaps/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/color.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.h vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/draw.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/gen.h vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.h vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/dist/troff/troff.d/fontmap.c vendor/heirloom-doctools/dist/troff/troff.d/fontmap.h 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/vgrind/vfontedpr.c Modified: vendor/heirloom-doctools/dist/checknr/checknr.c ============================================================================== --- vendor/heirloom-doctools/dist/checknr/checknr.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/checknr/checknr.c Sun Oct 23 00:24:25 2016 (r307809) @@ -179,7 +179,6 @@ static void checkknown(char *mac); static void addcmd(char *line); static void addmac(char *mac); static int binsrch(char *mac); -static char *fgetline(char **line, size_t *linesize, size_t *llen, FILE *fp); static void growstk(void) @@ -307,7 +306,7 @@ process(FILE *f) int pl; stktop = -1; - for (lineno = 1; fgetline(&line, &linesize, NULL, f); lineno++) { + for (lineno = 1; getline(&line, &linesize, f) > 0; lineno++) { if (line[0] == '.') { /* * find and isolate the macro/command name. @@ -636,34 +635,3 @@ binsrch(char *mac) slot = bot; /* place it would have gone */ return (-1); } - -#define LSIZE 256 - -static char * -fgetline(char **line, size_t *linesize, size_t *llen, FILE *fp) -{ - int c; - size_t n = 0; - - if (*line == NULL || *linesize < LSIZE + n + 1) - *line = realloc(*line, *linesize = LSIZE + n + 1); - for (;;) { - if (n >= *linesize - LSIZE / 2) - *line = realloc(*line, *linesize += LSIZE); - c = getc(fp); - if (c != EOF) { - (*line)[n++] = c; - (*line)[n] = '\0'; - if (c == '\n') - break; - } else { - if (n > 0) - break; - else - return NULL; - } - } - if (llen) - *llen = n; - return *line; -} Added: vendor/heirloom-doctools/dist/compat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/compat.c Sun Oct 23 00:24:25 2016 (r307809) @@ -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 Modified: vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c Sun Oct 23 00:24:25 2016 (r307809) @@ -31,7 +31,6 @@ static const char sccsid[] USED = "@(#)/ #include static void check(FILE *); -static char *fgetline(char **, size_t *, FILE *); static FILE *fin; static int delim = '$'; @@ -62,7 +61,7 @@ check(FILE *f) size_t insize = 0; start = eq = line = ndel = totdel = 0; - while (fgetline(&in, &insize, f) != NULL) { + while (getline(&in, &insize, f) > 0) { line++; ndel = 0; for (p = in; *p; p++) @@ -127,22 +126,3 @@ check(FILE *f) if (eq) printf(" Unfinished EQ\n"); } - -static char * -fgetline(char **lp, size_t *zp, FILE *fp) -{ - size_t n = 0; - int c; - - while ((c = getc(fp)) != EOF) { - if (n >= *zp) - *lp = realloc(*lp, *zp += 600); - (*lp)[n++] = c; - if (c == '\n') - break; - } - if (n >= *zp) - *lp = realloc(*lp, *zp += 600); - (*lp)[n] = 0; - return c != EOF ? *lp : NULL; -} Modified: vendor/heirloom-doctools/dist/eqn/diacrit.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/diacrit.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/diacrit.c Sun Oct 23 00:24:25 2016 (r307809) @@ -35,7 +35,7 @@ diacrit(int p1, int type) { t = oalloc(); #ifdef NEQN nrwid(p1, ps, p1); - printf(".nr 10 %gu\n", max(eht[p1]-ebase[p1]-VERT(2),0)); + printf(".nr 10 %gu\n", (float)max(eht[p1]-ebase[p1]-VERT(2),0)); #else /* NEQN */ effps = EFFPS(ps); nrwid(p1, effps, p1); Modified: vendor/heirloom-doctools/dist/eqn/e.h ============================================================================== --- vendor/heirloom-doctools/dist/eqn/e.h Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/e.h Sun Oct 23 00:24:25 2016 (r307809) @@ -29,11 +29,6 @@ #include #include "global.h" -#if defined (__GLIBC__) && defined (_IO_getc_unlocked) -#undef getc -#define getc(f) _IO_getc_unlocked(f) -#endif - #define FATAL 1 #define ROM '1' #ifndef NEQN @@ -92,8 +87,8 @@ extern int markline; /* 1 if this EQ/EN extern char *progname; typedef struct s_tbl { - char *name; - char *defn; + const char *name; + const char *defn; struct s_tbl *next; } tbl; extern char *spaceval; /* use in place of normal \x (for pic) */ @@ -125,7 +120,6 @@ int eqn(int, char **); int getline(char **, size_t *); void do_inline(void); void putout(int); -float max(float, float); int oalloc(void); void ofree(int); void setps(float); @@ -137,7 +131,7 @@ void error(int, const char *, ...); /* lex.c */ int gtc(void); int openinfile(void); -void pbstr(register char *); +void pbstr(register const char *); int yylex(void); int getstr(char *, register int); int cstr(char *, int, int); @@ -147,7 +141,7 @@ char *strsave(char *); void include(void); void delim(void); /* lookup.c */ -tbl *lookup(tbl **, char *, char *); +tbl *lookup(tbl **, const char *, const char *); void init_tbl(void); /* mark.c */ void mark(int); @@ -161,7 +155,7 @@ void move(int, int, int); void boverb(int, int); /* paren.c */ void paren(int, int, int); -void brack(int, char *, char *, char *); +void brack(int, const char *, const char *, const char *); /* pile.c */ void lpile(int, int, int); /* shift.c */ Modified: vendor/heirloom-doctools/dist/eqn/eqnbox.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqnbox.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/eqnbox.c Sun Oct 23 00:24:25 2016 (r307809) @@ -37,7 +37,7 @@ eqnbox(int p1, int p2, int lu) { #else /* NEQN */ int b, h; #endif /* NEQN */ - char *sh; + const char *sh; yyval.token = p1; b = max(ebase[p1], ebase[p2]); Modified: vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c Sun Oct 23 00:24:25 2016 (r307809) @@ -14,7 +14,7 @@ #include #include -const char *const ctl[] = { +static const char *const ctl[] = { "nul", "soh", "stx", Modified: vendor/heirloom-doctools/dist/eqn/funny.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/funny.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/funny.c Sun Oct 23 00:24:25 2016 (r307809) @@ -32,7 +32,7 @@ extern YYSTYPE yyval; void funny(int n) { - char *f = NULL; + const char *f = NULL; yyval.token = oalloc(); switch(n) { Modified: vendor/heirloom-doctools/dist/eqn/integral.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/integral.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/integral.c Sun Oct 23 00:24:25 2016 (r307809) @@ -56,7 +56,7 @@ integral(int p, int p1, int p2) { void setintegral(void) { - char *f; + const char *f; yyval.token = oalloc(); f = "\\(is"; Modified: vendor/heirloom-doctools/dist/eqn/io.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/io.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/io.c Sun Oct 23 00:24:25 2016 (r307809) @@ -26,9 +26,9 @@ #include #include -char *in; /* input buffer */ -size_t insize; /* input buffer size */ -int noeqn; +static char *in; /* input buffer */ +static size_t insize; /* input buffer size */ +static int noeqn; int main(int argc,char **argv) { @@ -95,7 +95,8 @@ eqn(int argc,char **argv) { int getline(char **sp, size_t *np) { - register int c, n = 0, esc = 0, par = 0, brack = 0; + register int c, esc = 0, par = 0, brack = 0; + size_t n = 0; char *xp; for (;;) { c = gtc(); @@ -225,11 +226,6 @@ putout(int p1) { } -float -max(float i,float j) { - return (i>j ? i : j); -} - int oalloc(void) { int i; Modified: vendor/heirloom-doctools/dist/eqn/lex.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/lex.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/lex.c Sun Oct 23 00:24:25 2016 (r307809) @@ -34,12 +34,12 @@ extern YYSTYPE yyval; #define SSIZE 400 -char token[SSIZE]; -int sp; +static char token[SSIZE]; +static int sp; #define putbak(c) *ip++ = c; #define PUSHBACK 300 /* maximum pushback characters */ -char ibuf[PUSHBACK+SSIZE]; /* pushback buffer for definitions, etc. */ -char *ip = ibuf; +static char ibuf[PUSHBACK+SSIZE]; /* pushback buffer for definitions, etc. */ +static char *ip = ibuf; int gtc(void) { @@ -77,9 +77,9 @@ openinfile(void) } void -pbstr(register char *str) +pbstr(register const char *str) { - register char *p; + register const char *p; p = str; while (*p++); Modified: vendor/heirloom-doctools/dist/eqn/lookup.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/lookup.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/lookup.c Sun Oct 23 00:24:25 2016 (r307809) @@ -33,8 +33,8 @@ tbl *keytbl[TBLSIZE]; /* key words */ tbl *restbl[TBLSIZE]; /* reserved words */ tbl *deftbl[TBLSIZE]; /* user-defined names */ -struct { - char *key; +static struct { + const char *key; int keyval; } keyword[] ={ { "sub", SUB }, @@ -104,9 +104,9 @@ struct { { NULL, 0 } }; -struct { - char *res; - char *resval; +static struct { + const char *res; + const char *resval; } resword[] ={ { ">=", "\\(>=" }, { "<=", "\\(<=" }, @@ -220,11 +220,11 @@ struct { }; tbl * -lookup(tbl **tblp, char *name, char *defn) /* find name in tbl. if defn non-null, install */ +lookup(tbl **tblp, const char *name, const char *defn) /* find name in tbl. if defn non-null, install */ { register tbl *p; register int h; - register unsigned char *s = (unsigned char *)name; + register unsigned const char *s = (unsigned const char *)name; for (h = 0; *s != '\0'; ) h += *s++; Modified: vendor/heirloom-doctools/dist/eqn/matrix.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/matrix.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/matrix.c Sun Oct 23 00:24:25 2016 (r307809) @@ -52,7 +52,7 @@ matrix(int p1) { int hb, b; #endif /* NEQN */ int nrow, ncol, i, j, k, val[100]; - char *space; + const char *space; space = "\\ \\ "; nrow = lp[p1]; /* disaster if rows inconsistent */ Modified: vendor/heirloom-doctools/dist/eqn/paren.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/paren.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/eqn/paren.c Sun Oct 23 00:24:25 2016 (r307809) @@ -163,7 +163,7 @@ paren(int leftc, int p1, int rightc) { } void -brack(int m, char *t, char *c, char *b) { +brack(int m, const char *t, const char *c, const char *b) { int j; printf("\\b'%s", t); for( j=0; j #include #include +#include "global.h" #include "grap.h" #include "y.tab.h" Modified: vendor/heirloom-doctools/dist/grap/grap.h ============================================================================== --- vendor/heirloom-doctools/dist/grap/grap.h Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/grap/grap.h Sun Oct 23 00:24:25 2016 (r307809) @@ -143,9 +143,6 @@ extern int pointsize, ps_set; #define Exp(x) errcheck(exp(x), "exp") #define Sqrt(x) errcheck(sqrt(x), "sqrt") -#define min(x,y) (((x) <= (y)) ? (x) : (y)) -#define max(x,y) (((x) >= (y)) ? (x) : (y)) - extern void yyerror(char *); extern void coord_x(Point); extern void coord_y(Point); Modified: vendor/heirloom-doctools/dist/grap/input.c ============================================================================== --- vendor/heirloom-doctools/dist/grap/input.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/grap/input.c Sun Oct 23 00:24:25 2016 (r307809) @@ -18,11 +18,6 @@ #include "grap.h" #include "y.tab.h" -#if defined (__GLIBC__) && defined (_IO_getc_unlocked) -#undef getc -#define getc(f) _IO_getc_unlocked(f) -#endif - Infile infile[10]; Infile *curfile = infile; @@ -596,33 +591,3 @@ void shell_exec(void) /* do it */ else system(shellbuf); } - -#define LSIZE 128 - -char *fgetline(char **line, size_t *linesize, size_t *llen, FILE *fp) -{ - int c; - size_t n = 0; - - if (*line == NULL || *linesize < LSIZE + n + 1) - *line = realloc(*line, *linesize = LSIZE + n + 1); - for (;;) { - if (n >= *linesize - LSIZE / 2) - *line = realloc(*line, *linesize += LSIZE); - c = getc(fp); - if (c != EOF) { - (*line)[n++] = c; - (*line)[n] = '\0'; - if (c == '\n') - break; - } else { - if (n > 0) - break; - else - return NULL; - } - } - if (llen) - *llen = n; - return *line; -} Modified: vendor/heirloom-doctools/dist/grap/main.c ============================================================================== --- vendor/heirloom-doctools/dist/grap/main.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/grap/main.c Sun Oct 23 00:24:25 2016 (r307809) @@ -156,12 +156,11 @@ void getdata(void) /* read input */ char *buf = NULL, *buf1 = NULL; size_t size = 0; int ln; - char *fgetline(char **, size_t *, size_t *, FILE *); fin = curfile->fin; curfile->lineno = 0; printf(".lf 1 %s\n", curfile->fname); - while (fgetline(&buf, &size, NULL, fin) != NULL) { + while (getline(&buf, &size, fin) > 0) { curfile->lineno++; if (*buf == '.' && *(buf+1) == 'G' && *(buf+2) == '1') { setup(); Modified: vendor/heirloom-doctools/dist/grap/misc.c ============================================================================== --- vendor/heirloom-doctools/dist/grap/misc.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/grap/misc.c Sun Oct 23 00:24:25 2016 (r307809) @@ -45,14 +45,11 @@ void setsize(int op, double expr) char *tostring(char *s) { - register char *p; - size_t l; + char *p; - l = strlen(s)+1; - p = malloc(l); + p = strdup(s); if (p == NULL) FATAL("out of space in tostring on %s", s); - n_strcpy(p, s, l); return(p); } Modified: vendor/heirloom-doctools/dist/include/global.h ============================================================================== --- vendor/heirloom-doctools/dist/include/global.h Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/include/global.h Sun Oct 23 00:24:25 2016 (r307809) @@ -15,3 +15,23 @@ #else # define n_wcscpy(dst, src, size ) wcscpy(dst, src) #endif + +#define min(x,y) ((x) < (y) ? (x) : (y)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define prefix(str, pfx) (strncmp(pfx, str, strlen(pfx)) == 0) + +#undef __unused +#define __unused __attribute__((unused)) + +#ifdef __GLIBC__ +#ifdef _IO_getc_unlocked +#undef getc +#define getc(f) _IO_getc_unlocked(f) +#endif +#ifdef _IO_putc_unlocked +#undef putc +#undef putchar +#define putc(c, f) _IO_putc_unlocked(c, f) +#define putchar(c) _IO_putc_unlocked(c, stdout) +#endif +#endif Modified: vendor/heirloom-doctools/dist/mpm/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/mpm/Makefile.mk Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/mpm/Makefile.mk Sun Oct 23 00:24:25 2016 (r307809) @@ -1,6 +1,6 @@ OBJ = misc.o page.o queue.o range.o slug.o version.o -FLAGS = $(EUC) $(DEFINES) +FLAGS = $(EUC) $(DEFINES) -I../include .c.o: $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< Modified: vendor/heirloom-doctools/dist/mpm/misc.h ============================================================================== --- vendor/heirloom-doctools/dist/mpm/misc.h Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/mpm/misc.h Sun Oct 23 00:24:25 2016 (r307809) @@ -16,20 +16,8 @@ #include #include #include +#include "global.h" -#ifdef __GLIBC__ -#ifdef _IO_getc_unlocked -#undef getc -#define getc(f) _IO_getc_unlocked(f) -#endif -#ifdef _IO_putc_unlocked -#undef putc -#undef putchar -#define putc(c, f) _IO_putc_unlocked(c, f) -#define putchar(c) _IO_putc_unlocked(c, stdout) -#endif -#endif /* __GLIBC__ */ - extern char *progname; extern int linenum; extern int wantwarn; @@ -39,11 +27,6 @@ extern void WARNING(const char *, ...); #define eq(s,t) (strcmp(s,t) == 0) -inline int max(int x, int y) { return x > y ? x : y; } -inline int min(int x, int y) { return x > y ? y : x; } -// already defined in stdlib.h: -//inline int abs(int x) { return (x >= 0) ? x : -x; } - extern int dbg; extern int pn, userpn; // actual and user-defined page numbers Modified: vendor/heirloom-doctools/dist/pic/arcgen.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/arcgen.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/pic/arcgen.c Sun Oct 23 00:24:25 2016 (r307809) @@ -30,7 +30,7 @@ obj *arcgen(int type) /* handles circula static int nexthv[2][4] ={ {U_DIR, L_DIR, D_DIR, R_DIR}, {D_DIR, R_DIR, U_DIR, L_DIR} }; double dx2, dy2, ht, phi, r, d; - int i, head, to, at, cw, invis, ddtype, battr; + int i, head, to, at, _cw, invis, ddtype, battr; obj *p, *ppos; double fromx, fromy, tox = 0, toy = 0, fillval = 0; Attr *ap; @@ -40,7 +40,7 @@ obj *arcgen(int type) /* handles circula prevw = getfval("arrowwid"); fromx = curx; fromy = cury; - head = to = at = cw = invis = ddtype = battr = 0; + head = to = at = _cw = invis = ddtype = battr = 0; for (i = 0; i < nattr; i++) { ap = &attr[i]; switch (ap->a_type) { @@ -66,7 +66,7 @@ obj *arcgen(int type) /* handles circula prevrad = ap->a_val.f / 2; break; case CW: - cw = 1; + _cw = 1; break; case FROM: /* start point of arc */ ppos = ap->a_val.o; @@ -107,16 +107,16 @@ obj *arcgen(int type) /* handles circula } } if (!at && !to) { /* the defaults are mostly OK */ - curx = fromx + prevrad * dctrx[cw][hvmode]; - cury = fromy + prevrad * dctry[cw][hvmode]; - tox = fromx + prevrad * dtox[cw][hvmode]; - toy = fromy + prevrad * dtoy[cw][hvmode]; - hvmode = nexthv[cw][hvmode]; + curx = fromx + prevrad * dctrx[_cw][hvmode]; + cury = fromy + prevrad * dctry[_cw][hvmode]; + tox = fromx + prevrad * dtox[_cw][hvmode]; + toy = fromy + prevrad * dtoy[_cw][hvmode]; + hvmode = nexthv[_cw][hvmode]; } else if (!at) { dx2 = (tox - fromx) / 2; dy2 = (toy - fromy) / 2; - phi = atan2(dy2, dx2) + (cw ? -PI/2 : PI/2); + phi = atan2(dy2, dx2) + (_cw ? -PI/2 : PI/2); if (prevrad <= 0.0) prevrad = dx2*dx2+dy2*dy2; for (r=prevrad; (d = r*r - (dx2*dx2+dy2*dy2)) <= 0.0; r *= 2) @@ -129,11 +129,11 @@ obj *arcgen(int type) /* handles circula dx2, dy2, phi, r, ht); } else if (at && !to) { /* do we have all the cases??? */ - tox = fromx + prevrad * dtox[cw][hvmode]; - toy = fromy + prevrad * dtoy[cw][hvmode]; - hvmode = nexthv[cw][hvmode]; + tox = fromx + prevrad * dtox[_cw][hvmode]; + toy = fromy + prevrad * dtoy[_cw][hvmode]; + hvmode = nexthv[_cw][hvmode]; } - if (cw) { /* interchange roles of from-to and heads */ + if (_cw) { /* interchange roles of from-to and heads */ double temp; temp = fromx; fromx = tox; tox = temp; temp = fromy; fromy = toy; toy = temp; @@ -148,7 +148,7 @@ obj *arcgen(int type) /* handles circula p->o_val[1] = fromy; p->o_val[2] = tox; p->o_val[3] = toy; - if (cw) { + if (_cw) { curx = fromx; cury = fromy; } else { @@ -158,7 +158,7 @@ obj *arcgen(int type) /* handles circula p->o_val[4] = prevw; p->o_val[5] = prevh; p->o_val[6] = prevrad; - p->o_attr = head | (cw ? CW_ARC : 0) | invis | ddtype | battr; + p->o_attr = head | (_cw ? CW_ARC : 0) | invis | ddtype | battr; p->o_fillval = fillval; if (head) p->o_nhead = getfval("arrowhead"); @@ -191,36 +191,36 @@ void arc_extreme(double x0, double y0, d /* start, end, center */ { /* assumes center isn't too far out */ - double r, xmin, ymin, xmax, ymax; + double r, _xmin, _ymin, _xmax, _ymax; int j, k; x0 -= xc; y0 -= yc; /* move to center */ x1 -= xc; y1 -= yc; - xmin = (x0x1)?x0:x1; ymax = (y0>y1)?y0:y1; + _xmin = (x0x1)?x0:x1; _ymax = (y0>y1)?y0:y1; r = sqrt(x0*x0 + y0*y0); if (r > 0.0) { j = quadrant(x0,y0); k = quadrant(x1,y1); if (j == k && y1*x0 < x1*y0) { /* viewed as complex numbers, if Im(z1/z0)<0, arc is big */ - if( xmin > -r) xmin = -r; if( ymin > -r) ymin = -r; - if( xmax < r) xmax = r; if( ymax < r) ymax = r; + if( _xmin > -r) _xmin = -r; if( _ymin > -r) _ymin = -r; + if( _xmax < r) _xmax = r; if( _ymax < r) _ymax = r; } else { while (j != k) { switch (j) { - case 1: if( ymax < r) ymax = r; break; /* north */ - case 2: if( xmin > -r) xmin = -r; break; /* west */ - case 3: if( ymin > -r) ymin = -r; break; /* south */ - case 4: if( xmax < r) xmax = r; break; /* east */ + case 1: if( _ymax < r) _ymax = r; break; /* north */ + case 2: if( _xmin > -r) _xmin = -r; break; /* west */ + case 3: if( _ymin > -r) _ymin = -r; break; /* south */ + case 4: if( _xmax < r) _xmax = r; break; /* east */ } j = j%4 + 1; } } } - xmin += xc; ymin += yc; - xmax += xc; ymax += yc; - extreme(xmin, ymin); - extreme(xmax, ymax); + _xmin += xc; _ymin += yc; + _xmax += xc; _ymax += yc; + extreme(_xmin, _ymin); + extreme(_xmax, _ymax); } int Modified: vendor/heirloom-doctools/dist/pic/blockgen.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/blockgen.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/pic/blockgen.c Sun Oct 23 00:24:25 2016 (r307809) @@ -20,8 +20,8 @@ struct pushstack stack[NBRACK]; int nstack = 0; -struct pushstack bracestack[NBRACE]; -int nbstack = 0; +static struct pushstack bracestack[NBRACE]; +static int nbstack = 0; void blockadj(obj *); Modified: vendor/heirloom-doctools/dist/pic/for.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/for.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/pic/for.c Sun Oct 23 00:24:25 2016 (r307809) @@ -25,10 +25,10 @@ typedef struct { char *str; /* string to push back */ } For; -For forstk[10]; /* stack of for loops */ -For *forp = forstk; /* pointer to current top */ +static For forstk[10]; /* stack of for loops */ +static For *forp = forstk; /* pointer to current top */ -void setfval(char *, double); +void setfval(const char *, double); void nextfor(void); void forloop(char *var, double from, double to, int op, Modified: vendor/heirloom-doctools/dist/pic/input.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/input.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/pic/input.c Sun Oct 23 00:24:25 2016 (r307809) @@ -18,11 +18,6 @@ #include "pic.h" #include "y.tab.h" -#if defined (__GLIBC__) && defined (_IO_getc_unlocked) -#undef getc -#define getc(f) _IO_getc_unlocked(f) -#endif - Infile infile[10]; Infile *curfile = infile; @@ -33,10 +28,12 @@ Src *srcp = src; void do_thru(void); int nextchar(void); int getarg(char *); -void freedef(char *); -int baldelim(int, char *); +int baldelim(int, const char *); +static void popsrc(void); + +static char *addnewline(char *); -void pushsrc(int type, char *ptr) /* new input source */ +void pushsrc(int type, const char *ptr) /* new input source */ { if (++srcp >= src + MAXSRC) FATAL("inputs nested too deep"); @@ -70,7 +67,7 @@ void pushsrc(int type, char *ptr) /* new } } -void popsrc(void) /* restore an old one */ +static void popsrc(void) /* restore an old one */ { if (srcp <= src) FATAL("too many inputs popped"); @@ -102,7 +99,7 @@ void popsrc(void) /* restore an old one srcp--; } -void definition(char *s) /* collect definition for s and install */ +void definition(const char *s) /* collect definition for s and install */ /* definitions picked up lexically */ { char *p; @@ -125,7 +122,7 @@ void definition(char *s) /* collect defi dprintf("installing %s as `%s'\n", s, p); } -char *delimstr(char *s) /* get body of X ... X */ +char *delimstr(const char *s) /* get body of X ... X */ /* message if too big */ { int c, delim, rdelim, n, deep; @@ -160,7 +157,7 @@ char *delimstr(char *s) /* get body of X return tostring(buf); } -int baldelim(int c, char *s) /* replace c by balancing entry in s */ +int baldelim(int c, const char *s) /* replace c by balancing entry in s */ { for ( ; *s; s += 2) if (*s == c) @@ -178,9 +175,9 @@ void undefine(char *s) /* undefine macro } -Arg args[10]; /* argument frames */ -Arg *argfp = args; /* frame pointer */ -int argcnt; /* number of arguments seen so far */ +static Arg args[10]; /* argument frames */ +static Arg *argfp = args; /* frame pointer */ +static int argcnt; /* number of arguments seen so far */ void dodef(struct symtab *stp) /* collect args and switch input to defn */ { @@ -239,13 +236,13 @@ int getarg(char *p) /* pick up single ar } #define PBSIZE 2000 -char pbuf[PBSIZE]; /* pushback buffer */ -char *pb = pbuf-1; /* next pushed back character */ +static char pbuf[PBSIZE]; /* pushback buffer */ +static char *pb = pbuf-1; /* next pushed back character */ -char ebuf[200]; /* collect input here for error reporting */ -char *ep = ebuf; +static char ebuf[200]; /* collect input here for error reporting */ +static char *ep = ebuf; -int begin = 0; +static int begin = 0; extern int thru; extern struct symtab *thrudef; extern char *untilstr; @@ -429,7 +426,7 @@ int unput(int c) return c; } -void pbstr(char *s) +void pbstr(const char *s) { pushsrc(String, s); } @@ -450,7 +447,6 @@ void eprint(void); void yyerror(char *s) { - extern char *cmdname; int ern = errno; /* cause some libraries clobber it */ if (synerr) @@ -498,7 +494,7 @@ void eprint(void) /* try to print contex void yywrap(void) {} -char *newfile = 0; /* filename for file copy */ +static char *newfile = 0; /* filename for file copy */ char *untilstr = 0; /* string that terminates a thru */ int thru = 0; /* 1 if copying thru macro */ struct symtab *thrudef = 0; /* macro being used */ @@ -513,7 +509,7 @@ void copydef(struct symtab *p) /* rememb thrudef = p; } -struct symtab *copythru(char *s) /* collect the macro name or body for thru */ +struct symtab *copythru(const char *s) /* collect the macro name or body for thru */ { struct symtab *p; char *q, *addnewline(char *); @@ -545,7 +541,7 @@ struct symtab *copythru(char *s) /* coll return p; } -char *addnewline(char *p) /* add newline to end of p */ +static char *addnewline(char *p) /* add newline to end of p */ { int n; @@ -584,7 +580,7 @@ void copy(void) /* begin input from file } } -char shellbuf[1000], *shellp; +static char shellbuf[1000], *shellp; void shell_init(void) /* set up to interpret a shell command */ { @@ -608,33 +604,3 @@ void shell_exec(void) /* do it */ else system(shellbuf); } - -#define LSIZE 128 - -char *fgetline(char **line, size_t *linesize, size_t *llen, FILE *fp) -{ - int c; - size_t n = 0; - - if (*line == NULL || *linesize < LSIZE + n + 1) - *line = realloc(*line, *linesize = LSIZE + n + 1); - for (;;) { - if (n >= *linesize - LSIZE / 2) - *line = realloc(*line, *linesize += LSIZE); - c = getc(fp); - if (c != EOF) { - (*line)[n++] = c; - (*line)[n] = '\0'; - if (c == '\n') - break; - } else { - if (n > 0) - break; - else - return NULL; - } - } - if (llen) - *llen = n; - return *line; -} Modified: vendor/heirloom-doctools/dist/pic/main.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/main.c Sat Oct 22 23:49:06 2016 (r307808) +++ vendor/heirloom-doctools/dist/pic/main.c Sun Oct 23 00:24:25 2016 (r307809) @@ -44,9 +44,8 @@ double deltx = 6; /* max x value in outp double delty = 6; /* max y value in output, for scaling */ int dbg = 0; int lineno = 0; -char *filename = "-"; int synerr = 0; -int anyerr = 0; /* becomes 1 if synerr ever 1 */ +static int anyerr = 0; /* becomes 1 if synerr ever 1 */ char *cmdname; int Sflag; @@ -57,7 +56,6 @@ double ymax = -30000; void fpecatch(int); void getdata(void), setdefaults(void); -void setfval(char *, double); int getpid(void); int @@ -122,7 +120,7 @@ void fpecatch(int n) FATAL("floating point exception %d", n); } -char *grow(char *ptr, char *name, int num, int size) /* make array bigger */ +char *grow(char *ptr, const char *name, int num, int size) /* make array bigger */ { char *p; @@ -136,7 +134,7 @@ char *grow(char *ptr, char *name, int nu } static struct { - char *name; + const char *name; double val; short scalable; /* 1 => adjust when "scale" changes */ } defaults[] ={ @@ -210,13 +208,12 @@ void getdata(void) char *p, *buf = NULL, *buf1 = NULL; size_t size = 0; int ln; - void reset(void), openpl(char *), closepl(char *), print(void); + void reset(void), openpl(char *), closepl(char *); int yyparse(void); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sun Oct 23 00:25:53 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 4F0AFC1DE30; Sun, 23 Oct 2016 00:25:53 +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 034DA139; Sun, 23 Oct 2016 00:25:52 +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 u9N0Pqg1094269; Sun, 23 Oct 2016 00:25:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9N0Ppb9094263; Sun, 23 Oct 2016 00:25:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610230025.u9N0Ppb9094263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 23 Oct 2016 00:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307810 - in vendor/heirloom-doctools/20161016: . checknr eqn eqn/checkeq.d eqn/eqnchar.d grap include mpm pic picpack ptx refer tbl troff troff/libhnj troff/nroff.d troff/troff.d troff... 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, 23 Oct 2016 00:25:53 -0000 Author: bapt Date: Sun Oct 23 00:25:51 2016 New Revision: 307810 URL: https://svnweb.freebsd.org/changeset/base/307810 Log: tag import of heirloom-doctools 20161016 Added: vendor/heirloom-doctools/20161016/ - copied from r306788, vendor/heirloom-doctools/dist/ vendor/heirloom-doctools/20161016/compat.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/compat.c Replaced: vendor/heirloom-doctools/20161016/checknr/checknr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/20161016/eqn/checkeq.d/checkeq.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c vendor/heirloom-doctools/20161016/eqn/diacrit.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c vendor/heirloom-doctools/20161016/eqn/e.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/e.h vendor/heirloom-doctools/20161016/eqn/eqnbox.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnbox.c vendor/heirloom-doctools/20161016/eqn/eqnchar.d/genutf8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c vendor/heirloom-doctools/20161016/eqn/funny.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/funny.c vendor/heirloom-doctools/20161016/eqn/integral.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/integral.c vendor/heirloom-doctools/20161016/eqn/io.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/20161016/eqn/lex.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/20161016/eqn/lookup.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/lookup.c vendor/heirloom-doctools/20161016/eqn/matrix.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/matrix.c vendor/heirloom-doctools/20161016/eqn/paren.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/paren.c vendor/heirloom-doctools/20161016/eqn/shift.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/shift.c vendor/heirloom-doctools/20161016/eqn/text.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/text.c vendor/heirloom-doctools/20161016/grap/coord.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/coord.c vendor/heirloom-doctools/20161016/grap/grap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/grap.h vendor/heirloom-doctools/20161016/grap/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/input.c vendor/heirloom-doctools/20161016/grap/main.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/20161016/grap/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/misc.c vendor/heirloom-doctools/20161016/include/global.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/include/global.h vendor/heirloom-doctools/20161016/mpm/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/20161016/mpm/misc.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/mpm/misc.h vendor/heirloom-doctools/20161016/pic/arcgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/arcgen.c vendor/heirloom-doctools/20161016/pic/blockgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/blockgen.c vendor/heirloom-doctools/20161016/pic/for.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/for.c vendor/heirloom-doctools/20161016/pic/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/20161016/pic/main.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/20161016/pic/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/misc.c vendor/heirloom-doctools/20161016/pic/pic.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pic.h vendor/heirloom-doctools/20161016/pic/picl.l - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/20161016/pic/pltroff.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pltroff.c vendor/heirloom-doctools/20161016/pic/symtab.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/symtab.c vendor/heirloom-doctools/20161016/picpack/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/20161016/picpack/picpack.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/picpack/picpack.c vendor/heirloom-doctools/20161016/ptx/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/20161016/ptx/ptx.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/20161016/refer/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/20161016/refer/deliv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/deliv2.c vendor/heirloom-doctools/20161016/refer/glue1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue1.c vendor/heirloom-doctools/20161016/refer/glue3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/20161016/refer/glue4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue4.c vendor/heirloom-doctools/20161016/refer/glue5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue5.c vendor/heirloom-doctools/20161016/refer/hunt1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt1.c vendor/heirloom-doctools/20161016/refer/hunt2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/20161016/refer/hunt5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt5.c vendor/heirloom-doctools/20161016/refer/hunt6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt6.c vendor/heirloom-doctools/20161016/refer/hunt7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt7.c vendor/heirloom-doctools/20161016/refer/hunt8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt8.c vendor/heirloom-doctools/20161016/refer/hunt9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt9.c vendor/heirloom-doctools/20161016/refer/inv1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv1.c vendor/heirloom-doctools/20161016/refer/inv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv2.c vendor/heirloom-doctools/20161016/refer/inv3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv3.c vendor/heirloom-doctools/20161016/refer/inv5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv5.c vendor/heirloom-doctools/20161016/refer/inv6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv6.c vendor/heirloom-doctools/20161016/refer/mkey1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey1.c vendor/heirloom-doctools/20161016/refer/mkey2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey2.c vendor/heirloom-doctools/20161016/refer/refer..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer..c vendor/heirloom-doctools/20161016/refer/refer0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer0.c vendor/heirloom-doctools/20161016/refer/refer1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer1.c vendor/heirloom-doctools/20161016/refer/refer2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer2.c vendor/heirloom-doctools/20161016/refer/refer3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer3.c vendor/heirloom-doctools/20161016/refer/refer5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer5.c vendor/heirloom-doctools/20161016/refer/refer6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer6.c vendor/heirloom-doctools/20161016/refer/refer7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer7.c vendor/heirloom-doctools/20161016/refer/refer8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer8.c vendor/heirloom-doctools/20161016/refer/shell.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/shell.c vendor/heirloom-doctools/20161016/refer/sortbib.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/sortbib.c vendor/heirloom-doctools/20161016/refer/tick.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/tick.c vendor/heirloom-doctools/20161016/tbl/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/20161016/tbl/t..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t..c vendor/heirloom-doctools/20161016/tbl/t0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t0.c vendor/heirloom-doctools/20161016/tbl/t1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t1.c vendor/heirloom-doctools/20161016/tbl/t3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t3.c vendor/heirloom-doctools/20161016/tbl/t4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t4.c vendor/heirloom-doctools/20161016/tbl/t5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t5.c vendor/heirloom-doctools/20161016/tbl/t8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t8.c vendor/heirloom-doctools/20161016/tbl/tb.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tb.c vendor/heirloom-doctools/20161016/tbl/tc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tc.c vendor/heirloom-doctools/20161016/tbl/te.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/te.c vendor/heirloom-doctools/20161016/tbl/tg.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tg.c vendor/heirloom-doctools/20161016/tbl/tm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tm.c vendor/heirloom-doctools/20161016/tbl/ts.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/ts.c vendor/heirloom-doctools/20161016/tbl/tt.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tt.c vendor/heirloom-doctools/20161016/tbl/tu.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tu.c vendor/heirloom-doctools/20161016/tbl/tv.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tv.c vendor/heirloom-doctools/20161016/troff/ext.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/20161016/troff/libhnj/hnjalloc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/libhnj/hnjalloc.c vendor/heirloom-doctools/20161016/troff/n1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/20161016/troff/n2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/20161016/troff/n3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/20161016/troff/n4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n4.c vendor/heirloom-doctools/20161016/troff/n5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/20161016/troff/n7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/20161016/troff/n8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/20161016/troff/n9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/20161016/troff/nroff.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/draw.c vendor/heirloom-doctools/20161016/troff/nroff.d/n10.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n10.c vendor/heirloom-doctools/20161016/troff/nroff.d/n6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/20161016/troff/nroff.d/pt.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/20161016/troff/tdef.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/20161016/troff/troff.d/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/20161016/troff/troff.d/afm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/20161016/troff/troff.d/afm.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/20161016/troff/troff.d/devaps/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk vendor/heirloom-doctools/20161016/troff/troff.d/dpost.d/Makefile.mk - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/20161016/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/20161016/troff/troff.d/dpost.d/dpost.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/20161016/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/20161016/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/20161016/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/20161016/troff/troff.d/dpost.d/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/20161016/troff/troff.d/dpost.d/ps_include.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c vendor/heirloom-doctools/20161016/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/20161016/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/20161016/troff/troff.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/20161016/troff/troff.d/fontmap.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.c vendor/heirloom-doctools/20161016/troff/troff.d/fontmap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.h vendor/heirloom-doctools/20161016/troff/troff.d/otf.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/20161016/troff/troff.d/otfdump.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/20161016/troff/troff.d/pt.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/20161016/troff/troff.d/t10.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/20161016/troff/troff.d/t6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/20161016/vgrind/vfontedpr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/vgrind/vfontedpr.c Deleted: vendor/heirloom-doctools/20161016/picpack/getopt.c vendor/heirloom-doctools/20161016/troff/troff.d/devaps/getopt.c vendor/heirloom-doctools/20161016/troff/troff.d/dpost.d/getopt.c Copied: vendor/heirloom-doctools/20161016/checknr/checknr.c (from r307809, vendor/heirloom-doctools/dist/checknr/checknr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161016/checknr/checknr.c Sun Oct 23 00:25:51 2016 (r307810, copy of r307809, 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, 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/20161016/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/20161016/compat.c Sun Oct 23 00:25:51 2016 (r307810, 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/20161016/eqn/checkeq.d/checkeq.c (from r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161016/eqn/checkeq.d/checkeq.c Sun Oct 23 00:25:51 2016 (r307810, copy of r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c) @@ -0,0 +1,128 @@ +/* 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 "checkeq.c 1.6 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/checkeq.sl 4.1 (gritter) 9/15/05"; + +#include +#include + +static void check(FILE *); + +static FILE *fin; +static int delim = '$'; + +int +main(int argc, char **argv) +{ + if (argc <= 1) + check(stdin); + else + while (--argc > 0) { + if ((fin = fopen(*++argv, "r")) == NULL) { + perror(*argv); + exit(1); + } + printf("%s:\n", *argv); + check(fin); + fclose(fin); + } + return (0); +} + +static void +check(FILE *f) +{ + int start, line, eq, ndel, totdel; + char *in = NULL, *p; + size_t insize = 0; + + start = eq = line = ndel = totdel = 0; + while (getline(&in, &insize, f) > 0) { + line++; + ndel = 0; + for (p = in; *p; p++) + if (*p == delim) + ndel++; + if (*in == '.' && *(in+1) == 'E' && *(in+2) == 'Q') { + if (eq++) + printf(" Spurious EQ, line %d\n", line); + if (totdel) + printf(" EQ in %c%c, line %d\n", + delim, delim, line); + } else if (*in == '.' && *(in+1) == 'E' && *(in+2) == 'N') { + if (eq == 0) + printf(" Spurious EN, line %d\n", line); + else + eq = 0; + if (totdel > 0) + printf(" EN in %c%c, line %d\n", + delim, delim, line); + start = 0; + } else if (eq && *in == 'd' && *(in+1) == 'e' && + *(in+2) == 'l' && *(in+3) == 'i' && *(in+4) == 'm') { + for (p = in+5; *p; p++) + if (*p != ' ') { + if (*p == 'o' && *(p+1) == 'f') + delim = 0; + else + delim = *p; + break; + } + if (delim == 0) + printf(" Delim off, line %d\n", line); + else + printf(" New delims %c%c, line %d\n", + delim, delim, line); + } + if (ndel > 0 && eq > 0) + printf(" %c%c in EQ, line %d\n", delim, + delim, line); + if (ndel == 0) + continue; + totdel += ndel; + if (totdel%2) { + if (start == 0) + start = line; + else { + printf(" %d line %c%c, lines %d-%d\n", + line-start+1, delim, delim, start, line); + start = line; + } + } else { + if (start > 0) { + printf(" %d line %c%c, lines %d-%d\n", + line-start+1, delim, delim, start, line); + start = 0; + } + totdel = 0; + } + } + if (totdel) + printf(" Unfinished %c%c\n", delim, delim); + if (eq) + printf(" Unfinished EQ\n"); +} Copied: vendor/heirloom-doctools/20161016/eqn/diacrit.c (from r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161016/eqn/diacrit.c Sun Oct 23 00:25:51 2016 (r307810, copy of r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c) @@ -0,0 +1,128 @@ +/* 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 (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. + * All Rights Reserved. + */ + +/* from OpenSolaris "diacrit.c 1.6 05/06/02 SMI" SVr4.0 1.1 */ + +/* + * Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany + * + * Sccsid @(#)diacrit.c 1.7 (gritter) 1/13/08 + */ + +#include "e.h" +#include "y.tab.h" + +void +diacrit(int p1, int type) { + int c, t; +#ifndef NEQN + float effps; +#endif /* NEQN */ + + c = oalloc(); + t = oalloc(); +#ifdef NEQN + nrwid(p1, ps, p1); + printf(".nr 10 %gu\n", (float)max(eht[p1]-ebase[p1]-VERT(2),0)); +#else /* NEQN */ + effps = EFFPS(ps); + nrwid(p1, effps, p1); + printf(".nr 10 %gp\n", VERT(max(eht[p1]-ebase[p1]-EM(1,ps),0))); /* vertical shift if high */ + printf(".if \\n(ct>1 .nr 10 \\n(10+\\s%s.25m\\s0\n", tsize(effps)); + if (type != HAT && type != TILDE) { + printf(".nr %d \\s%s.1m\\s0\n", t, tsize(effps)); /* horiz shift if high */ + printf(".if \\n(ct>1 .nr %d \\s%s.15m\\s0\n", t, tsize(effps)); + } else + printf(".nr %d 0\n", t); +#endif /* NEQN */ + switch(type) { + case VEC: /* vec */ +#ifndef NEQN + printf(".ds %d \\v'-.4m'\\s%s\\(->\\s0\\v'.4m'\n", + c, tsize(max(effps-3, 6))); + break; +#endif /* NEQN */ + case DYAD: /* dyad */ +#ifdef NEQN + printf(".ds %d \\v'-12p'_\\v'12p'\n", c); +#else /* !NEQN */ + printf(".ds %d \\v'-.4m'\\s%s\\z\\(<-\\(->\\s0\\v'.4m'\n", + c, tsize(max(effps-3, 6))); +#endif /* !NEQN */ + break; + case HAT: + printf(".ds %d ^\n", c); + break; + case TILDE: + printf(".ds %d ~\n", c); + break; + case DOT: +#ifndef NEQN + printf(".ds %d \\s%s\\v'-.67m'.\\v'.67m'\\s0\n", c, tsize(effps)); +#else /* NEQN */ + printf(".ds %d \\v'-12p'.\\v'12p'\n", c); +#endif /* NEQN */ + break; + case DOTDOT: +#ifndef NEQN + printf(".ds %d \\s%s\\v'-.67m'..\\v'.67m\\s0'\n", c, tsize(effps)); +#else /* NEQN */ + printf(".ds %d \\v'-12p'..\\v'12p'\n", c); +#endif /* NEQN */ + break; + case BAR: +#ifndef NEQN + printf(".ds %d \\s%s\\v'.28m'\\h'.05m'\\l'\\n(%du-.1m\\(rn'\\h'.05m'\\v'-.28m'\\s0\n", + c, tsize(effps), p1); +#else /* NEQN */ + printf(".ds %d \\v'-12p'\\l'\\n(%du'\\v'12p'\n", + c, p1); +#endif /* NEQN */ + break; + case UNDER: +#ifndef NEQN + printf(".ds %d \\l'\\n(%du\\(ul'\n", c, p1); + printf(".nr %d 0\n", t); + printf(".nr 10 0-%gp\n", ebase[p1]); +#else /* NEQN */ + printf(".ds %d \\l'\\n(%du'\n", c, p1); +#endif /* NEQN */ + break; + } + nrwid(c, ps, c); +#ifndef NEQN + if (!ital(lfont[p1])) + printf(".nr %d 0\n", t); + printf(".as %d \\h'-\\n(%du-\\n(%du/2u+\\n(%du'\\v'0-\\n(10u'\\*(%d", + p1, p1, c, t, c); + printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u-\\n(%du'\n", c, p1, t); + /* BUG - should go to right end of widest */ +#else /* NEQN */ + printf(".as %d \\h'-\\n(%du-\\n(%du/2u'\\v'0-\\n(10u'\\*(%d", + p1, p1, c, c); + printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u'\n", c, p1); +#endif /* NEQN */ +#ifndef NEQN + if (type != UNDER) + eht[p1] += VERT(EM(0.15, ps)); /* 0.15m */ + if(dbg)printf(".\tdiacrit: %c over S%d, lf=%c, rf=%c, h=%g,b=%g\n", + type, p1, lfont[p1], rfont[p1], eht[p1], ebase[p1]); +#else /* NEQN */ + if (type != UNDER) + eht[p1] += VERT(1); + if (dbg) printf(".\tdiacrit: %c over S%d, h=%d, b=%d\n", type, p1, eht[p1], ebase[p1]); +#endif /* NEQN */ + ofree(c); ofree(t); +} Copied: vendor/heirloom-doctools/20161016/eqn/e.h (from r307809, vendor/heirloom-doctools/dist/eqn/e.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161016/eqn/e.h Sun Oct 23 00:25:51 2016 (r307810, copy of r307809, vendor/heirloom-doctools/dist/eqn/e.h) @@ -0,0 +1,178 @@ +/* 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 (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. + * All Rights Reserved. + */ + +/* from "e.h 1.5 05/06/02 SMI" "ucbeqn:e.h 1.1" */ + +/* + * Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany + * + * Sccsid @(#)e.h 1.13 (gritter) 1/13/08 + */ + +/* + * Changes Copyright (c) 2014 Carsten Kunze (carsten.kunze at arcor.de) + */ + +#include +#include +#include "global.h" + +#define FATAL 1 +#define ROM '1' +#ifndef NEQN +#define ITAL '2' +#define BLD '3' +#else /* NEQN */ +#define ITAL '1' +#define BLD '1' +#endif /* NEQN */ + +#define rom(c) (((c) & 0177) == ROM) +#define ital(c) (((c) & 0177) == ITAL) +#define bld(c) (((c) & 0177) == BLD) + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon Oct 24 13:51:49 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 5D3EBC1F948; Mon, 24 Oct 2016 13:51:49 +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 EF4F9662; Mon, 24 Oct 2016 13:51:48 +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 u9ODpmlA045290; Mon, 24 Oct 2016 13:51:48 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ODpj4O045264; Mon, 24 Oct 2016 13:51:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201610241351.u9ODpj4O045264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 24 Oct 2016 13:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307859 - in vendor/libarchive/dist: . build cat/test cpio/test libarchive libarchive/test tar/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: Mon, 24 Oct 2016 13:51:49 -0000 Author: mm Date: Mon Oct 24 13:51:45 2016 New Revision: 307859 URL: https://svnweb.freebsd.org/changeset/base/307859 Log: Update vendor/libarchive to git 629358182b04d7de2316bbd29708c58ddf797fd2 Libarchive 3.2.2 Added: vendor/libarchive/dist/build/ci_build.sh (contents, props changed) Modified: vendor/libarchive/dist/.travis.yml vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/build/version vendor/libarchive/dist/cat/test/CMakeLists.txt vendor/libarchive/dist/cat/test/main.c vendor/libarchive/dist/cat/test/test.h vendor/libarchive/dist/configure.ac vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/cpio/test/test.h vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_entry.h 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_read_format_mtree_crash747.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c vendor/libarchive/dist/libarchive/test/test_read_set_format.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test.h vendor/libarchive/dist/tar/test/test_option_b.c vendor/libarchive/dist/tar/test/test_symlink_dir.c Modified: vendor/libarchive/dist/.travis.yml ============================================================================== --- vendor/libarchive/dist/.travis.yml Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/.travis.yml Mon Oct 24 13:51:45 2016 (r307859) @@ -1,20 +1,13 @@ language: C -sudo: true +sudo: required +dist: trusty compiler: - gcc - clang -before_install: - - sudo add-apt-repository ppa:kubuntu-ppa/backports -y - - sudo apt-get update -qq +env: + - BUILD_SYSTEM=cmake + - BUILD_SYSTEM=autotools install: - - sudo apt-get install -y cmake=2.8.12.2-0ubuntu1~ubuntu12.04.1~ppa2 - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev -before_script: - - BUILD_DIR=`pwd`/BUILD - - mkdir -p ${BUILD_DIR} - - cd ${BUILD_DIR} - - cmake .. script: - - cd ${BUILD_DIR} - - make - - make test + - build/ci_build.sh Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/Makefile.am Mon Oct 24 13:51:45 2016 (r307859) @@ -23,7 +23,7 @@ TESTS_ENVIRONMENT= $(libarchive_TESTS_EN DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio # The next line is commented out by default in shipping libarchive releases. # It is uncommented by default in trunk. -DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g +# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g AM_CFLAGS=$(DEV_CFLAGS) PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) @@ -662,6 +662,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_filter_lrzip.tar.lrz.uu \ libarchive/test/test_read_filter_lzop.tar.lzo.uu \ libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \ + libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \ libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \ libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \ libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \ @@ -787,6 +788,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu \ libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \ 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_mac_metadata.zip.uu \ libarchive/test/test_read_format_zip_malformed1.zip.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/NEWS Mon Oct 24 13:51:45 2016 (r307859) @@ -1,3 +1,6 @@ +Oct 23, 2016: libarchive 3.2.2 released + Security release + Jun 20, 2016: libarchive 3.2.1 released This fixes a handful of security and other critical issues with 3.2.0 Added: vendor/libarchive/dist/build/ci_build.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci_build.sh Mon Oct 24 13:51:45 2016 (r307859) @@ -0,0 +1,103 @@ +#!/bin/sh +# +# Automated build and test of libarchive on CI systems +# +# Variables that can be passed via environment: +# BUILD_SYSTEM= +# BUILDDIR= +# SRCDIR= +# CONFIGURE_ARGS= +# MAKE_ARGS= +# + +ACTIONS= +BUILD_SYSTEM="${BUILD_SYSTEM:-autotools}" +CURDIR=`pwd` +SRCDIR="${SRCDIR:-`pwd`}" +RET=0 + +usage () { + echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test ] [ -a ... ] [ -d builddir ] [-s srcdir ]" +} +inputerror () { + echo $1 + usage + exit 1 +} +while getopts a:b:d:s: opt; do + case ${opt} in + a) + case "${OPTARG}" in + autogen) ;; + configure) ;; + build) ;; + test) ;; + *) inputerror "Invalid action (-a)" ;; + esac + ACTIONS="${ACTIONS} ${OPTARG}" + ;; + b) BUILD_SYSTEM="${OPTARG}" + case "${BUILD_SYSTEM}" in + autotools) ;; + cmake) ;; + *) inputerror "Invalid build system (-b)" ;; + esac + ;; + d) + BUILDDIR="${OPTARG}" + ;; + s) + SRCDIR="${OPTARG}" + if [ ! -f "${SRCDIR}/build/version" ]; then + inputerror "Missing file: ${SRCDIR}/build/version" + fi + ;; + esac +done +if [ -z "${ACTIONS}" ]; then + ACTIONS="autogen configure build test" +fi +if [ -z "${BUILD_SYSTEM}" ]; then + inputerror "Missing type (-t) parameter" +fi +if [ -z "${BUILDDIR}" ]; then + BUILDDIR="${CURDIR}/BUILD/${BUILD_SYSTEM}" +fi +mkdir -p "${BUILDDIR}" +for action in ${ACTIONS}; do + cd "${BUILDDIR}" + case "${action}" in + autogen) + case "${BUILD_SYSTEM}" in + autotools) + cd "${SRCDIR}" + sh build/autogen.sh + RET="$?" + ;; + esac + ;; + configure) + case "${BUILD_SYSTEM}" in + autotools) "${SRCDIR}/configure" ${CONFIGURE_ARGS} ;; + cmake) cmake ${CONFIGURE_ARGS} "${SRCDIR}" ;; + esac + RET="$?" + ;; + build) + make ${MAKE_ARGS} + RET="$?" + ;; + test) + case "${BUILD_SYSTEM}" in + autotools) make ${MAKE_ARGS} check ;; + cmake) make ${MAKE_ARGS} test ;; + esac + RET="$?" + ;; + esac + if [ "${RET}" != "0" ]; then + exit "${RET}" + fi + cd "${CURDIR}" +done +exit "${RET}" Modified: vendor/libarchive/dist/build/version ============================================================================== --- vendor/libarchive/dist/build/version Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/build/version Mon Oct 24 13:51:45 2016 (r307859) @@ -1 +1 @@ -3002001 +3002002 Modified: vendor/libarchive/dist/cat/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/cat/test/CMakeLists.txt Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cat/test/CMakeLists.txt Mon Oct 24 13:51:45 2016 (r307859) @@ -58,7 +58,8 @@ IF(ENABLE_CAT AND ENABLE_TEST) # Experimental new test handling ADD_CUSTOM_TARGET(run_bsdcat_test COMMAND bsdcat_test -p $ - -r ${CMAKE_CURRENT_SOURCE_DIR}) + -r ${CMAKE_CURRENT_SOURCE_DIR} + -vv) ADD_DEPENDENCIES(run_bsdcat_test bsdcat) ADD_DEPENDENCIES(run_all_tests run_bsdcat_test) Modified: vendor/libarchive/dist/cat/test/main.c ============================================================================== --- vendor/libarchive/dist/cat/test/main.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cat/test/main.c Mon Oct 24 13:51:45 2016 (r307859) @@ -129,6 +129,13 @@ # include #endif +mode_t umasked(mode_t expected_mode) +{ + mode_t mode = umask(0); + umask(mode); + return expected_mode & ~mode; +} + /* Path to working directory for current test */ const char *testworkdir; #ifdef PROGRAM @@ -1156,6 +1163,35 @@ assertion_file_contains_lines_any_order( return (0); } +/* Verify that a text file does not contains the specified strings */ +int +assertion_file_contains_no_invalid_strings(const char *file, int line, + const char *pathname, const char *strings[]) +{ + char *buff; + int i; + + buff = slurpfile(NULL, "%s", pathname); + if (buff == NULL) { + failure_start(file, line, "Can't read file: %s", pathname); + failure_finish(NULL); + return (0); + } + + for (i = 0; strings[i] != NULL; ++i) { + if (strstr(buff, strings[i]) != NULL) { + failure_start(file, line, "Invalid string in %s: %s", pathname, + strings[i]); + failure_finish(NULL); + free(buff); + return(0); + } + } + + free(buff); + return (0); +} + /* Test that two paths point to the same file. */ /* As a side-effect, asserts that both files exist. */ static int @@ -1293,6 +1329,11 @@ assertion_file_time(const char *file, in switch (type) { case 'a': filet_nsec = st.st_atimespec.tv_nsec; break; case 'b': filet = st.st_birthtime; + /* FreeBSD filesystems that don't support birthtime + * (e.g., UFS1) always return -1 here. */ + if (filet == -1) { + return (1); + } filet_nsec = st.st_birthtimespec.tv_nsec; break; case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break; default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type); @@ -1370,6 +1411,8 @@ assertion_file_mode(const char *file, in assertion_count(file, line); #if defined(_WIN32) && !defined(__CYGWIN__) failure_start(file, line, "assertFileMode not yet implemented for Windows"); + (void)mode; /* UNUSED */ + (void)r; /* UNUSED */ #else { struct stat st; @@ -1424,7 +1467,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); if (r == 0 && (int)st.st_nlink == nlinks) - return (1); + return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); failure_finish(NULL); @@ -1660,6 +1703,7 @@ assertion_make_file(const char *file, in if (0 != chmod(path, mode)) { failure_start(file, line, "Could not chmod %s", path); failure_finish(NULL); + close(fd); return (0); } if (contents != NULL) { @@ -1674,6 +1718,7 @@ assertion_make_file(const char *file, in failure_start(file, line, "Could not write to %s", path); failure_finish(NULL); + close(fd); return (0); } } Modified: vendor/libarchive/dist/cat/test/test.h ============================================================================== --- vendor/libarchive/dist/cat/test/test.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cat/test/test.h Mon Oct 24 13:51:45 2016 (r307859) @@ -174,6 +174,9 @@ /* Assert that file contents match a string. */ #define assertFileContents(data, data_size, pathname) \ assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname) +/* Verify that a file does not contain invalid strings */ +#define assertFileContainsNoInvalidStrings(pathname, strings) \ + assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings) #define assertFileMtime(pathname, sec, nsec) \ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec) #define assertFileMtimeRecent(pathname) \ @@ -182,6 +185,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -239,6 +244,7 @@ int assertion_file_atime_recent(const ch int assertion_file_birthtime(const char *, int, const char *, long, long); int assertion_file_birthtime_recent(const char *, int, const char *); int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); +int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); int assertion_file_mode(const char *, int, const char *, int); @@ -327,6 +333,9 @@ void copy_reference_file(const char *); */ void extract_reference_files(const char **); +/* Subtract umask from mode */ +mode_t umasked(mode_t expected_mode); + /* Path to working directory for current test */ extern const char *testworkdir; Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/configure.ac Mon Oct 24 13:51:45 2016 (r307859) @@ -4,8 +4,8 @@ dnl First, define all of the version num dnl In particular, this allows the version macro to be used in AC_INIT dnl These first two version numbers are updated automatically on each release. -m4_define([LIBARCHIVE_VERSION_S],[3.2.1]) -m4_define([LIBARCHIVE_VERSION_N],[3002001]) +m4_define([LIBARCHIVE_VERSION_S],[3.2.2]) +m4_define([LIBARCHIVE_VERSION_N],[3002002]) dnl bsdtar and bsdcpio versioning tracks libarchive m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) Modified: vendor/libarchive/dist/cpio/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/cpio/test/CMakeLists.txt Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cpio/test/CMakeLists.txt Mon Oct 24 13:51:45 2016 (r307859) @@ -91,7 +91,8 @@ IF(ENABLE_CPIO AND ENABLE_TEST) # Experimental new test handling ADD_CUSTOM_TARGET(run_bsdcpio_test COMMAND bsdcpio_test -p $ - -r ${CMAKE_CURRENT_SOURCE_DIR}) + -r ${CMAKE_CURRENT_SOURCE_DIR} + -vv) ADD_DEPENDENCIES(run_bsdcpio_test bsdcpio) ADD_DEPENDENCIES(run_all_tests run_bsdcpio_test) ENDIF(ENABLE_CPIO AND ENABLE_TEST) Modified: vendor/libarchive/dist/cpio/test/main.c ============================================================================== --- vendor/libarchive/dist/cpio/test/main.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cpio/test/main.c Mon Oct 24 13:51:45 2016 (r307859) @@ -1164,6 +1164,35 @@ assertion_file_contains_lines_any_order( return (0); } +/* Verify that a text file does not contains the specified strings */ +int +assertion_file_contains_no_invalid_strings(const char *file, int line, + const char *pathname, const char *strings[]) +{ + char *buff; + int i; + + buff = slurpfile(NULL, "%s", pathname); + if (buff == NULL) { + failure_start(file, line, "Can't read file: %s", pathname); + failure_finish(NULL); + return (0); + } + + for (i = 0; strings[i] != NULL; ++i) { + if (strstr(buff, strings[i]) != NULL) { + failure_start(file, line, "Invalid string in %s: %s", pathname, + strings[i]); + failure_finish(NULL); + free(buff); + return(0); + } + } + + free(buff); + return (0); +} + /* Test that two paths point to the same file. */ /* As a side-effect, asserts that both files exist. */ static int @@ -1383,6 +1412,8 @@ assertion_file_mode(const char *file, in assertion_count(file, line); #if defined(_WIN32) && !defined(__CYGWIN__) failure_start(file, line, "assertFileMode not yet implemented for Windows"); + (void)mode; /* UNUSED */ + (void)r; /* UNUSED */ #else { struct stat st; Modified: vendor/libarchive/dist/cpio/test/test.h ============================================================================== --- vendor/libarchive/dist/cpio/test/test.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/cpio/test/test.h Mon Oct 24 13:51:45 2016 (r307859) @@ -174,6 +174,9 @@ /* Assert that file contents match a string. */ #define assertFileContents(data, data_size, pathname) \ assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname) +/* Verify that a file does not contain invalid strings */ +#define assertFileContainsNoInvalidStrings(pathname, strings) \ + assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings) #define assertFileMtime(pathname, sec, nsec) \ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec) #define assertFileMtimeRecent(pathname) \ @@ -241,6 +244,7 @@ int assertion_file_atime_recent(const ch int assertion_file_birthtime(const char *, int, const char *, long, long); int assertion_file_birthtime_recent(const char *, int, const char *); int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); +int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); int assertion_file_mode(const char *, int, const char *, int); Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/archive.h Mon Oct 24 13:51:45 2016 (r307859) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3002001 +#define ARCHIVE_VERSION_NUMBER 3002002 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(vo /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.2.1" +#define ARCHIVE_VERSION_ONLY_STRING "3.2.2" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: vendor/libarchive/dist/libarchive/archive_entry.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/archive_entry.h Mon Oct 24 13:51:45 2016 (r307859) @@ -29,7 +29,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3002001 +#define ARCHIVE_VERSION_NUMBER 3002002 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Oct 24 13:51:45 2016 (r307859) @@ -300,7 +300,7 @@ IF(ENABLE_TEST) # Experimental new test handling ADD_CUSTOM_TARGET(run_libarchive_test - COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR}) + COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR} -vv) ADD_DEPENDENCIES(run_all_tests run_libarchive_test) ENDIF(ENABLE_TEST) Modified: vendor/libarchive/dist/libarchive/test/main.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/main.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/main.c Mon Oct 24 13:51:45 2016 (r307859) @@ -1162,6 +1162,35 @@ assertion_file_contains_lines_any_order( return (0); } +/* Verify that a text file does not contains the specified strings */ +int +assertion_file_contains_no_invalid_strings(const char *file, int line, + const char *pathname, const char *strings[]) +{ + char *buff; + int i; + + buff = slurpfile(NULL, "%s", pathname); + if (buff == NULL) { + failure_start(file, line, "Can't read file: %s", pathname); + failure_finish(NULL); + return (0); + } + + for (i = 0; strings[i] != NULL; ++i) { + if (strstr(buff, strings[i]) != NULL) { + failure_start(file, line, "Invalid string in %s: %s", pathname, + strings[i]); + failure_finish(NULL); + free(buff); + return(0); + } + } + + free(buff); + return (0); +} + /* Test that two paths point to the same file. */ /* As a side-effect, asserts that both files exist. */ static int @@ -1381,6 +1410,8 @@ assertion_file_mode(const char *file, in assertion_count(file, line); #if defined(_WIN32) && !defined(__CYGWIN__) failure_start(file, line, "assertFileMode not yet implemented for Windows"); + (void)mode; /* UNUSED */ + (void)r; /* UNUSED */ #else { struct stat st; Modified: vendor/libarchive/dist/libarchive/test/test.h ============================================================================== --- vendor/libarchive/dist/libarchive/test/test.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/test.h Mon Oct 24 13:51:45 2016 (r307859) @@ -174,6 +174,9 @@ /* Assert that file contents match a string. */ #define assertFileContents(data, data_size, pathname) \ assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname) +/* Verify that a file does not contain invalid strings */ +#define assertFileContainsNoInvalidStrings(pathname, strings) \ + assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings) #define assertFileMtime(pathname, sec, nsec) \ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec) #define assertFileMtimeRecent(pathname) \ @@ -241,6 +244,7 @@ int assertion_file_atime_recent(const ch int assertion_file_birthtime(const char *, int, const char *, long, long); int assertion_file_birthtime_recent(const char *, int, const char *); int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); +int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); int assertion_file_mode(const char *, int, const char *, int); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_mtree_crash747.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_mtree_crash747.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/test_read_format_mtree_crash747.c Mon Oct 24 13:51:45 2016 (r307859) @@ -33,6 +33,11 @@ DEFINE_TEST(test_read_format_mtree_crash const char *reffile = "test_read_format_mtree_crash747.mtree.bz2"; struct archive *a; + if (archive_bzlib_version() == NULL) { + skipping("This test requires bzlib"); + return; + } + extract_reference_file(reffile); assert((a = archive_read_new()) != NULL); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c Mon Oct 24 13:51:45 2016 (r307859) @@ -50,6 +50,11 @@ DEFINE_TEST(test_read_format_zip_high_co size_t s; int64_t o; + if (archive_zlib_version() == NULL) { + skipping("Zip compression test requires zlib"); + return; + } + extract_reference_file(refname); p = slurpfile(&archive_size, refname); @@ -82,6 +87,11 @@ DEFINE_TEST(test_read_format_zip_high_co char *body, *body_read, *buff; int n; + if (archive_zlib_version() == NULL) { + skipping("Zip compression test requires zlib"); + return; + } + assert((body = malloc(body_size)) != NULL); assert((body_read = malloc(body_size)) != NULL); assert((buff = malloc(buff_size)) != NULL); Modified: vendor/libarchive/dist/libarchive/test/test_read_set_format.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_set_format.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/test_read_set_format.c Mon Oct 24 13:51:45 2016 (r307859) @@ -133,11 +133,12 @@ DEFINE_TEST(test_read_append_filter) assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP); - if (r == ARCHIVE_WARN && !canGzip()) { - skipping("gzip reading not fully supported on this platform"); + if (r != ARCHIVE_OK && archive_zlib_version() == NULL && !canGzip()) { + skipping("gzip tests require zlib or working gzip command"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } + assertEqualIntA(a, ARCHIVE_OK, r); assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); @@ -200,8 +201,11 @@ DEFINE_TEST(test_read_append_filter_wron { struct archive_entry *ae; struct archive *a; +#if !defined(_WIN32) || defined(__CYGWIN__) + FILE * fp; int fd; fpos_t pos; +#endif /* * If we have "bunzip2 -q", try using that. @@ -211,11 +215,13 @@ DEFINE_TEST(test_read_append_filter_wron return; } +#if !defined(_WIN32) || defined(__CYGWIN__) /* bunzip2 will write to stderr, redirect it to a file */ fflush(stderr); fgetpos(stderr, &pos); fd = dup(fileno(stderr)); - freopen("stderr1", "w", stderr); + fp = freopen("stderr1", "w", stderr); +#endif assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); @@ -227,12 +233,15 @@ DEFINE_TEST(test_read_append_filter_wron assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); - /* restore stderr */ - fflush(stderr); - dup2(fd, fileno(stderr)); - close(fd); - clearerr(stderr); - fsetpos(stderr, &pos); - +#if !defined(_WIN32) || defined(__CYGWIN__) + /* restore stderr and verify results */ + if (fp != NULL) { + fflush(stderr); + dup2(fd, fileno(stderr)); + close(fd); + clearerr(stderr); + fsetpos(stderr, &pos); + } assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1"); +#endif } Modified: vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Mon Oct 24 13:51:45 2016 (r307859) @@ -117,8 +117,8 @@ DEFINE_TEST(test_write_format_iso9660) */ dirname[0] = '\0'; strcpy(dir, "/dir0"); - for (i = 0; i < 10; i++) { - dir[4] = '0' + i; + for (i = 0; i < 13; i++) { + dir[4] = "0123456789ABCDEF"[i]; if (i == 0) strcat(dirname, dir+1); else @@ -134,6 +134,19 @@ DEFINE_TEST(test_write_format_iso9660) archive_entry_free(ae); } + strcat(dirname, "/file"); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_atime(ae, 2, 20); + archive_entry_set_birthtime(ae, 3, 30); + archive_entry_set_ctime(ae, 4, 40); + archive_entry_set_mtime(ae, 5, 50); + archive_entry_copy_pathname(ae, dirname); + archive_entry_set_mode(ae, S_IFREG | 0755); + archive_entry_set_size(ae, 8); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9)); + /* * "dir0/dir1/file1" has 8 bytes of data. */ @@ -333,6 +346,45 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(2048, archive_entry_size(ae)); /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(3, archive_entry_birthtime(ae)); + assertEqualInt(4, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0555) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(3, archive_entry_birthtime(ae)); + assertEqualInt(4, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0555) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(3, archive_entry_birthtime(ae)); + assertEqualInt(4, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0555) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* * Read "hardlnk" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); @@ -386,6 +438,21 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualMem(buff2, "12345678", 8); /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(3, archive_entry_birthtime(ae)); + assertEqualInt(4, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file", archive_entry_pathname(ae)); + assert((AE_IFREG | 0555) == archive_entry_mode(ae)); + assertEqualInt(1, archive_entry_nlink(ae)); + assertEqualInt(8, archive_entry_size(ae)); + assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); + assertEqualMem(buff2, "12345678", 8); + + /* * Read "dir0/dir1/file1" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); @@ -580,29 +647,65 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(2048, archive_entry_size(ae)); /* - * Read "hardlnk" + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); assertEqualInt(5, archive_entry_atime(ae)); assertEqualInt(5, archive_entry_ctime(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - assertEqualString("hardlnk", archive_entry_pathname(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "file" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); - assertEqualInt(2, archive_entry_nlink(ae)); assertEqualInt(8, archive_entry_size(ae)); assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); assertEqualMem(buff2, "12345678", 8); /* - * Read "file" + * Read "hardlnk" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); assertEqualInt(5, archive_entry_atime(ae)); assertEqualInt(5, archive_entry_ctime(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - assertEqualString("file", archive_entry_pathname(ae)); - assertEqualString("hardlnk", archive_entry_hardlink(ae)); + assertEqualString("hardlnk", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_hardlink(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); + assertEqualInt(2, archive_entry_nlink(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualIntA(a, 0, archive_read_data(a, buff2, 10)); @@ -625,6 +728,22 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualMem(buff2, "12345678", 8); /* + * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString( + "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file", + archive_entry_pathname(ae)); + assert((AE_IFREG | 0400) == archive_entry_mode(ae)); + assertEqualInt(1, archive_entry_nlink(ae)); + assertEqualInt(8, archive_entry_size(ae)); + assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); + assertEqualMem(buff2, "12345678", 8); + + /* * Read "dir0/dir1/file1" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); @@ -746,6 +865,42 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(2048, archive_entry_size(ae)); /* + * Read "rr_moved/dir7/dir8/dir9/dira" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "rr_moved/dir7/dir8/dir9/dira/dirB" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* + * Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC", + archive_entry_pathname(ae)); + assert((S_IFDIR | 0700) == archive_entry_mode(ae)); + assertEqualInt(2048, archive_entry_size(ae)); + + /* * Read "dir0" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); @@ -827,33 +982,35 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(2048, archive_entry_size(ae)); /* - * Read "file" + * Read "hardlink" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); assertEqualInt(5, archive_entry_atime(ae)); - assertEqualInt(0, archive_entry_birthtime(ae)); assertEqualInt(5, archive_entry_ctime(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - assertEqualString("FILE", archive_entry_pathname(ae)); + assertEqualString("HARDLNK", archive_entry_pathname(ae)); + assertEqualString(NULL, archive_entry_hardlink(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); - assertEqualInt(2, archive_entry_nlink(ae)); assertEqualInt(8, archive_entry_size(ae)); assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); assertEqualMem(buff2, "12345678", 8); /* - * Read "hardlink" + * Read "file" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_birthtime(ae)); assertEqualInt(5, archive_entry_ctime(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - assertEqualString("HARDLNK", archive_entry_pathname(ae)); - assertEqualString("FILE", archive_entry_hardlink(ae)); + assertEqualString("FILE", archive_entry_pathname(ae)); + assertEqualString("HARDLNK", archive_entry_hardlink(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); + assertEqualInt(2, archive_entry_nlink(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualIntA(a, 0, archive_read_data(a, buff2, 10)); + /* * Read longname */ @@ -871,6 +1028,22 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualMem(buff2, "12345678", 8); /* + * Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC/file" + */ + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_entry_atime(ae)); + assertEqualInt(5, archive_entry_ctime(ae)); + assertEqualInt(5, archive_entry_mtime(ae)); + assertEqualString( + "RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC/FILE", + archive_entry_pathname(ae)); + assert((AE_IFREG | 0400) == archive_entry_mode(ae)); + assertEqualInt(1, archive_entry_nlink(ae)); + assertEqualInt(8, archive_entry_size(ae)); + assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); + assertEqualMem(buff2, "12345678", 8); + + /* * Read "dir0/dir1/file1" */ assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); Modified: vendor/libarchive/dist/tar/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/tar/test/CMakeLists.txt Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/tar/test/CMakeLists.txt Mon Oct 24 13:51:45 2016 (r307859) @@ -100,7 +100,8 @@ IF(ENABLE_TAR AND ENABLE_TEST) # Experimental new test handling ADD_CUSTOM_TARGET(run_bsdtar_test COMMAND bsdtar_test -p $ - -r ${CMAKE_CURRENT_SOURCE_DIR}) + -r ${CMAKE_CURRENT_SOURCE_DIR} + -vv) ADD_DEPENDENCIES(run_bsdtar_test bsdtar) ADD_DEPENDENCIES(run_all_tests run_bsdtar_test) Modified: vendor/libarchive/dist/tar/test/main.c ============================================================================== --- vendor/libarchive/dist/tar/test/main.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/tar/test/main.c Mon Oct 24 13:51:45 2016 (r307859) @@ -1188,7 +1188,7 @@ assertion_file_contains_no_invalid_strin return(0); } } - + free(buff); return (0); } @@ -1412,6 +1412,8 @@ assertion_file_mode(const char *file, in assertion_count(file, line); #if defined(_WIN32) && !defined(__CYGWIN__) failure_start(file, line, "assertFileMode not yet implemented for Windows"); + (void)mode; /* UNUSED */ + (void)r; /* UNUSED */ #else { struct stat st; Modified: vendor/libarchive/dist/tar/test/test.h ============================================================================== --- vendor/libarchive/dist/tar/test/test.h Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/tar/test/test.h Mon Oct 24 13:51:45 2016 (r307859) @@ -244,7 +244,7 @@ int assertion_file_atime_recent(const ch int assertion_file_birthtime(const char *, int, const char *, long, long); int assertion_file_birthtime_recent(const char *, int, const char *); int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); -int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); +int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); int assertion_file_mode(const char *, int, const char *, int); Modified: vendor/libarchive/dist/tar/test/test_option_b.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_b.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/tar/test/test_option_b.c Mon Oct 24 13:51:45 2016 (r307859) @@ -33,7 +33,7 @@ DEFINE_TEST(test_option_b) assertMakeFile("file1", 0644, "file1"); if (systemf("cat file1 > test_cat.out 2> test_cat.err") != 0) { - skipping("Platform doesn't have cat"); + skipping("This test requires a `cat` program"); return; } testprog_ustar = malloc(strlen(testprog) + sizeof(USTAR_OPT) + 1); Modified: vendor/libarchive/dist/tar/test/test_symlink_dir.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_symlink_dir.c Mon Oct 24 13:44:24 2016 (r307858) +++ vendor/libarchive/dist/tar/test/test_symlink_dir.c Mon Oct 24 13:51:45 2016 (r307859) @@ -63,7 +63,7 @@ DEFINE_TEST(test_symlink_dir) /* "dir2" is a symlink to a non-existing "real_dir2" */ assertMakeSymlink("dest1/dir2", "real_dir2"); } else { - skipping("some symlink checks"); + skipping("Symlinks are not supported on this platform"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon Oct 24 13:52:55 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 79871C1F9A1; Mon, 24 Oct 2016 13:52:55 +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 1D5948A0; Mon, 24 Oct 2016 13:52:55 +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 u9ODqskD046657; Mon, 24 Oct 2016 13:52:54 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ODqs5T046654; Mon, 24 Oct 2016 13:52:54 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201610241352.u9ODqs5T046654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 24 Oct 2016 13:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307860 - in vendor/libarchive/3.2.2: . build cat/test cpio/test libarchive libarchive/test tar/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: Mon, 24 Oct 2016 13:52:55 -0000 Author: mm Date: Mon Oct 24 13:52:53 2016 New Revision: 307860 URL: https://svnweb.freebsd.org/changeset/base/307860 Log: Tag libarchive 3.2.2 Added: vendor/libarchive/3.2.2/ - copied from r307858, vendor/libarchive/dist/ vendor/libarchive/3.2.2/build/ci_build.sh - copied unchanged from r307859, vendor/libarchive/dist/build/ci_build.sh Replaced: vendor/libarchive/3.2.2/.travis.yml - copied unchanged from r307859, vendor/libarchive/dist/.travis.yml vendor/libarchive/3.2.2/Makefile.am - copied unchanged from r307859, vendor/libarchive/dist/Makefile.am vendor/libarchive/3.2.2/NEWS - copied unchanged from r307859, vendor/libarchive/dist/NEWS vendor/libarchive/3.2.2/build/version - copied unchanged from r307859, vendor/libarchive/dist/build/version vendor/libarchive/3.2.2/cat/test/CMakeLists.txt - copied unchanged from r307859, vendor/libarchive/dist/cat/test/CMakeLists.txt vendor/libarchive/3.2.2/cat/test/main.c - copied unchanged from r307859, vendor/libarchive/dist/cat/test/main.c vendor/libarchive/3.2.2/cat/test/test.h - copied unchanged from r307859, vendor/libarchive/dist/cat/test/test.h vendor/libarchive/3.2.2/configure.ac - copied unchanged from r307859, vendor/libarchive/dist/configure.ac vendor/libarchive/3.2.2/cpio/test/CMakeLists.txt - copied unchanged from r307859, vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/3.2.2/cpio/test/main.c - copied unchanged from r307859, vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/3.2.2/cpio/test/test.h - copied unchanged from r307859, vendor/libarchive/dist/cpio/test/test.h vendor/libarchive/3.2.2/libarchive/archive.h - copied unchanged from r307859, vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/3.2.2/libarchive/archive_entry.h - copied unchanged from r307859, vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/3.2.2/libarchive/test/CMakeLists.txt - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/3.2.2/libarchive/test/main.c - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/3.2.2/libarchive/test/test.h - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/3.2.2/libarchive/test/test_read_format_mtree_crash747.c - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/test_read_format_mtree_crash747.c vendor/libarchive/3.2.2/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c vendor/libarchive/3.2.2/libarchive/test/test_read_set_format.c - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/test_read_set_format.c vendor/libarchive/3.2.2/libarchive/test/test_write_format_iso9660.c - copied unchanged from r307859, vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c vendor/libarchive/3.2.2/tar/test/CMakeLists.txt - copied unchanged from r307859, vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/3.2.2/tar/test/main.c - copied unchanged from r307859, vendor/libarchive/dist/tar/test/main.c vendor/libarchive/3.2.2/tar/test/test.h - copied unchanged from r307859, vendor/libarchive/dist/tar/test/test.h vendor/libarchive/3.2.2/tar/test/test_option_b.c - copied unchanged from r307859, vendor/libarchive/dist/tar/test/test_option_b.c vendor/libarchive/3.2.2/tar/test/test_symlink_dir.c - copied unchanged from r307859, vendor/libarchive/dist/tar/test/test_symlink_dir.c Copied: vendor/libarchive/3.2.2/.travis.yml (from r307859, vendor/libarchive/dist/.travis.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/3.2.2/.travis.yml Mon Oct 24 13:52:53 2016 (r307860, copy of r307859, vendor/libarchive/dist/.travis.yml) @@ -0,0 +1,13 @@ +language: C +sudo: required +dist: trusty +compiler: + - gcc + - clang +env: + - BUILD_SYSTEM=cmake + - BUILD_SYSTEM=autotools +install: + - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev +script: + - build/ci_build.sh Copied: vendor/libarchive/3.2.2/Makefile.am (from r307859, vendor/libarchive/dist/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/3.2.2/Makefile.am Mon Oct 24 13:52:53 2016 (r307860, copy of r307859, vendor/libarchive/dist/Makefile.am) @@ -0,0 +1,1255 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS= foreign subdir-objects +ACLOCAL_AMFLAGS = -I build/autoconf + +# +# What to build and install +# +lib_LTLIBRARIES= libarchive.la +noinst_LTLIBRARIES= libarchive_fe.la +bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) $(bsdcat_programs) +man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) $(bsdcat_man_MANS) +BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h cat/test/list.h + +# +# What to test: We always test libarchive, test bsdtar and bsdcpio only +# if we built them. +# +check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) +TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) +TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) $(bsdcat_TESTS_ENVIRONMENT) +# Always build and test both bsdtar and bsdcpio as part of 'distcheck' +DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio +# The next line is commented out by default in shipping libarchive releases. +# It is uncommented by default in trunk. +# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g +AM_CFLAGS=$(DEV_CFLAGS) +PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ +AM_CPPFLAGS=$(PLATFORMCPPFLAGS) + +# +# What to include in the distribution +# +EXTRA_DIST= \ + CMakeLists.txt \ + build/autogen.sh \ + build/bump-version.sh \ + build/clean.sh \ + build/cmake \ + build/version \ + contrib \ + doc \ + examples \ + $(libarchive_EXTRA_DIST) \ + $(libarchive_test_EXTRA_DIST) \ + $(bsdtar_EXTRA_DIST) \ + $(bsdtar_test_EXTRA_DIST) \ + $(bsdcpio_EXTRA_DIST) \ + $(bsdcpio_test_EXTRA_DIST) \ + $(bsdcat_EXTRA_DIST) \ + $(bsdcat_test_EXTRA_DIST) + +# a) Clean out some unneeded files and directories +# b) Collect all documentation and format it for distribution. +dist-hook: + rm -rf `find $(distdir) -name CVS -type d` + rm -rf `find $(distdir) -name .svn -type d` + rm -f `find $(distdir) -name '*~'` + rm -f `find $(distdir) -name '*.out'` + rm -f `find $(distdir) -name '*.core'` + -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile + cd $(distdir)/doc && /bin/sh update.sh + +# +# Extra rules for cleanup +# +DISTCLEANFILES= \ + libarchive/test/list.h \ + tar/test/list.h \ + cpio/test/list.h \ + cat/test/list.h + +distclean-local: + -rm -rf .ref + -rm -rf autom4te.cache/ + -rm -f *~ + -[ -f libarchive/Makefile ] && cd libarchive && make clean + -[ -f libarchive/test/Makefile ] && cd libarchive/test && make clean + -[ -f tar/Makefile ] && cd tar && make clean + -[ -f tar/test/Makefile ] && cd tar/test && make clean + -[ -f cpio/Makefile ] && cd cpio && make clean + -[ -f cpio/test/Makefile ] && cd cpio/test && make clean + -[ -f cat/Makefile ] && cd cat && make clean + -[ -f cpio/test/Makefile ] && cd cat/test && make clean + +# +# Libarchive headers, source, etc. +# +# + +include_HEADERS= libarchive/archive.h libarchive/archive_entry.h + +libarchive_la_SOURCES= \ + libarchive/archive_acl.c \ + libarchive/archive_acl_private.h \ + libarchive/archive_check_magic.c \ + libarchive/archive_cmdline.c \ + libarchive/archive_cmdline_private.h \ + libarchive/archive_crc32.h \ + libarchive/archive_cryptor.c \ + libarchive/archive_cryptor_private.h \ + libarchive/archive_digest.c \ + libarchive/archive_digest_private.h \ + libarchive/archive_endian.h \ + libarchive/archive_entry.c \ + libarchive/archive_entry.h \ + libarchive/archive_entry_copy_stat.c \ + libarchive/archive_entry_link_resolver.c \ + libarchive/archive_entry_locale.h \ + libarchive/archive_entry_private.h \ + libarchive/archive_entry_sparse.c \ + libarchive/archive_entry_stat.c \ + libarchive/archive_entry_strmode.c \ + libarchive/archive_entry_xattr.c \ + libarchive/archive_getdate.c \ + libarchive/archive_getdate.h \ + libarchive/archive_hmac.c \ + libarchive/archive_hmac_private.h \ + libarchive/archive_match.c \ + libarchive/archive_options.c \ + libarchive/archive_options_private.h \ + libarchive/archive_pack_dev.h \ + libarchive/archive_pack_dev.c \ + libarchive/archive_pathmatch.c \ + libarchive/archive_pathmatch.h \ + libarchive/archive_platform.h \ + libarchive/archive_ppmd_private.h \ + libarchive/archive_ppmd7.c \ + libarchive/archive_ppmd7_private.h \ + libarchive/archive_private.h \ + libarchive/archive_random.c \ + libarchive/archive_random_private.h \ + libarchive/archive_rb.c \ + libarchive/archive_rb.h \ + libarchive/archive_read.c \ + libarchive/archive_read_add_passphrase.c \ + libarchive/archive_read_append_filter.c \ + libarchive/archive_read_data_into_fd.c \ + libarchive/archive_read_disk_entry_from_file.c \ + libarchive/archive_read_disk_posix.c \ + libarchive/archive_read_disk_private.h \ + libarchive/archive_read_disk_set_standard_lookup.c \ + libarchive/archive_read_extract.c \ + libarchive/archive_read_extract2.c \ + libarchive/archive_read_open_fd.c \ + libarchive/archive_read_open_file.c \ + libarchive/archive_read_open_filename.c \ + libarchive/archive_read_open_memory.c \ + libarchive/archive_read_private.h \ + libarchive/archive_read_set_format.c \ + libarchive/archive_read_set_options.c \ + libarchive/archive_read_support_filter_all.c \ + libarchive/archive_read_support_filter_bzip2.c \ + libarchive/archive_read_support_filter_compress.c \ + libarchive/archive_read_support_filter_grzip.c \ + libarchive/archive_read_support_filter_gzip.c \ + libarchive/archive_read_support_filter_lrzip.c \ + libarchive/archive_read_support_filter_lz4.c \ + libarchive/archive_read_support_filter_lzop.c \ + libarchive/archive_read_support_filter_none.c \ + libarchive/archive_read_support_filter_program.c \ + libarchive/archive_read_support_filter_rpm.c \ + libarchive/archive_read_support_filter_uu.c \ + libarchive/archive_read_support_filter_xz.c \ + libarchive/archive_read_support_format_7zip.c \ + libarchive/archive_read_support_format_all.c \ + libarchive/archive_read_support_format_ar.c \ + libarchive/archive_read_support_format_by_code.c \ + libarchive/archive_read_support_format_cab.c \ + libarchive/archive_read_support_format_cpio.c \ + libarchive/archive_read_support_format_empty.c \ + libarchive/archive_read_support_format_iso9660.c \ + libarchive/archive_read_support_format_lha.c \ + libarchive/archive_read_support_format_mtree.c \ + libarchive/archive_read_support_format_rar.c \ + libarchive/archive_read_support_format_raw.c \ + libarchive/archive_read_support_format_tar.c \ + libarchive/archive_read_support_format_warc.c \ + libarchive/archive_read_support_format_xar.c \ + libarchive/archive_read_support_format_zip.c \ + libarchive/archive_string.c \ + libarchive/archive_string.h \ + libarchive/archive_string_composition.h \ + libarchive/archive_string_sprintf.c \ + libarchive/archive_util.c \ + libarchive/archive_virtual.c \ + libarchive/archive_write.c \ + libarchive/archive_write_disk_acl.c \ + libarchive/archive_write_disk_posix.c \ + libarchive/archive_write_disk_private.h \ + libarchive/archive_write_disk_set_standard_lookup.c \ + libarchive/archive_write_open_fd.c \ + libarchive/archive_write_open_file.c \ + libarchive/archive_write_open_filename.c \ + libarchive/archive_write_open_memory.c \ + libarchive/archive_write_private.h \ + libarchive/archive_write_add_filter.c \ + libarchive/archive_write_add_filter_b64encode.c \ + libarchive/archive_write_add_filter_by_name.c \ + libarchive/archive_write_add_filter_bzip2.c \ + libarchive/archive_write_add_filter_compress.c \ + libarchive/archive_write_add_filter_grzip.c \ + libarchive/archive_write_add_filter_gzip.c \ + libarchive/archive_write_add_filter_lrzip.c \ + libarchive/archive_write_add_filter_lz4.c \ + libarchive/archive_write_add_filter_lzop.c \ + libarchive/archive_write_add_filter_none.c \ + libarchive/archive_write_add_filter_program.c \ + libarchive/archive_write_add_filter_uuencode.c \ + libarchive/archive_write_add_filter_xz.c \ + libarchive/archive_write_set_format.c \ + libarchive/archive_write_set_format_7zip.c \ + libarchive/archive_write_set_format_ar.c \ + libarchive/archive_write_set_format_by_name.c \ + libarchive/archive_write_set_format_cpio.c \ + libarchive/archive_write_set_format_cpio_newc.c \ + libarchive/archive_write_set_format_filter_by_ext.c \ + libarchive/archive_write_set_format_iso9660.c \ + libarchive/archive_write_set_format_mtree.c \ + libarchive/archive_write_set_format_pax.c \ + libarchive/archive_write_set_format_raw.c \ + libarchive/archive_write_set_format_shar.c \ + libarchive/archive_write_set_format_ustar.c \ + libarchive/archive_write_set_format_v7tar.c \ + libarchive/archive_write_set_format_gnutar.c \ + libarchive/archive_write_set_format_warc.c \ + libarchive/archive_write_set_format_xar.c \ + libarchive/archive_write_set_format_zip.c \ + libarchive/archive_write_set_options.c \ + libarchive/archive_write_set_passphrase.c \ + libarchive/archive_xxhash.h \ + libarchive/config_freebsd.h \ + libarchive/filter_fork_posix.c \ + libarchive/filter_fork.h \ + libarchive/xxhash.c + +if INC_WINDOWS_FILES +libarchive_la_SOURCES+= \ + libarchive/archive_entry_copy_bhfi.c \ + libarchive/archive_read_disk_windows.c \ + libarchive/archive_windows.h \ + libarchive/archive_windows.c \ + libarchive/archive_write_disk_windows.c \ + libarchive/filter_fork_windows.c +endif + +# -no-undefined marks that libarchive doesn't rely on symbols +# defined in the application. This is mandatory for cygwin. +libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) +libarchive_la_LIBADD= $(LTLIBICONV) + +# Manpages to install +libarchive_man_MANS= \ + libarchive/archive_entry.3 \ + libarchive/archive_entry_acl.3 \ + libarchive/archive_entry_linkify.3 \ + libarchive/archive_entry_paths.3 \ + libarchive/archive_entry_perms.3 \ + libarchive/archive_entry_stat.3 \ + libarchive/archive_entry_time.3 \ + libarchive/archive_read.3 \ + libarchive/archive_read_add_passphrase.3 \ + libarchive/archive_read_data.3 \ + libarchive/archive_read_disk.3 \ + libarchive/archive_read_extract.3 \ + libarchive/archive_read_filter.3 \ + libarchive/archive_read_format.3 \ + libarchive/archive_read_free.3 \ + libarchive/archive_read_header.3 \ + libarchive/archive_read_new.3 \ + libarchive/archive_read_open.3 \ + libarchive/archive_read_set_options.3 \ + libarchive/archive_util.3 \ + libarchive/archive_write.3 \ + libarchive/archive_write_blocksize.3 \ + libarchive/archive_write_data.3 \ + libarchive/archive_write_disk.3 \ + libarchive/archive_write_filter.3 \ + libarchive/archive_write_finish_entry.3 \ + libarchive/archive_write_format.3 \ + libarchive/archive_write_free.3 \ + libarchive/archive_write_header.3 \ + libarchive/archive_write_new.3 \ + libarchive/archive_write_open.3 \ + libarchive/archive_write_set_options.3 \ + libarchive/archive_write_set_passphrase.3 \ + libarchive/cpio.5 \ + libarchive/libarchive.3 \ + libarchive/libarchive_changes.3 \ + libarchive/libarchive_internals.3 \ + libarchive/libarchive-formats.5 \ + libarchive/mtree.5 \ + libarchive/tar.5 + +# Additional libarchive files to include in the distribution +libarchive_EXTRA_DIST= \ + libarchive/archive_windows.c \ + libarchive/archive_windows.h \ + libarchive/filter_fork_windows.c \ + libarchive/CMakeLists.txt \ + $(libarchive_man_MANS) + +# pkgconfig +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = build/pkgconfig/libarchive.pc + +# Sources needed by all test programs +test_utils_SOURCES= \ + test_utils/test_utils.c \ + test_utils/test_utils.h + +# +# +# libarchive_test program +# +# +libarchive_test_SOURCES= \ + $(libarchive_la_SOURCES) \ + $(test_utils_SOURCES) \ + libarchive/test/main.c \ + libarchive/test/read_open_memory.c \ + libarchive/test/test.h \ + libarchive/test/test_acl_freebsd_posix1e.c \ + libarchive/test/test_acl_freebsd_nfs4.c \ + libarchive/test/test_acl_nfs4.c \ + libarchive/test/test_acl_pax.c \ + libarchive/test/test_acl_posix1e.c \ + libarchive/test/test_archive_api_feature.c \ + libarchive/test/test_archive_clear_error.c \ + libarchive/test/test_archive_cmdline.c \ + libarchive/test/test_archive_digest.c \ + libarchive/test/test_archive_getdate.c \ + libarchive/test/test_archive_match_owner.c \ + libarchive/test/test_archive_match_path.c \ + libarchive/test/test_archive_match_time.c \ + libarchive/test/test_archive_pathmatch.c \ + libarchive/test/test_archive_read_add_passphrase.c \ + libarchive/test/test_archive_read_close_twice.c \ + libarchive/test/test_archive_read_close_twice_open_fd.c \ + libarchive/test/test_archive_read_close_twice_open_filename.c \ + libarchive/test/test_archive_read_multiple_data_objects.c \ + libarchive/test/test_archive_read_next_header_empty.c \ + libarchive/test/test_archive_read_next_header_raw.c \ + libarchive/test/test_archive_read_open2.c \ + libarchive/test/test_archive_read_set_filter_option.c \ + libarchive/test/test_archive_read_set_format_option.c \ + libarchive/test/test_archive_read_set_option.c \ + libarchive/test/test_archive_read_set_options.c \ + libarchive/test/test_archive_read_support.c \ + libarchive/test/test_archive_set_error.c \ + libarchive/test/test_archive_string.c \ + libarchive/test/test_archive_string_conversion.c \ + libarchive/test/test_archive_write_add_filter_by_name.c \ + libarchive/test/test_archive_write_set_filter_option.c \ + libarchive/test/test_archive_write_set_format_by_name.c \ + libarchive/test/test_archive_write_set_format_filter_by_ext.c \ + libarchive/test/test_archive_write_set_format_option.c \ + libarchive/test/test_archive_write_set_option.c \ + libarchive/test/test_archive_write_set_options.c \ + libarchive/test/test_archive_write_set_passphrase.c \ + libarchive/test/test_bad_fd.c \ + libarchive/test/test_compat_bzip2.c \ + libarchive/test/test_compat_cpio.c \ + libarchive/test/test_compat_gtar.c \ + libarchive/test/test_compat_gzip.c \ + libarchive/test/test_compat_lz4.c \ + libarchive/test/test_compat_lzip.c \ + libarchive/test/test_compat_lzma.c \ + libarchive/test/test_compat_lzop.c \ + libarchive/test/test_compat_mac.c \ + libarchive/test/test_compat_pax_libarchive_2x.c \ + libarchive/test/test_compat_solaris_tar_acl.c \ + libarchive/test/test_compat_solaris_pax_sparse.c \ + libarchive/test/test_compat_tar_hardlink.c \ + libarchive/test/test_compat_uudecode.c \ + libarchive/test/test_compat_uudecode_large.c \ + libarchive/test/test_compat_xz.c \ + libarchive/test/test_compat_zip.c \ + libarchive/test/test_empty_write.c \ + libarchive/test/test_entry.c \ + libarchive/test/test_entry_strmode.c \ + libarchive/test/test_extattr_freebsd.c \ + libarchive/test/test_filter_count.c \ + libarchive/test/test_fuzz.c \ + libarchive/test/test_gnutar_filename_encoding.c \ + libarchive/test/test_link_resolver.c \ + libarchive/test/test_open_failure.c \ + libarchive/test/test_open_fd.c \ + libarchive/test/test_open_file.c \ + libarchive/test/test_open_filename.c \ + libarchive/test/test_pax_filename_encoding.c \ + libarchive/test/test_read_data_large.c \ + libarchive/test/test_read_disk.c \ + libarchive/test/test_read_disk_directory_traversals.c \ + libarchive/test/test_read_disk_entry_from_file.c \ + libarchive/test/test_read_extract.c \ + libarchive/test/test_read_file_nonexistent.c \ + libarchive/test/test_read_filter_compress.c \ + libarchive/test/test_read_filter_grzip.c \ + libarchive/test/test_read_filter_lrzip.c \ + libarchive/test/test_read_filter_lzop.c \ + libarchive/test/test_read_filter_lzop_multiple_parts.c \ + libarchive/test/test_read_filter_program.c \ + libarchive/test/test_read_filter_program_signature.c \ + libarchive/test/test_read_filter_uudecode.c \ + libarchive/test/test_read_format_7zip.c \ + libarchive/test/test_read_format_7zip_encryption_data.c \ + libarchive/test/test_read_format_7zip_encryption_partially.c \ + libarchive/test/test_read_format_7zip_encryption_header.c \ + libarchive/test/test_read_format_7zip_malformed.c \ + libarchive/test/test_read_format_ar.c \ + libarchive/test/test_read_format_cab.c \ + libarchive/test/test_read_format_cab_filename.c \ + libarchive/test/test_read_format_cpio_afio.c \ + libarchive/test/test_read_format_cpio_bin.c \ + libarchive/test/test_read_format_cpio_bin_Z.c \ + libarchive/test/test_read_format_cpio_bin_be.c \ + libarchive/test/test_read_format_cpio_bin_bz2.c \ + libarchive/test/test_read_format_cpio_bin_gz.c \ + libarchive/test/test_read_format_cpio_bin_le.c \ + libarchive/test/test_read_format_cpio_bin_lzip.c \ + libarchive/test/test_read_format_cpio_bin_lzma.c \ + libarchive/test/test_read_format_cpio_bin_xz.c \ + libarchive/test/test_read_format_cpio_filename.c \ + libarchive/test/test_read_format_cpio_odc.c \ + libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c \ + libarchive/test/test_read_format_cpio_svr4_gzip.c \ + libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c \ + libarchive/test/test_read_format_cpio_svr4c_Z.c \ + libarchive/test/test_read_format_empty.c \ + libarchive/test/test_read_format_gtar_filename.c \ + libarchive/test/test_read_format_gtar_gz.c \ + libarchive/test/test_read_format_gtar_lzma.c \ + libarchive/test/test_read_format_gtar_sparse.c \ + libarchive/test/test_read_format_gtar_sparse_skip_entry.c \ + libarchive/test/test_read_format_iso_Z.c \ + libarchive/test/test_read_format_iso_multi_extent.c \ + libarchive/test/test_read_format_iso_xorriso.c \ + libarchive/test/test_read_format_isojoliet_bz2.c \ + libarchive/test/test_read_format_isojoliet_long.c \ + libarchive/test/test_read_format_isojoliet_rr.c \ + libarchive/test/test_read_format_isojoliet_versioned.c \ + libarchive/test/test_read_format_isorr_bz2.c \ + libarchive/test/test_read_format_isorr_ce.c \ + libarchive/test/test_read_format_isorr_new_bz2.c \ + libarchive/test/test_read_format_isorr_rr_moved.c \ + libarchive/test/test_read_format_isozisofs_bz2.c \ + libarchive/test/test_read_format_lha.c \ + libarchive/test/test_read_format_lha_bugfix_0.c \ + libarchive/test/test_read_format_lha_filename.c \ + libarchive/test/test_read_format_mtree.c \ + libarchive/test/test_read_format_mtree_crash747.c \ + libarchive/test/test_read_format_pax_bz2.c \ + libarchive/test/test_read_format_rar.c \ + libarchive/test/test_read_format_rar_encryption_data.c \ + libarchive/test/test_read_format_rar_encryption_partially.c \ + libarchive/test/test_read_format_rar_encryption_header.c \ + libarchive/test/test_read_format_rar_invalid1.c \ + libarchive/test/test_read_format_raw.c \ + libarchive/test/test_read_format_tar.c \ + libarchive/test/test_read_format_tar_concatenated.c \ + libarchive/test/test_read_format_tar_empty_pax.c \ + libarchive/test/test_read_format_tar_empty_filename.c \ + libarchive/test/test_read_format_tar_filename.c \ + libarchive/test/test_read_format_tbz.c \ + libarchive/test/test_read_format_tgz.c \ + libarchive/test/test_read_format_tlz.c \ + libarchive/test/test_read_format_txz.c \ + libarchive/test/test_read_format_tz.c \ + libarchive/test/test_read_format_ustar_filename.c \ + libarchive/test/test_read_format_warc.c \ + libarchive/test/test_read_format_xar.c \ + libarchive/test/test_read_format_zip.c \ + libarchive/test/test_read_format_zip_comment_stored.c \ + libarchive/test/test_read_format_zip_encryption_data.c \ + libarchive/test/test_read_format_zip_encryption_partially.c \ + 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_mac_metadata.c \ + libarchive/test/test_read_format_zip_malformed.c \ + libarchive/test/test_read_format_zip_msdos.c \ + libarchive/test/test_read_format_zip_nested.c \ + libarchive/test/test_read_format_zip_nofiletype.c \ + libarchive/test/test_read_format_zip_padded.c \ + libarchive/test/test_read_format_zip_sfx.c \ + libarchive/test/test_read_format_zip_traditional_encryption_data.c \ + libarchive/test/test_read_format_zip_winzip_aes.c \ + libarchive/test/test_read_format_zip_winzip_aes_large.c \ + libarchive/test/test_read_format_zip_zip64.c \ + libarchive/test/test_read_large.c \ + libarchive/test/test_read_pax_truncated.c \ + libarchive/test/test_read_position.c \ + libarchive/test/test_read_set_format.c \ + libarchive/test/test_read_too_many_filters.c \ + libarchive/test/test_read_truncated.c \ + libarchive/test/test_read_truncated_filter.c \ + libarchive/test/test_sparse_basic.c \ + libarchive/test/test_tar_filenames.c \ + libarchive/test/test_tar_large.c \ + libarchive/test/test_ustar_filenames.c \ + libarchive/test/test_ustar_filename_encoding.c \ + libarchive/test/test_warn_missing_hardlink_target.c \ + libarchive/test/test_write_disk.c \ + libarchive/test/test_write_disk_appledouble.c \ + libarchive/test/test_write_disk_failures.c \ + libarchive/test/test_write_disk_hardlink.c \ + libarchive/test/test_write_disk_hfs_compression.c \ + libarchive/test/test_write_disk_lookup.c \ + libarchive/test/test_write_disk_mac_metadata.c \ + libarchive/test/test_write_disk_no_hfs_compression.c \ + libarchive/test/test_write_disk_perms.c \ + libarchive/test/test_write_disk_secure.c \ + libarchive/test/test_write_disk_secure744.c \ + libarchive/test/test_write_disk_secure745.c \ + libarchive/test/test_write_disk_secure746.c \ + libarchive/test/test_write_disk_sparse.c \ + libarchive/test/test_write_disk_symlink.c \ + libarchive/test/test_write_disk_times.c \ + libarchive/test/test_write_filter_b64encode.c \ + libarchive/test/test_write_filter_bzip2.c \ + libarchive/test/test_write_filter_compress.c \ + libarchive/test/test_write_filter_gzip.c \ + libarchive/test/test_write_filter_gzip_timestamp.c \ + libarchive/test/test_write_filter_lrzip.c \ + libarchive/test/test_write_filter_lz4.c \ + libarchive/test/test_write_filter_lzip.c \ + libarchive/test/test_write_filter_lzma.c \ + libarchive/test/test_write_filter_lzop.c \ + libarchive/test/test_write_filter_program.c \ + libarchive/test/test_write_filter_uuencode.c \ + libarchive/test/test_write_filter_xz.c \ + libarchive/test/test_write_format_7zip.c \ + libarchive/test/test_write_format_7zip_empty.c \ + libarchive/test/test_write_format_7zip_large.c \ + libarchive/test/test_write_format_ar.c \ + libarchive/test/test_write_format_cpio.c \ + libarchive/test/test_write_format_cpio_empty.c \ + libarchive/test/test_write_format_cpio_newc.c \ + libarchive/test/test_write_format_cpio_odc.c \ + libarchive/test/test_write_format_gnutar.c \ + libarchive/test/test_write_format_gnutar_filenames.c \ + libarchive/test/test_write_format_iso9660.c \ + libarchive/test/test_write_format_iso9660_boot.c \ + libarchive/test/test_write_format_iso9660_empty.c \ + libarchive/test/test_write_format_iso9660_filename.c \ + libarchive/test/test_write_format_iso9660_zisofs.c \ + libarchive/test/test_write_format_mtree.c \ + libarchive/test/test_write_format_mtree_absolute_path.c \ + libarchive/test/test_write_format_mtree_classic.c \ + libarchive/test/test_write_format_mtree_classic_indent.c\ + libarchive/test/test_write_format_mtree_fflags.c \ + libarchive/test/test_write_format_mtree_no_separator.c \ + libarchive/test/test_write_format_mtree_quoted_filename.c\ + libarchive/test/test_write_format_pax.c \ + libarchive/test/test_write_format_raw.c \ + libarchive/test/test_write_format_raw_b64.c \ + libarchive/test/test_write_format_shar_empty.c \ + libarchive/test/test_write_format_tar.c \ + libarchive/test/test_write_format_tar_empty.c \ + libarchive/test/test_write_format_tar_sparse.c \ + libarchive/test/test_write_format_tar_ustar.c \ + libarchive/test/test_write_format_tar_v7tar.c \ + libarchive/test/test_write_format_warc.c \ + libarchive/test/test_write_format_warc_empty.c \ + libarchive/test/test_write_format_xar.c \ + libarchive/test/test_write_format_xar_empty.c \ + libarchive/test/test_write_format_zip.c \ + libarchive/test/test_write_format_zip_compression_store.c \ + libarchive/test/test_write_format_zip_empty.c \ + libarchive/test/test_write_format_zip_empty_zip64.c \ + libarchive/test/test_write_format_zip_file.c \ + libarchive/test/test_write_format_zip_file_zip64.c \ + libarchive/test/test_write_format_zip_large.c \ + libarchive/test/test_write_format_zip_zip64.c \ + libarchive/test/test_write_open_memory.c \ + libarchive/test/test_write_read_format_zip.c \ + libarchive/test/test_zip_filename_encoding.c + +libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS) +libarchive_test_LDADD= $(LTLIBICONV) + +# The "list.h" file just lists all of the tests defined in all of the sources. +# Building it automatically provides a sanity-check on libarchive_test_SOURCES +# above. +libarchive/test/list.h: Makefile + $(MKDIR_P) libarchive/test + cat $(top_srcdir)/libarchive/test/test_*.c | grep '^DEFINE_TEST' > libarchive/test/list.h + +libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG + +libarchive_test_EXTRA_DIST=\ + libarchive/test/list.h \ + libarchive/test/test_acl_pax.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 \ + libarchive/test/test_compat_cpio_1.cpio.uu \ + libarchive/test/test_compat_gtar_1.tar.uu \ + libarchive/test/test_compat_gzip_1.tgz.uu \ + libarchive/test/test_compat_gzip_2.tgz.uu \ + libarchive/test/test_compat_lz4_1.tar.lz4.uu \ + libarchive/test/test_compat_lz4_2.tar.lz4.uu \ + libarchive/test/test_compat_lz4_3.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B4.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B5.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B6.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B7.tar.lz4.uu \ + libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu \ + libarchive/test/test_compat_lzip_1.tlz.uu \ + libarchive/test/test_compat_lzip_2.tlz.uu \ + libarchive/test/test_compat_lzma_1.tlz.uu \ + libarchive/test/test_compat_lzma_2.tlz.uu \ + libarchive/test/test_compat_lzma_3.tlz.uu \ + libarchive/test/test_compat_lzop_1.tar.lzo.uu \ + libarchive/test/test_compat_lzop_2.tar.lzo.uu \ + libarchive/test/test_compat_lzop_3.tar.lzo.uu \ + libarchive/test/test_compat_mac-1.tar.Z.uu \ + libarchive/test/test_compat_mac-2.tar.Z.uu \ + libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \ + 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_tar_hardlink_1.tar.uu \ + libarchive/test/test_compat_uudecode_large.tar.Z.uu \ + libarchive/test/test_compat_xz_1.txz.uu \ + libarchive/test/test_compat_zip_1.zip.uu \ + libarchive/test/test_compat_zip_2.zip.uu \ + libarchive/test/test_compat_zip_3.zip.uu \ + libarchive/test/test_compat_zip_4.zip.uu \ + libarchive/test/test_compat_zip_5.zip.uu \ + libarchive/test/test_compat_zip_6.zip.uu \ + libarchive/test/test_compat_zip_7.xps.uu \ + libarchive/test/test_fuzz.cab.uu \ + libarchive/test/test_fuzz.lzh.uu \ + libarchive/test/test_fuzz_1.iso.Z.uu \ + libarchive/test/test_pax_filename_encoding.tar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part3.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part4.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part6.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part1.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part2.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part3.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu \ + libarchive/test/test_read_filter_grzip.tar.grz.uu \ + libarchive/test/test_read_filter_lrzip.tar.lrz.uu \ + libarchive/test/test_read_filter_lzop.tar.lzo.uu \ + libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \ + libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \ + libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_copy_lzma.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_deflate.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_lzma1_1.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_lzma1_2.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_lzma2_1.7z.uu \ + libarchive/test/test_read_format_7zip_bcj2_lzma2_2.7z.uu \ + libarchive/test/test_read_format_7zip_bcj_bzip2.7z.uu \ + libarchive/test/test_read_format_7zip_bcj_copy.7z.uu \ + libarchive/test/test_read_format_7zip_bcj_deflate.7z.uu \ + libarchive/test/test_read_format_7zip_bcj_lzma1.7z.uu \ + libarchive/test/test_read_format_7zip_bcj_lzma2.7z.uu \ + libarchive/test/test_read_format_7zip_bzip2.7z.uu \ + libarchive/test/test_read_format_7zip_copy.7z.uu \ + libarchive/test/test_read_format_7zip_copy_2.7z.uu \ + libarchive/test/test_read_format_7zip_deflate.7z.uu \ + libarchive/test/test_read_format_7zip_delta_lzma1.7z.uu \ + libarchive/test/test_read_format_7zip_delta_lzma2.7z.uu \ + libarchive/test/test_read_format_7zip_empty_archive.7z.uu \ + libarchive/test/test_read_format_7zip_empty_file.7z.uu \ + libarchive/test/test_read_format_7zip_encryption.7z.uu \ + libarchive/test/test_read_format_7zip_encryption_header.7z.uu \ + libarchive/test/test_read_format_7zip_encryption_partially.7z.uu \ + libarchive/test/test_read_format_7zip_lzma1.7z.uu \ + libarchive/test/test_read_format_7zip_lzma1_2.7z.uu \ + libarchive/test/test_read_format_7zip_lzma1_lzma2.7z.uu \ + libarchive/test/test_read_format_7zip_lzma2.7z.uu \ + libarchive/test/test_read_format_7zip_malformed.7z.uu \ + libarchive/test/test_read_format_7zip_malformed2.7z.uu \ + libarchive/test/test_read_format_7zip_ppmd.7z.uu \ + libarchive/test/test_read_format_7zip_symbolic_name.7z.uu \ + libarchive/test/test_read_format_ar.ar.uu \ + libarchive/test/test_read_format_cab_1.cab.uu \ + libarchive/test/test_read_format_cab_2.cab.uu \ + libarchive/test/test_read_format_cab_3.cab.uu \ + libarchive/test/test_read_format_cab_filename_cp932.cab.uu \ + libarchive/test/test_read_format_cpio_bin_be.cpio.uu \ + libarchive/test/test_read_format_cpio_bin_le.cpio.uu \ + libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu \ + libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu \ + libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu \ + libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu \ + libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu \ + libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu \ + libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu \ + libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu \ + libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu \ + libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu \ + libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \ + libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu \ + libarchive/test/test_read_format_iso.iso.Z.uu \ + libarchive/test/test_read_format_iso_2.iso.Z.uu \ + libarchive/test/test_read_format_iso_joliet.iso.Z.uu \ + libarchive/test/test_read_format_iso_joliet_by_nero.iso.Z.uu \ + libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu \ + libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu \ + libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu \ + libarchive/test/test_read_format_iso_rockridge.iso.Z.uu \ + libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu \ + libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu \ + libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu \ + libarchive/test/test_read_format_iso_xorriso.iso.Z.uu \ + libarchive/test/test_read_format_iso_zisofs.iso.Z.uu \ + libarchive/test/test_read_format_lha_bugfix_0.lzh.uu \ + libarchive/test/test_read_format_lha_filename_cp932.lzh.uu \ + libarchive/test/test_read_format_lha_header0.lzh.uu \ + libarchive/test/test_read_format_lha_header1.lzh.uu \ + libarchive/test/test_read_format_lha_header2.lzh.uu \ + libarchive/test/test_read_format_lha_header3.lzh.uu \ + libarchive/test/test_read_format_lha_lh0.lzh.uu \ + libarchive/test/test_read_format_lha_lh6.lzh.uu \ + libarchive/test/test_read_format_lha_lh7.lzh.uu \ + libarchive/test/test_read_format_lha_withjunk.lzh.uu \ + libarchive/test/test_read_format_mtree.mtree.uu \ + libarchive/test/test_read_format_mtree_nomagic.mtree.uu \ + libarchive/test/test_read_format_mtree_nomagic2.mtree.uu \ + libarchive/test/test_read_format_mtree_nomagic3.mtree.uu \ + libarchive/test/test_read_format_rar.rar.uu \ + libarchive/test/test_read_format_rar_binary_data.rar.uu \ + libarchive/test/test_read_format_rar_compress_best.rar.uu \ + libarchive/test/test_read_format_rar_compress_normal.rar.uu \ + libarchive/test/test_read_format_rar_encryption_data.rar.uu \ + libarchive/test/test_read_format_rar_encryption_header.rar.uu \ + libarchive/test/test_read_format_rar_encryption_partially.rar.uu \ + libarchive/test/test_read_format_rar_invalid1.rar.uu \ + libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu \ + libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu \ + libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu \ + libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu \ + libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu \ + libarchive/test/test_read_format_rar_noeof.rar.uu \ + libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \ + libarchive/test/test_read_format_rar_sfx.exe.uu \ + libarchive/test/test_read_format_rar_subblock.rar.uu \ + libarchive/test/test_read_format_rar_unicode.rar.uu \ + libarchive/test/test_read_format_rar_windows.rar.uu \ + libarchive/test/test_read_format_raw.data.Z.uu \ + libarchive/test/test_read_format_raw.data.uu \ + libarchive/test/test_read_format_tar_concatenated.tar.uu \ + libarchive/test/test_read_format_tar_empty_filename.tar.uu \ + libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \ + libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \ + libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \ + libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \ + libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \ + libarchive/test/test_read_format_warc.warc.uu \ + libarchive/test/test_read_format_zip.zip.uu \ + libarchive/test/test_read_format_zip_comment_stored_1.zip.uu \ + libarchive/test/test_read_format_zip_comment_stored_2.zip.uu \ + libarchive/test/test_read_format_zip_encryption_data.zip.uu \ + libarchive/test/test_read_format_zip_encryption_header.zip.uu \ + libarchive/test/test_read_format_zip_encryption_partially.zip.uu \ + libarchive/test/test_read_format_zip_filename_cp866.zip.uu \ + libarchive/test/test_read_format_zip_filename_cp932.zip.uu \ + libarchive/test/test_read_format_zip_filename_koi8r.zip.uu \ + libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu \ + libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \ + 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_mac_metadata.zip.uu \ + libarchive/test/test_read_format_zip_malformed1.zip.uu \ + libarchive/test/test_read_format_zip_msdos.zip.uu \ + libarchive/test/test_read_format_zip_nested.zip.uu \ + libarchive/test/test_read_format_zip_nofiletype.zip.uu \ + libarchive/test/test_read_format_zip_padded1.zip.uu \ + libarchive/test/test_read_format_zip_padded2.zip.uu \ + libarchive/test/test_read_format_zip_padded3.zip.uu \ + libarchive/test/test_read_format_zip_sfx.uu \ + libarchive/test/test_read_format_zip_symlink.zip.uu \ + libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu \ + libarchive/test/test_read_format_zip_ux.zip.uu \ + libarchive/test/test_read_format_zip_winzip_aes128.zip.uu \ + libarchive/test/test_read_format_zip_winzip_aes256.zip.uu \ + libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu \ + libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu \ + libarchive/test/test_read_format_zip_zip64a.zip.uu \ + libarchive/test/test_read_format_zip_zip64b.zip.uu \ + libarchive/test/test_read_large_splitted_rar_aa.uu \ + libarchive/test/test_read_large_splitted_rar_ab.uu \ + libarchive/test/test_read_large_splitted_rar_ac.uu \ + libarchive/test/test_read_large_splitted_rar_ad.uu \ + libarchive/test/test_read_large_splitted_rar_ae.uu \ + libarchive/test/test_read_splitted_rar_aa.uu \ + libarchive/test/test_read_splitted_rar_ab.uu \ + libarchive/test/test_read_splitted_rar_ac.uu \ + libarchive/test/test_read_splitted_rar_ad.uu \ + libarchive/test/test_read_too_many_filters.gz.uu \ + libarchive/test/test_splitted_rar_seek_support_aa.uu \ + libarchive/test/test_splitted_rar_seek_support_ab.uu \ + libarchive/test/test_splitted_rar_seek_support_ac.uu \ + libarchive/test/test_write_disk_appledouble.cpio.gz.uu \ + libarchive/test/test_write_disk_hfs_compression.tgz.uu \ + libarchive/test/test_write_disk_mac_metadata.tar.gz.uu \ + libarchive/test/test_write_disk_no_hfs_compression.tgz.uu \ + libarchive/test/CMakeLists.txt \ + libarchive/test/README + +# +# Common code for libarchive frontends (cpio, tar) +# +libarchive_fe_la_SOURCES= \ + libarchive_fe/err.c \ + libarchive_fe/err.h \ + libarchive_fe/lafe_platform.h \ + libarchive_fe/line_reader.c \ + libarchive_fe/line_reader.h \ + libarchive_fe/passphrase.c \ + libarchive_fe/passphrase.h + +libarchive_fe_la_CPPFLAGS= -I$(top_srcdir)/libarchive +# +# +# bsdtar source, docs, etc. +# +# + +bsdtar_SOURCES= \ + tar/bsdtar.c \ + tar/bsdtar.h \ + tar/bsdtar_platform.h \ + tar/cmdline.c \ + tar/creation_set.c \ + tar/read.c \ + tar/subst.c \ + tar/util.c \ + tar/write.c + +if INC_WINDOWS_FILES +bsdtar_SOURCES+= \ + tar/bsdtar_windows.h \ + tar/bsdtar_windows.c +endif + +bsdtar_DEPENDENCIES= libarchive.la libarchive_fe.la + +if STATIC_BSDTAR +bsdtar_ldstatic= -static +bsdtar_ccstatic= -DLIBARCHIVE_STATIC +else +bsdtar_ldstatic= +bsdtar_ccstatic= +endif + +bsdtar_LDADD= libarchive.la libarchive_fe.la $(LTLIBICONV) +bsdtar_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS) +bsdtar_LDFLAGS= $(bsdtar_ldstatic) + +bsdtar_EXTRA_DIST= \ + tar/bsdtar.1 \ + tar/bsdtar_windows.h \ + tar/bsdtar_windows.c \ + tar/CMakeLists.txt \ + tar/config_freebsd.h + + +if BUILD_BSDTAR +bsdtar_man_MANS= tar/bsdtar.1 +bsdtar_programs= bsdtar +else +bsdtar_man_MANS= +bsdtar_programs= +endif + +# +# bsdtar_test +# + +bsdtar_test_SOURCES= \ + $(test_utils_SOURCES) \ + tar/test/main.c \ + tar/test/test.h \ + tar/test/test_0.c \ + tar/test/test_basic.c \ + tar/test/test_copy.c \ + tar/test/test_empty_mtree.c \ + tar/test/test_extract_tar_Z.c \ + tar/test/test_extract_tar_bz2.c \ + tar/test/test_extract_tar_grz.c \ + tar/test/test_extract_tar_gz.c \ + tar/test/test_extract_tar_lrz.c \ + tar/test/test_extract_tar_lz.c \ + tar/test/test_extract_tar_lz4.c \ + tar/test/test_extract_tar_lzma.c \ + tar/test/test_extract_tar_lzo.c \ + tar/test/test_extract_tar_xz.c \ + tar/test/test_format_newc.c \ + tar/test/test_help.c \ + tar/test/test_leading_slash.c \ + tar/test/test_missing_file.c \ + tar/test/test_option_C_upper.c \ + tar/test/test_option_H_upper.c \ + tar/test/test_option_L_upper.c \ + tar/test/test_option_O_upper.c \ + tar/test/test_option_T_upper.c \ + tar/test/test_option_U_upper.c \ + tar/test/test_option_X_upper.c \ + tar/test/test_option_a.c \ + tar/test/test_option_b.c \ + tar/test/test_option_b64encode.c \ + tar/test/test_option_exclude.c \ + tar/test/test_option_gid_gname.c \ + tar/test/test_option_grzip.c \ + tar/test/test_option_j.c \ + tar/test/test_option_k.c \ + tar/test/test_option_keep_newer_files.c \ + tar/test/test_option_lrzip.c \ + tar/test/test_option_lz4.c \ + tar/test/test_option_lzma.c \ + tar/test/test_option_lzop.c \ + tar/test/test_option_n.c \ + tar/test/test_option_newer_than.c \ + tar/test/test_option_nodump.c \ + tar/test/test_option_older_than.c \ + tar/test/test_option_passphrase.c \ + tar/test/test_option_q.c \ + tar/test/test_option_r.c \ + tar/test/test_option_s.c \ + tar/test/test_option_uid_uname.c \ + tar/test/test_option_uuencode.c \ + tar/test/test_option_xz.c \ + tar/test/test_option_z.c \ + tar/test/test_patterns.c \ + tar/test/test_print_longpath.c \ + tar/test/test_stdio.c \ + tar/test/test_strip_components.c \ + tar/test/test_symlink_dir.c \ + tar/test/test_version.c \ + tar/test/test_windows.c + +bsdtar_test_CPPFLAGS=\ + -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ + -I$(top_srcdir)/test_utils \ + -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \ + $(PLATFORMCPPFLAGS) + +tar/test/list.h: Makefile + $(MKDIR_P) tar/test + cat $(top_srcdir)/tar/test/test_*.c | grep '^DEFINE_TEST' > tar/test/list.h + +if BUILD_BSDTAR +bsdtar_test_programs= bsdtar_test +bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar$(EXEEXT) BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test +else +bsdtar_test_programs= +bsdtar_TESTS_ENVIRONMENT= +endif + +bsdtar_test_EXTRA_DIST= \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Oct 25 16:12:50 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 AF501C21395; Tue, 25 Oct 2016 16:12:50 +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 50AD32F9; Tue, 25 Oct 2016 16:12:50 +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 u9PGCnpu052569; Tue, 25 Oct 2016 16:12:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PGCjJT052434; Tue, 25 Oct 2016 16:12:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251612.u9PGCjJT052434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 16:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307921 - in vendor/heirloom-doctools/dist: . checknr col eqn eqn/checkeq.d eqn/eqn.d eqn/eqnchar.d eqn/neqn.d grap mpm pic picpack ptx refer soelim tbl troff troff/libhnj troff/nroff.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: Tue, 25 Oct 2016 16:12:50 -0000 Author: bapt Date: Tue Oct 25 16:12:45 2016 New Revision: 307921 URL: https://svnweb.freebsd.org/changeset/base/307921 Log: Import heirloom doctools snapshot 20161025 Modified: vendor/heirloom-doctools/dist/checknr/Makefile.mk vendor/heirloom-doctools/dist/col/Makefile.mk vendor/heirloom-doctools/dist/configure vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/dist/mk.config vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/dist/pic/Makefile.mk vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk 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/ps_include.c vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/dist/version.mk vendor/heirloom-doctools/dist/vgrind/Makefile.mk Modified: vendor/heirloom-doctools/dist/checknr/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/checknr/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/checknr/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -3,12 +3,12 @@ OBJ = checknr.o FLAGS = $(DEFINES) -I../include .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: checknr checknr: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o checknr + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checknr install: $(INSTALL) -c checknr $(ROOT)$(BINDIR)/checknr Modified: vendor/heirloom-doctools/dist/col/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/col/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/col/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -7,7 +7,7 @@ FLAGS = $(DEFINES) -I../include all: $(BIN) $(BIN): $(OBJ) - $(CC) ${CFLAGS} $(LDFLAGS) $(OBJ) -o $(BIN) + $(CC) ${_CFLAGS} $(_LDFLAGS) $(OBJ) -o $(BIN) install: $(INSTALL) -c $(BIN) $(ROOT)$(BINDIR)/$(BIN) @@ -19,4 +19,4 @@ clean: mrproper: clean .c.o: - ${CC} ${CFLAGS} ${CPPFLAGS} $(FLAGS) -c $< + ${CC} ${_CFLAGS} $(FLAGS) -c $< Modified: vendor/heirloom-doctools/dist/configure ============================================================================== --- vendor/heirloom-doctools/dist/configure Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/configure Tue Oct 25 16:12:45 2016 (r307921) @@ -86,7 +86,7 @@ gen_mk () { [ -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 "$__SAN" ] && echo "__SAN=$__SAN" >> $OUTMK + [ -n "$__CLDBG" ] && echo "__CLDBG=$__CLDBG" >> $OUTMK cat $INMK >> $OUTMK || exit 1 } check_make () { @@ -225,6 +225,7 @@ rm -f $LOG gen_mk check_make +#check_Sanitizer check_lex check_strlcpy check_strlcat Modified: vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -4,12 +4,12 @@ OBJ = checkeq.o FLAGS = .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: checkeq checkeq: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o checkeq + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checkeq install: $(INSTALL) -c checkeq $(ROOT)$(BINDIR)/checkeq Modified: vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -6,12 +6,12 @@ OBJ = diacrit.o e.o eqnbox.o font.o from FLAGS = -I. -I.. -I../../include $(DEFINES) .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: eqn eqn: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o eqn + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o eqn e.c: e.y $(YACC) -d ../e.y Modified: vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -1,7 +1,7 @@ FILES = ascii eqnchar greek iso utf-8 .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(EUC) -c $< + $(CC) $(_CFLAGS) $(EUC) -c $< all: $(FILES) @@ -9,10 +9,10 @@ utf-8: genutf8 -./genutf8 >utf-8 genutf8: genutf8.o - -$(CC) $(CFLAGS) $(LDFLAGS) genutf8.o $(LIBS) -o genutf8 + -$(CC) $(_CFLAGS) $(_LDFLAGS) genutf8.o $(LIBS) -o genutf8 genutf8.o: genutf8.c - -$(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(EUC) -c genutf8.c + -$(CC) $(_CFLAGS) $(EUC) -c genutf8.c install: all test -d $(ROOT)$(PUBDIR) || mkdir -p $(ROOT)$(PUBDIR) Modified: vendor/heirloom-doctools/dist/eqn/lex.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/lex.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/eqn/lex.c Tue Oct 25 16:12:45 2016 (r307921) @@ -299,7 +299,7 @@ include(void) { void delim(void) { yyval.token = eqnreg = 0; - if (cstr(token, 0, SSIZE) || token[0] & 0200 || token[1] & 0200) + if (cstr(token, 0, SSIZE)) error(FATAL, "Bizarre delimiters at %.20s", token); lefteq = token[0]; righteq = token[1]; Modified: vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -6,12 +6,12 @@ OBJ = diacrit.o e.o eqnbox.o font.o from FLAGS = -I. -I.. -I../../include -DNEQN $(DEFINES) .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: neqn neqn: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o neqn + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o neqn e.c: e.y $(YACC) -d ../e.y Modified: vendor/heirloom-doctools/dist/grap/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/grap/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/grap/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -6,12 +6,12 @@ FLAGS = -DLIBDIR='"$(LIBDIR)"' $(DEFINES YFLAGS = -d .c.o: - $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: grap.c grapl.c grap grap: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -lm -o grap + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o grap y.tab.h: grap.c Modified: vendor/heirloom-doctools/dist/mk.config ============================================================================== --- vendor/heirloom-doctools/dist/mk.config Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/mk.config Tue Oct 25 16:12:45 2016 (r307921) @@ -83,7 +83,7 @@ STRIP=strip # # Compiler flags. # -#CFLAGS= +_CFLAGS=$(CFLAGS) $(_CPPFLAGS) $(__CDBG) $(__CLDBG) # # C preprocessor flags. @@ -91,17 +91,12 @@ STRIP=strip # Use -D_GNU_SOURCE for Linux with GNU libc. # Use -D_INCLUDE__STDC_A1_SOURCE for HP-UX. # -CPPFLAGS=-D_GNU_SOURCE - -# -# Warning flags for the compiler. -# -#WARN= +_CPPFLAGS=$(CPPFLAGS) -D_GNU_SOURCE # # Linker flags. # -#LDFLAGS= +_LDFLAGS=$(LDFLAGS) $(__CLDBG) # # Additional libraries to link with. Modified: vendor/heirloom-doctools/dist/mpm/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/mpm/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/mpm/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -3,15 +3,15 @@ OBJ = misc.o page.o queue.o range.o slug FLAGS = $(EUC) $(DEFINES) -I../include .c.o: - $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< .cc.o: - $(CXX) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CXX) $(_CFLAGS) $(FLAGS) -c $< all: pm pm: $(OBJ) - $(CXX) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -lm -o pm + $(CXX) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o pm install: all test -d $(ROOT)$(LIBDIR) || mkdir -p $(ROOT)$(LIBDIR) Modified: vendor/heirloom-doctools/dist/pic/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/pic/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/pic/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -7,12 +7,12 @@ FLAGS = $(DEFINES) -I../include YFLAGS = -d .c.o: - $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: picy.c picl.c pic pic: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -lm -o pic + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o pic y.tab.h: picy.c Modified: vendor/heirloom-doctools/dist/picpack/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/picpack/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/picpack/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -3,12 +3,12 @@ OBJ = picpack.o FLAGS = -I../troff/troff.d/dpost.d .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: picpack picpack: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o picpack + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o picpack install: $(INSTALL) -c picpack $(ROOT)$(BINDIR)/picpack Modified: vendor/heirloom-doctools/dist/ptx/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/ptx/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/ptx/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -3,12 +3,12 @@ OBJ = ptx.o FLAGS = -DLIBDIR='"$(LIBDIR)"' $(EUC) -I../include .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: ptx ptx: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o ptx + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o ptx install: $(INSTALL) -c ptx $(ROOT)$(BINDIR)/ptx Modified: vendor/heirloom-doctools/dist/refer/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/refer/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/refer/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -15,31 +15,31 @@ FLAGS = -DMACDIR='"$(MACDIR)"' -DREFDIR= -I../include .c.o: - $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: refer addbib lookbib sortbib roffbib indxbib mkey inv hunt papers/runinv cd papers && PATH=..:$$PATH sh runinv refer: $(ROBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(ROBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(ROBJ) $(LIBS) -o $@ addbib: $(AOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(AOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(AOBJ) $(LIBS) -o $@ lookbib: $(LOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(LOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(LOBJ) $(LIBS) -o $@ sortbib: $(SOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(SOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(SOBJ) $(LIBS) -o $@ mkey: $(MOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(MOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(MOBJ) $(LIBS) -o $@ inv: $(IOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(IOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(IOBJ) $(LIBS) -o $@ hunt: $(HOBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(HOBJ) $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(HOBJ) $(LIBS) -o $@ indxbib: indxbib.sh rm -f $@ Modified: vendor/heirloom-doctools/dist/refer/glue3.c ============================================================================== --- vendor/heirloom-doctools/dist/refer/glue3.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/refer/glue3.c Tue Oct 25 16:12:45 2016 (r307921) @@ -74,7 +74,7 @@ corout(char *_in, char *out, const char return 0; } -# define ALEN 50 +# define ALEN 100 int callhunt(char *_in, char *out, char *arg, int outlen) Modified: vendor/heirloom-doctools/dist/soelim/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/soelim/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/soelim/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -3,12 +3,12 @@ OBJ = soelim.o FLAGS = .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: soelim soelim: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o soelim + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o soelim install: $(INSTALL) -c soelim $(ROOT)$(BINDIR)/soelim Modified: vendor/heirloom-doctools/dist/tbl/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/tbl/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/tbl/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -4,12 +4,12 @@ OBJ = t0.o t1.o t2.o t3.o t4.o t5.o t6.o FLAGS = -DMACDIR='"$(MACDIR)"' -I../include .c.o: - $(CC) $(CFLAGS) $(WARN) $(FLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: tbl tbl: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o tbl + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o tbl install: $(INSTALL) -c tbl $(ROOT)$(BINDIR)/tbl Modified: vendor/heirloom-doctools/dist/troff/ext.h ============================================================================== --- vendor/heirloom-doctools/dist/troff/ext.h Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/ext.h Tue Oct 25 16:12:45 2016 (r307921) @@ -276,6 +276,8 @@ extern void cvtime(void); extern int ctoi(register char *); extern void mesg(int); extern void errprint(const char *, ...); +#define fdprintf xxfdprintf +extern void fdprintf(int, const char *, ...); extern char *roff_sprintf(char *, size_t, const char *, ...); extern int control(register int, register int); extern int getrq2(void); @@ -442,6 +444,10 @@ extern void casehylen(void); extern void casehypp(void); extern void casepshape(void); extern void caselpfx(void); +#undef min +#undef max +extern int max(int, int); +extern int min(int, int); extern void casece(void); extern void caserj(void); extern void casebrnl(void); Modified: vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -1,7 +1,7 @@ FLAGS = .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< OBJ = hnjalloc.o hyphen.o @@ -11,7 +11,7 @@ libhnj.a: $(OBJ) $(AR) crs $@ $(OBJ) test: test.o libhnj.a - $(CC) $(CFLAGS) $(LDFLAGS) test.o -L. -lhnj -o test + $(CC) $(_CFLAGS) $(_LDFLAGS) test.o -L. -lhnj -o test install: Modified: vendor/heirloom-doctools/dist/troff/n1.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/n1.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/n1.c Tue Oct 25 16:12:45 2016 (r307921) @@ -110,6 +110,14 @@ wchar_t twc = 0; static unsigned char escoff[126-31]; static void initg(void); +static void printlong(long, int); +static void printn(long, long); +static char *sprintlong(char *s, long, int); +static char *sprintn(char *s, long n, int b); +#ifndef NROFF +#define vfdprintf xxvfdprintf +static void vfdprintf(int fd, const char *fmt, va_list ap); +#endif static tchar setyon(void); static void _setenv(void); static tchar setZ(void); @@ -597,6 +605,182 @@ errprint(const char *s, ...) /* error me va_end(ap); } +#ifndef NROFF +/* + * Scaled down version of C Library printf. + * Only %s %u %d (==%u) %o %c %x %D are recognized. + */ +#undef putchar +#define putchar(n) (*pfbp++ = (n)) /* NO CHECKING! */ + +static char pfbuf[NTM]; +static char *pfbp = pfbuf; + +void +fdprintf(int fd, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfdprintf(fd, fmt, ap); + va_end(ap); +} + +static void +vfdprintf(int fd, const char *fmt, va_list ap) +{ + register int c; + char *s; + register int i; + + pfbp = pfbuf; +loop: + while ((c = *fmt++) != '%') { + if (c == '\0') { + if (fd == 2) + write(STDERR_FILENO, pfbuf, pfbp - pfbuf); + else { + *pfbp = 0; + pfbp = pfbuf; + while (*pfbp) { + *obufp++ = *pfbp++; + if (obufp >= &obuf[OBUFSZ]) + flusho(); + } + } + return; + } + putchar(c); + } + c = *fmt++; + if (c == 'd' || c == 'u' || c == 'o' || c == 'x') { + i = va_arg(ap, int); + printlong(i, c); + } else if (c == 'c') { + if (c > 0177 || c < 040) + putchar('\\'); + putchar(va_arg(ap, int) & 0177); + } else if (c == 's') { + s = va_arg(ap, char *); + while ((c = *s++)) + putchar(c); + } else if (c == 'D') { + printn(va_arg(ap, long), 10); + } else if (c == 'O') { + printn(va_arg(ap, long), 8); + } else if (c == 'e' || c == 'E' || + c == 'f' || c == 'F' || + c == 'g' || c == 'G') { + char tmp[40]; + char fmt[] = "%%"; + fmt[1] = c; + snprintf(s = tmp, sizeof(tmp), fmt, va_arg(ap, double)); + while ((c = *s++)) + putchar(c); + } else if (c == 'p') { + i = (intptr_t)va_arg(ap, void *); + putchar('0'); + putchar('x'); + printlong(i, 'x'); + } else if (c == 'l') { + c = *fmt++; + if (c == 'd' || c == 'u' || c == 'o' || c == 'x') { + i = va_arg(ap, long); + printlong(i, c); + } else if (c == 'c') { + i = va_arg(ap, int); + if (c & ~0177) { +#ifdef EUC + char mb[MB_LEN_MAX]; + int j, n; + n = wctomb(mb, i); + for (j = 0; j < n; j++) + putchar(mb[j]&0377); +#endif /* EUC */ + } else + putchar(i); + } + } else if (c == 'C') { + extern int nchtab; + tchar t = va_arg(ap, tchar); + if ((i = cbits(t)) < 0177) { + putchar(i); + } else if (i < 128 + nchtab) { + putchar('\\'); + putchar('('); + putchar(chname[chtab[i-128]]); + putchar(chname[chtab[i-128]+1]); + } + else if ((i = tr2un(i, fbits(t))) != -1) + goto U; + } else if (c == 'U') { + i = va_arg(ap, int); + U: + putchar('U'); + putchar('+'); + if (i < 0x1000) + putchar('0'); + if (i < 0x100) + putchar('0'); + if (i < 0x10) + putchar('0'); + printn((long)i, 16); +#ifdef EUC + if (iswprint(i)) { + char mb[MB_LEN_MAX]; + int j, n; + n = wctomb(mb, i); + putchar(' '); + putchar('('); + for (j = 0; j < n; j++) + putchar(mb[j]&0377); + putchar(')'); + } +#endif /* EUC */ + } + goto loop; +} +#endif /* !NROFF */ + + +static void +printlong(long i, int fmt) +{ + switch (fmt) { + case 'd': + if (i < 0) { + putchar('-'); + i = -i; + } + /*FALLTHRU*/ + case 'u': + printn(i, 10); + break; + case 'o': + printn(i, 8); + break; + case 'x': + printn(i, 16); + break; + } +} + +/* + * Print an unsigned integer in base b. + */ +static void printn(register long n, register long b) +{ + register long a; + + if (n < 0) { /* shouldn't happen */ + putchar('-'); + n = -n; + } + if ((a = n / b)) + printn(a, b); + putchar("0123456789ABCDEF"[(int)(n%b)]); +} + /* returns pointer to \0 that ends the string */ /* VARARGS2 */ Modified: vendor/heirloom-doctools/dist/troff/n2.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/n2.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/n2.c Tue Oct 25 16:12:45 2016 (r307921) @@ -52,7 +52,6 @@ * output, cleanup */ -#include #include #include #include @@ -237,10 +236,10 @@ outtp(tchar i) #ifdef EUC if (iscopy(i)) - dprintf(ptid, "%lc", j); + fdprintf(ptid, "%lc", j); else #endif /* EUC */ - dprintf(ptid, "%c", j); + fdprintf(ptid, "%c", j); #endif } Modified: vendor/heirloom-doctools/dist/troff/n5.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/n5.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/n5.c Tue Oct 25 16:12:45 2016 (r307921) @@ -418,6 +418,24 @@ caselpfx(void) } } +int +max(int aa, int bb) +{ + if (aa > bb) + return (aa); + else + return (bb); +} + +int +min(int aa, int bb) +{ + if (aa < bb) + return (aa); + else + return (bb); +} + static void cerj(int dorj) { Modified: vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -13,12 +13,12 @@ FLAGS = -DNROFF -DUSG $(EUC) -I. -I.. -I -I$(BST) .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: nroff nroff: $(OBJ) $(LIBHNJ)/libhnj.a - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) -L$(LIBHNJ) -lhnj $(LIBS) -o nroff + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) -L$(LIBHNJ) -lhnj $(LIBS) -o nroff install: $(INSTALL) -c nroff $(ROOT)$(BINDIR)/nroff Modified: vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -10,18 +10,18 @@ FLAGS = -DUSG $(EUC) -I. -I.. -I../../in -DSHELL='"$(SHELL)"' -DRELEASE='"$(RELEASE)"' $(DEFINES) -I$(BST) .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: troff ta otfdump troff: $(OBJ) $(LIBHNJ)/libhnj.a - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) -L$(LIBHNJ) -lhnj $(LIBS) -o troff + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) -L$(LIBHNJ) -lhnj $(LIBS) -o troff ta: draw.o ta.o - $(CC) $(CFLAGS) $(LDFLAGS) draw.o ta.o $(LIBS) -lm -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) draw.o ta.o $(LIBS) -lm -o $@ otfdump: otfdump.o otfdump_vs.o - $(CC) $(CFLAGS) $(LDFLAGS) otfdump.o otfdump_vs.o $(LIBS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) otfdump.o otfdump_vs.o $(LIBS) -o $@ install: $(INSTALL) -c troff $(ROOT)$(BINDIR)/troff Modified: vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -6,15 +6,15 @@ FONTS = B I R S CT CW CX GB GI GR GS HI FLAGS = -I. -I.. -DFNTDIR='"$(FNTDIR)"' .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: daps makedev fonts HM.out daps: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -lm -o daps + $(CC) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o daps makedev: makedev.o - $(CC) $(LDFLAGS) makedev.o $(LIBS) -o makedev + $(CC) $(_LDFLAGS) makedev.o $(LIBS) -o makedev fonts: makedev for i in $(FONTS); \ Modified: vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -17,10 +17,10 @@ clean: mrproper: clean $(BIN): $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) -o $@ .c.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + $(CC) $(_CFLAGS) -c $< char.o: char.h main.h $(BST)/bst.h lib.h tr_out.h dhtml.o: dhtml.h tr_out.h char.h main.h Modified: vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -8,12 +8,12 @@ FLAGS = -I. -I.. -DFNTDIR='"$(FNTDIR)"' $(DEFINES) -I../../../include -I.. -I$(BST) .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: dpost dpost: $(OBJ) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o dpost + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o dpost install: $(INSTALL) -c dpost $(ROOT)$(BINDIR)/dpost Modified: vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c Tue Oct 25 16:12:45 2016 (r307921) @@ -2419,7 +2419,7 @@ t_supply(char *fnt) /* supply a font */ while (*fnt == ' ' || *fnt == '\t') fnt++; - for (np = font; *np && *np != ' ' && *np != '\t' && *np != '\n'; np++); + for (np = fnt; *np && *np != ' ' && *np != '\t' && *np != '\n'; np++); if (*np == '\0' || *np == '\n') return; *np = '\0'; @@ -3303,7 +3303,7 @@ t_sf(int forceflush) fprintf(tf, "%d %g changefont\n", fontname[font].fontslant, (fontname[font].fontheight != 0) ? (double)fontname[font].fontheight : (double)fractsize); } - if (tracked < 0 || tracked > 0 && forceflush) + if (tracked < 0 || (tracked > 0 && forceflush)) t_strack(); } /* End of t_sf */ Modified: vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c Tue Oct 25 16:12:45 2016 (r307921) @@ -167,6 +167,8 @@ ps_include( break; case DOCUMENTNEEDEDRESOURCES: goto needres; + case NORMAL: /* TODO: case is not in original code */ + break; } continue; } else Modified: vendor/heirloom-doctools/dist/troff/troff.d/draw.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/draw.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/draw.c Tue Oct 25 16:12:45 2016 (r307921) @@ -49,6 +49,7 @@ #include #include #include +#include "global.h" #define PI 3.141592654 #define hmot(n) hpos += n #define hgoto(n) hpos = n Modified: vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -6,7 +6,7 @@ FONTS = AB AI AR AX BI CB CI CO CW CX GR FLAGS = -I. -I.. -DFNTDIR='"$(FNTDIR)"' .c.o: - $(CC) $(CFLAGS) $(WARN) $(CPPFLAGS) $(FLAGS) -c $< + $(CC) $(_CFLAGS) $(FLAGS) -c $< all: Modified: vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk Tue Oct 25 16:12:45 2016 (r307921) @@ -20,4 +20,4 @@ clean: mrproper: clean $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(OBJS) -o $@ + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJS) -o $@ Modified: vendor/heirloom-doctools/dist/troff/troff.d/t10.c ============================================================================== --- vendor/heirloom-doctools/dist/troff/troff.d/t10.c Tue Oct 25 16:06:28 2016 (r307920) +++ vendor/heirloom-doctools/dist/troff/troff.d/t10.c Tue Oct 25 16:12:45 2016 (r307921) @@ -50,7 +50,6 @@ * contributors. */ -#include #include #include "tdef.h" #include @@ -290,22 +289,22 @@ ptinit(void) kern = xflag; if (ascii) return; - dprintf(ptid, "x T %s\n", devname); - dprintf(ptid, "x res %d %d %d\n", Inch, Hor, Vert); - dprintf(ptid, "x init\n"); /* do initialization for particular device */ + fdprintf(ptid, "x T %s\n", devname); + fdprintf(ptid, "x res %d %d %d\n", Inch, Hor, Vert); + fdprintf(ptid, "x init\n"); /* do initialization for particular device */ /* for (i = 1; i <= nfonts; i++) - dprintf(ptid, "x font %d %s\n", i, fontbase[i]->namefont); - dprintf(ptid, "x xxx fonts=%d sizes=%d unit=%d\n", nfonts, nsizes, Unitwidth); - dprintf(ptid, "x xxx nchtab=%d lchname=%d nfitab=%d\n", + fdprintf(ptid, "x font %d %s\n", i, fontbase[i]->namefont); + fdprintf(ptid, "x xxx fonts=%d sizes=%d unit=%d\n", nfonts, nsizes, Unitwidth); + fdprintf(ptid, "x xxx nchtab=%d lchname=%d nfitab=%d\n", dev.nchtab, dev.lchname, dev.nchtab+128-32); - dprintf(ptid, "x xxx sizes:\nx xxx "); + fdprintf(ptid, "x xxx sizes:\nx xxx "); for (i = 0; i < nsizes; i++) - dprintf(ptid, " %d", pstab[i]); - dprintf(ptid, "\nx xxx chars:\nx xxx "); + fdprintf(ptid, " %d", pstab[i]); + fdprintf(ptid, "\nx xxx chars:\nx xxx "); for (i = 0; i < dev.nchtab; i++) - dprintf(ptid, " %s", &chname[chtab[i]]); - dprintf(ptid, "\nx xxx\n"); + fdprintf(ptid, " %s", &chname[chtab[i]]); + fdprintf(ptid, "\nx xxx\n"); */ #ifdef EUC ptlocale(setlocale(LC_CTYPE, NULL)); @@ -415,9 +414,9 @@ ptout(register tchar i) if (linkout) ptlink(linkout); /* - dprintf(ptid, "x xxx end of line: hpos=%d, vpos=%d\n", hpos, vpos); + fdprintf(ptid, "x xxx end of line: hpos=%d, vpos=%d\n", hpos, vpos); */ - dprintf(ptid, "n%d %d\n", b, a); /* be nice to chuck */ + fdprintf(ptid, "n%d %d\n", b, a); /* be nice to chuck */ } tchar * @@ -456,7 +455,7 @@ ptout0(tchar *pi, tchar *pend) ptlead(); if (esc) ptesc(); - dprintf(ptid, "x X "); + fdprintf(ptid, "x X "); /* * not guaranteed of finding a XOFF if a word overflow * error occured, so also bound this loop by olinep @@ -480,9 +479,9 @@ ptout0(tchar *pi, tchar *pend) ptps(); j = f = u2pts(sbits(i)); if (j != f && xflag && dev.anysize) - dprintf(ptid, "x H -23 %g\n", f); + fdprintf(ptid, "x H -23 %g\n", f); else - dprintf(ptid, "x H %d\n", j); + fdprintf(ptid, "x H %d\n", j); return(pi+outsize); } if (k == SLANT) { @@ -491,7 +490,7 @@ ptout0(tchar *pi, tchar *pend) if (xfont != mfont) ptfont(); } - dprintf(ptid, "x S %d\n", (int)sbits(i)-180); + fdprintf(ptid, "x S %d\n", (int)sbits(i)-180); return(pi+outsize); } if (k == WORDSP) { @@ -627,23 +626,23 @@ ptout0(tchar *pi, tchar *pend) switch ((c=cbits(pi[1]))) { case DRAWCIRCLE: /* circle */ case DRAWCIRCLEFI: - dprintf(ptid, "D%c %d\n", c, dx); /* dx is diameter */ + fdprintf(ptid, "D%c %d\n", c, dx); /* dx is diameter */ w = 0; hpos += dx; break; case DRAWELLIPSE: case DRAWELLIPSEFI: - dprintf(ptid, "D%c %d %d\n", c, dx, dy); + fdprintf(ptid, "D%c %d %d\n", c, dx, dy); w = 0; hpos += dx; break; case DRAWLINE: /* line */ k = cbits(pi[2]); - dprintf(ptid, "D%c %d %d ", DRAWLINE, dx, dy); + fdprintf(ptid, "D%c %d %d ", DRAWLINE, dx, dy); if (k < 128) - dprintf(ptid, "%c\n", k); + fdprintf(ptid, "%c\n", k); else - dprintf(ptid, "%s\n", &chname[chtab[k - 128]]); + fdprintf(ptid, "%s\n", &chname[chtab[k - 128]]); w = 0; hpos += dx; vpos += dy; @@ -655,7 +654,7 @@ ptout0(tchar *pi, tchar *pend) dy2 = absmot(pi[6]); if (isnmot(pi[6])) dy2 = -dy2; - dprintf(ptid, "D%c %d %d %d %d\n", DRAWARC, + fdprintf(ptid, "D%c %d %d %d %d\n", DRAWARC, dx, dy, dx2, dy2); w = 0; hpos += dx + dx2; @@ -663,13 +662,13 @@ ptout0(tchar *pi, tchar *pend) break; case DRAWSPLINE: /* spline */ default: /* something else; copy it like spline */ - dprintf(ptid, "D%c %d %d", (int)cbits(pi[1]), dx, dy); + fdprintf(ptid, "D%c %d %d", (int)cbits(pi[1]), dx, dy); w = 0; hpos += dx; vpos += dy; if (cbits(pi[3]) == DRAWFCN || cbits(pi[4]) == DRAWFCN) { /* it was somehow defective */ - dprintf(ptid, "\n"); + fdprintf(ptid, "\n"); break; } for (n = 5; cbits(pi[n]) != DRAWFCN; n += 2) { @@ -679,11 +678,11 @@ ptout0(tchar *pi, tchar *pend) dy = absmot(pi[n+1]); if (isnmot(pi[n+1])) dy = -dy; - dprintf(ptid, " %d %d", dx, dy); + fdprintf(ptid, " %d %d", dx, dy); hpos += dx; vpos += dy; } - dprintf(ptid, "\n"); + fdprintf(ptid, "\n"); break; } for (n = 3; cbits(pi[n]) != DRAWFCN; n++) @@ -716,7 +715,7 @@ ptout0(tchar *pi, tchar *pend) if (esc += bd) ptesc(); if (k < 128) { - dprintf(ptid, "c%c\n", k); + fdprintf(ptid, "c%c\n", k); } else pnc(k, a); if (z) @@ -735,13 +734,13 @@ pnc(int k, struct afmtab *a) { if (k >= nchtab + 128) { if (a && (j = a->fitab[k-nchtab-128-32]) < a->nchars && a->nametab[j] != NULL) { - dprintf(ptid, "CPS%s\n", a->nametab[j]); + fdprintf(ptid, "CPS%s\n", a->nametab[j]); } else { - dprintf(ptid, "N%d\n", + fdprintf(ptid, "N%d\n", k - (html ? 0 : (nchtab + 128)) ); } } else { - dprintf(ptid, "C%s\n", &chname[chtab[k - 128]]); + fdprintf(ptid, "C%s\n", &chname[chtab[k - 128]]); } } @@ -767,7 +766,7 @@ pthorscale(int always) { if (horscale || mhorscale) { if (always || mhorscale != horscale) - dprintf(ptid, "x X HorScale %g\n", + fdprintf(ptid, "x X HorScale %g\n", horscale ? horscale : 1.0); mhorscale = horscale; } else @@ -779,7 +778,7 @@ pttrack(int always) { if (xflag && (lasttrack || lettrack || mtrack)) { if (always || mtrack != (lasttrack + lettrack)) - dprintf(ptid, "x X Track %d\n", lasttrack + lettrack); + fdprintf(ptid, "x X Track %d\n", lasttrack + lettrack); mtrack = lasttrack + lettrack; } else mtrack = 0; @@ -805,9 +804,9 @@ ptps(void) if ((z = zoomtab[xfont]) != 0 && dev.anysize && xflag) s *= z; if (dev.anysize && xflag && (!found || (z != 0 && z != 1))) - dprintf(ptid, "s-23 %g\n", s); + fdprintf(ptid, "s-23 %g\n", s); else - dprintf(ptid, "s%d\n", (int)s); /* really should put out string rep of size */ + fdprintf(ptid, "s%d\n", (int)s); /* really should put out string rep of size */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Oct 25 16:14: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 DCE37C21529; Tue, 25 Oct 2016 16:14: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 8D6348D5; Tue, 25 Oct 2016 16:14: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 u9PGECSF052673; Tue, 25 Oct 2016 16:14:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PGECSi052665; Tue, 25 Oct 2016 16:14:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251614.u9PGECSi052665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 16:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307922 - in vendor/heirloom-doctools/20161025: . 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: Tue, 25 Oct 2016 16:14:14 -0000 Author: bapt Date: Tue Oct 25 16:14:11 2016 New Revision: 307922 URL: https://svnweb.freebsd.org/changeset/base/307922 Log: Tag import of heirloom-doctools 20161025 Added: vendor/heirloom-doctools/20161025/ - copied from r306788, vendor/heirloom-doctools/dist/ vendor/heirloom-doctools/20161025/compat.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/compat.c Replaced: vendor/heirloom-doctools/20161025/checknr/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk vendor/heirloom-doctools/20161025/checknr/checknr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/20161025/col/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/col/Makefile.mk vendor/heirloom-doctools/20161025/configure - copied unchanged from r307921, vendor/heirloom-doctools/dist/configure vendor/heirloom-doctools/20161025/eqn/checkeq.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk vendor/heirloom-doctools/20161025/eqn/checkeq.d/checkeq.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c vendor/heirloom-doctools/20161025/eqn/diacrit.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c vendor/heirloom-doctools/20161025/eqn/e.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/e.h vendor/heirloom-doctools/20161025/eqn/eqn.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/20161025/eqn/eqnbox.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnbox.c vendor/heirloom-doctools/20161025/eqn/eqnchar.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk vendor/heirloom-doctools/20161025/eqn/eqnchar.d/genutf8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c vendor/heirloom-doctools/20161025/eqn/funny.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/funny.c vendor/heirloom-doctools/20161025/eqn/integral.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/integral.c vendor/heirloom-doctools/20161025/eqn/io.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/20161025/eqn/lex.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/20161025/eqn/lookup.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/lookup.c vendor/heirloom-doctools/20161025/eqn/matrix.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/matrix.c vendor/heirloom-doctools/20161025/eqn/neqn.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk vendor/heirloom-doctools/20161025/eqn/paren.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/paren.c vendor/heirloom-doctools/20161025/eqn/shift.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/shift.c vendor/heirloom-doctools/20161025/eqn/text.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/text.c vendor/heirloom-doctools/20161025/grap/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/20161025/grap/coord.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/coord.c vendor/heirloom-doctools/20161025/grap/grap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/grap.h vendor/heirloom-doctools/20161025/grap/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/input.c vendor/heirloom-doctools/20161025/grap/main.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/20161025/grap/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/misc.c vendor/heirloom-doctools/20161025/include/global.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/include/global.h vendor/heirloom-doctools/20161025/mk.config - copied unchanged from r307921, vendor/heirloom-doctools/dist/mk.config vendor/heirloom-doctools/20161025/mpm/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/20161025/mpm/misc.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/mpm/misc.h vendor/heirloom-doctools/20161025/pic/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/pic/Makefile.mk vendor/heirloom-doctools/20161025/pic/arcgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/arcgen.c vendor/heirloom-doctools/20161025/pic/blockgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/blockgen.c vendor/heirloom-doctools/20161025/pic/for.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/for.c vendor/heirloom-doctools/20161025/pic/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/20161025/pic/main.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/20161025/pic/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/misc.c vendor/heirloom-doctools/20161025/pic/pic.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pic.h vendor/heirloom-doctools/20161025/pic/picl.l - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/20161025/pic/pltroff.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pltroff.c vendor/heirloom-doctools/20161025/pic/symtab.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/symtab.c vendor/heirloom-doctools/20161025/picpack/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/20161025/picpack/picpack.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/picpack/picpack.c vendor/heirloom-doctools/20161025/ptx/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/20161025/ptx/ptx.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/20161025/refer/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/20161025/refer/deliv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/deliv2.c vendor/heirloom-doctools/20161025/refer/glue1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue1.c vendor/heirloom-doctools/20161025/refer/glue3.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/20161025/refer/glue4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue4.c vendor/heirloom-doctools/20161025/refer/glue5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue5.c vendor/heirloom-doctools/20161025/refer/hunt1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt1.c vendor/heirloom-doctools/20161025/refer/hunt2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/20161025/refer/hunt5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt5.c vendor/heirloom-doctools/20161025/refer/hunt6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt6.c vendor/heirloom-doctools/20161025/refer/hunt7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt7.c vendor/heirloom-doctools/20161025/refer/hunt8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt8.c vendor/heirloom-doctools/20161025/refer/hunt9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt9.c vendor/heirloom-doctools/20161025/refer/inv1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv1.c vendor/heirloom-doctools/20161025/refer/inv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv2.c vendor/heirloom-doctools/20161025/refer/inv3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv3.c vendor/heirloom-doctools/20161025/refer/inv5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv5.c vendor/heirloom-doctools/20161025/refer/inv6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv6.c vendor/heirloom-doctools/20161025/refer/mkey1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey1.c vendor/heirloom-doctools/20161025/refer/mkey2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey2.c vendor/heirloom-doctools/20161025/refer/refer..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer..c vendor/heirloom-doctools/20161025/refer/refer0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer0.c vendor/heirloom-doctools/20161025/refer/refer1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer1.c vendor/heirloom-doctools/20161025/refer/refer2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer2.c vendor/heirloom-doctools/20161025/refer/refer3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer3.c vendor/heirloom-doctools/20161025/refer/refer5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer5.c vendor/heirloom-doctools/20161025/refer/refer6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer6.c vendor/heirloom-doctools/20161025/refer/refer7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer7.c vendor/heirloom-doctools/20161025/refer/refer8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer8.c vendor/heirloom-doctools/20161025/refer/shell.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/shell.c vendor/heirloom-doctools/20161025/refer/sortbib.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/sortbib.c vendor/heirloom-doctools/20161025/refer/tick.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/tick.c vendor/heirloom-doctools/20161025/soelim/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/20161025/tbl/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/20161025/tbl/t..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t..c vendor/heirloom-doctools/20161025/tbl/t0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t0.c vendor/heirloom-doctools/20161025/tbl/t1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t1.c vendor/heirloom-doctools/20161025/tbl/t3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t3.c vendor/heirloom-doctools/20161025/tbl/t4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t4.c vendor/heirloom-doctools/20161025/tbl/t5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t5.c vendor/heirloom-doctools/20161025/tbl/t8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t8.c vendor/heirloom-doctools/20161025/tbl/tb.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tb.c vendor/heirloom-doctools/20161025/tbl/tc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tc.c vendor/heirloom-doctools/20161025/tbl/te.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/te.c vendor/heirloom-doctools/20161025/tbl/tg.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tg.c vendor/heirloom-doctools/20161025/tbl/tm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tm.c vendor/heirloom-doctools/20161025/tbl/ts.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/ts.c vendor/heirloom-doctools/20161025/tbl/tt.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tt.c vendor/heirloom-doctools/20161025/tbl/tu.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tu.c vendor/heirloom-doctools/20161025/tbl/tv.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tv.c vendor/heirloom-doctools/20161025/troff/ext.h - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/20161025/troff/libhnj/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/20161025/troff/libhnj/hnjalloc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/libhnj/hnjalloc.c vendor/heirloom-doctools/20161025/troff/n1.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/20161025/troff/n2.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/20161025/troff/n3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/20161025/troff/n4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n4.c vendor/heirloom-doctools/20161025/troff/n5.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/20161025/troff/n7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/20161025/troff/n8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/20161025/troff/n9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/20161025/troff/nroff.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/20161025/troff/nroff.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/draw.c vendor/heirloom-doctools/20161025/troff/nroff.d/n10.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n10.c vendor/heirloom-doctools/20161025/troff/nroff.d/n6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/20161025/troff/nroff.d/pt.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/20161025/troff/tdef.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/20161025/troff/troff.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/20161025/troff/troff.d/afm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/20161025/troff/troff.d/afm.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/20161025/troff/troff.d/devaps/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk vendor/heirloom-doctools/20161025/troff/troff.d/dhtml/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk vendor/heirloom-doctools/20161025/troff/troff.d/dpost.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/20161025/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/20161025/troff/troff.d/dpost.d/dpost.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/20161025/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/20161025/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/20161025/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/20161025/troff/troff.d/dpost.d/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/20161025/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/20161025/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/20161025/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/20161025/troff/troff.d/draw.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/20161025/troff/troff.d/font/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk vendor/heirloom-doctools/20161025/troff/troff.d/font/devhtml/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/20161025/troff/troff.d/fontmap.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.c vendor/heirloom-doctools/20161025/troff/troff.d/fontmap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.h vendor/heirloom-doctools/20161025/troff/troff.d/otf.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/20161025/troff/troff.d/otfdump.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/20161025/troff/troff.d/pt.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/20161025/troff/troff.d/t10.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/20161025/troff/troff.d/t6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/20161025/version.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/version.mk vendor/heirloom-doctools/20161025/vgrind/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/vgrind/Makefile.mk vendor/heirloom-doctools/20161025/vgrind/vfontedpr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/vgrind/vfontedpr.c Deleted: vendor/heirloom-doctools/20161025/picpack/getopt.c vendor/heirloom-doctools/20161025/troff/troff.d/devaps/getopt.c vendor/heirloom-doctools/20161025/troff/troff.d/dpost.d/getopt.c Copied: vendor/heirloom-doctools/20161025/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/20161025/checknr/Makefile.mk Tue Oct 25 16:14:11 2016 (r307922, 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/20161025/checknr/checknr.c (from r307809, vendor/heirloom-doctools/dist/checknr/checknr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161025/checknr/checknr.c Tue Oct 25 16:14:11 2016 (r307922, copy of r307809, 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, 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/20161025/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/20161025/col/Makefile.mk Tue Oct 25 16:14:11 2016 (r307922, 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/20161025/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/20161025/compat.c Tue Oct 25 16:14:11 2016 (r307922, 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/20161025/configure (from r307921, vendor/heirloom-doctools/dist/configure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161025/configure Tue Oct 25 16:14:11 2016 (r307922, 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/20161025/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/20161025/eqn/checkeq.d/Makefile.mk Tue Oct 25 16:14:11 2016 (r307922, 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 Thu Oct 27 07:11:33 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 26157C228B1; Thu, 27 Oct 2016 07:11:33 +0000 (UTC) (envelope-from avg@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 E9A1A2D8; Thu, 27 Oct 2016 07:11:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9R7BWtZ049492; Thu, 27 Oct 2016 07:11:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9R7BWMi049491; Thu, 27 Oct 2016 07:11:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610270711.u9R7BWMi049491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Oct 2016 07:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r307993 - vendor-sys/illumos/dist/uts/common/fs/zfs 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: Thu, 27 Oct 2016 07:11:33 -0000 Author: avg Date: Thu Oct 27 07:11:31 2016 New Revision: 307993 URL: https://svnweb.freebsd.org/changeset/base/307993 Log: 3746 ZRLs are racy illumos/illumos-gate@260af64db74a52d64de8c6c5f67dd0a71d228ca5 https://github.com/illumos/illumos-gate/commit/260af64db74a52d64de8c6c5f67dd0a71d228ca5 https://www.illumos.org/issues/3746 From the original change log: It was possible for a reference to be added even with the lock held, and for references added just after a lock release to be lost. This bug was also independently found and reported in wesunsolve.net issues 6985013 6995524. In zrl_add(), always use an atomic operation to update the refcount. The mutex in the ZRL only guarantees that wakeups occur for waiters on the lock. It offers no protection against concurrent updates of the refcount. The only refcount transition that is safe to perform without an atomic operation is from ZRL_LOCKED back to 0, since this can only be performed by the thread which has the ZRL locked. Authored by: Will Andrews Reviewed by: Boris Protopopov Reviewed by: Pavel Zakharov Reviewed by: Yuri Pankov Reviewed by: Justin T. Gibbs Approved by: Matt Ahrens Author: Youzhong Yang Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zrlock.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zrlock.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zrlock.c Thu Oct 27 06:35:52 2016 (r307992) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zrlock.c Thu Oct 27 07:11:31 2016 (r307993) @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015 by Delphix. All rights reserved. + * Copyright 2016 The MathWorks, Inc. All rights reserved. */ /* @@ -71,37 +72,32 @@ zrl_destroy(zrlock_t *zrl) void zrl_add_impl(zrlock_t *zrl, const char *zc) { - uint32_t n = (uint32_t)zrl->zr_refcount; - - while (n != ZRL_LOCKED) { - uint32_t cas = atomic_cas_32( - (uint32_t *)&zrl->zr_refcount, n, n + 1); - if (cas == n) { - ASSERT3S((int32_t)n, >=, 0); -#ifdef ZFS_DEBUG - if (zrl->zr_owner == curthread) { - DTRACE_PROBE2(zrlock__reentry, - zrlock_t *, zrl, uint32_t, n); - } - zrl->zr_owner = curthread; - zrl->zr_caller = zc; + for (;;) { + uint32_t n = (uint32_t)zrl->zr_refcount; + while (n != ZRL_LOCKED) { + uint32_t cas = atomic_cas_32( + (uint32_t *)&zrl->zr_refcount, n, n + 1); + if (cas == n) { + ASSERT3S((int32_t)n, >=, 0); +#ifdef ZFS_DEBUG + if (zrl->zr_owner == curthread) { + DTRACE_PROBE2(zrlock__reentry, + zrlock_t *, zrl, uint32_t, n); + } + zrl->zr_owner = curthread; + zrl->zr_caller = zc; #endif - return; + return; + } + n = cas; } - n = cas; - } - mutex_enter(&zrl->zr_mtx); - while (zrl->zr_refcount == ZRL_LOCKED) { - cv_wait(&zrl->zr_cv, &zrl->zr_mtx); + mutex_enter(&zrl->zr_mtx); + while (zrl->zr_refcount == ZRL_LOCKED) { + cv_wait(&zrl->zr_cv, &zrl->zr_mtx); + } + mutex_exit(&zrl->zr_mtx); } - ASSERT3S(zrl->zr_refcount, >=, 0); - zrl->zr_refcount++; -#ifdef ZFS_DEBUG - zrl->zr_owner = curthread; - zrl->zr_caller = zc; -#endif - mutex_exit(&zrl->zr_mtx); } void