OpenBSD CVS

CVS log for src/usr.bin/mandoc/Makefile


[BACK] Up to [local] / src / usr.bin / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.120 / (download) - annotate - [select for diffs], Mon Jul 4 15:45:27 2022 UTC (22 months, 2 weeks ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored)

Repair "make man.cgi" which got accidentally broken in the previous
commit to the Makefile.  The man.cgi binary now uses roff_escape.o, too.

Revision 1.119 / (download) - annotate - [select for diffs], Thu May 19 15:17:50 2022 UTC (2 years ago) by schwarze
Branch: MAIN
Changes since 1.118: +3 -2 lines
Diff to previous 1.118 (colored)

Make roff_expand() parse left-to-right rather than right-to-left.
Some escape sequences have side effects on global state, implying
that the order of evaluation matters.  For example, this fixes the
long-standing bug that "\n+x\n+x\n+x" after ".nr x 0 1" used to
print "321"; now it correctly prints "123".

Right-to-left parsing was convenient because it implicitly handled
nested escape sequences.  With correct left-to-right parsing, nesting
now requires an explicit implementation, here solved as follows:
1. Handle nested expanding escape sequences iteratively.
When finding one, expand it, then retry parsing the enclosing escape
sequence from the beginning, which will ultimately succeed as soon
as it no longer contains any nested expanding escape sequences.
2. Handle nested non-expanding escape sequences recursively.
When finding one, the escape sequence parser calls itself to find
the end of the inner sequence, then continues parsing the outer
sequence after that point.

This requires the mandoc_escape() function to operate in two different
modes.  The roff(7) parser uses it in a mode where it generates
diagnostics and may return an expansion request instead of a parse
result.  All other callers, in particular the formatters, use it
in a simpler mode that never generates diagnostics and always returns
a definite parsing result, but that requires all expanding escape
sequences to already have been expanded earlier.  The bulk of the
code is the same for both modes.
Since this required a major rewrite of the function anyway, move
it into its own new file roff_escape.c and out of the file mandoc.c,
which was misnamed in the first place and lacks a clear focus.

As a side benefit, this also fixes a number of assertion failures
that tb@ found with afl(1), for example "\n\\\\*0", "\v\-\\*0",
and "\w\-\\\\\$0*0".

As another side benefit, it also resolves some code duplication
between mandoc_escape() and roff_expand() and centralizes all
handling of escape sequences (except for expansion) in roff_escape.c,
hopefully easing maintenance and feature improvements in the future.

While here, also move end-of-input handling out of the complicated
function roff_expand() and into the simpler function roff_parse_comment(),
making the logic easier to understand.

Since this is a major reorganization of a central component of
mandoc(1), stability of the program might slightly suffer for a few
weeks, but i believe that's not a problem at this point of the
release cycle.  The new code already satisfies the regression suite,
but more tweaking and regression testing to further improve the
handling of various escape sequences will likely follow in the near
future.

Revision 1.118 / (download) - annotate - [select for diffs], Fri Mar 13 00:31:04 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.117: +9 -9 lines
Diff to previous 1.117 (colored)

Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c
and into a formatting part including command line argument checking
in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.

Immediate functional benefits include:
* Improved prioritization of automatic tags for .Em and .Sy.
* Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged.
* Explicit tagging of .Er and .Fl now works in HTML output.
* Automatic tagging of .IP and .TP now works in HTML output.
But mainly, this patch provides clean earth to build further improvements on.

Technical changes:
* Main program: Write a tag file for ASCII and UTF-8 output only.
* All formatters: There is no more need to delay writing the tags.
* mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection.
* HTML formatter: If available, use the "string" attribute as the tag.
* HTML formatter: New function to write permalinks, to reduce code duplication.

Style cleanup in the vicinity while here:
* mdoc(7) terminal formatter: To set up bold font for children,
defer to termp_bold_pre() rather than calling term_fontpush() manually.
* mdoc(7) terminal formatter: Garbage collect some duplicate functions.
* mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions.
* Where possible, use switch statements rather than if cascades.
* Get rid of some more Yoda notation.

The necessity for such changes was first discussed with kn@, but i didn't
bother him with a request to review the resulting -673/+782 line patch.

Revision 1.117 / (download) - annotate - [select for diffs], Wed Mar 6 12:26:30 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

man.cgi also needs to link arch.o; forgotten in rev. 1.116

Revision 1.116 / (download) - annotate - [select for diffs], Mon Mar 4 13:01:52 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain
about the architecture rather than about the manual page name:

$ man -S vax cpu
man: Unknown architecture "vax".
$ man -S sparc64 foobar
man: No entry for foobar in the manual.

Friendlier error message suggested by jmc@, who also OK'ed the patch.

Revision 1.115 / (download) - annotate - [select for diffs], Sun Feb 24 12:57:14 2019 UTC (5 years, 2 months ago) by kn
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

Remove -S from install commands

As of usr.bin/xinstall/install.c revision 1.68, -S is a no-op and
install(1) will always create files safely, thus clean the option usage
from the tree.

Diff from Lauri Tirkkonen <lotheac at iki dot fi>, thanks.

Revision 1.114 / (download) - annotate - [select for diffs], Mon Dec 24 19:59:17 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.113: +5 -1 lines
Diff to previous 1.113 (colored)

