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.5:
details: https://anonhg.NetBSD.org/src/rev/c227238aaa06
branches: trunk
changeset: 756665:c227238aaa06
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Jul 27 22:34:54 2010 +0000
description:
Import mdocml 1.10.5:
- Initial support for PDF output
- Improved support for various roff commands
diffstat:
external/bsd/mdocml/dist/Makefile | 32 +-
external/bsd/mdocml/dist/arch.in | 4 +-
external/bsd/mdocml/dist/chars.c | 98 ++-
external/bsd/mdocml/dist/chars.h | 8 +-
external/bsd/mdocml/dist/chars.in | 744 ++++++++++++------------
external/bsd/mdocml/dist/html.c | 48 +-
external/bsd/mdocml/dist/html.h | 5 +-
external/bsd/mdocml/dist/libman.h | 4 +-
external/bsd/mdocml/dist/libmandoc.h | 6 +-
external/bsd/mdocml/dist/libmdoc.h | 4 +-
external/bsd/mdocml/dist/main.c | 37 +-
external/bsd/mdocml/dist/main.h | 5 +-
external/bsd/mdocml/dist/man.7 | 142 ++--
external/bsd/mdocml/dist/man.c | 7 +-
external/bsd/mdocml/dist/man.h | 3 +-
external/bsd/mdocml/dist/man_action.c | 3 +-
external/bsd/mdocml/dist/man_html.c | 85 ++-
external/bsd/mdocml/dist/man_macro.c | 3 +-
external/bsd/mdocml/dist/man_validate.c | 55 +-
external/bsd/mdocml/dist/mandoc.1 | 18 +-
external/bsd/mdocml/dist/mandoc.c | 267 ++++----
external/bsd/mdocml/dist/mandoc.h | 3 +-
external/bsd/mdocml/dist/mdoc.7 | 943 +++++++++++++++++++-----------
external/bsd/mdocml/dist/mdoc.c | 4 +-
external/bsd/mdocml/dist/mdoc.h | 65 +-
external/bsd/mdocml/dist/mdoc_argv.c | 12 +-
external/bsd/mdocml/dist/mdoc_html.c | 42 +-
external/bsd/mdocml/dist/mdoc_macro.c | 6 +-
external/bsd/mdocml/dist/mdoc_validate.c | 49 +-
external/bsd/mdocml/dist/out.c | 291 +++------
external/bsd/mdocml/dist/out.h | 8 +-
external/bsd/mdocml/dist/roff.3 | 5 +-
external/bsd/mdocml/dist/roff.7 | 13 +-
external/bsd/mdocml/dist/roff.c | 47 +-
external/bsd/mdocml/dist/st.in | 4 +-
external/bsd/mdocml/dist/term.c | 71 +-
external/bsd/mdocml/dist/term.h | 12 +-
external/bsd/mdocml/dist/term_ascii.c | 4 +-
external/bsd/mdocml/dist/term_ps.c | 309 ++++++++-
39 files changed, 2000 insertions(+), 1466 deletions(-)
diffs (truncated from 5870 to 300 lines):
diff -r 0ceba22111c9 -r c227238aaa06 external/bsd/mdocml/dist/Makefile
--- a/external/bsd/mdocml/dist/Makefile Tue Jul 27 22:27:52 2010 +0000
+++ b/external/bsd/mdocml/dist/Makefile Tue Jul 27 22:34:54 2010 +0000
@@ -1,4 +1,4 @@
-.SUFFIXES: .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.txt .3.txt .7.txt .1.sgml .3.sgml .7.sgml .h .h.html .1.ps .3.ps .7.ps
+.SUFFIXES: .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.txt .3.txt .7.txt .1.sgml .3.sgml .7.sgml .h .h.html .1.ps .3.ps .7.ps .1.pdf .3.pdf .7.pdf
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
@@ -12,8 +12,8 @@
INSTALL_LIB = $(INSTALL) -m 0644
INSTALL_MAN = $(INSTALL_DATA)
-VERSION = 1.10.4
-VDATE = 12 July 2010
+VERSION = 1.10.5
+VDATE = 27 July 2010
VFLAGS = -DVERSION="\"$(VERSION)\""
WFLAGS = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
@@ -25,12 +25,6 @@
LINTFLAGS += $(VFLAGS)
-MANDOCFLAGS = -Wall -fstrict
-
-MANDOCHTML = -Thtml -Ostyle=style.css,man=%N.%S.html,includes=%I.html
-
-MANDOCPS = -Tps
-
ROFFLNS = roff.ln
ROFFSRCS = roff.c
@@ -110,6 +104,9 @@
PSS = mandoc.1.ps mdoc.3.ps man.3.ps mdoc.7.ps man.7.ps \
mandoc_char.7.ps roff.7.ps roff.3.ps
+PDFS = mandoc.1.pdf mdoc.3.pdf man.3.pdf mdoc.7.pdf man.7.pdf \
+ mandoc_char.7.pdf roff.7.pdf roff.3.pdf
+
XSLS = ChangeLog.xsl
TEXTS = mandoc.1.txt mdoc.3.txt man.3.txt mdoc.7.txt man.7.txt \
@@ -137,7 +134,7 @@
DOCLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
$(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \
- config.h config.log $(PSS)
+ config.h config.log $(PSS) $(PDFS)
DOINSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
$(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS)
@@ -151,12 +148,14 @@
dist: mdocml-$(VERSION).tar.gz
-www: all $(GSGMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) $(PSS)
+www: all $(GSGMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) $(PSS) $(PDFS)
ps: $(PSS)
+pdf: $(PDFS)
+
installwww: www
- $(INSTALL_DATA) $(HTMLS) $(PSS) $(TEXTS) $(STATICS) $(DESTDIR)$(PREFIX)/
+ $(INSTALL_DATA) $(HTMLS) $(PSS) $(PDFS) $(TEXTS) $(STATICS) $(DESTDIR)$(PREFIX)/
$(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/
$(INSTALL_DATA) mdocml-$(VERSION).md5 $(DESTDIR)$(PREFIX)/snapshots/
$(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/mdocml.tar.gz
@@ -299,13 +298,16 @@
sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
.1.1.txt .3.3.txt .7.7.txt:
- ./mandoc $(MANDOCFLAGS) $< | col -b > $@
+ ./mandoc -Tascii -Wall,error -fstrict $< | col -b > $@
.1.1.sgml .3.3.sgml .7.7.sgml:
- ./mandoc $(MANDOCFLAGS) $(MANDOCHTML) $< > $@
+ ./mandoc -Thtml -Wall,error -fstrict -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@
.1.1.ps .3.3.ps .7.7.ps:
- ./mandoc $(MANDOCFLAGS) $(MANDOCPS) $< > $@
+ ./mandoc -Tps -Wall,error -fstrict $< > $@
+
+.1.1.pdf .3.3.pdf .7.7.pdf:
+ ./mandoc -Tpdf -Wall,error -fstrict $< > $@
.tar.gz.md5:
md5 $< > $@
diff -r 0ceba22111c9 -r c227238aaa06 external/bsd/mdocml/dist/arch.in
--- a/external/bsd/mdocml/dist/arch.in Tue Jul 27 22:27:52 2010 +0000
+++ b/external/bsd/mdocml/dist/arch.in Tue Jul 27 22:34:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $Vendor-Id: arch.in,v 1.8 2010/06/19 20:46:27 kristaps Exp $ */
+/* $Vendor-Id: arch.in,v 1.9 2010/07/19 15:43:10 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
*
@@ -22,6 +22,8 @@
* formatted output.
*
* Be sure to escape strings.
+ *
+ * REMEMBER TO ADD NEW ARCHITECTURES TO MDOC.7!
*/
LINE("alpha", "Alpha")
diff -r 0ceba22111c9 -r c227238aaa06 external/bsd/mdocml/dist/chars.c
--- a/external/bsd/mdocml/dist/chars.c Tue Jul 27 22:27:52 2010 +0000
+++ b/external/bsd/mdocml/dist/chars.c Tue Jul 27 22:34:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $Vendor-Id: chars.c,v 1.20 2010/06/19 20:46:27 kristaps Exp $ */
+/* $Vendor-Id: chars.c,v 1.24 2010/07/26 13:59:00 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
*
@@ -33,10 +33,7 @@
struct ln *next;
const char *code;
const char *ascii;
- const char *html;
- size_t codesz;
- size_t asciisz;
- size_t htmlsz;
+ int unicode;
int type;
#define CHARS_CHAR (1 << 0)
#define CHARS_STRING (1 << 1)
@@ -45,12 +42,12 @@
#define LINES_MAX 370
-#define CHAR(w, x, y, z, a, b) \
- { NULL, (w), (y), (a), (x), (z), (b), CHARS_CHAR },
-#define STRING(w, x, y, z, a, b) \
- { NULL, (w), (y), (a), (x), (z), (b), CHARS_STRING },
-#define BOTH(w, x, y, z, a, b) \
- { NULL, (w), (y), (a), (x), (z), (b), CHARS_BOTH },
+#define CHAR(in, ch, code) \
+ { NULL, (in), (ch), (code), CHARS_CHAR },
+#define STRING(in, ch, code) \
+ { NULL, (in), (ch), (code), CHARS_STRING },
+#define BOTH(in, ch, code) \
+ { NULL, (in), (ch), (code), CHARS_BOTH },
#define CHAR_TBL_START static struct ln lines[LINES_MAX] = {
#define CHAR_TBL_END };
@@ -64,8 +61,7 @@
static inline int match(const struct ln *,
const char *, size_t, int);
-static const char *find(struct tbl *, const char *,
- size_t, size_t *, int);
+static const struct ln *find(struct tbl *, const char *, size_t, int);
void
@@ -126,31 +122,80 @@
}
-const char *
-chars_a2ascii(void *arg, const char *p, size_t sz, size_t *rsz)
+/*
+ * Special character to Unicode codepoint.
+ */
+int
+chars_spec2cp(void *arg, const char *p, size_t sz)
{
+ const struct ln *ln;
- return(find((struct tbl *)arg, p, sz, rsz, CHARS_CHAR));
+ ln = find((struct tbl *)arg, p, sz, CHARS_CHAR);
+ if (NULL == ln)
+ return(-1);
+ return(ln->unicode);
+}
+
+
+/*
+ * Reserved word to Unicode codepoint.
+ */
+int
+chars_res2cp(void *arg, const char *p, size_t sz)
+{
+ const struct ln *ln;
+
+ ln = find((struct tbl *)arg, p, sz, CHARS_STRING);
+ if (NULL == ln)
+ return(-1);
+ return(ln->unicode);
}
+/*
+ * Special character to string array.
+ */
const char *
-chars_a2res(void *arg, const char *p, size_t sz, size_t *rsz)
+chars_spec2str(void *arg, const char *p, size_t sz, size_t *rsz)
{
+ const struct ln *ln;
- return(find((struct tbl *)arg, p, sz, rsz, CHARS_STRING));
+ ln = find((struct tbl *)arg, p, sz, CHARS_CHAR);
+ if (NULL == ln)
+ return(NULL);
+
+ *rsz = strlen(ln->ascii);
+ return(ln->ascii);
}
-static const char *
-find(struct tbl *tab, const char *p, size_t sz, size_t *rsz, int type)
+/*
+ * Reserved word to string array.
+ */
+const char *
+chars_res2str(void *arg, const char *p, size_t sz, size_t *rsz)
+{
+ const struct ln *ln;
+
+ ln = find((struct tbl *)arg, p, sz, CHARS_STRING);
+ if (NULL == ln)
+ return(NULL);
+
+ *rsz = strlen(ln->ascii);
+ return(ln->ascii);
+}
+
+
+static const struct ln *
+find(struct tbl *tab, const char *p, size_t sz, int type)
{
struct ln *pp, *prev;
struct ln **htab;
int hash;
assert(p);
- assert(sz > 0);
+ if (0 == sz)
+ return(NULL);
if (p[0] < PRINT_LO || p[0] > PRINT_HI)
return(NULL);
@@ -179,12 +224,7 @@
htab[hash] = pp;
}
- if (CHARS_HTML == tab->type) {
- *rsz = pp->htmlsz;
- return(pp->html);
- }
- *rsz = pp->asciisz;
- return(pp->ascii);
+ return(pp);
}
return(NULL);
@@ -197,7 +237,7 @@
if ( ! (ln->type & type))
return(0);
- if (ln->codesz != sz)
+ if (strncmp(ln->code, p, sz))
return(0);
- return(0 == strncmp(ln->code, p, sz));
+ return('\0' == ln->code[(int)sz]);
}
diff -r 0ceba22111c9 -r c227238aaa06 external/bsd/mdocml/dist/chars.h
--- a/external/bsd/mdocml/dist/chars.h Tue Jul 27 22:27:52 2010 +0000
+++ b/external/bsd/mdocml/dist/chars.h Tue Jul 27 22:34:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $Vendor-Id: chars.h,v 1.4 2010/06/19 20:46:27 kristaps Exp $ */
+/* $Vendor-Id: chars.h,v 1.5 2010/07/16 22:33:30 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
*
@@ -25,8 +25,10 @@
};
void *chars_init(enum chars);
-const char *chars_a2ascii(void *, const char *, size_t, size_t *);
-const char *chars_a2res(void *, const char *, size_t, size_t *);
+const char *chars_spec2str(void *, const char *, size_t, size_t *);
+int chars_spec2cp(void *, const char *, size_t);
+const char *chars_res2str(void *, const char *, size_t, size_t *);
+int chars_res2cp(void *, const char *, size_t);
void chars_free(void *);
__END_DECLS
diff -r 0ceba22111c9 -r c227238aaa06 external/bsd/mdocml/dist/chars.in
--- a/external/bsd/mdocml/dist/chars.in Tue Jul 27 22:27:52 2010 +0000
+++ b/external/bsd/mdocml/dist/chars.in Tue Jul 27 22:34:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $Vendor-Id: chars.in,v 1.25 2010/06/19 20:46:27 kristaps Exp $ */
+/* $Vendor-Id: chars.in,v 1.31 2010/07/26 13:59:00 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
Home |
Main Index |
Thread Index |
Old Index