From f88b6c166601db65e30d49d360aeb63cd0a021ea Mon Sep 17 00:00:00 2001
From: Franco Fichtner
Date: Sun, 6 Oct 2013 09:47:07 +0200
Subject: [PATCH] Import mdocml-1.12.2
---
contrib/mdocml/Makefile | 302 ++-----
contrib/mdocml/NEWS | 331 ++++++++
contrib/mdocml/TODO | 165 ++--
contrib/mdocml/apropos.1 | 55 +-
contrib/mdocml/apropos.c | 137 +---
contrib/mdocml/apropos_db.c | 6 +-
contrib/mdocml/arch.in | 5 +-
contrib/mdocml/catman.c | 5 +-
contrib/mdocml/cgi.c | 39 +-
contrib/mdocml/chars.c | 6 +-
contrib/mdocml/chars.in | 3 +-
contrib/mdocml/config.h.post | 15 +-
contrib/mdocml/demandoc.1 | 7 +-
contrib/mdocml/demandoc.c | 4 +-
contrib/mdocml/eqn.7 | 7 +-
contrib/mdocml/gmdiff | 35 +
contrib/mdocml/html.c | 124 ++-
contrib/mdocml/html.h | 4 +-
contrib/mdocml/index.sgml | 167 ++--
contrib/mdocml/libman.h | 12 +-
contrib/mdocml/libmandoc.h | 11 +-
contrib/mdocml/libmdoc.h | 19 +-
contrib/mdocml/libroff.h | 4 +-
contrib/mdocml/main.c | 30 +-
contrib/mdocml/man.7 | 90 ++-
contrib/mdocml/man.c | 255 +++---
contrib/mdocml/man.cgi.7 | 5 +-
contrib/mdocml/man.h | 4 +-
contrib/mdocml/man_html.c | 62 +-
contrib/mdocml/man_macro.c | 162 ++--
contrib/mdocml/man_term.c | 201 +++--
contrib/mdocml/man_validate.c | 199 +++--
contrib/mdocml/mandoc.1 | 22 +-
contrib/mdocml/mandoc.3 | 94 ++-
contrib/mdocml/mandoc.c | 334 +++-----
contrib/mdocml/mandoc.h | 34 +-
contrib/mdocml/mandoc_char.7 | 9 +-
contrib/mdocml/mandocdb.8 | 53 +-
contrib/mdocml/mandocdb.c | 373 +++++----
contrib/mdocml/mandocdb.h | 6 +-
contrib/mdocml/manpath.c | 20 +-
contrib/mdocml/manpath.h | 4 +-
contrib/mdocml/mdoc.7 | 80 +-
contrib/mdocml/mdoc.c | 295 +++----
contrib/mdocml/mdoc.h | 4 +-
contrib/mdocml/mdoc_argv.c | 111 +--
contrib/mdocml/mdoc_html.c | 65 +-
contrib/mdocml/mdoc_macro.c | 386 ++++-----
contrib/mdocml/mdoc_man.c | 1352 +++++++++++++++++++++++++++-----
contrib/mdocml/mdoc_term.c | 189 ++---
contrib/mdocml/mdoc_validate.c | 198 +++--
contrib/mdocml/out.c | 39 +-
contrib/mdocml/preconv.1 | 7 +-
contrib/mdocml/preconv.c | 11 +-
contrib/mdocml/predefs.in | 4 +-
contrib/mdocml/read.c | 98 ++-
contrib/mdocml/roff.7 | 37 +-
contrib/mdocml/roff.c | 344 +++++---
contrib/mdocml/st.in | 19 +-
contrib/mdocml/tbl.3 | 295 +++++++
contrib/mdocml/tbl.7 | 14 +-
contrib/mdocml/tbl.c | 40 +-
contrib/mdocml/tbl_data.c | 12 +-
contrib/mdocml/tbl_html.c | 20 +-
contrib/mdocml/tbl_layout.c | 154 +---
contrib/mdocml/tbl_term.c | 138 ++--
contrib/mdocml/term.c | 172 ++--
contrib/mdocml/term.h | 9 +-
contrib/mdocml/term_ascii.c | 5 +-
contrib/mdocml/test-betoh64.c | 18 +
contrib/mdocml/test-mmap.c | 2 +-
contrib/mdocml/tree.c | 16 +-
contrib/mdocml/whatis.1 | 53 +-
73 files changed, 4701 insertions(+), 2906 deletions(-)
create mode 100644 contrib/mdocml/NEWS
create mode 100644 contrib/mdocml/gmdiff
create mode 100644 contrib/mdocml/tbl.3
create mode 100644 contrib/mdocml/test-betoh64.c
diff --git a/contrib/mdocml/Makefile b/contrib/mdocml/Makefile
index 304237b478..044d087281 100644
--- a/contrib/mdocml/Makefile
+++ b/contrib/mdocml/Makefile
@@ -1,19 +1,15 @@
.PHONY: clean install installwww
.SUFFIXES: .sgml .html .md5 .h .h.html
.SUFFIXES: .1 .3 .7 .8
-.SUFFIXES: .1.txt .3.txt .7.txt .8.txt
-.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf
-.SUFFIXES: .1.ps .3.ps .7.ps .8.ps
.SUFFIXES: .1.html .3.html .7.html .8.html
-.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml
# Specify this if you want to hard-code the operating system to appear
# in the lower-left hand corner of -mdoc manuals.
#
-# CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
+# CFLAGS += -DOSNAME="\"OpenBSD 5.4\""
-VERSION = 1.12.1
-VDATE = 23 March 2012
+VERSION = 1.12.2
+VDATE = 05 October 2013
# IFF your system supports multi-byte functions (setlocale(), wcwidth(),
# putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a
@@ -29,10 +25,11 @@ CFLAGS += -DUSE_WCHAR
# variable.
#CFLAGS += -DUSE_MANPATH
-# If your system supports static binaries only, uncomment this. This
-# appears only to be BSD UNIX systems (Mac OS X has no support and Linux
-# requires -pthreads for static libdb).
+# If your system does not support static binaries, comment this,
+# for example on Mac OS X.
STATIC = -static
+# Linux requires -pthread to statically link with libdb.
+#STATIC += -pthread
CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\""
CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
@@ -64,6 +61,7 @@ DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln
all: mandoc preconv demandoc $(DBBIN)
SRCS = Makefile \
+ NEWS \
TODO \
apropos.1 \
apropos.c \
@@ -92,6 +90,7 @@ SRCS = Makefile \
eqn_term.c \
example.style.css \
external.png \
+ gmdiff \
html.c \
html.h \
index.css \
@@ -147,6 +146,7 @@ SRCS = Makefile \
st.c \
st.in \
style.css \
+ tbl.3 \
tbl.7 \
tbl.c \
tbl_data.c \
@@ -158,6 +158,7 @@ SRCS = Makefile \
term.h \
term_ascii.c \
term_ps.c \
+ test-betoh64.c \
test-fgetln.c \
test-getsubopt.c \
test-mmap.c \
@@ -173,10 +174,6 @@ LIBMAN_OBJS = man.o \
man_hash.o \
man_macro.o \
man_validate.o
-LIBMAN_LNS = man.ln \
- man_hash.ln \
- man_macro.ln \
- man_validate.ln
LIBMDOC_OBJS = arch.o \
att.o \
@@ -188,16 +185,6 @@ LIBMDOC_OBJS = arch.o \
mdoc_validate.o \
st.o \
vol.o
-LIBMDOC_LNS = arch.ln \
- att.ln \
- lib.ln \
- mdoc.ln \
- mdoc_argv.ln \
- mdoc_hash.ln \
- mdoc_macro.ln \
- mdoc_validate.ln \
- st.ln \
- vol.ln
LIBROFF_OBJS = eqn.o \
roff.o \
@@ -205,12 +192,6 @@ LIBROFF_OBJS = eqn.o \
tbl_data.o \
tbl_layout.o \
tbl_opts.o
-LIBROFF_LNS = eqn.ln \
- roff.ln \
- tbl.ln \
- tbl_data.ln \
- tbl_layout.ln \
- tbl_opts.ln
LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
$(LIBMDOC_OBJS) \
@@ -219,52 +200,35 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
mandoc.o \
msec.o \
read.o
-LIBMANDOC_LNS = $(LIBMAN_LNS) \
- $(LIBMDOC_LNS) \
- $(LIBROFF_LNS) \
- chars.ln \
- mandoc.ln \
- msec.ln \
- read.ln
COMPAT_OBJS = compat_fgetln.o \
compat_getsubopt.o \
compat_strlcat.o \
compat_strlcpy.o
-COMPAT_LNS = compat_fgetln.ln \
- compat_getsubopt.ln \
- compat_strlcat.ln \
- compat_strlcpy.ln
-
-arch.o arch.ln: arch.in
-att.o att.ln: att.in
-chars.o chars.ln: chars.in
-lib.o lib.ln: lib.in
-msec.o msec.ln: msec.in
-roff.o roff.ln: predefs.in
-st.o st.ln: st.in
-vol.o vol.ln: vol.in
-
-$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h
-$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h
-$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h
-$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h
-
-$(COMPAT_OBJS) $(COMPAT_LNS): config.h
+
+arch.o: arch.in
+att.o: att.in
+chars.o: chars.in
+lib.o: lib.in
+msec.o: msec.in
+roff.o: predefs.in
+st.o: st.in
+vol.o: vol.in
+
+$(LIBMAN_OBJS): libman.h
+$(LIBMDOC_OBJS): libmdoc.h
+$(LIBROFF_OBJS): libroff.h
+$(LIBMANDOC_OBJS): mandoc.h mdoc.h man.h libmandoc.h config.h
+$(COMPAT_OBJS): config.h
MANDOC_HTML_OBJS = eqn_html.o \
html.o \
man_html.o \
mdoc_html.o \
tbl_html.o
-MANDOC_HTML_LNS = eqn_html.ln \
- html.ln \
- man_html.ln \
- mdoc_html.ln \
- tbl_html.ln
+$(MANDOC_HTML_OBJS): html.h
MANDOC_MAN_OBJS = mdoc_man.o
-MANDOC_MAN_LNS = mdoc_man.ln
MANDOC_TERM_OBJS = eqn_term.o \
man_term.o \
@@ -273,13 +237,7 @@ MANDOC_TERM_OBJS = eqn_term.o \
term_ascii.o \
term_ps.o \
tbl_term.o
-MANDOC_TERM_LNS = eqn_term.ln \
- man_term.ln \
- mdoc_term.ln \
- term.ln \
- term_ascii.ln \
- term_ps.ln \
- tbl_term.ln
+$(MANDOC_TERM_OBJS): term.h
MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
$(MANDOC_MAN_OBJS) \
@@ -287,31 +245,16 @@ MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
main.o \
out.o \
tree.o
-MANDOC_LNS = $(MANDOC_HTML_LNS) \
- $(MANDOC_MAN_LNS) \
- $(MANDOC_TERM_LNS) \
- main.ln \
- out.ln \
- tree.ln
-
-$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h
-$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h
-$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h
+$(MANDOC_OBJS): main.h mandoc.h mdoc.h man.h config.h out.h
MANDOCDB_OBJS = mandocdb.o manpath.o
-MANDOCDB_LNS = mandocdb.ln manpath.ln
-
-$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h
+$(MANDOCDB_OBJS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h
PRECONV_OBJS = preconv.o
-PRECONV_LNS = preconv.ln
-
-$(PRECONV_OBJS) $(PRECONV_LNS): config.h
+$(PRECONV_OBJS): config.h
APROPOS_OBJS = apropos.o apropos_db.o manpath.o
-APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln
-
-$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h
+$(APROPOS_OBJS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h
CGI_OBJS = $(MANDOC_HTML_OBJS) \
$(MANDOC_MAN_OBJS) \
@@ -321,103 +264,30 @@ CGI_OBJS = $(MANDOC_HTML_OBJS) \
manpath.o \
out.o \
tree.o
-
-CGI_LNS = $(MANDOC_HTML_LNS) \
- $(MANDOC_MAN_LNS) \
- $(MANDOC_TERM_LNS) \
- cgi.ln \
- apropos_db.ln \
- manpath.ln \
- out.ln \
- tree.ln
-
-$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h
+$(CGI_OBJS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h
CATMAN_OBJS = catman.o manpath.o
-CATMAN_LNS = catman.ln manpath.ln
-
-$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h
+$(CATMAN_OBJS): config.h mandoc.h manpath.h mandocdb.h
DEMANDOC_OBJS = demandoc.o
-DEMANDOC_LNS = demandoc.ln
-
-$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h
+$(DEMANDOC_OBJS): config.h
INDEX_MANS = apropos.1.html \
- apropos.1.xhtml \
- apropos.1.ps \
- apropos.1.pdf \
- apropos.1.txt \
catman.8.html \
- catman.8.xhtml \
- catman.8.ps \
- catman.8.pdf \
- catman.8.txt \
demandoc.1.html \
- demandoc.1.xhtml \
- demandoc.1.ps \
- demandoc.1.pdf \
- demandoc.1.txt \
mandoc.1.html \
- mandoc.1.xhtml \
- mandoc.1.ps \
- mandoc.1.pdf \
- mandoc.1.txt \
whatis.1.html \
- whatis.1.xhtml \
- whatis.1.ps \
- whatis.1.pdf \
- whatis.1.txt \
mandoc.3.html \
- mandoc.3.xhtml \
- mandoc.3.ps \
- mandoc.3.pdf \
- mandoc.3.txt \
+ tbl.3.html \
eqn.7.html \
- eqn.7.xhtml \
- eqn.7.ps \
- eqn.7.pdf \
- eqn.7.txt \
man.7.html \
- man.7.xhtml \
- man.7.ps \
- man.7.pdf \
- man.7.txt \
man.cgi.7.html \
- man.cgi.7.xhtml \
- man.cgi.7.ps \
- man.cgi.7.pdf \
- man.cgi.7.txt \
mandoc_char.7.html \
- mandoc_char.7.xhtml \
- mandoc_char.7.ps \
- mandoc_char.7.pdf \
- mandoc_char.7.txt \
mdoc.7.html \
- mdoc.7.xhtml \
- mdoc.7.ps \
- mdoc.7.pdf \
- mdoc.7.txt \
preconv.1.html \
- preconv.1.xhtml \
- preconv.1.ps \
- preconv.1.pdf \
- preconv.1.txt \
roff.7.html \
- roff.7.xhtml \
- roff.7.ps \
- roff.7.pdf \
- roff.7.txt \
tbl.7.html \
- tbl.7.xhtml \
- tbl.7.ps \
- tbl.7.pdf \
- tbl.7.txt \
- mandocdb.8.html \
- mandocdb.8.xhtml \
- mandocdb.8.ps \
- mandocdb.8.pdf \
- mandocdb.8.txt
+ mandocdb.8.html
$(INDEX_MANS): mandoc
@@ -430,38 +300,19 @@ INDEX_OBJS = $(INDEX_MANS) \
www: index.html
-lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN)
-
clean:
rm -f libmandoc.a $(LIBMANDOC_OBJS)
- rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS)
rm -f mandocdb $(MANDOCDB_OBJS)
- rm -f llib-lmandocdb.ln $(MANDOCDB_LNS)
rm -f preconv $(PRECONV_OBJS)
- rm -f llib-lpreconv.ln $(PRECONV_LNS)
rm -f apropos whatis $(APROPOS_OBJS)
- rm -f llib-lapropos.ln $(APROPOS_LNS)
rm -f man.cgi $(CGI_OBJS)
- rm -f llib-lman.cgi.ln $(CGI_LNS)
rm -f catman $(CATMAN_OBJS)
- rm -f llib-lcatman.ln $(CATMAN_LNS)
rm -f demandoc $(DEMANDOC_OBJS)
- rm -f llib-ldemandoc.ln $(DEMANDOC_LNS)
rm -f mandoc $(MANDOC_OBJS)
- rm -f llib-lmandoc.ln $(MANDOC_LNS)
- rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS)
- rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip
+ rm -f config.h config.log $(COMPAT_OBJS)
+ rm -f mdocml.tar.gz
rm -f index.html $(INDEX_OBJS)
- rm -rf test-fgetln.dSYM
- rm -rf test-strlcpy.dSYM
- rm -rf test-strlcat.dSYM
- rm -rf test-strptime.dSYM
- rm -rf test-mmap.dSYM
- rm -rf test-getsubopt.dSYM
- rm -rf apropos.dSYM
- rm -rf catman.dSYM
- rm -rf mandocdb.dSYM
- rm -rf whatis.dSYM
+ rm -rf *.dSYM
install: all
mkdir -p $(DESTDIR)$(BINDIR)
@@ -475,7 +326,7 @@ install: all
$(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
$(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
$(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
- $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3
+ $(INSTALL_MAN) mandoc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
$(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
$(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
@@ -500,54 +351,30 @@ installwww: www
libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
$(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
-llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS)
- $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS)
-
mandoc: $(MANDOC_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
-llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln
-
mandocdb: $(MANDOCDB_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
-llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln
-
preconv: $(PRECONV_OBJS)
$(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS)
-llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln
-
whatis: apropos
cp -f apropos whatis
apropos: $(APROPOS_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB)
-llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln
-
catman: $(CATMAN_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB)
-llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln
-
man.cgi: $(CGI_OBJS) libmandoc.a
$(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB)
-llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln
-
demandoc: $(DEMANDOC_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
-llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln
- $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln
-
mdocml.md5: mdocml.tar.gz
md5 mdocml.tar.gz >$@
@@ -557,37 +384,6 @@ mdocml.tar.gz: $(SRCS)
( cd .dist/ && tar zcf ../$@ ./ )
rm -rf .dist/
-mdocml-win32.zip: $(SRCS)
- mkdir -p .win32/mdocml-$(VERSION)/
- $(INSTALL_SOURCE) $(SRCS) .win32
- cp .win32/Makefile .win32/Makefile.old
- egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile
- ( cd .win32; \
- CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \
- make install PREFIX=mdocml-$(VERSION) ; \
- zip -r ../$@ mdocml-$(VERSION) )
- rm -rf .win32
-
-mdocml-win64.zip: $(SRCS)
- mkdir -p .win64/mdocml-$(VERSION)/
- $(INSTALL_SOURCE) $(SRCS) .win64
- cp .win64/Makefile .win64/Makefile.old
- egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile
- ( cd .win64; \
- CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \
- make install PREFIX=mdocml-$(VERSION) ; \
- zip -r ../$@ mdocml-$(VERSION) )
- rm -rf .win64
-
-mdocml-macosx.zip: $(SRCS)
- mkdir -p .macosx/mdocml-$(VERSION)/
- $(INSTALL_SOURCE) $(SRCS) .macosx
- ( cd .macosx; \
- CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \
- make install PREFIX=mdocml-$(VERSION) ; \
- zip -r ../$@ mdocml-$(VERSION) )
- rm -rf .macosx
-
index.html: $(INDEX_OBJS)
config.h: config.h.pre config.h.post
@@ -618,6 +414,10 @@ config.h: config.h.pre config.h.post
echo '#define HAVE_STRLCPY'; \
rm test-strlcpy; \
fi; \
+ if $(CC) $(CFLAGS) -Werror -o test-betoh64 test-betoh64.c >> config.log 2>&1; then \
+ echo '#define HAVE_BETOH64'; \
+ rm test-betoh64; \
+ fi; \
echo; \
cat config.h.post \
) > $@
@@ -625,21 +425,9 @@ config.h: config.h.pre config.h.post
.h.h.html:
highlight -I $< >$@
-.1.1.txt .3.3.txt .7.7.txt .8.8.txt:
- ./mandoc -Tascii -Wall,stop $< | col -b >$@
-
.1.1.html .3.3.html .7.7.html .8.8.html:
./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
-.1.1.ps .3.3.ps .7.7.ps .8.8.ps:
- ./mandoc -Tps -Wall,stop $< >$@
-
-.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml:
- ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@
-
-.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf:
- ./mandoc -Tpdf -Wall,stop $< >$@
-
.sgml.html:
validate --warn $<
sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@
diff --git a/contrib/mdocml/NEWS b/contrib/mdocml/NEWS
new file mode 100644
index 0000000000..784b89b0eb
--- /dev/null
+++ b/contrib/mdocml/NEWS
@@ -0,0 +1,331 @@
+$Id: NEWS,v 1.2 2013/10/05 13:15:51 schwarze Exp $
+
+This file lists the most important changes in the mdocml.bsd.lv distribution.
+
+Changes in version 1.12.2, released on Oktober 5, 2013
+
+ * The mdoc(7) to man(7) converter, to be called as mandoc -Tman,
+ is now fully functional.
+ * The mandoc(1) utility now supports the -Ios (default operating system)
+ input option, and the -Tutf8 output mode now actually works.
+ * The mandocdb(8) utility no longer truncates existing databases when
+ starting to build new ones, but only replaces them when the build
+ actually succeeds.
+ * The man(7) parser now supports the PD macro (paragraph distance),
+ and (for GNU man-ext compatibility only) EX (example block) and EE
+ (example end). Plus several bugfixes regarding indentation, line
+ breaks, and vertical spacing, and regarding RS following TP.
+ * The roff(7) parser now supports the \f(BI (bold+italic) font escape,
+ the \z (zero cursor advance) escape and the cc (change control
+ character) and it (input line trap) requests. Plus bugfixes regarding
+ the \t (tab) escape, nested escape sequences, and conditional requests.
+ * In mdoc(7), several bugs were fixed related to UTF-8 output of quoting
+ enclosures, delimiter handling, list indentation and horizontal and
+ vertical spacing, formatting of the Lk, %U, and %C macros, plus some
+ bugfixes related to the handling of syntax errors like badly nested
+ font blocks, stray Ta macros outside column lists, unterminated It Xo
+ blocks, and non-text children of Nm blocks.
+ * In tbl(7), the width of horizontal spans and the vertical spacing
+ around tables was corrected, and in man(7) files, a crash was fixed
+ that was triggered by some particular unclosed T{ macros.
+ * For mandoc developers, we now provide a tbl(3) library manual and
+ gmdiff, a very small, very simplistic groff-versus-mandoc output
+ comparison tool.
+ * Provide this NEWS file.
+
+Changes in version 1.12.1, released on March 23, 2012
+
+ * Significant work on apropos(1) and mandocdb(8). These tools are now
+ much more robust. A whatis(1) implementation is now handled as an
+ apropos(1) mode. These tools are also able to minimally handle
+ pre-formatted pages, that is, those already formatted by another
+ utility such as GNU troff.
+ * The man.cgi(7) script is also now available for wider testing.
+ It interfaces with mandocdb(8) manuals cached by catman(8).
+ HTML output is generated on-the-fly by libmandoc or internal
+ methods to convert pre-formatted pages.
+ * The mailing list archive for the discuss and tech lists are being
+ hosted by Gmane at gmane.comp.tools.mdocml.user and
+ gmane.comp.tools.mdocml.devel, respectively.
+
+Changes in version 1.12.0, released on October 8, 2011
+
+ * This version features a new, work-in-progress mandoc(1) output mode:
+ -Tman. This mode allows a system maintainer to distribute man(7)
+ media for older systems that may not natively support mdoc(7), such
+ as old Solaris systems.
+ * The -Ofragment option was added to mandoc(1)'s -Thtml and -Txhtml modes.
+ * While adding features, an apropos(1) utility has been merged from the
+ mandoc-tools sandbox. This interfaces with mandocdb(8) for semantic
+ search of manual content. apropos(1) is different from the traditional
+ apropos primarily in allowing keyword search (such as for functions,
+ utilities, etc.) and regular expressions. Note that the calling
+ syntax for apropos is likely to change as it settles down.
+ * In documentation news, the mdoc(7) and man(7) manuals have been
+ made considerably more readable by adding MACRO OVERVIEW sections, by
+ moving the gory details of the LANGUAGE SYNTAX to the roff(7) manual,
+ and by moving the very technical MACRO SYNTAX sections down to the
+ bottom of the page.
+ * Furthermore, for tbl(7), the -Tascii mode horizontal spacing of tables
+ was rewritten completely. It is now compatible with groff(1), both
+ with and without frames and rulers.
+ * Nesting of indented blocks is now supported in man(7), and several
+ bugs were fixed regarding indentation and alignment.
+ * The page headers in mdoc(7) are now nicer for very long titles.
+
+Changes in version 1.11.7, released on September 2, 2011
+
+ * Added demandoc(1) utility for stripping away macros and escapes.
+ This replaces the historical deroff(1) utility.
+ * Also improved the mdoc(7) and man(7) manuals.
+
+Changes in version 1.11.6, released on August 16, 2011
+
+ * Handling of tr macro in roff(7) implemented. This makes Perl
+ documentation much more readable. Hyphenation is also now enabled in
+ man(7) format documents. Many other general improvements have been
+ implemented.
+
+Changes in version 1.11.5, released on July 24, 2011
+
+ * Significant eqn(7) improvements. mdocml can now parse arbitrary eqn
+ input (although few GNU extensions are accepted, nor is mixing
+ low-level roff with eqn). See the eqn(7) manual for details.
+ For the time being, equations are rendered as simple in-line text.
+ The equation parser satisfies the language specified in the
+ Second Edition User's Guide:
+ http://www.kohala.com/start/troff/v7man/eqn/eqn2e.ps
+
+Changes in version 1.11.4, released on July 12, 2011
+
+ * Bug-fixes and clean-ups across all systems, especially in mandocdb(8)
+ and the man(7) parser. This release was significantly assisted by
+ participants in OpenBSD's c2k11. Thanks!
+
+Changes in version 1.11.3, released on May 26, 2011
+
+ * Introduce locale-encoding of output with the -Tlocale output option and
+ Unicode escaped-character input. See mandoc(1) and mandoc_char(7),
+ respectively, for details. This allows for non-ASCII characters (e.g.,
+ \[u5000]) to be rendered in the locale's encoding, if said environment
+ supports wide-character encoding (if it does not, -Tascii is used
+ instead). Locale support can be turned off at compile time by removing
+ -DUSE_WCHAR in the Makefile, in which case -Tlocale is always a synonym
+ for -Tascii.
+ * Furthermore, multibyte-encoded documents, such as those in UTF-8, may
+ be on-the-fly recoded into mandoc(1) input by using the newly-added
+ preconv(1) utility. Note: in the future, this feature may be
+ integrated into mandoc(1).
+
+Changes in version 1.11.2, released on May 12, 2011
+
+ * Corrected some installation issues in version 1.11.1.
+ * Further migration to libmandoc.
+ * Initial public release (this utility is very much under development)
+ of mandocdb(8). This utility produces keyword databases of manual
+ content, which features semantic querying of manual content.
+
+Changes in version 1.11.1, released on April 4, 2011
+
+ * The earlier libroff, libmdoc, and libman soup have been merged into
+ a single library, libmandoc, which manages all aspects of parsing
+ real manuals, from line-handling to tbl(7) parsing.
+ * Beyond this structural change, initial eqn(7) functionality is in
+ place. For the time being, this is limited to the recognition of
+ equation blocks; future version of mdocml will expand upon this
+ framework.
+ * As usual, many general fixes and improvements have also occurred.
+ In particular, a great deal of redundancy and superfluous code has
+ been removed with the merging of the backend libraries.
+
+Changes in version 1.10.9, released on January 7, 2011
+
+ * Many back-end fixes have been implemented: argument handling (quoting),
+ man(7) improvements, error/warning classes, and many more.
+ * Initial tbl(7) functionality (see the "TS", "TE", and "T&" macros in
+ the roff(7) manual) has been merged from tbl.bsd.lv. Output is still
+ minimal, especially for -Thtml and -Txhtml, but manages to at least
+ display data. This means that mandoc(1) now has built-in support
+ for two troff preprocessors via libroff: soelim(1) and tbl(1).
+
+Changes in version 1.10.8, released on December 24, 2010
+
+ * Significant improvements merged from OpenBSD downstream, including
+ - many new roff(7) components,
+ - in-line implementation of troff's soelim(1),
+ - broken-block handling,
+ - overhauled error classifications, and
+ - cleaned up handling of error conditions.
+ * Also overhauled the -Thtml and -Txhtml output modes. They now display
+ readable output in arbitrary browsers, including text-based ones like
+ lynx(1). See HTML and XHTML manuals in the DOCUMENTATION section
+ for examples. Attention: available style-sheet classes have been
+ considerably changed! See the example.style.css file for details.
+ Lastly, libmdoc and libman have been cleaned up and reduced in size
+ and complexity.
+
+Changes in version 1.10.6, released on September 27, 2010
+
+ * Calling conventions for mandoc(1) have changed: -W improved and -f
+ deprecated.
+ * Non-ASCII characters are also now uniformly discarded.
+ * Lots of documentation improvements.
+ * Many incremental fixes accomodating for groff's more interesting
+ productions.
+ * Lastly, pod2man(1) preambles are now fully accepted after some
+ considerable roff(7) and special character support.
+
+Changes in version 1.10.5, released on July 27, 2010
+
+ * Primarily a bug-fix and polish release, but including -Tpdf support
+ in mandoc(1) by way of "Summer of Code". Highlights:
+ * fix "Sm" and "Bd" handling
+ * fix end-of-sentence handling for embedded sentences
+ * polish man(7) documentation
+ * document all mdoc(7) macros
+ * polish mandoc(1) -Tps output
+ * lots of internal clean-ups in character escapes
+ * un-break literal contexts in man(7) documents
+ * improve -Thtml output for -man
+ * add mandoc(1) -Tpdf support
+
+Changes in version 1.10.4, released on July 12, 2010
+
+ * Lots of features developed during both "Summer of Code" and the
+ OpenBSD c2k10 hackathon:
+ * minimal "ds" roff(7) symbols are supported
+ * "Bk" mdoc(7) support
+ * beautified SYNOPSIS section output
+ * variable font-width and paper-size support in mandoc(1) -Tps output
+ * acceptance of scope-block breakage in mdoc(7)
+ * clarify error message status
+ * many minor bug-fixes and formatting issues resolved
+
+Changes in version 1.10.2, released on June 19, 2010
+
+ * Small release featuring text-decoration in -Tps output,
+ a few minor relaxations of errors, and some optimisations.
+
+Changes in version 1.10.1, released on June 7, 2010
+
+ * This primarily focusses on the "Bl" and "It" macros described in
+ mdoc(7). Multi-line column support is now fully compatible with groff,
+ as are implicit list entries for columns.
+ * Removed manuals(7) in favour of http://manpages.bsd.lv.
+ * The way we handle the SYNOPSIS section (see the SYNOPSIS documentation
+ in MANUAL STRUCTURE) has also been considerably simplified compared
+ to groff's method.
+ * Furthermore, the -Owidth=width output option has been added to -Tascii,
+ see mandoc(1).
+ * Lastly, initial PostScript output has been added with the -Tps option
+ to mandoc(1). It's brutally simple at the moment: fixed-font, with no
+ font decorations.
+
+Changes in version 1.10.0, released on May 29, 2010
+
+ * Release consisting of the results from the m2k10 hackathon and up-merge
+ from OpenBSD. This requires a significant note of thanks to Ingo
+ Schwarze (OpenBSD) and Joerg Sonnenberger (NetBSD) for their hard work,
+ and again to Joerg for hosting m2k10. Highlights (mostly cribbed from
+ Ingo's m2k10 report) follow in no particular order:
+ * a libroff preprocessor in front of libmdoc and libman stripping out
+ roff(7) instructions;
+ * end-of-sentence (EOS) detection in free-form and macro lines;
+ * correct handling of tab-separated columnar lists in mdoc(7);
+ * improved main calling routines to optionally use mmap(3) for better
+ performance;
+ * cleaned up exiting when invoked as -Tlint or over multiple files
+ with -fign-errors;
+ * error and warning message handling re-written to be unified for
+ libroff, libmdoc, and libman;
+ * handling of badly-nested explicit-scoped macros;
+ * improved free-form text parsing in libman and libmdoc;
+ * significant GNU troff compatibility improvements in -Tascii,
+ largely in terms of spacing;
+ * a regression framework for making sure the many fragilities of GNU
+ troff aren't trampled in subsequent work;
+ * support for -Tascii breaking at hyphens encountered in free-form text;
+ * and many more minor fixes and improvements
+
+Changes in version 1.9.25, released on May 13, 2010
+
+ * Fixed handling of "\*(Ba" escape.
+ * Backed out -fno-ign-chars (pointless complexity).
+ * Fixed erroneous breaking of literal lines.
+ * Fixed SYNOPSIS breaking lines before non-initial macros.
+ * Changed default section ordering.
+ * Most importantly, the framework for end-of-sentence double-spacing is
+ in place, now implemented for the "end-of-sentence, end-of-line" rule.
+ * This is a stable roll-back point before the mandoc hackathon in Rostock!
+
+Changes in version 1.9.24, released on May 9, 2010
+
+ * Rolled back break-at-hyphen.
+ * -DUGLY is now the default (no feature splits!).
+ * Free-form text is not de-chunked any more: lines are passed
+ whole-sale into the front-end, including whitespace.
+ * Added mailing lists.
+
+Changes in version 1.9.23, released on April 7, 2010
+
+ * mdocml has been linked to the OpenBSD build.
+ * This version incorporates many small changes, mostly from patches
+ by OpenBSD, allowing crufty manuals to slip by with warnings instead
+ of erroring-out.
+ * Some subtle semantic issues, such as punctuation scope, have also
+ been fixed.
+ * Lastly, some issues with -Thtml have been fixed, which prompted an
+ update to the online manual pages style layout.
+
+Changes in version 1.9.22, released on March 31, 2010
+
+ * Adjusted merge of the significant work by Ingo Schwarze
+ in getting "Xo" blocks (block full implicit, e.g., "It"
+ for non-columnar lists) to work properly. This isn't
+ enabled by default: you must specify -DUGLY as a compiler
+ flag (see the Makefile for details).
+
+Changes in version 1.9.20, released on March 30, 2010
+
+ * More efforts to get roff instructions in man(7) documents under
+ control. Note that roff instructions embedded in line-scoped,
+ next-line macros (e.g. "B") are not supported.
+ * Leading punctuation for mdoc(7) macros, such as "Fl ( ( a",
+ are now correctly handled.
+
+Changes in version 1.9.18, released on March 27, 2010
+
+ * Many fixes (largely pertaining to scope)
+ and improvements (e.g., handling of apostrophe-control macros,
+ which fixes the strange "BR" seen in some macro output)
+ to handling roff instructions in man(7) documents.
+
+Changes in version 1.9.17, released on March 25, 2010
+
+ * Accept perlpod(1) standard preamble.
+ * Also accept (and discard) "de", "dei", "am", "ami", and "ig"
+ roff macro blocks.
+
+Changes in version 1.9.16, released on March 22, 2010
+
+ * Inspired by patches and bug reports by Ingo Schwarze,
+ allowed man(7) to accept non-printing elements to be nested
+ within next-line scopes, such as "br" within "B" or "TH",
+ which is valid roff.
+ * Longsoon architecture also noted and Makefile cleaned up.
+
+Changes in version 1.9.15, released on February 18, 2010
+
+ * Moved to our new BSD.lv home.
+ * XHTML is now an acceptable output mode for mandoc(1);
+ * "Xr" made more compatible with groff;
+ * "Vt" fixed when invoked in SYNOPSIS;
+ * "\\" escape removed;
+ * end-of-line white-space detected for all lines;
+ * subtle bug fixed in list display for some modes;
+ * compatibility layer checked in for compilation in diverse
+ UNIX systems;
+ * and column lengths handled correctly.
+
+For older releases, see the ChangeLog files
+in http://mdocml.bsd.lv/snapshots/ .
diff --git a/contrib/mdocml/TODO b/contrib/mdocml/TODO
index a870136129..0aebbd38b4 100644
--- a/contrib/mdocml/TODO
+++ b/contrib/mdocml/TODO
@@ -1,25 +1,19 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $
+* $Id: TODO,v 1.157 2013/09/27 21:12:34 schwarze Exp $
************************************************************************
************************************************************************
-* parser bugs
+* crashes
************************************************************************
-- ".\}" on its own line gets translated to bare ".\&"
- which forces pset() into man(7)
- and then triggers an unknown macro error
- reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200
-
-************************************************************************
-* formatter bugs
-************************************************************************
-
-- tbl(7): Horizontal and vertical lines are formatted badly:
- With the box option, there is too much white space at the end of cells.
- Horizontal lines from "=" lines are a bit too long.
- yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400
+- .Bl -tag followed by a text node preceding the first .It should not
+ throw a FATAL error, but only a normal ERROR. Putting this into the
+ HEAD of an implicit .It might be cleanest, inserting an implicit .Pp
+ or just dumping the orphan stuff directly into the BODY of the .Bl
+ might be easier to implement, and all options can no doubt be made
+ to yield correct (i.e. groff bug-compatible) rendering.
+ Anthony J. Bentley on discuss@ Sun, 22 Sep 2013 16:33:21 -0600
************************************************************************
* missing features
@@ -27,15 +21,11 @@
--- missing roff features ----------------------------------------------
-- The pod2man preamble wants \h'...' with quoted numerical arguments,
- see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt.
+- roff.c should treat \n(.H>23 and \n(.V>19 in the pod2man(1)
+ preamble as true, see for example AUTHORS in MooseX::Getopt.3p
reported by Andreas Voegele
Tue, 22 Nov 2011 15:34:47 +0100 on ports@
-- .if n \{
- .br\}
- should cause an extra space to be raised.
-
- .ad (adjust margins)
.ad l -- adjust left margin only (flush left)
.ad r -- adjust right margin only (flush right)
@@ -45,19 +35,37 @@
.ad -- re-enable adjustment without changing the mode
Adjustment mode is ignored while in no-fill mode (.nf).
-- .it (line traps) occur in mysql(1), yasm_arch(7)
- generated by DocBook XSL Stylesheets v1.71.1
- reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500
-
+- .as (append to string)
+ found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200
+
+- .ce (center N lines)
+ found by naddy@ in xloadimage(1)
+ found by Juan Francisco Cantero Hurtado
+ in lang/racket(1) Thu, 20 Jun 2013 03:19:11 +0200
+
+- .fc (field control)
+ found by naddy@ in xloadimage(1)
+
- .ns (no-space mode) occurs in xine-config(1)
reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
-- xloadimage(1) wants .ti (temporary indent), rep by naddy@
-
- .ta (tab settings) occurs in ircbug(1) and probably gnats(1)
reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500
-- \c (interrupted text) occurs in chat(8)
+- .ti (temporary indent)
+ found by naddy@ in xloadimage(1)
+ found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600
+
+- .while and .shift
+ found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200
+
+- \c (interrupted text) should prevent the line break
+ even inside .Bd literal; that occurs in chat(8)
+ also found in cclive(1) - DocBook output
+
+- \h horizontal move
+ found in cclive(1) DocBook output
+ Anthony J. Bentley on discuss@ Sat, 21 Sep 2013 22:29:34 -0600
- using undefined strings or macros defines them to be empty
wl@ Mon, 14 Nov 2011 14:37:01 +0000
@@ -134,6 +142,8 @@
- groff an-ext.tmac macros (.UR, .UE) occur in xine(5)
reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
+ also occur in freeciv-client(6) freeciv-server(6) freeciv-modpack(6)
+ reported by bentley@ Tue, 30 Oct 2012 01:05:57 -0600
- -T[x]html doesn't stipulate non-collapsing spaces in literal mode
@@ -149,6 +159,15 @@
--- missing misc features ----------------------------------------------
+- The whatis(1) utility looks for whole words in Nm.
+ If the file name of a page does not agree with the contents of any
+ of its Nm macros (e.g. pool(9)), add the file name as an Nm entry
+ to the mandoc.db as well, such that whatis(1) finds it.
+ If there is a page with a file name that does not appear as a substring
+ neither in Nm nor in Nd, the same fix would allow finding that page
+ with apropos(1) using the file name as a key, as well.
+ Issue reported by tedu@ Fri, 05 Jul 2013 21:15:23 -0400
+
- clean up escape sequence handling, creating three classes:
(1) fully implemented, or parsed and ignored without loss of content
(2) unimplemented, potentially causing loss of content
@@ -156,14 +175,6 @@
see textproc/mgdiff(1) for nice examples
(3) undefined, just output the character -> perhaps WARNING
-- The \t escape sequence is the same as a literal tab, see for example
- the ASCII table in hexdump(1) where
- .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo
- .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq
- produces
- 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq
- and the example in oldrdist(1)
-
- look at pages generated from reStructeredText, e.g. devel/mercurial hg(1)
These are a weird mixture of man(7) and custom autogenerated low-level
roff stuff. Figure out to what extent we can cope.
@@ -188,9 +199,6 @@
so far, we only have it in roff(7) and man(7)
reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
-- perl(1) SYNOPSIS looks bad; reported by deraadt@
- 1) man(7) seems to need SYNOPSIS .Nm blocks, too
-
- In .Bl -column,
.It Em AuthenticationKey Length
ought to render "Key Length" with emphasis, too,
@@ -210,9 +218,18 @@
of in_line() - put trailing punctuation out of scope.
Found in mount_nfs(8) and exports(5), search for "Appendix".
+- Trailing punctuation after .%T triggers EOS spacing, at least
+ outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not
+ the right solution, it sends mandoc into an endless loop.
+ reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100
+
- in enclosures, mandoc sometimes fancies a bogus end of sentence
reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059
+- formatting /usr/local/man/man1/latex2man.1 with groff and mandoc
+ reveals lots of bugs both in groff and mandoc...
+ reported by bentley@ Wed, 22 May 2013 23:49:30 -0600
+
************************************************************************
* formatting issues: gratuitous differences
************************************************************************
@@ -225,18 +242,6 @@
is just "o\bo".
see for example OpenBSD ksh(1)
-- The characters "|" and "\*(Ba" should never be bold,
- not even in the middle of a word, e.g. ".Cm b\*(Bac" in
- "mknod [-m mode] name b|c major minor"
- in OpenBSD ksh(1)
-
-- A bogus .Pp between two .It must not produce a double blank line,
- see between -R and -r in OpenBSD rm(1), before "update" in mount(8),
- or in DIAGNOSTICS in init(8), or before "is always true" in ksh(1).
- The same happens with .Pp just before .El, see bgpd.conf(5).
- Also have `It' complain if `Pp' is invoked at certain times (not
- -compact?).
-
- .Pp between two .It in .Bl -column should produce one,
not two blank lines, see e.g. login.conf(5).
reported by jmc@ Sun, 17 Apr 2011 14:04:58 +0059
@@ -250,6 +255,10 @@
in between, see for example tmux(1).
reported by nicm@ 13 Jan 2011 00:18:57 +0000
+- Trailing punctuation after .It should trigger EOS spacing.
+ reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100
+ Probably, this should be fixed somewhere in termp_it_pre(), not sure.
+
- .Nx 1.0a
should be "NetBSD 1.0A", not "NetBSD 1.0a",
see OpenBSD ccdconfig(8).
@@ -265,6 +274,9 @@
as -width 7n, not -width 11n.
The same applies to .Bl -column column widths;
reported again by Nicolas Joly Thu, 1 Mar 2012 13:41:26 +0100 via wiz@ 5 Mar
+ reported again by Franco Fichtner Fri, 27 Sep 2013 21:02:28 +0200
+ An easy partial fix would be to just skip the first word if it starts
+ with a dot, including any following white space, when measuring.
- The \& zero-width character counts as output.
That is, when it is alone on a line between two .Pp,
@@ -277,56 +289,11 @@
Also, we don't want to break the line within the argument of:
.Fa "chtype tl"
-- .Ns should work when called at the end of an input line, see
- the following code in vi(1):
- .It Xo
- .Op Ar line
- .Cm a Ns Op Cm ppend Ns
- .Op Cm !\&
- .Xc
- The input text is appended after the specified line.
-
- Header lines of excessive length:
Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c
and document it in mdoc(7) and man(7) COMPATIBILITY
found while talking to Chris Bennett
-- In man(7), the sequence
- .HP
- one line of regular text
- .SH
- should not produce two blank lines before the .SH,
- see for example named-checkconf(8).
-
-- In man(7), the sequence
- .SH HEADER
-
- .PP
- regular text
- should not produce any blank lines between the header and the text,
- see for example rsync(1).
- Reported by naddy@ Mon, 28 Mar 2011 20:45:42 +0200
-
-- In man(7), the sequence
- regular text
- .IP
- .IP "tag"
- indented text
- should produce one, not four blank lines between the regular text
- and the tag, see for example rsync(1).
- Likewise,
- regular text
- .IP
- indented text
- should produce one, not two blank lines in between, and
- regular text
- .IP
- .RS
- .IP tag
- indented text
- should produce one, not three blank lines.
- Reported by naddy@ Mon, 28 Mar 2011 20:45:42 +0200
-
- trailing whitespace must be ignored even when followed by a font escape,
see for example
makes
@@ -334,12 +301,6 @@
operate in batch mode
in dig(1).
-************************************************************************
-* error reporting issues
-************************************************************************
-
-- .TP directly followed by .RS gives an assertion.
-
************************************************************************
* performance issues
************************************************************************
diff --git a/contrib/mdocml/apropos.1 b/contrib/mdocml/apropos.1
index 7dea132a46..5adfeb6c31 100644
--- a/contrib/mdocml/apropos.1
+++ b/contrib/mdocml/apropos.1
@@ -1,6 +1,6 @@
-.\" $Id: apropos.1,v 1.17 2012/03/24 01:46:25 kristaps Exp $
+.\" $Id: apropos.1,v 1.16.2.3 2013/10/05 01:25:20 schwarze Exp $
.\"
-.\" Copyright (c) 2011, 2012 Kristaps Dzonsons
+.\" Copyright (c) 2011 Kristaps Dzonsons
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 24 2012 $
+.Dd $Mdocdate: October 5 2013 $
.Dt APROPOS 1
.Os
.Sh NAME
@@ -23,8 +23,8 @@
.Sh SYNOPSIS
.Nm
.Op Fl C Ar file
-.Op Fl M Ar manpath
-.Op Fl m Ar manpath
+.Op Fl M Ar path
+.Op Fl m Ar path
.Op Fl S Ar arch
.Op Fl s Ar section
.Ar expression ...
@@ -44,11 +44,11 @@ searches for
databases in the default paths stipulated by
.Xr man 1 ,
parses terms as case-sensitive regular expressions
-over manual names and descriptions.
+.Pq the Li \&~ operator
+over manual names and descriptions
+.Pq the Li \&Nm No and Li \&Nd No macro keys .
Multiple terms imply pairwise
.Fl o .
-If standard output is a TTY, a result may be selected from a list and
-its manual displayed with the pager.
.Pp
Its arguments are as follows:
.Bl -tag -width Ds
@@ -58,13 +58,13 @@ Specify an alternative configuration
in
.Xr man.conf 5
format.
-.It Fl M Ar manpath
+.It Fl M Ar path
Use the colon-separated path instead of the default list of paths
searched for
.Xr mandocdb 8
databases.
Invalid paths, or paths without manual databases, are ignored.
-.It Fl m Ar manpath
+.It Fl m Ar path
Prepend the colon-separated paths to the list of paths searched
for
.Xr mandocdb 8
@@ -156,21 +156,13 @@ If an architecture is specified for the manual, it is displayed as
.Pp
.D1 title(cat/arch) \- description
.Pp
-If on a TTY, results are prefixed with a numeric identifier.
+Resulting manuals may be accessed as
.Pp
-.D1 [index] title(cat) \- description
+.Dl $ man \-s sec title
.Pp
-One may choose a manual be entering the index at the prompt.
-Valid choices are displayed using
-.Ev MANPAGER ,
-or failing that ,
-.Ev PAGER
-or just
-.Xr more 1 .
-Source pages are formatted with
-.Xr mandoc 1 ;
-preformatted pages with
-.Xr cat 1 .
+If an architecture is specified in the output, use
+.Pp
+.Dl $ man \-s sec \-S arch title
.Ss Macro Keys
Queries evaluate over a subset of
.Xr mdoc 7
@@ -248,14 +240,6 @@ Text production:
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
-.It Ev MANPAGER
-Default pager for manuals.
-If this is unset, falls back to
-.Ev Pager .
-.It Ev PAGER
-The second choice for a manual pager.
-If this is unset, use
-.Xr more 1 .
.It Ev MANPATH
Colon-separated paths modifying the default list of paths searched for
manual databases.
@@ -276,11 +260,11 @@ If none of these conditions are met, it overrides the default list.
.El
.Sh FILES
.Bl -tag -width "/etc/man.conf" -compact
-.It Pa whatis.db
+.It Pa mandoc.db
name of the
.Xr mandocdb 8
keyword database
-.It Pa whatis.index
+.It Pa mandoc.index
name of the
.Xr mandocdb 8
filename database
@@ -317,12 +301,11 @@ as variable names in the library category:
.Pp
.Dl $ apropos \-s 3 Va~^optind \-a Va~^optarg$
.Sh SEE ALSO
-.Xr more 1
+.Xr man 1 ,
.Xr re_format 7 ,
.Xr mandocdb 8
.Sh AUTHORS
The
.Nm
utility was written by
-.An Kristaps Dzonsons ,
-.Mt kristaps@bsd.lv .
+.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
diff --git a/contrib/mdocml/apropos.c b/contrib/mdocml/apropos.c
index 9c3cae96af..f5d1425f86 100644
--- a/contrib/mdocml/apropos.c
+++ b/contrib/mdocml/apropos.c
@@ -1,4 +1,4 @@
-/* $Id: apropos.c,v 1.30 2012/03/24 02:18:51 kristaps Exp $ */
+/* $Id: apropos.c,v 1.27.2.1 2013/09/17 23:23:10 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons
* Copyright (c) 2011 Ingo Schwarze
@@ -25,40 +25,29 @@
#include
#include
#include
-#include
#include "apropos_db.h"
#include "mandoc.h"
#include "manpath.h"
-#define SINGLETON(_res, _sz) \
- ((_sz) && (_res)[0].matched && \
- (1 == (_sz) || 0 == (_res)[1].matched))
-#define EMPTYSET(_res, _sz) \
- ((0 == (_sz)) || 0 == (_res)[0].matched)
-
static int cmp(const void *, const void *);
static void list(struct res *, size_t, void *);
-static void usage(void);
static char *progname;
int
main(int argc, char *argv[])
{
- int ch, rc, whatis, usecat;
+ int ch, rc, whatis;
struct res *res;
struct manpaths paths;
- const char *prog;
- pid_t pid;
- char path[PATH_MAX];
- int fds[2];
- size_t terms, ressz, sz;
+ size_t terms, ressz;
struct opts opts;
struct expr *e;
- char *defpaths, *auxpaths, *conf_file, *cp;
- extern int optind;
+ char *defpaths, *auxpaths;
+ char *conf_file;
extern char *optarg;
+ extern int optind;
progname = strrchr(argv[0], '/');
if (progname == NULL)
@@ -66,18 +55,16 @@ main(int argc, char *argv[])
else
++progname;
- whatis = 0 == strncmp(progname, "whatis", 6);
+ whatis = (0 == strncmp(progname, "whatis", 6));
memset(&paths, 0, sizeof(struct manpaths));
memset(&opts, 0, sizeof(struct opts));
- usecat = 0;
ressz = 0;
res = NULL;
auxpaths = defpaths = NULL;
conf_file = NULL;
e = NULL;
- path[0] = '\0';
while (-1 != (ch = getopt(argc, argv, "C:M:m:S:s:")))
switch (ch) {
@@ -97,15 +84,14 @@ main(int argc, char *argv[])
opts.cat = optarg;
break;
default:
- usage();
- return(EXIT_FAILURE);
+ goto usage;
}
argc -= optind;
argv += optind;
- if (0 == argc)
- return(EXIT_SUCCESS);
+ if (0 == argc)
+ goto usage;
rc = 0;
@@ -123,63 +109,21 @@ main(int argc, char *argv[])
(paths.sz, paths.paths, &opts,
e, terms, NULL, &ressz, &res, list);
- terms = 1;
-
if (0 == rc) {
fprintf(stderr, "%s: Bad database\n", progname);
goto out;
- } else if ( ! isatty(STDOUT_FILENO) || EMPTYSET(res, ressz))
- goto out;
-
- if ( ! SINGLETON(res, ressz)) {
- printf("Which manpage would you like [1]? ");
- fflush(stdout);
- if (NULL != (cp = fgetln(stdin, &sz)) &&
- sz > 1 && '\n' == cp[--sz]) {
- if ((ch = atoi(cp)) <= 0)
- goto out;
- terms = (size_t)ch;
- }
}
- if (--terms < ressz && res[terms].matched) {
- chdir(paths.paths[res[terms].volume]);
- strlcpy(path, res[terms].file, PATH_MAX);
- usecat = RESTYPE_CAT == res[terms].type;
- }
out:
manpath_free(&paths);
resfree(res, ressz);
exprfree(e);
+ return(rc ? EXIT_SUCCESS : EXIT_FAILURE);
- if ('\0' == path[0])
- return(rc ? EXIT_SUCCESS : EXIT_FAILURE);
-
- if (-1 == pipe(fds)) {
- perror(NULL);
- exit(EXIT_FAILURE);
- }
-
- if (-1 == (pid = fork())) {
- perror(NULL);
- exit(EXIT_FAILURE);
- } else if (pid > 0) {
- dup2(fds[0], STDIN_FILENO);
- close(fds[1]);
- prog = NULL != getenv("MANPAGER") ?
- getenv("MANPAGER") :
- (NULL != getenv("PAGER") ?
- getenv("PAGER") : "more");
- execlp(prog, prog, (char *)NULL);
- perror(prog);
- return(EXIT_FAILURE);
- }
-
- dup2(fds[1], STDOUT_FILENO);
- close(fds[0]);
- prog = usecat ? "cat" : "mandoc";
- execlp(prog, prog, path, (char *)NULL);
- perror(prog);
+usage:
+ fprintf(stderr, "usage: %s [-C file] [-M path] [-m path] "
+ "[-S arch] [-s section]%s ...\n", progname,
+ whatis ? " name" : "\n expression");
return(EXIT_FAILURE);
}
@@ -191,49 +135,22 @@ list(struct res *res, size_t sz, void *arg)
qsort(res, sz, sizeof(struct res), cmp);
- if (EMPTYSET(res, sz) || SINGLETON(res, sz))
- return;
-
- if ( ! isatty(STDOUT_FILENO))
- for (i = 0; i < sz && res[i].matched; i++)
- printf("%s(%s%s%s) - %.70s\n",
- res[i].title, res[i].cat,
- *res[i].arch ? "/" : "",
- *res[i].arch ? res[i].arch : "",
- res[i].desc);
- else
- for (i = 0; i < sz && res[i].matched; i++)
- printf("[%zu] %s(%s%s%s) - %.70s\n", i + 1,
- res[i].title, res[i].cat,
- *res[i].arch ? "/" : "",
- *res[i].arch ? res[i].arch : "",
- res[i].desc);
+ for (i = 0; i < sz; i++) {
+ if ( ! res[i].matched)
+ continue;
+ printf("%s(%s%s%s) - %.70s\n",
+ res[i].title,
+ res[i].cat,
+ *res[i].arch ? "/" : "",
+ *res[i].arch ? res[i].arch : "",
+ res[i].desc);
+ }
}
static int
cmp(const void *p1, const void *p2)
-{
- const struct res *r1 = p1;
- const struct res *r2 = p2;
-
- if (0 == r1->matched)
- return(1);
- else if (0 == r2->matched)
- return(1);
-
- return(strcasecmp(r1->title, r2->title));
-}
-
-static void
-usage(void)
{
- fprintf(stderr, "usage: %s "
- "[-C file] "
- "[-M manpath] "
- "[-m manpath] "
- "[-S arch] "
- "[-s section] "
- "expression ...\n",
- progname);
+ return(strcasecmp(((const struct res *)p1)->title,
+ ((const struct res *)p2)->title));
}
diff --git a/contrib/mdocml/apropos_db.c b/contrib/mdocml/apropos_db.c
index 8aea771da7..61002ee5d3 100644
--- a/contrib/mdocml/apropos_db.c
+++ b/contrib/mdocml/apropos_db.c
@@ -1,4 +1,4 @@
-/* $Id: apropos_db.c,v 1.31 2012/03/24 01:46:25 kristaps Exp $ */
+/* $Id: apropos_db.c,v 1.32.2.1 2013/10/02 21:03:26 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons
* Copyright (c) 2011 Ingo Schwarze
@@ -19,6 +19,8 @@
#include "config.h"
#endif
+#include
+
#include
#include
#include
@@ -35,6 +37,7 @@
# include
# include
#else
+# include
# include
#endif
@@ -426,6 +429,7 @@ apropos_search(int pathsz, char **paths, const struct opts *opts,
*/
for (i = 0; i < pathsz; i++) {
+ assert('/' == paths[i][0]);
if (chdir(paths[i]))
continue;
if (single_search(&tree, opts, expr, terms, mc, i))
diff --git a/contrib/mdocml/arch.in b/contrib/mdocml/arch.in
index 5113446e46..d0c445f308 100644
--- a/contrib/mdocml/arch.in
+++ b/contrib/mdocml/arch.in
@@ -1,4 +1,4 @@
-/* $Id: arch.in,v 1.12 2012/01/28 14:02:17 joerg Exp $ */
+/* $Id: arch.in,v 1.14 2013/09/16 22:12:57 schwarze Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons
*
@@ -38,9 +38,9 @@ LINE("arm", "ARM")
LINE("arm26", "ARM26")
LINE("arm32", "ARM32")
LINE("armish", "ARMISH")
+LINE("armv7", "ARMv7")
LINE("aviion", "AViiON")
LINE("atari", "ATARI")
-LINE("beagle", "Beagle")
LINE("bebox", "BeBox")
LINE("cats", "cats")
LINE("cesfic", "CESFIC")
@@ -81,6 +81,7 @@ LINE("netwinder", "NetWinder")
LINE("news68k", "NeWS68k")
LINE("newsmips", "NeWSMIPS")
LINE("next68k", "NeXT68k")
+LINE("octeon", "OCTEON")
LINE("ofppc", "OFPPC")
LINE("palm", "Palm")
LINE("pc532", "PC532")
diff --git a/contrib/mdocml/catman.c b/contrib/mdocml/catman.c
index 1d313ea6e0..c755d27057 100644
--- a/contrib/mdocml/catman.c
+++ b/contrib/mdocml/catman.c
@@ -1,4 +1,4 @@
-/* $Id: catman.c,v 1.10 2012/01/03 15:17:20 kristaps Exp $ */
+/* $Id: catman.c,v 1.11 2012/06/08 10:33:48 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons
*
@@ -380,7 +380,8 @@ manup(const struct manpaths *dirs, char *base)
char dst[MAXPATHLEN],
src[MAXPATHLEN];
const char *path;
- int i, c;
+ size_t i;
+ int c;
size_t sz;
FILE *f;
diff --git a/contrib/mdocml/cgi.c b/contrib/mdocml/cgi.c
index 2f5870ff8e..6d40fcde42 100644
--- a/contrib/mdocml/cgi.c
+++ b/contrib/mdocml/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.42 2012/03/24 01:46:25 kristaps Exp $ */
+/* $Id: cgi.c,v 1.45 2013/06/05 02:00:26 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons
*
@@ -18,7 +18,6 @@
#include "config.h"
#endif
-#include
#include
#include
@@ -726,14 +725,14 @@ format(const struct req *req, const char *file)
struct man *man;
void *vp;
enum mandoclevel rc;
- char opts[MAXPATHLEN + 128];
+ char opts[PATH_MAX + 128];
if (-1 == (fd = open(file, O_RDONLY, 0))) {
resp_baddb();
return;
}
- mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL);
+ mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL, NULL);
rc = mparse_readfd(mp, fd, file);
close(fd);
@@ -743,7 +742,7 @@ format(const struct req *req, const char *file)
}
snprintf(opts, sizeof(opts), "fragment,"
- "man=%s/search.html?sec=%%S&expr=%%N,"
+ "man=%s/search.html?sec=%%S&expr=Nm~^%%N$,"
/*"includes=/cgi-bin/man.cgi/usr/include/%%I"*/,
progname);
@@ -777,7 +776,7 @@ pg_show(const struct req *req, char *path)
struct manpaths ps;
size_t sz;
char *sub;
- char file[MAXPATHLEN];
+ char file[PATH_MAX];
const char *cp;
int rc, catm;
unsigned int vol, rec, mr;
@@ -831,10 +830,10 @@ pg_show(const struct req *req, char *path)
goto out;
}
- sz = strlcpy(file, ps.paths[vol], MAXPATHLEN);
- assert(sz < MAXPATHLEN);
- strlcat(file, "/", MAXPATHLEN);
- strlcat(file, MANDOC_IDX, MAXPATHLEN);
+ sz = strlcpy(file, ps.paths[vol], PATH_MAX);
+ assert(sz < PATH_MAX);
+ strlcat(file, "/", PATH_MAX);
+ strlcat(file, MANDOC_IDX, PATH_MAX);
/* Open the index recno(3) database. */
@@ -863,8 +862,8 @@ pg_show(const struct req *req, char *path)
resp_baddb();
else {
file[(int)sz] = '\0';
- strlcat(file, "/", MAXPATHLEN);
- strlcat(file, cp, MAXPATHLEN);
+ strlcat(file, "/", PATH_MAX);
+ strlcat(file, cp, PATH_MAX);
if (catm)
catman(req, file);
else
@@ -973,7 +972,7 @@ int
main(void)
{
int i;
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
DIR *cwd;
struct req req;
char *p, *path, *subpath;
@@ -1010,7 +1009,7 @@ main(void)
memset(&req, 0, sizeof(struct req));
- strlcpy(buf, ".", MAXPATHLEN);
+ strlcpy(buf, ".", PATH_MAX);
pathgen(cwd, buf, &req);
closedir(cwd);
@@ -1120,8 +1119,8 @@ pathgen(DIR *dir, char *path, struct req *req)
int rc;
size_t sz, ssz;
- sz = strlcat(path, "/", MAXPATHLEN);
- if (sz >= MAXPATHLEN) {
+ sz = strlcat(path, "/", PATH_MAX);
+ if (sz >= PATH_MAX) {
fprintf(stderr, "%s: Path too long", path);
return;
}
@@ -1138,9 +1137,9 @@ pathgen(DIR *dir, char *path, struct req *req)
continue;
path[(int)sz] = '\0';
- ssz = strlcat(path, d->d_name, MAXPATHLEN);
+ ssz = strlcat(path, d->d_name, PATH_MAX);
- if (ssz >= MAXPATHLEN) {
+ if (ssz >= PATH_MAX) {
fprintf(stderr, "%s: Path too long", path);
return;
} else if (NULL == (cd = opendir(path))) {
@@ -1187,9 +1186,9 @@ pathgen(DIR *dir, char *path, struct req *req)
continue;
path[(int)sz] = '\0';
- ssz = strlcat(path, d->d_name, MAXPATHLEN);
+ ssz = strlcat(path, d->d_name, PATH_MAX);
- if (ssz >= MAXPATHLEN) {
+ if (ssz >= PATH_MAX) {
fprintf(stderr, "%s: Path too long", path);
return;
} else if (NULL == (cd = opendir(path))) {
diff --git a/contrib/mdocml/chars.c b/contrib/mdocml/chars.c
index ce03347b5d..3ad1f57471 100644
--- a/contrib/mdocml/chars.c
+++ b/contrib/mdocml/chars.c
@@ -1,4 +1,4 @@
-/* $Id: chars.c,v 1.52 2011/11/08 00:15:23 kristaps Exp $ */
+/* $Id: chars.c,v 1.54 2013/06/20 22:39:30 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons
* Copyright (c) 2011 Ingo Schwarze
@@ -37,7 +37,7 @@ struct ln {
int unicode;
};
-#define LINES_MAX 328
+#define LINES_MAX 329
#define CHAR(in, ch, code) \
{ NULL, (in), (ch), (code) },
@@ -77,7 +77,7 @@ mchars_alloc(void)
*/
tab = mandoc_malloc(sizeof(struct mchars));
- htab = mandoc_calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
+ htab = mandoc_calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln *));
for (i = 0; i < LINES_MAX; i++) {
hash = (int)lines[i].code[0] - PRINT_LO;
diff --git a/contrib/mdocml/chars.in b/contrib/mdocml/chars.in
index a4c45b3c43..cc6549e7e5 100644
--- a/contrib/mdocml/chars.in
+++ b/contrib/mdocml/chars.in
@@ -1,4 +1,4 @@
-/* $Id: chars.in,v 1.42 2011/10/02 10:02:26 kristaps Exp $ */
+/* $Id: chars.in,v 1.43 2013/06/20 22:39:30 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons
*
@@ -42,6 +42,7 @@ CHAR("&", "", 0)
CHAR("^", "", 0)
CHAR("|", "", 0)
CHAR("}", "", 0)
+CHAR("t", "", 0)
/* Accents. */
CHAR("a\"", "\"", 779)
diff --git a/contrib/mdocml/config.h.post b/contrib/mdocml/config.h.post
index 39da2b2f06..cee82aa1c3 100644
--- a/contrib/mdocml/config.h.post
+++ b/contrib/mdocml/config.h.post
@@ -15,14 +15,13 @@
# 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)
+#ifndef HAVE_BETOH64
+# if defined(__APPLE__)
+# define betoh64(x) OSSwapBigToHostInt64(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# else
+# define betoh64(x) be64toh(x)
+# endif
#endif
#ifndef HAVE_STRLCAT
diff --git a/contrib/mdocml/demandoc.1 b/contrib/mdocml/demandoc.1
index 845b9c14b5..84571baf30 100644
--- a/contrib/mdocml/demandoc.1
+++ b/contrib/mdocml/demandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: demandoc.1,v 1.6 2011/12/25 19:35:44 kristaps Exp $
+.\" $Id: demandoc.1,v 1.7 2013/07/13 19:41:16 schwarze Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 25 2011 $
+.Dd $Mdocdate: July 13 2013 $
.Dt DEMANDOC 1
.Os
.Sh NAME
@@ -105,5 +105,4 @@ documents.
The
.Nm
utility was written by
-.An Kristaps Dzonsons ,
-.Mt kristaps@bsd.lv .
+.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
diff --git a/contrib/mdocml/demandoc.c b/contrib/mdocml/demandoc.c
index 2474a358e2..aad42085b1 100644
--- a/contrib/mdocml/demandoc.c
+++ b/contrib/mdocml/demandoc.c
@@ -1,4 +1,4 @@
-/* $Id: demandoc.c,v 1.6 2011/09/01 22:25:53 kristaps Exp $ */
+/* $Id: demandoc.c,v 1.7 2012/05/31 22:27:14 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons
*
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL);
+ mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL, NULL);
assert(mp);
if (0 == argc)
diff --git a/contrib/mdocml/eqn.7 b/contrib/mdocml/eqn.7
index f86b9c496b..dcbad41cc1 100644
--- a/contrib/mdocml/eqn.7
+++ b/contrib/mdocml/eqn.7
@@ -1,4 +1,4 @@
-.\" $Id: eqn.7,v 1.28 2011/09/25 18:37:09 schwarze Exp $
+.\" $Id: eqn.7,v 1.29 2013/07/13 19:41:16 schwarze Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 25 2011 $
+.Dd $Mdocdate: July 13 2013 $
.Dt EQN 7
.Os
.Sh NAME
@@ -276,5 +276,4 @@ was added in 2011.
This
.Nm
reference was written by
-.An Kristaps Dzonsons ,
-.Mt kristaps@bsd.lv .
+.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
diff --git a/contrib/mdocml/gmdiff b/contrib/mdocml/gmdiff
new file mode 100644
index 0000000000..a5bca9d31c
--- /dev/null
+++ b/contrib/mdocml/gmdiff
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (c) 2013 Ingo Schwarze
+#
+# 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.
+
+if [ `id -u` -eq 0 ]; then
+ echo "$0: do not run me as root"
+ exit 1
+fi
+
+if [ $# -eq 0 ]; then
+ echo "usage: $0 manual_source_file ..."
+ exit 1
+fi
+
+while [ -n "$1" ]; do
+ file=$1
+ shift
+ echo " ========== $file ========== "
+ tbl $file | groff -mandoc -Tascii -P -c 2>&1 > /tmp/groff.out
+ mandoc -Ios='OpenBSD ports' -Werror $file 2>&1 > /tmp/mandoc.out
+ diff -au /tmp/groff.out /tmp/mandoc.out 2>&1
+done
+
+exit 0
diff --git a/contrib/mdocml/html.c b/contrib/mdocml/html.c
index 326df035fc..9d28b4270e 100644
--- a/contrib/mdocml/html.c
+++ b/contrib/mdocml/html.c
@@ -1,7 +1,7 @@
-/* $Id: html.c,v 1.150 2011/10/05 21:35:17 kristaps Exp $ */
+/* $Id: html.c,v 1.152 2013/08/08 20:07:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons
- * Copyright (c) 2011 Ingo Schwarze
+ * Copyright (c) 2011, 2012, 2013 Ingo Schwarze
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -235,6 +235,9 @@ print_metaf(struct html *h, enum mandoc_esc deco)
case (ESCAPE_FONTBOLD):
font = HTMLFONT_BOLD;
break;
+ case (ESCAPE_FONTBI):
+ font = HTMLFONT_BI;
+ break;
case (ESCAPE_FONT):
/* FALLTHROUGH */
case (ESCAPE_FONTROMAN):
@@ -253,17 +256,27 @@ print_metaf(struct html *h, enum mandoc_esc deco)
h->metal = h->metac;
h->metac = font;
- if (HTMLFONT_NONE != font)
- h->metaf = HTMLFONT_BOLD == font ?
- print_otag(h, TAG_B, 0, NULL) :
- print_otag(h, TAG_I, 0, NULL);
+ switch (font) {
+ case (HTMLFONT_ITALIC):
+ h->metaf = print_otag(h, TAG_I, 0, NULL);
+ break;
+ case (HTMLFONT_BOLD):
+ h->metaf = print_otag(h, TAG_B, 0, NULL);
+ break;
+ case (HTMLFONT_BI):
+ h->metaf = print_otag(h, TAG_B, 0, NULL);
+ print_otag(h, TAG_I, 0, NULL);
+ break;
+ default:
+ break;
+ }
}
int
html_strlen(const char *cp)
{
- int ssz, sz;
- const char *seq, *p;
+ size_t rsz;
+ int skip, sz;
/*
* Account for escaped sequences within string length
@@ -274,10 +287,21 @@ html_strlen(const char *cp)
*/
sz = 0;
- while (NULL != (p = strchr(cp, '\\'))) {
- sz += (int)(p - cp);
- ++cp;
- switch (mandoc_escape(&cp, &seq, &ssz)) {
+ skip = 0;
+ while (1) {
+ rsz = strcspn(cp, "\\");
+ if (rsz) {
+ cp += rsz;
+ if (skip) {
+ skip = 0;
+ rsz--;
+ }
+ sz += rsz;
+ }
+ if ('\0' == *cp)
+ break;
+ cp++;
+ switch (mandoc_escape(&cp, NULL, NULL)) {
case (ESCAPE_ERROR):
return(sz);
case (ESCAPE_UNICODE):
@@ -285,15 +309,19 @@ html_strlen(const char *cp)
case (ESCAPE_NUMBERED):
/* FALLTHROUGH */
case (ESCAPE_SPECIAL):
- sz++;
+ if (skip)
+ skip = 0;
+ else
+ sz++;
+ break;
+ case (ESCAPE_SKIPCHAR):
+ skip = 1;
break;
default:
break;
}
}
-
- assert(sz >= 0);
- return(sz + strlen(cp));
+ return(sz);
}
static int
@@ -308,6 +336,12 @@ print_encode(struct html *h, const char *p, int norecurse)
nospace = 0;
while ('\0' != *p) {
+ if (HTML_SKIPCHAR & h->flags && '\\' != *p) {
+ h->flags &= ~HTML_SKIPCHAR;
+ p++;
+ continue;
+ }
+
sz = strcspn(p, rejs);
fwrite(p, 1, sz, stdout);
@@ -337,6 +371,33 @@ print_encode(struct html *h, const char *p, int norecurse)
if (ESCAPE_ERROR == esc)
break;
+ switch (esc) {
+ case (ESCAPE_FONT):
+ /* FALLTHROUGH */
+ case (ESCAPE_FONTPREV):
+ /* FALLTHROUGH */
+ case (ESCAPE_FONTBOLD):
+ /* FALLTHROUGH */
+ case (ESCAPE_FONTITALIC):
+ /* FALLTHROUGH */
+ case (ESCAPE_FONTBI):
+ /* FALLTHROUGH */
+ case (ESCAPE_FONTROMAN):
+ if (0 == norecurse)
+ print_metaf(h, esc);
+ continue;
+ case (ESCAPE_SKIPCHAR):
+ h->flags |= HTML_SKIPCHAR;
+ continue;
+ default:
+ break;
+ }
+
+ if (h->flags & HTML_SKIPCHAR) {
+ h->flags &= ~HTML_SKIPCHAR;
+ continue;
+ }
+
switch (esc) {
case (ESCAPE_UNICODE):
/* Skip passed "u" header. */
@@ -356,19 +417,6 @@ print_encode(struct html *h, const char *p, int norecurse)
else if (-1 == c && 1 == len)
putchar((int)*seq);
break;
- case (ESCAPE_FONT):
- /* FALLTHROUGH */
- case (ESCAPE_FONTPREV):
- /* FALLTHROUGH */
- case (ESCAPE_FONTBOLD):
- /* FALLTHROUGH */
- case (ESCAPE_FONTITALIC):
- /* FALLTHROUGH */
- case (ESCAPE_FONTROMAN):
- if (norecurse)
- break;
- print_metaf(h, esc);
- break;
case (ESCAPE_NOSPACE):
if ('\0' == *p)
nospace = 1;
@@ -511,10 +559,20 @@ print_text(struct html *h, const char *word)
}
assert(NULL == h->metaf);
- if (HTMLFONT_NONE != h->metac)
- h->metaf = HTMLFONT_BOLD == h->metac ?
- print_otag(h, TAG_B, 0, NULL) :
- print_otag(h, TAG_I, 0, NULL);
+ switch (h->metac) {
+ case (HTMLFONT_ITALIC):
+ h->metaf = print_otag(h, TAG_I, 0, NULL);
+ break;
+ case (HTMLFONT_BOLD):
+ h->metaf = print_otag(h, TAG_B, 0, NULL);
+ break;
+ case (HTMLFONT_BI):
+ h->metaf = print_otag(h, TAG_B, 0, NULL);
+ print_otag(h, TAG_I, 0, NULL);
+ break;
+ default:
+ break;
+ }
assert(word);
if ( ! print_encode(h, word, 0)) {
diff --git a/contrib/mdocml/html.h b/contrib/mdocml/html.h
index 60960702f1..894cfc4cff 100644
--- a/contrib/mdocml/html.h
+++ b/contrib/mdocml/html.h
@@ -1,4 +1,4 @@
-/* $Id: html.h,v 1.47 2011/10/05 21:35:17 kristaps Exp $ */
+/* $Id: html.h,v 1.49 2013/08/08 20:07:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons
*
@@ -75,6 +75,7 @@ enum htmlfont {
HTMLFONT_NONE = 0,
HTMLFONT_BOLD,
HTMLFONT_ITALIC,
+ HTMLFONT_BI,
HTMLFONT_MAX
};
@@ -117,6 +118,7 @@ struct html {
#define HTML_PREKEEP (1 << 3)
#define HTML_NONOSPACE (1 << 4) /* never add spaces */
#define HTML_LITERAL (1 << 5) /* literal (e.g., ) context */
+#define HTML_SKIPCHAR (1 << 6) /* skip the next character */
struct tagq tags; /* stack of open tags */
struct rofftbl tbl; /* current table */
struct tag *tblt; /* current open table scope */
diff --git a/contrib/mdocml/index.sgml b/contrib/mdocml/index.sgml
index 4386a9ebd9..e716635702 100644
--- a/contrib/mdocml/index.sgml
+++ b/contrib/mdocml/index.sgml
@@ -25,7 +25,7 @@
pages whilst providing token support for man.
- Why? groff amounts to over 5 MB of source code, most of which is C++ and all of which is GPL. It runs slowly, produces
+ Why? groff amounts to over 5 MB of source code, most of which is C++ and GPL version 3. It runs slowly, produces
uncertain output, and varies in operation from system to system. mdocml strives to fix this (respectively small, C, ISC-licensed, fast and regular).
@@ -55,15 +55,6 @@
run make install
. Be careful: the preconv, apropos, and whatis binary names are
usually taken by existing utilities.
-
-
- Binary archives consist of pre-compiled binaries, manuals, and other necessary files.
- Universal (Mac OS X) binaries are compiled for the PCC, i386, and x86_64 architectures.
- Windows binaries are compiled with MingW for the 32-bit (i686) and
- 64-bit (x86_64) architectures.
-
Downstream
@@ -80,37 +71,52 @@
DragonFly BSD |
- usr.bin/mandoc
+ contrib/mdocml (1.12.1 sources)
+ lib/libmandoc
+ usr.bin/mandoc (build system)
+ |
+
+
+ FreeBSD 10.0, -CURRENT |
+
+ contrib/mdocml (1.12.1 sources)
+ usr.bin/mandoc (build system)
|
- FreeBSD |
+ FreeBSD 9.x, 8.x |
- ports/textproc/mdocml
+ ports/textproc/mdocml (1.12.1 port)
|
NetBSD |
- src/external/bsd/mdocml
+ src/external/bsd/mdocml (1.12.1 sources plus patches and build system)
|
OpenBSD |
- src/usr.bin/mandoc
+ src/usr.bin/mandoc (1.12.2 sources and build system)
|
pkgsrc |
- textproc/mdocml
+ textproc/mdocml (1.12.0 port)
|
Minix3 |
- external/bsd/mdocml
+ external/bsd/mdocml (1.10.9 sources and build system)
+ |
+
+
+ Alpine Linux |
+
+ aports/main/mdocml (1.12.1 port)
|
@@ -131,150 +137,96 @@
apropos(1) |
search the manual page database
- (text |
- xhtml |
- pdf |
- ps)
|
demandoc(1) |
emit only text of UNIX manuals
- (text |
- xhtml |
- pdf |
- ps)
|
mandoc(1) |
format and display UNIX manuals
- (text |
- xhtml |
- pdf |
- ps)
|
preconv(1) |
recode multibyte UNIX manuals
- (text |
- xhtml |
- pdf |
- ps)
|
whatis(1) |
search the manual page database
- (text |
- xhtml |
- pdf |
- ps)
|
mandoc(3) |
mandoc macro compiler library
- (text |
- xhtml |
- pdf |
- ps)
|
- man(7) |
+ tbl(3) |
- man language reference
- (text |
- xhtml |
- pdf |
- ps)
+ roff table parser library for mandoc
|
- man.cgi(7) |
+ eqn(7) |
- cgi for manpage query and display
- (text |
- xhtml |
- pdf |
- ps)
+ eqn-mandoc language reference
|
- eqn(7) |
+ man(7) |
- eqn-mandoc language reference
- (text |
- xhtml |
- pdf |
- ps)
+ man language reference
+ |
+
+
+ man.cgi(7) |
+
+ cgi for manpage query and display
|
mandoc_char(7) |
mandoc special characters
- (text |
- xhtml |
- pdf |
- ps)
|
mdoc(7) |
mdoc language reference
- (text |
- xhtml |
- pdf |
- ps)
|
roff(7) |
roff-mandoc language reference
- (text |
- xhtml |
- pdf |
- ps)
|
tbl(7) |
tbl-mandoc language reference
- (text |
- xhtml |
- pdf |
- ps)
|
catman(8) |
update a man.cgi manpage cache
- (text |
- xhtml |
- pdf |
- ps)
|
mandocdb(8) |
index UNIX manuals
- (text |
- xhtml |
- pdf |
- ps)
|
@@ -325,6 +277,52 @@
+
+ 02-10-2013: version 1.12.2
+
+
+ The mdoc(7) to man(7) converter,
+ to be called as mandoc -Tman
, is now fully functional.
+
+
+ The mandoc(1) utility now supports the -Ios
(default operating system)
+ input option, and the -Tutf8
output mode now actually works.
+
+
+ The mandocdb(8) utility no longer truncates existing databases when starting to build new ones,
+ but only replaces them when the build actually succeeds.
+
+
+ The man(7) parser now supports the PD macro (paragraph distance),
+ and (for GNU man-ext compatibility only) EX (example block) and EE (example end).
+ Plus several bugfixes regarding indentation, line breaks, and vertical spacing,
+ and regarding RS following TP.
+
+
+ The roff(7) parser now supports the \f(BI (bold+italic) font escape,
+ the \z (zero cursor advance) escape and the cc (change control character)
+ and it (input line trap) requests.
+ Plus bugfixes regarding the \t (tab) escape, nested escape sequences, and conditional requests.
+
+
+ In mdoc(7), several bugs were fixed related to UTF-8 output of quoting enclosures,
+ delimiter handling, list indentation and horizontal and vertical spacing,
+ formatting of the Lk, %U, and %C macros,
+ plus some bugfixes related to the handling of syntax errors like badly nested font blocks,
+ stray Ta macros outside column lists, unterminated It Xo blocks,
+ and non-text children of Nm blocks.
+
+
+ In tbl(7), the width of horizontal spans and the vertical spacing around tables was corrected,
+ and in man(7) files, a crash was fixed that was triggered by some particular unclosed T{ macros.
+
+
+ For mandoc developers, we now provide a tbl(3) library manual and gmdiff
,
+ a very small, very simplistic groff-versus-mandoc output comparison tool.
+
+
+ See NEWS for historical notes.
+
23-03-2011: version 1.12.1
@@ -357,7 +355,8 @@
Copyright © 2008–2011
Kristaps Dzonsons,
- $Date: 2012/03/24 02:07:32 $
+ © 2013 Ingo Schwarze,
+ $Date: 2013/10/05 14:05:09 $