install /usr/share/misc/mandoc.css
users of -T html normally need this file,
so the source tree should not be the only place to get it
pointed out by millert@, OK millert@ deraadt@ tedu@

Revision 1.113 / (download) - annotate - [select for diffs], Fri Dec 14 01:17:46 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.112: +4 -4 lines
Diff to previous 1.112 (colored)

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback.  It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:14 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

Cleanup, no functional change:
Split the top level parser interface out of the utility header
mandoc.h, into a new header mandoc_parse.h, for use in the main
program and in the main parser only.
Move enum mandoc_os into roff.h because struct roff_man is the
place where it is stored.
This allows removal of mandoc.h from seven files in low-level
parsers and in formatters.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Jul 1 09:47:23 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.110: +4 -3 lines
Diff to previous 1.110 (colored)

Basic reporting of .Xrs to manual pages that don't exist
in the base system, inspired by mdoclint(1).

We are able to do this because (1) the -mdoc parser, the -Tlint validator,
and the man(1) manual page lookup code are all in the same program
and (2) the mandoc.db(5) database format allows fast lookup.

Feedback from, previous versions tested by, and OK jmc@.

A few features will be added to this in the tree, step by step.

Revision 1.110 / (download) - annotate - [select for diffs], Fri May 12 17:35:34 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.109: +5 -3 lines
Diff to previous 1.109 (colored)

Fix the man.cgi target after the recent file additions;
this didn't break the build because it's not built by default.

Revision 1.109 / (download) - annotate - [select for diffs], Sun May 7 17:30:58 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

Revision 1.108 / (download) - annotate - [select for diffs], Fri May 5 02:06:17 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.107 / (download) - annotate - [select for diffs], Thu May 4 22:07:44 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.106: +6 -5 lines
Diff to previous 1.106 (colored)

Start roff formatter modules for HTML and termininal output,
used by both the mdoc and man formatters, with the ultimate
goal of reducing code duplication between the two macro formatters.
Made possible by the parser unification.
Add the first formatting function (for the .br request).

Revision 1.106 / (download) - annotate - [select for diffs], Sat Apr 29 12:43:55 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.105: +5 -5 lines
Diff to previous 1.105 (colored)

Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Mar 3 14:21:41 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.104: +2 -1 lines
Diff to previous 1.104 (colored)

new -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
thanks to reyk@ and to Vsevolod at FreeBSD for suggesting it

Revision 1.104 / (download) - annotate - [select for diffs], Wed Jan 25 02:54:53 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.103: +3 -1 lines
Diff to previous 1.103 (colored)

Add the style sheet used on man.openbsd.org to the source tree.

It is NOT used during "make build" and NOT installed, but it is
helpful for people trying to read and understand html.c and mdoc_html.c,
and maybe even for users of mandoc -Thtml.

OK deraadt@

Revision 1.103 / (download) - annotate - [select for diffs], Mon Aug 1 10:32:39 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.102: +5 -4 lines
Diff to previous 1.102 (colored)

Remove the dependency on SQLite without loss of functionality.
Drop the obsolete names_check() now that we deleted MLINKS.
Run "doas makewhatis" after compiling and installing this.

Earlier version tested by jmc@ and jturner@;
"commit it all" deraadt@   "commit and dodge" krw@

