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 Import mdocml 1.10.4:



details:   https://anonhg.NetBSD.org/src/rev/47fa8b1d4c53
branches:  trunk
changeset: 756591:47fa8b1d4c53
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Jul 25 19:10:40 2010 +0000

description:
Import mdocml 1.10.4:
- Smaller bugfixes
- Improved .ds support
- Support .Bk -words
- Improve multi-page postscript output
- Improve indentation in SYNOPSIS
- Improved support for badly nested blocks

diffstat:

 external/bsd/mdocml/dist/Makefile        |   10 +-
 external/bsd/mdocml/dist/html.c          |   48 +-
 external/bsd/mdocml/dist/html.h          |    6 +-
 external/bsd/mdocml/dist/libman.h        |   23 +-
 external/bsd/mdocml/dist/libmdoc.h       |   27 +-
 external/bsd/mdocml/dist/main.c          |   93 ++-
 external/bsd/mdocml/dist/main.h          |    4 +-
 external/bsd/mdocml/dist/man.3           |   21 +-
 external/bsd/mdocml/dist/man.c           |    6 +-
 external/bsd/mdocml/dist/man.h           |    4 +-
 external/bsd/mdocml/dist/man_html.c      |    2 +-
 external/bsd/mdocml/dist/man_macro.c     |    5 +-
 external/bsd/mdocml/dist/man_validate.c  |    7 +-
 external/bsd/mdocml/dist/mandoc.1        |  263 +++++------
 external/bsd/mdocml/dist/mandoc.c        |    2 +-
 external/bsd/mdocml/dist/mandoc.h        |   66 ++-
 external/bsd/mdocml/dist/mdoc.3          |  102 ++++-
 external/bsd/mdocml/dist/mdoc.7          |  296 +++++++++++++-
 external/bsd/mdocml/dist/mdoc.c          |   88 +++-
 external/bsd/mdocml/dist/mdoc.h          |   46 +-
 external/bsd/mdocml/dist/mdoc_argv.c     |    5 +-
 external/bsd/mdocml/dist/mdoc_html.c     |  223 +++++++---
 external/bsd/mdocml/dist/mdoc_macro.c    |  570 ++++++++++++++------------
 external/bsd/mdocml/dist/mdoc_validate.c |  277 ++++++++-----
 external/bsd/mdocml/dist/out.c           |    4 +-
 external/bsd/mdocml/dist/out.h           |    9 +-
 external/bsd/mdocml/dist/roff.3          |   23 +-
 external/bsd/mdocml/dist/roff.7          |   61 ++-
 external/bsd/mdocml/dist/roff.c          |  290 ++++++++++++-
 external/bsd/mdocml/dist/roff.h          |    4 +-
 external/bsd/mdocml/dist/term.c          |  142 +++---
 external/bsd/mdocml/dist/term.h          |   38 +-
 external/bsd/mdocml/dist/term_ascii.c    |   71 +++-
 external/bsd/mdocml/dist/term_ps.c       |  642 ++++++++++++++++++++++++++++--
 external/bsd/mdocml/dist/tree.c          |    7 +-
 35 files changed, 2554 insertions(+), 931 deletions(-)

diffs (truncated from 5785 to 300 lines):

diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/Makefile
--- a/external/bsd/mdocml/dist/Makefile Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/Makefile Sun Jul 25 19:10:40 2010 +0000
@@ -12,8 +12,8 @@
 INSTALL_LIB    = $(INSTALL) -m 0644
 INSTALL_MAN    = $(INSTALL_DATA)
 
-VERSION           = 1.10.2
-VDATE     = 19 June 2010
+VERSION           = 1.10.4
+VDATE     = 12 July 2010
 
 VFLAGS    = -DVERSION="\"$(VERSION)\""
 WFLAGS     = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
@@ -23,10 +23,6 @@
 # in the lower-left hand corner of -mdoc manuals.
 # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
 
-# Unset this if you don't want Xo/Xc allowing split `It' lines, which
-# breaks symmetry.
-CFLAGS   += -DUGLY
-
 LINTFLAGS += $(VFLAGS)
 
 MANDOCFLAGS = -Wall -fstrict
@@ -65,7 +61,7 @@
 MANOBJS           = man_macro.o man.o man_hash.o man_validate.o \
             man_action.o man_argv.o
 MANSRCS           = man_macro.c man.c man_hash.c man_validate.c \
-            man_action.c mandoc.c man_argv.c
+            man_action.c man_argv.c
 
 MAINLNS           = main.ln mdoc_term.ln chars.ln term.ln tree.ln \
             compat.ln man_term.ln html.ln mdoc_html.ln \
diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/html.c
--- a/external/bsd/mdocml/dist/html.c   Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/html.c   Sun Jul 25 19:10:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: html.c,v 1.102 2010/06/19 20:46:27 kristaps Exp $ */
+/*     $Vendor-Id: html.c,v 1.105 2010/07/06 12:37:17 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  *
@@ -393,8 +393,15 @@
                t = NULL;
 
        if ( ! (HTML_NOSPACE & h->flags))
-               if ( ! (HTML_CLRLINE & htmltags[tag].flags))
-                       putchar(' ');
+               if ( ! (HTML_CLRLINE & htmltags[tag].flags)) {
+                       /* Manage keeps! */
+                       if ( ! (HTML_KEEP & h->flags)) {
+                               if (HTML_PREKEEP & h->flags)
+                                       h->flags |= HTML_KEEP;
+                               putchar(' ');
+                       } else
+                               printf("&#160;");
+               }
 
        /* Print out the tag name and attributes. */
 
@@ -484,11 +491,11 @@
 
 
 void
-print_text(struct html *h, const char *p)
+print_text(struct html *h, const char *word)
 {
 
-       if (*p && 0 == *(p + 1))
-               switch (*p) {
+       if (word[0] && '\0' == word[1])
+               switch (word[0]) {
                case('.'):
                        /* FALLTHROUGH */
                case(','):
@@ -511,19 +518,26 @@
                        break;
                }
 
-       if ( ! (h->flags & HTML_NOSPACE))
-               putchar(' ');
+       if ( ! (HTML_NOSPACE & h->flags)) {
+               /* Manage keeps! */
+               if ( ! (HTML_KEEP & h->flags)) {
+                       if (HTML_PREKEEP & h->flags)
+                               h->flags |= HTML_KEEP;
+                       putchar(' ');
+               } else
+                       printf("&#160;");
+       }
 
-       assert(p);
-       if ( ! print_encode(h, p, 0))
+       assert(word);
+       if ( ! print_encode(h, word, 0))
                h->flags &= ~HTML_NOSPACE;
 
        /* 
         * Note that we don't process the pipe: the parser sees it as
         * punctuation, but we don't in terms of typography.
         */
-       if (*p && 0 == *(p + 1))
-               switch (*p) {
+       if (word[0] && '\0' == word[1])
+               switch (word[0]) {
                case('('):
                        /* FALLTHROUGH */
                case('['):
@@ -718,11 +732,11 @@
                break;
        }
 
-       if (su->pt)
-               buffmt(h, "%s: %f%s;", p, v, u);
-       else
-               /* LINTED */
-               buffmt(h, "%s: %d%s;", p, (int)v, u);
+       /* 
+        * XXX: the CSS spec isn't clear as to which types accept
+        * integer or real numbers, so we just make them all decimals.
+        */
+       buffmt(h, "%s: %.2f%s;", p, v, u);
 }
 
 
diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/html.h
--- a/external/bsd/mdocml/dist/html.h   Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/html.h   Sun Jul 25 19:10:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: html.h,v 1.24 2010/06/19 20:46:27 kristaps Exp $ */
+/*     $Vendor-Id: html.h,v 1.25 2010/07/06 12:37:17 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  *
@@ -110,7 +110,9 @@
 struct html {
        int               flags;
 #define        HTML_NOSPACE     (1 << 0)
-#define        HTML_IGNDELIM    (1 << 2)
+#define        HTML_IGNDELIM    (1 << 1)
+#define        HTML_KEEP        (1 << 2)
+#define        HTML_PREKEEP     (1 << 3)
        struct tagq       tags;
        struct ordq       ords;
        void             *symtab;
diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/libman.h
--- a/external/bsd/mdocml/dist/libman.h Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/libman.h Sun Jul 25 19:10:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: libman.h,v 1.36 2010/06/19 20:46:27 kristaps Exp $ */
+/*     $Vendor-Id: libman.h,v 1.41 2010/07/07 15:04:54 kristaps Exp $ */
 /*
  * Copyright (c) 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  *
@@ -25,8 +25,8 @@
 };
 
 struct man {
-       void            *data;
-       mandocmsg        msg;
+       void            *data; /* private application data */
+       mandocmsg        msg; /* output message handler */
        int              pflags; /* parse flags (see man.h) */
        int              flags; /* parse flags */
 #define        MAN_HALT        (1 << 0) /* badness happened: die */
@@ -35,14 +35,19 @@
 #define        MAN_ILINE       (1 << 3) /* Ignored in next-line scope. */
 #define        MAN_LITERAL     (1 << 4) /* Literal input. */
 #define        MAN_BPLINE      (1 << 5)
-       enum man_next    next;
-       struct man_node *last;
-       struct man_node *first;
-       struct man_meta  meta;
+       enum man_next    next; /* where to put the next node */
+       struct man_node *last; /* the last parsed node */
+       struct man_node *first; /* the first parsed node */
+       struct man_meta  meta; /* document meta-data */
+       struct regset   *regs; /* registers */
 };
 
-#define        MACRO_PROT_ARGS   struct man *m, enum mant tok, int line, \
-                         int ppos, int *pos, char *buf
+#define        MACRO_PROT_ARGS   struct man *m, \
+                         enum mant tok, \
+                         int line, \
+                         int ppos, \
+                         int *pos, \
+                         char *buf
 
 struct man_macro {
        int             (*fp)(MACRO_PROT_ARGS);
diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/libmdoc.h
--- a/external/bsd/mdocml/dist/libmdoc.h        Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/libmdoc.h        Sun Jul 25 19:10:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: libmdoc.h,v 1.53 2010/06/19 20:46:27 kristaps Exp $ */
+/*     $Vendor-Id: libmdoc.h,v 1.60 2010/07/07 15:04:54 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  *
@@ -25,8 +25,8 @@
 };
 
 struct mdoc {
-       void             *data;
-       mandocmsg         msg;
+       void             *data; /* private application data */
+       mandocmsg         msg; /* message callback */
        int               flags;
 #define        MDOC_HALT        (1 << 0) /* error in parse: halt */
 #define        MDOC_LITERAL     (1 << 1) /* in a literal scope */
@@ -35,17 +35,23 @@
 #define        MDOC_PHRASELIT   (1 << 4) /* literal within a partila phrase */
 #define        MDOC_PPHRASE     (1 << 5) /* within a partial phrase */
 #define        MDOC_FREECOL     (1 << 6) /* `It' invocation should close */
+#define        MDOC_SYNOPSIS    (1 << 7) /* SYNOPSIS-style formatting */
        int               pflags;
-       enum mdoc_next    next;
-       struct mdoc_node *last;
-       struct mdoc_node *first;
-       struct mdoc_meta  meta;
+       enum mdoc_next    next; /* where to put the next node */
+       struct mdoc_node *last; /* the last node parsed */
+       struct mdoc_node *first; /* the first node parsed */
+       struct mdoc_meta  meta; /* document meta-data */
        enum mdoc_sec     lastnamed;
        enum mdoc_sec     lastsec;
+       struct regset    *regs; /* registers */
 };
 
-#define        MACRO_PROT_ARGS struct mdoc *m, enum mdoct tok, \
-                       int line, int ppos, int *pos, char *buf
+#define        MACRO_PROT_ARGS struct mdoc *m, \
+                       enum mdoct tok, \
+                       int line, \
+                       int ppos, \
+                       int *pos, \
+                       char *buf
 
 struct mdoc_macro {
        int             (*fp)(MACRO_PROT_ARGS);
@@ -103,6 +109,9 @@
 int              mdoc_head_alloc(struct mdoc *, int, int, enum mdoct);
 int              mdoc_tail_alloc(struct mdoc *, int, int, enum mdoct);
 int              mdoc_body_alloc(struct mdoc *, int, int, enum mdoct);
+int              mdoc_endbody_alloc(struct mdoc *m, int line, int pos,
+                       enum mdoct tok, struct mdoc_node *body,
+                       enum mdoc_endbody end);
 void             mdoc_node_delete(struct mdoc *, struct mdoc_node *);
 void             mdoc_hash_init(void);
 enum mdoct       mdoc_hash_find(const char *);
diff -r da36f03b430c -r 47fa8b1d4c53 external/bsd/mdocml/dist/main.c
--- a/external/bsd/mdocml/dist/main.c   Sun Jul 25 17:44:01 2010 +0000
+++ b/external/bsd/mdocml/dist/main.c   Sun Jul 25 19:10:40 2010 +0000
@@ -1,6 +1,7 @@
-/*     $Vendor-Id: main.c,v 1.89 2010/06/19 20:46:27 kristaps Exp $ */
+/*     $Vendor-Id: main.c,v 1.98 2010/07/07 15:04:54 kristaps Exp $ */
 /*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
+ * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
+ * Copyright (c) 2010 Ingo Schwarze <schwarze%openbsd.org@localhost>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -30,10 +31,10 @@
 #include <unistd.h>
 
 #include "mandoc.h"
+#include "main.h"
 #include "mdoc.h"
 #include "man.h"
 #include "roff.h"
-#include "main.h"
 
 #define        UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))
 
@@ -87,6 +88,7 @@
        struct man       *man;          /* man parser */
        struct mdoc      *mdoc;         /* mdoc parser */
        struct roff      *roff;         /* roff parser (!NULL) */
+       struct regset     regs;         /* roff registers */
        enum outt         outtype;      /* which output to use */
        out_mdoc          outmdoc;      /* mdoc output ptr */
        out_man           outman;       /* man output ptr */
@@ -97,6 +99,9 @@
 
 static const char * const      mandocerrs[MANDOCERR_MAX] = {
        "ok",
+
+       "generic warning",
+
        "text should be uppercase",
        "sections out of conventional order",
        "section name repeats",
@@ -115,7 +120,11 @@
        "unknown manual section",
        "section not in conventional manual section",
        "end of line whitespace",
+       "blocks badly nested",



Home | Main Index | Thread Index | Old Index