Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/mdocml/dist Merge mdocml state from 2012-01-30 ...



details:   https://anonhg.NetBSD.org/src/rev/abd3343ca025
branches:  trunk
changeset: 773282:abd3343ca025
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Jan 30 16:44:03 2012 +0000

description:
Merge mdocml state from 2012-01-30 for various relaxed checks in the
parser to allow it to pass almost all man pages in pkgsrc.

diffstat:

 external/bsd/mdocml/dist/apropos_db.h     |    59 +
 external/bsd/mdocml/dist/compat_fgetln.c  |    93 +
 external/bsd/mdocml/dist/compat_strlcpy.c |     4 +
 external/bsd/mdocml/dist/config.h.post    |    13 +
 external/bsd/mdocml/dist/libman.h         |     3 +-
 external/bsd/mdocml/dist/man-cgi.css      |    13 +
 external/bsd/mdocml/dist/man.7            |    44 +-
 external/bsd/mdocml/dist/man.cgi.7        |   123 ++
 external/bsd/mdocml/dist/mandoc_char.7    |   219 +++-
 external/bsd/mdocml/dist/mandocdb.c       |  1653 +++++++++++++++++++---------
 external/bsd/mdocml/dist/manpath.c        |   225 +++
 external/bsd/mdocml/dist/mdoc_html.c      |    64 +-
 external/bsd/mdocml/dist/mdoc_macro.c     |    37 +-
 external/bsd/mdocml/dist/mdoc_man.c       |   119 +-
 external/bsd/mdocml/dist/msec.c           |     7 +-
 external/bsd/mdocml/dist/preconv.1        |    18 +-
 external/bsd/mdocml/dist/test-fgetln.c    |    11 +
 17 files changed, 1978 insertions(+), 727 deletions(-)

diffs (truncated from 3631 to 300 lines):

diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/apropos_db.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/mdocml/dist/apropos_db.h     Mon Jan 30 16:44:03 2012 +0000
@@ -0,0 +1,59 @@
+/*     $Vendor-Id: apropos_db.h,v 1.11 2011/12/16 12:06:35 kristaps Exp $ */
+/*
+ * Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
+ *
+ * Permission to use, copy, modify, and 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.
+ */
+#ifndef APROPOS_H
+#define APROPOS_H
+
+enum   restype {
+       RESTYPE_MAN, /* man(7) file */
+       RESTYPE_MDOC, /* mdoc(7) file */
+       RESTYPE_CAT /* pre-formatted file */
+};
+
+struct res {
+       enum restype     type; /* input file type */
+       char            *file; /* file in file-system */
+       char            *cat; /* category (3p, 3, etc.) */
+       char            *title; /* title (FOO, etc.) */
+       char            *arch; /* arch (or empty string) */
+       char            *desc; /* description (from Nd) */
+       unsigned int     rec; /* record in index */
+       /*
+        * The index volume.  This indexes into the array of directories
+        * searched for manual page databases.
+        */
+       unsigned int     volume;
+};
+
+struct opts {
+       const char      *arch; /* restrict to architecture */
+       const char      *cat; /* restrict to manual section */
+};
+
+__BEGIN_DECLS
+
+struct expr;
+
+int             apropos_search(int, char **, const struct opts *,
+                       const struct expr *, size_t, void *,
+                       void (*)(struct res *, size_t, void *));
+struct expr    *exprcomp(int, char *[], size_t *);
+void            exprfree(struct expr *);
+struct expr    *termcomp(int, char *[], size_t *);
+
+__END_DECLS
+
+#endif /*!APROPOS_H*/
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/compat_fgetln.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/mdocml/dist/compat_fgetln.c  Mon Jan 30 16:44:03 2012 +0000
@@ -0,0 +1,93 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_FGETLN
+
+int dummy;
+
+#else
+
+/*     $NetBSD: compat_fgetln.c,v 1.1.1.1 2012/01/30 16:44:03 joerg Exp $      */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char *
+fgetln(fp, len)
+       FILE *fp;
+       size_t *len;
+{
+       static char *buf = NULL;
+       static size_t bufsiz = 0;
+       char *ptr;
+
+
+       if (buf == NULL) {
+               bufsiz = BUFSIZ;
+               if ((buf = malloc(bufsiz)) == NULL)
+                       return NULL;
+       }
+
+       if (fgets(buf, bufsiz, fp) == NULL)
+               return NULL;
+
+       *len = 0;
+       while ((ptr = strchr(&buf[*len], '\n')) == NULL) {
+               size_t nbufsiz = bufsiz + BUFSIZ;
+               char *nbuf = realloc(buf, nbufsiz);
+
+               if (nbuf == NULL) {
+                       int oerrno = errno;
+                       free(buf);
+                       errno = oerrno;
+                       buf = NULL;
+                       return NULL;
+               } else
+                       buf = nbuf;
+
+               *len = bufsiz;
+               if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL)
+                       return buf;
+
+               bufsiz = nbufsiz;
+       }
+
+       *len = (ptr - buf) + 1;
+       return buf;
+}
+
+#endif
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/compat_strlcpy.c
--- a/external/bsd/mdocml/dist/compat_strlcpy.c Mon Jan 30 16:17:14 2012 +0000
+++ b/external/bsd/mdocml/dist/compat_strlcpy.c Mon Jan 30 16:44:03 2012 +0000
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef HAVE_STRLCPY
 
 int dummy;
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/config.h.post
--- a/external/bsd/mdocml/dist/config.h.post    Mon Jan 30 16:17:14 2012 +0000
+++ b/external/bsd/mdocml/dist/config.h.post    Mon Jan 30 16:44:03 2012 +0000
@@ -15,6 +15,16 @@
 #  endif
 #endif
 