Revision 1.102 / (download) - annotate - [select for diffs], Sun Jul 10 10:03:15 2016 UTC (7 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.101: +1 -7 lines
Diff to previous 1.101 (colored)

Simplify the code and the server setup by deleting the pseudo-manpath
"mandoc" that was used for man.cgi(8) documentation and by assuming
that the apropos(1) and man.cgi(8) manuals are simply installed in
the default manpath.  Even though man.cgi(8) is not installed by
default when installing OpenBSD, it is easy to copy it into the
default manpath used for man.cgi(8).

Idea found when considering a question asked by wrant dot com.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Mar 30 06:38:46 2016 UTC (8 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.100: +1 -2 lines
Diff to previous 1.100 (colored)

for some time now mandoc has not required MLINKS to function
correctly - logically complete that now by removing MLINKS from base;

authors need only to ensure there is an entry in NAME for any function/
util being added. MLINKS will still work, and remain for perl to ease
upgrades;

ok nicm (curses) bcook (ssl)
ok schwarze, who provided a lot of feedback and assistance
ok tb natano jung

Revision 1.100 / (download) - annotate - [select for diffs], Thu Oct 22 22:05:42 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (colored)

use the new function man_validate() here, too

Revision 1.99 / (download) - annotate - [select for diffs], Tue Oct 20 02:00:49 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.98: +6 -5 lines
Diff to previous 1.98 (colored)

In order to become able to generate syntax tree nodes on the roff(7)
level, validation must be separated from parsing and rewinding.
This first big step moves calling of the mdoc(7) post_*() functions
out of the parser loop into their own mdoc_validate() pass, while
using a new mdoc_state() module to make syntax tree state handling
available to both the parser loop and the validation pass.

Revision 1.98 / (download) - annotate - [select for diffs], Tue Oct 13 15:50:15 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.97: +5 -4 lines
Diff to previous 1.97 (colored)

Reduce the amount of code by moving the three copies of the ohash
callback functions into one common place, preparing for the use of
ohash for some additional purposes.  No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jul 19 05:59:07 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

Do not fork and exec gunzip(1), just link with libz instead.
As discussed with deraadt@, that's cleaner and will help tame(2).
Something like this was also suggested earlier by bapt at FreeBSD.
Minus 50 lines of code, deleting one interface function (mparse_wait),
no functional change intended.

Revision 1.96 / (download) - annotate - [select for diffs], Fri Jul 17 22:35:36 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

Initial, still somewhat experimental implementation to leverage
less(1) -T and :t ctags(1)-like functionality to jump to the
definitions of various terms inside manual pages.
To be polished in the tree, so bear with me and report issues.

Technically, if less(1) is used as a pager, information is collected
by the mdoc(7) terminal formatter, first stored using the ohash
library, then ultimately written to a temporary file which is passed
to less via -T.  No change intended for other output formatters or
when running without a pager.

Based on an idea from Kristaps using feedback from many, in particular
phessler@ nicm@ millert@ halex@ doug@ kspillner@ deraadt@.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Mar 27 17:36:56 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

Parse the new man.conf(5) "output" directive.
The next step will be to actually use the parsed data.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Mar 26 23:45:37 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

Strip information that no longer applies and document new "manpath" directive.
jmc@ agrees with the general direction (but hasn't seen this draft;
let's tweak it in the tree).

Revision 1.93 / (download) - annotate - [select for diffs], Wed Mar 18 18:04:12 2015 UTC (9 years, 2 months ago) by pascal
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (colored)

Convert -static -> ${STATIC} to make man.cgi static PIE.

no concerns from schwarze@

Revision 1.92 / (download) - annotate - [select for diffs], Sat Mar 14 21:33:18 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.91: +3 -2 lines
Diff to previous 1.91 (colored)

Delete the separate and incomplete whatis(1) manual
and replace it by an MLINK to apropos(1),
which already contains all information about whatis(1).
"up to you" jmc@

Revision 1.91 / (download) - annotate - [select for diffs], Mon Feb 16 16:18:02 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.90: +1 -2 lines
Diff to previous 1.90 (colored)

Delete the -V option.  It serves no purpose but keeps confusing people.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Jan 16 01:58:18 2015 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

Delete the MANLINT variable and the related SUFFIXES rules because
since yesterday, "mandoc -Tlint -Wfatal" can no longer fail.
Instead, as suggested by deraadt@, provide a manlint target
that is *not* run during make build, but can be run
whenever you want to check syntax of manuals.
"nice stuff" deraadt@

Revision 1.89 / (download) - annotate - [select for diffs], Sun Dec 14 17:55:37 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.88: +4 -2 lines
Diff to previous 1.88 (colored)

Switch man(1) to the mandoc implementation.
OK krw@ naddy@ sthen@  "commit it now" deraadt@

I won't remove the files in src/usr.bin/man, such that we can quickly
switch back in case a problem is found.

Revision 1.88 / (download) - annotate - [select for diffs], Sat Dec 13 15:30:52 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

just released mandoc 1.13.2

Revision 1.87 / (download) - annotate - [select for diffs], Fri Nov 28 18:35:37 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Retire support for CSRG supplementary document titles.  These are
long obsolete and were never written in mdoc(7) in the first place.
Removes 100 lines from source files.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Nov 28 18:07:38 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.85: +3 -4 lines
Diff to previous 1.85 (colored)

Drop useless architecture table.  Validating architecture names
is a job for makewhatis(8)/mandoc.db(5), not for the parser.
Removes 150 lines from source files and 4k (1%) from the binary.
Bloat found by deraadt@.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Nov 28 17:23:34 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

Remove bulky, irrelevant library description string tables
not used by a single manual in OpenBSD and just print library names;
will remain in the portable version for use by FreeBSD and NetBSD.
Removes 150 lines from source tree and 16 Kilobytes (4%) from binary.
Bloat found by deraadt@.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Nov 25 22:20:22 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

fix (disabled) build of man.cgi

Revision 1.83 / (download) - annotate - [select for diffs], Thu Oct 30 00:05:02 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

support UTF-8 and ISO-8859-1 input by integrating modified parts
of kristaps@' version of the preconv(1) utility into mandoc(1);
positive feedback from bentley@ and no concern raised when shown on tech@

Revision 1.82 / (download) - annotate - [select for diffs], Wed Aug 27 00:06:08 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

Add an implementation of man(1) into the /usr/bin/mandoc binary and
provide a unified set of command line options for mandoc(1), man(1),
apropos(1), and whatis(1), each option doing the same for all four.
Not adding any completely new options, only extending exiting ones
from one tool to the others.  New options are:
* apropos & whatis -acfkw  (in the past, these were man(1) only)
* apropos & whatis -a -IOTW  (in the past, mandoc(1) only)
* mandoc -ac  (in the past, man(1) only)
* man -IOTW  (in the past, mandoc(1) only)

Before we can decide whether or not we want to replace src/usr.bin/man
with this implementation, considerable bugfixing, testing, and
performance measurements are needed, which i'd rather do in the tree
than outside.  Note that these bugs only affect the new man(1) mode,
existing mandoc(1), apropos(1), and whatis(1) is fine.

The new functionality in mandoc(1), apropos(1), and whatis(1)
is fully enabled.  To play with the new man(1), you can try:
# mv /usr/bin/man /usr/bin/oman
# ln -s /usr/bin/mandoc /usr/bin/man

Positive feedback about the general direction from sthen@ and jmc@,
and deraadt@ is not against it.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Aug 14 02:49:23 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

mandoc 1.13.1 has been released

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jul 13 09:58:52 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.79: +6 -2 lines
Diff to previous 1.79 (colored)

Install the manuals of the web interface below the same directory
as manpath.conf, such that we do not need to mix our own documentation
into the documentation we are serving, which may not even be possible
if the latter is updated automatically.

Based on an idea by beck@.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Jul 12 18:05:50 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.78: +3 -2 lines
Diff to previous 1.78 (colored)

No need for run-time configuration, add minimal compile-time
configuration facilities, just two paths and two HTML strings.
Show the title on all pages, not just the index page.

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 11 15:37:22 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +35 -1 lines
Diff to previous 1.77 (colored)

Bring in man.cgi(8) to maintain it in our tree together with mandoc.
It will not be enabled in the build nor installed by default.

A comment in the Makefile lists the three simple steps
needed to build, install, and run it on the two machines
worldwide that are going to run it.

deraadt@ agrees with having the code in the tree.

Revision 1.77 / (download) - annotate - [select for diffs], Mon May 12 19:11:20 2014 UTC (10 years ago) by espie
Branch: MAIN
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (colored)

adjust to ohash being in libutil now, and to the interface changes.
fix potential integer overflows in memory allocation (mostly for pedagogical
purposes, these are unlikely to overflow in practice)
move the rest of lst.lib stuff into its own directory.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 18 10:00:48 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.75: +7 -2 lines
Diff to previous 1.75 (colored)

Switch to the new makewhatis(8)/apropos(1)/whatis(1) combo.
"commit the switch now" espie@  "go for it" deraadt@

See the apropos(1) manual for a description of what's new.
On machines where you want the full functionality,
run "sudo makewhatis" and put "MAKEWHATISARGS=' '" into weekly.local(8).
Otherwise, when upgrading via source, run "sudo makewhatis -Q".

Revision 1.75 / (download) - annotate - [select for diffs], Fri Mar 21 22:17:01 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.74: +3 -2 lines
Diff to previous 1.74 (colored)

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions.  Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Jan 19 00:09:33 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

Support a second -v on mandocdb(8) to show keys while they are being added;
i need that for debugging, in particular to be used with -t.
To be able to do so, provide a global table of key names, for reuse.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Jan 2 17:05:02 2014 UTC (10 years, 4 months ago) by miod
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

LDFLAGS -> LDADD, fixes build on static arches.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Dec 31 00:40:19 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.71: +5 -4 lines
Diff to previous 1.71 (colored)

Replace the Berkeley-DB based mandocdb(8) by an SQLite3-based version,
aiming for more flexible development and optimization options.
Kristaps started this during the summer 2012, i did some very heavy
bugfixing during t2k13 and finally, during the last few days,
got it to a state where it is ripe for in-tree development.
Beware, neither the user interfaces nor the database formats
are expected to be stable just yet.

Will not be installed or activated until further discussion.
No functional change to mandoc(1).

"As long as it remains off until we decide the cost, fine." deraadt@

Revision 1.71 / (download) - annotate - [select for diffs], Sun Oct 6 23:59:59 2013 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Yesterday, i released (portable) mandoc 1.12.2, so bump our VERSION, too.
No merging is needed; basically, mandoc is developed here and mdocml.bsd.lv
is not really "upstream", but just OpenBSD plus compatibility goo.  All the
same, the exercise is far from useless: NetBSD, FreeBSD, and DragonFly have
mandoc in base, NetBSD uses it by default to show manuals, and FreeBSD and
DragonFly have finally come close to switching away from groff as well.
Useful bug reports come in and help making our mandoc better.
Maybe we should list mandoc as an OpenBSD associated project on index.html.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Aug 6 19:11:53 2013 UTC (10 years, 9 months ago) by miod
Branch: MAIN
Changes since 1.69: +2 -6 lines
Diff to previous 1.69 (colored)

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Apr 15 13:52:59 2012 UTC (12 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

Call this mandoc 1.12.1.

I refrained from merging one patch that i dislike
and one that requires additional review,
but we are now definitely much closer to 1.12.1 than to 1.12.0.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Jan 16 08:42:38 2012 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.67: +2 -7 lines
Diff to previous 1.67 (colored)

Backout activation of the new apropos(1)/whatis(1)/makewhatis(8).
In its current state, it causes too much slowdown, in particular
during system builds, and there are other regressions.
That cannot be fixed quickly while it's enabled.

Problems pointed out by espie@, backout requested by deraadt@,
diff "looks good" to espie@.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Jan 10 09:45:13 2012 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.66: +3 -4 lines
Diff to previous 1.66 (colored)

Continue using the traditional name makewhatis(8),
do not rename to mandocdb(8):  Even though there is some
additional functionality, the basic purpose remains the same.
Requested by espie@; "decide fast" deraadt@.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Jan 5 23:03:57 2012 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +7 -3 lines
Diff to previous 1.65 (colored)

Enable the new apropos(1), whatis(1), and makewhatis(8).
Unlink the old apropos(1), whatis(1), and makewhatis(8) from the build.
Call the new tools from pkg_create(1) and pkg_add(1).
"Please enable it now."  deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Nov 26 16:41:35 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

Resync to bsd.lv, most code from kristaps@.
In particular, support the MANPATH environment variable
and don't confuse index record numbers when working with
multiple mandoc databases at once.
Besides, remove lots of gratuitious code and whitespace differences.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Nov 17 14:52:32 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Minimal man.conf(5) _whatdb support for mandocdb(8) and apropos(1),
and add the standard options -M and -m to apropos(1).
Including a bugfix to prevent mandocdb(8) from leaking
database file descriptors.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Nov 13 09:58:21 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

Split the common code to be reused by other mandocdb clients,
for example the future man.cgi, out of apropos.c (which still
contains the apropos(1) main program, command line handling, and
the terminal output formatter) into apropos_db.{h,c} (which now
contains the database searching backend code).

While here,
* Drop the -e option; to search for exact strings, use REs.
* Drop the -r option (more changes related to this coming soon).
* Use the traditional -s and -S instead of inventing our own options.
* Drop the sort option (at least for now), it got in the way.

Written by kristaps@.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Oct 9 17:59:56 2011 UTC (12 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Sync to version 1.12.0; all code by kristaps@:
Implement .Rv in -Tman.
Let -man -Tman work a bit like cat(1).
Add the -Ofragment option to -T[x]html.
Minor fixes in -T[x]html.
Lots of apropos(1) and -Tman code cleanup.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Oct 6 23:04:16 2011 UTC (12 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +6 -1 lines
Diff to previous 1.60 (colored)

1) Import the future apropos(1) replacement written by kristaps@.
2) Link both that one and mandocdb(8) into the mandoc(1) binary.
3) Install a /usr/bin/mandocdb hardlink and the mandocdb(8) manual.

Do not replace /usr/bin/apropos by a hardlink yet because it is
not ready for production, and ports integration is still missing.
Development will be done in the tree, even the user interfaces
are still subject to change at this point.

Both jmc@ and deraadt@ agree with getting this in.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Sep 18 15:54:48 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

sync to version 1.11.7 from kristaps@
main new feature: support the roff(7) .tr request
plus various bugfixes and some refactoring

regressions are so minor that it's better to get this in
and fix them in the tree

Revision 1.59 / (download) - annotate - [select for diffs], Sun Sep 18 10:25:28 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +4 -5 lines
Diff to previous 1.58 (colored)

sync to version 1.11.5:
adding an implementation of the eqn(7) language
by kristaps@

So far, only .EQ/.EN blocks are handled, in-line equations are not, and
rendering is not yet very pretty, but the parser is fairly complete.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Sep 17 14:45:22 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57 (colored)

Initial, incomplete support for -Tman
to convert mdoc(7) documents to the man(7) language.
This is work in progress and will be developed in tree.
It does already handle the cat(1) manual,
but will hardly handle all your fancy manuals yet.
go ahead  kristaps@ jmc@ millert@ deraadt@

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jul 31 16:15:40 2011 UTC (12 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

Actually, by merging individual patches, we are already in sync
with release 1.11.4.  Correct this for release.

Revision 1.56 / (download) - annotate - [select for diffs], Sun May 29 21:22:18 2011 UTC (12 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Merge release 1.11.3, almost all code by kristaps@:
* Unicode output support (no Unicode input yet, though).
* Refactoring: completely handle predefined strings in roff.c.
- New function mandoc_escape() replaces a2roffdeco() and mandoc_special().
- Start using mandoc_getarg() in mdoc_argv.c.
- Clean up parsing of delimiters in mdoc(7).
* And many minor fixes and lots of cleanup.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Apr 24 16:22:02 2011 UTC (13 years ago) by schwarze
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored)

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Apr 21 22:59:54 2011 UTC (13 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Merge version 1.10.10:
lots of cleanup and maintenance work by kristaps@.
- move some main.c globals into struct curparse
- move mandoc_*alloc to mandoc.h such that all code can use them
- make mandoc_isdelim available to formatting frontends
- dissolve mdoc_strings.c, move the code where it is used
- make all error reporting functions void, their return values were useless
- and various minor cleanups and fixes

Revision 1.53 / (download) - annotate - [select for diffs], Sun Mar 20 23:36:42 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

Import the foundation for eqn(7) support.
Written by kristaps@.

For now, i'm adding one line to each of the four frontends
to just pass the input text through to the output,
not yet interpreting any of then eqn keywords.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Jan 9 14:30:48 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Sync tbl handling to bsd.lv release 1.10.9:
* .T} can be followed by a delimiter, then more data.
* Do not limit table column widths (improves terminfo(5)).
* Let numerical cells respect explicitly specified minimum cell widths.
* Let terminal output survive missing data cells.
* Parse and ignore arguments in parentheses on layout cell specifications.
* Move tbl_calc() into out.c such that it can be used by all frontends.
* Give tables an HTML class.
* Some cleanup in tbl -Thtml code.
All code by kristaps@.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +3 -4 lines
Diff to previous 1.50 (colored)

Merge kristaps@' cleaner tbl integration, removing mine;
there are still a few bugs, but fixing these will be easier in tree.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Dec 25 13:23:03 2010 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Yet another batch of -Thtml polishing from kristaps@:
In particular, use <SMALL> for .SM and <CODE> for .Dl.
Use <B> for bold and <I> for italic in general.
Also call this mandoc 1.10.8 now, as it is functionally equivalent,
even though one one set of refactoring patches has not been merged
yet because it conflicts with our tbl(1) handling.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Dec 7 00:08:52 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Complete the merge of bsd.lv version 1.10.7:
No more functional changes, just sync ordering, comments and white space.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Dec 1 23:02:57 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -3 lines
Diff to previous 1.47 (colored)

Merge man_action.c into man_validate.c.
Same as for mdoc_action.c, but much simpler.
Work by kristaps@, re-applying OpenBSD changes on top.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Dec 1 22:02:29 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Merge mdoc_action.c into mdoc_validate.c, because having two places to do
basically the same things just causes code duplication and confusion.
Work by kristaps@, including a few bugfixes he found during the merge,
and reapplying OpenBSD changes on top.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Oct 15 20:45:03 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +2 -1 lines
Diff to previous 1.45 (colored)

Minimal glue to integrate tbl into the mandoc man(7) parser and formatter.
The output dosn't look nice yet, escape handling is still missing,
but will follow soon.
"move forward aggressively :-)" deraadt@

Revision 1.45 / (download) - annotate - [select for diffs], Mon Sep 27 21:25:28 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

Merge the last bits of 1.10.6 (released today), most were already in:
* ignore double-.Pp
* ignore .Pp before .Bd and .Bl (unless -compact in specified)
* avoid double blank line upon .Pp, .br and friends in literal context
* cast enums to int when passing them to exit(3) to please lint(1)
While merging, fix a regression introduced by kristaps@:
Outside literal mode, double blank lines must both be printed.
To achieve this again after kristaps@ improvements in 1.10.6,
treat such blank lines as .sp (instead of .Pp as in 1.10.5)
and drop .Pp before .sp just like dropping .Pp before .Pp.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jul 31 21:43:07 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Merge bsd.lv version 1.10.5: last larger batch of bug fixes before release.
NOT including Kristaps' .Bd -literal changes which cause regressions.
Features:
* -Tpdf now fully working
Bugfixes:
* proper handling of quoted strings by .ds in roff(7)
* allow empty .Dd
* make .Sm start no-spacing after the first output word
* underline .Ad
* minor fixes in -Thtml
and some optimisations in terminal output.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jul 13 01:09:12 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Merge release 1.10.4 (all code by kristaps@), providing four new features:
1) Proper .Bk support: allow output line breaks at input line breaks,
but keep input lines together in the output, finally fixing
synopses like aucat(1), mail(1) and tmux(1).
2) Mostly finished -Tps (PostScript) output.
3) Implement -Thtml output for .Nm blocks and .Bk -words.
4) Allow iterative interpolation of user-defined roff(7) strings.
Also contains some minor bugfixes and some performance improvements.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jun 29 15:49:52 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

sync to bsd.lv version 1.10.3:
* support -Tps -Opaper=a4 and -Opaper=letter
* lots of mandoc.1 manual improvements

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jun 26 17:56:43 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

merge release 1.10.2
* bug fixes:
- interaction of ASCII_HYPH with special chars (found by Ulrich Spoerlein)
- handling of roff conditionals (found by Ulrich Spoerlein)
- .Bd -offset will no more default to 6n
* maintenance:
- more caching of .Bd and .Bl arguments for efficiency
- deconstify man(7) validation routines
- add FreeBSD library names (provided by Ulrich Spoerlein)
* start PostScript font-switching

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jun 10 22:50:10 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

minimal initial -Tps support, from kristaps@ GSOC
so far, monospace without font decoration,
but it already has page headers and footers

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jun 6 20:30:08 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Merge bsd.lv version 1.10.1 (to be released soon).

The main step forward is that this now has *much* better .Bl -column
support, now supporting many manuals that previously errored out
without producing any output.

Other fixes include:
* do not die from multiple list types, use the first and warn
* in .Bl without a type, default to -item
* various tweaks to .Dt
* fix .In, .Fd, .Ft, .Fn and .Fo formatting
* some documentation fixes and additions
* and fix a couple of bugs reported by Ulrich Spoerlein:
* better support for roff block-end "\}" without a preceding dot
* .In must not break the line outside SYNOPSIS
* spelling in some error messages