+#if defined(__APPLE__)
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define betoh32(x) OSSwapBigToHostInt32(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define betoh64(x) OSSwapBigToHostInt64(x)
+#elif defined(__linux__)
+# define betoh32(x) be32toh(x)
+# define betoh64(x) be64toh(x)
+#endif
+
 #ifndef HAVE_STRLCAT
 extern size_t    strlcat(char *, const char *, size_t);
 #endif
@@ -25,5 +35,8 @@
 extern int       getsubopt(char **, char * const *, char **);
 extern char     *suboptarg;
 #endif
+#ifndef HAVE_FGETLN
+extern char     *fgetln(FILE *, size_t *);
+#endif
 
 #endif /* MANDOC_CONFIG_H */
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/libman.h
--- a/external/bsd/mdocml/dist/libman.h Mon Jan 30 16:17:14 2012 +0000
+++ b/external/bsd/mdocml/dist/libman.h Mon Jan 30 16:44:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: libman.h,v 1.54 2011/09/18 14:14:15 schwarze Exp $ */
+/*     $Vendor-Id: libman.h,v 1.55 2011/11/07 01:24:40 schwarze Exp $ */
 /*
  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  *
@@ -54,6 +54,7 @@
 #define        MAN_FSCOPED      (1 << 2)       /* See blk_imp(). */
 #define        MAN_NSCOPED      (1 << 3)       /* See in_line_eoln(). */
 #define        MAN_NOCLOSE      (1 << 4)       /* See blk_exp(). */
+#define        MAN_BSCOPE       (1 << 5)       /* Break BLINE scope. */
 };
 
 extern const struct man_macro *const man_macros;
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/man-cgi.css
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/mdocml/dist/man-cgi.css      Mon Jan 30 16:44:03 2012 +0000
@@ -0,0 +1,13 @@
+body                           { font-family: Helvetica, Arial, sans-serif; }
+body > div                     { padding-left: 2em; 
+                                 padding-top: 1em; }
+body > div#mancgi              { padding-left: 0em; 
+                                 padding-top: 0em; }
+body > div.results             { font-size: smaller; }
+#mancgi fieldset               { text-align: center; 
+                                 border: thin solid silver;
+                                 border-radius: 1em;
+                                 font-size: small; }
+#mancgi input[name=expr]       { width: 25%; }
+.results td.title              { vertical-align: top;
+                                 padding-right: 1em; }
diff -r 53fda5e37546 -r abd3343ca025 external/bsd/mdocml/dist/man.7
--- a/external/bsd/mdocml/dist/man.7    Mon Jan 30 16:17:14 2012 +0000
+++ b/external/bsd/mdocml/dist/man.7    Mon Jan 30 16:44:03 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $Vendor-Id: man.7,v 1.111 2011/09/26 23:07:31 schwarze Exp $
+.\"    $Vendor-Id: man.7,v 1.113 2012/01/03 15:16:24 kristaps Exp $
 .\"
 .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
 .\" Copyright (c) 2011 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd September 26, 2011
+.Dd January 3, 2012
 .Dt MAN 7
 .Os
 .Sh NAME
@@ -272,6 +272,10 @@
 .It Sx RB Ta alternate between roman and boldface fonts
 .It Sx RI Ta alternate between roman and italic fonts
 .El
+.Ss Semantic markup
+.Bl -column "PP, LP, P" description
+.It Sx OP Ta optional arguments
+.El
 .Sh MACRO REFERENCE
 This section is a canonical reference to all macros, arranged
 alphabetically.
@@ -437,6 +441,19 @@
 .Sx \&PP ,
 and
 .Sx \&TP .
+.Ss \&OP
+Optional command-line argument.
+This has the following syntax:
+.Bd -filled -offset indent
+.Pf \. Sx \&OP
+.Cm key Op Cm value
+.Ed
+.Pp
+The
+.Cm key
+is usually a command-line flag and
+.Cm value
+its argument.
 .Ss \&P
 Synonym for
 .Sx \&LP .
@@ -691,6 +708,7 @@
 .It Sx \&I   Ta    n         Ta    next-line Ta    \&
 .It Sx \&IB  Ta    n         Ta    current   Ta    \&
 .It Sx \&IR  Ta    n         Ta    current   Ta    \&
+.It Sx \&OP  Ta    0, 1      Ta    current   Ta    compat
 .It Sx \&R   Ta    n         Ta    next-line Ta    \&
 .It Sx \&RB  Ta    n         Ta    current   Ta    \&
 .It Sx \&RI  Ta    n         Ta    current   Ta    \&
@@ -840,7 +858,26 @@
 .Sx \&sp
 macro does not accept negative values in mandoc.
 In GNU troff, this would result in strange behaviour.
+.It
+In page header lines, GNU troff versions up to and including 1.21
+only print
+.Ar volume
+names explicitly specified in the



Home | Main Index | Thread Index | Old Index