While merging, fix one regression in .In spacing
that needs to go to bsd.lv, too.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jun 6 18:08:41 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

Merge bsd.lv release 1.10.0,
which is mostly the post-hackathon release,
bringing in the OpenBSD changes to bsd.lv,
but which also has a few additional minor fixes:

* .Lb is an in-line macro, not in_line_eoln
* .Bt, .Ud now warn when discarding arguments
* allow bad -man dates to flow verbatim into the front-ends
- so far all reported by Ulrich Spoerlein
* .Ar, .Fl and .Li starting with closing punctuation emit an empty element
* empty .Li macros print nothing, but may cause spacing
* proper EOS handling for .Bt, .Ex, .Rv, and .Ud.
* cleanup: collapse posts_xr into posts_wtext (which is the same)
* efficiency: very simple table lookup for roff.c

Revision 1.37 / (download) - annotate - [select for diffs], Sun May 16 00:54:03 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

In theory, Kristaps never intended to write a roff parser,
but in practice, most real legacy man(7)uals are using so much
low level roff that we can't really get away without at least
partially handling some roff instructions.

As doing this in man(7) only has become messy and as even some
mdoc(7) pages need it, start a minimal partial roff preprocessor.
As a first step, move handling of .am[i], .de[i] and .ig there.
Do not use the roff preprocessor for new manuals!

Now that we have three main parser libraries - roff, man and mdoc -
each one having its own error handling is becoming messy, too.
Thus, start unifying message handling in one central place,
introducing a new generic function mmsg().

coded by kristaps@

Revision 1.36 / (download) - annotate - [select for diffs], Fri May 14 14:47:44 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Merge 1.9.25, keeping local patches;
this does not merge kristaps' end-of-sentences handling yet,
i will check that separately.  This one includes:
* handle \*(Ba as a delimiter
* introduce ARGS_PEND for .Bl -column .It end-of-line special casing
* section ordering: expect EXIT STATUS at the right place
* line break fixes in SYNOPSIS
* allow literal contexts to have arbitrary line lengths
* the input file column number can not be used to identify the beginning
  of a line because white space is allowed after the initial '.'
* proper leading spaces in -man -Tascii mode
* do not let Lb break lines in -mdoc -Thtml LIBRARY

Revision 1.35 / (download) - annotate - [select for diffs], Fri May 14 01:54:37 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

merge 1.9.24, keeping local patches; some changes:
* preserve multiple consecutive space characters in input
* do not restrict .Cd and .Rv to certain sections (requested by Joerg)
* do not run lookup() on quoted words
* enum return types for mdoc_args and mdoc_argv
* fix auto-closing of LINK tag in -Txhtml (from Daniel Friesel)
* various lint and manual fixes

Revision 1.34 / (download) - annotate - [select for diffs], Mon May 10 18:20:31 2010 UTC (14 years ago) by drahn
Branch: MAIN
Changes since 1.33: +3 -2 lines
Diff to previous 1.33 (colored)

Switch to using COMPILER_VERSION instead of USE_GCC3, allows for more flexible
complier picking, eg supporting gcc2, gcc3, and gcc4. based on diff by Marco,
with fixes from espie@.
ok espie@ general mumbling of approval of others.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Apr 7 23:15:05 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Merge the good parts of 1.9.23,
avoid the bad parts of 1.9.23, and keep local patches.

Input in general:
 * Basic handling of roff-style font escapes \f, \F.
 * Quoted punctuation does not count as punctuation.

mdoc(7) parser:
 * Make .Pf callable; noted by Claus Assmann.
 * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@.
 * Do not warn when .Er is used outside certain sections.
 * Replace mdoc_node_free[list] by mdoc_node_delete.
 * Replace #define by enum for rew*() return values.

man(7) parser:
 * When .TH is missing, use default section and date.

Output in general:
 * Curly braces do not count as punctuation.
 * No space after .Fl w/o args when a macro follows on the same line.

HTML output:
 * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT().
 * Print whitespace after, not before .Vt .Fn .Ft .Fo.

Checked that all manuals in base still build.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Apr 2 12:39:47 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

merge 1.9.22, keeping local patches
* convert mdoc tokens from #define to enum
* fix a segfault with .Xo/.Xc in explicit blocks
* Thorn is \*(Th, not \*(TH; noticed by Joerg Sonnenberger

Revision 1.31 / (download) - annotate - [select for diffs], Fri Apr 2 11:37:07 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

merge 1.9.20, keeping local patches
* prevent roff instructions in man(7) from clobbering scopes and line modes
  (noted by Sascha Wildner)
* handle leading punctuation in mdoc(7) blocks and line macros
  (looks good in principle, but is causing some fallout in OpenBSD,
   so i will disable it locally for now with the next commit)

Revision 1.30 / (download) - annotate - [select for diffs], Mon Mar 29 22:56:52 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

merge 1.9.19, keeping local patches
 * scoping fixes for roff instructions
 * accept apostroph in place of dot as a macro control character
 * accept tabs between the control character and the macro name
 * check that man(7) .TH titles use capital letters

Revision 1.29 / (download) - annotate - [select for diffs], Fri Mar 26 01:22:05 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

merge 1.9.17, keeping local patches

* much improved pod2man support and low-level roff robustness
* have -Tlint imply -Wall and -fstrict
* use fewer macros and more enum in libman
* and various bug fixes

Revision 1.28 / (download) - annotate - [select for diffs], Thu Mar 25 23:23:01 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

merge 1.9.16, keeping local patches

This is mostly cleanup by kristaps@ after my rather hackish patch
to tolerate the non-text macros .na, .sp, .br in next-line scope;
plus some nesting issues fixed by him, all in man(7).
This survived a full  cd /usr/src; make man.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 3 23:29:03 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.26: +1 -2 lines
Diff to previous 1.26 (colored)

This is not intended to document just the mandoc(1) program, but rather
man(7) and mdoc(7) special characters and predefined strings in general;
just as mandoc(1) is not intending to implement new languages,
but provide standard formatting for man(7) and mdoc(7) files,
whatever "standard" may mean in this context (sigh).
So move this to the right place.

noticed by deraadt@

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jan 3 19:59:59 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored)

Install mandoc_char(7), a comprehensive overview of mandoc(1) special
characters and predefined strings.

In kristaps@'s words:
"Note that mandoc_char(7) is a superset of the latest groff_char(7)
(which defines most special characters), groff(7) (more special
characters, mostly formatting), and mdoc_samples(7) (predefined
strings and other nits).  Thus, some of the characters that mandoc(1)
accepts are not accepted by the groff in OpenBSD base."

This is useful because you now have everything in one place, and
in a form authoritative for mandoc(1).  At least as long as we still
have groff(1) in base, we must keep groff_char(7) as well, of course.

"sure" jmc@

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 2 02:42:06 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

complete the sync to 1.9.15-pre2: mostly minor fixes
 * bugfix: do not restore TERMP flags when leaving lists, just reset them
 * and a few HTML fixes
 * clarity: return width from a2width, not width+2, and adapt to it
 * manual: document .Bl and .Fl
 * portability: no need to escape '%' in macro names

Revision 1.24 / (download) - annotate - [select for diffs], Thu Dec 24 02:08:14 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

sync to 1.9.14: rewrite escape sequence handling:
- new function a2roffdeco
- font modes (\f) only affect the current stack point
- implement scaling (\s)
- implement space suppression (\c)
- implement non-breaking space (\~) in -Tascii
- many manual improvements

Revision 1.23 / (download) - annotate - [select for diffs], Wed Dec 23 22:30:17 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

sync to 1.9.13: minor fixes:

correctness/functionality:
 - bugfix: properly ignore lines with only a dot in -man
 - bugfix: .Bl -ohang doesn't allow -width, warn about this
 - improve date string handling by new function mandoc_a2time
 - some HTML improvements
 - significant documentation additions in man.7 and mdoc.7

portability:
 - replace __dead by __attribute__((noreturn))
 - bugfix: correct .Dx rendering
 - some more library names for NetBSD

simplicity:
 - replace hand-rolled putchar(3)-loops by fwrite(3)
 - replace single-character printf(3) by putchar(3)

Revision 1.22 / (download) - annotate - [select for diffs], Tue Dec 22 23:58:00 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.21 / (download) - annotate - [select for diffs], Tue Oct 27 21:40:07 2009 UTC (14 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

sync to 1.9.11: adapt printing of dates to groff conventions,
NetBSD portability fixes and some minor bugfixes and feature enhancements;
also checked that my hyphenation code still works on top of this

Revision 1.20 / (download) - annotate - [select for diffs], Wed Oct 21 19:13:50 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

sync to 1.9.9, featuring:
 * -Thtml output mode
 * roff scaling units
 * and some minor fixes
for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.19 / (download) - annotate - [select for diffs], Mon Oct 19 09:16:58 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

sync to 1.9.5: partial rewrite of special character and predefined string
tables and the supporting infrastructure, mostly in preparation for
HTML output support

Revision 1.18 / (download) - annotate - [select for diffs], Fri Sep 18 22:48:29 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

now in sync with version 1.9.2

Revision 1.17 / (download) - annotate - [select for diffs], Sat Aug 22 23:17:39 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

another large chunk of -man updates,
among others regarding .DT, .HP, .RS, .RE, .SH, .SS, and scoping,
now in sync vith release 1.9.1

Revision 1.16 / (download) - annotate - [select for diffs], Sat Aug 22 20:14:37 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +4 -3 lines
Diff to previous 1.15 (colored)

Kristaps@ significantly overhauled libman.
I'm committing this in one large chunk because in contrast to -mdoc, -man
is mostly untested in OpenBSD anyway, so any fallout can be fixed in-tree.
Among others, improved support for .IP, .HP, and .TP.
Now in sync with release 1.9.0.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Aug 22 17:23:13 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

now in sync with 1.8.5 (except for %T underline)

Revision 1.14 / (download) - annotate - [select for diffs], Sat Aug 22 15:48:21 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

now in sync with 1.8.4
except for the %T underline diff which is still pending (me slacking)

Revision 1.13 / (download) - annotate - [select for diffs], Sun Aug 9 20:53:16 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

now in sync with version 1.8.3
excepting one change to .%T that I first want to discuss upstream

Revision 1.12 / (download) - annotate - [select for diffs], Sun Aug 9 17:52:08 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

now in sync with release 1.8.2

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 26 23:54:24 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

now in sync with version 1.8.1

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jul 18 22:15:04 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Kristaps was so happy about .Bl -hang support ("the last major missing
formatting feature") that he bumped the version from 1.7 to 1.8.
We are now in sync with release 1.8.0.
There is lots of work left, though, before we can use this in production...

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jul 13 00:37:07 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

now in sync with release 1.7.24

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jul 12 22:53:55 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

now in sync with release 1.7.23

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 8 00:04:10 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

sync to 1.7.21: unified escape sequence validation for mdoc and man
checking is still incomplete, but a bit better, in particular for man
now in sync with 1.7.22: the only 1.7.22 diff was already in

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jun 27 13:28:08 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Now in sync with 1.7.20, except that a few patches looking incorrect
have not been merged but instead reported upstream, and a few additional
patches approved upstream have already been merged.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jun 21 20:52:39 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

now in sync with release 1.7.19

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 18 22:16:56 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

complete sync to 1.7.17: garbage collect unused functions
mdoc_msg, mdoc_pmsg, mdoc_vmsg, and mdoc_nwarn

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 14 23:39:43 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

sync to 1.7.16: support -V command line option

Revision 1.2 / (download) - annotate - [select for diffs], Wed Apr 15 20:10:20 2009 UTC (15 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.1: +7 -2 lines
Diff to previous 1.1 (colored)

Replace variadic macros with real functions, so that this compiles on
platforms still using gcc 2.
ok deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 6 20:30:40 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN

Initial check-in of mandoc for formatting manuals. ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.