CVS log for mandoc/man_validate.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.154 / (download) - annotate - [select for diffs], Fri Apr 24 12:02:33 2020 UTC (3 months, 2 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.153: +8 -3 lines
Diff to previous 1.153 (colored)

provide a STYLE message when mandoc knows the file name and the extension
disagrees with the section number given in the .Dt or .TH macro;
feature suggested and patch tested by jmc@

Revision 1.153 / (download) - annotate - [select for diffs], Sat Apr 18 20:40:10 2020 UTC (3 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.152: +2 -2 lines
Diff to previous 1.152 (colored)

When a .Tg is attached to a paragraph, attach the permalink
to the first word, or the first few words if they are short.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Apr 4 20:33:33 2020 UTC (4 months ago) by schwarze
Branch: MAIN
Changes since 1.151: +25 -2 lines
Diff to previous 1.151 (colored)

automatically tag .SH and .SS in man(7) terminal output
in the same way as it was done for .Sh and .Ss in mdoc(7)

Revision 1.151 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:28 2020 UTC (4 months, 4 weeks ago) by schwarze
Branch: MAIN
Changes since 1.150: +103 -5 lines
Diff to previous 1.150 (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.150 / (download) - annotate - [select for diffs], Sun Jan 19 16:44:50 2020 UTC (6 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.149: +6 -11 lines
Diff to previous 1.149 (colored)

Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:
without an argument, use the empty string, and always concatenate
all arguments, no matter their number.
This allows reducing the number of arguments of mandoc_normdate()
and some other simplifications, at the same time polishing some
error messages by adding the name of the macro in question.

Revision 1.149 / (download) - annotate - [select for diffs], Thu Jun 27 15:07:30 2019 UTC (13 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.148: +13 -15 lines
Diff to previous 1.148 (colored)

Fix mandoc_normdate() and the way it is used.
In the past, it could return NULL but the calling code wasn't prepared
to handle that.  Make sure it always returns an allocated string.
While here, simplify the code by handling the "quick" attribute
inside mandoc_normdate() rather than at multiple callsites.

Triggered by deraadt@ pointing out
that snprintf(3) error handling was incomplete in time2a().

Revision 1.148 / (download) - annotate - [select for diffs], Wed Mar 13 18:29:18 2019 UTC (16 months, 4 weeks ago) by schwarze
Branch: MAIN
Changes since 1.147: +3 -3 lines
Diff to previous 1.147 (colored)

Contrary to what the NetBSD attribute(3) manual page suggests,
using __dead instead of __attribute__((__noreturn__)) actually
hinders portability rather than helping it.

Given that mandoc already uses __attribute__ in several files
and that in the portable version, ./configure already contains
rudimentary support for ignoring it on platforms that do not
support it, use __attribute__ directly.

This is expected to fix build failures that Stephen Gregoratto
<dev at sgregoratto dot me> reported from Arch and Debian Linux.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Mar 11 13:21:11 2019 UTC (17 months ago) by schwarze
Branch: MAIN
Changes since 1.146: +3 -3 lines
Diff to previous 1.146 (colored)

mark check_abort() and post_abort() as __dead;
based on a patch by Christos@ Zoulas at NetBSD

Revision 1.146 / (download) - annotate - [select for diffs], Mon Dec 31 10:04:39 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.145: +2 -3 lines
Diff to previous 1.145 (colored)

Cleanup, no functional change:
Since the man(7) and roff(7) validators no longer use the parser
state flag ROFF_NOFILL, we can finally get rid of the function
man_state(), resulting in a better separation of parsing and validation.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Dec 31 08:38:21 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.144: +20 -4 lines
Diff to previous 1.144 (colored)

Use the new flag NODE_NOFILL in the validators, which is sometimes
simpler and always more robust.  In particular, move the nesting
warnings for .EX and .EE from man_state(), where they were misplaced,
to the man(7) validator.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Dec 31 07:08:12 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.143: +3 -4 lines
Diff to previous 1.143 (colored)

Move parsing of the .nf and .fi (fill mode) requests from the man(7)
parser to the roff(7) parser.  As a side effect, .nf and .fi are
now also parsed in mdoc(7) input, though the mdoc(7) formatters
still ignore most of their effect.

Revision 1.143 / (download) - annotate - [select for diffs], Mon Dec 31 04:55:46 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.142: +3 -3 lines
Diff to previous 1.142 (colored)

Cleanup, minus 15 LOC, no functional change:
Simplify the way the man(7) and mdoc(7) validators are called.
Reset the parser state with a common function before calling them.
There is no need to again reset the parser state afterwards,
the parsers are no longer used after validation.
This allows getting rid of man_node_validate() and mdoc_node_validate()
as separate functions.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Dec 16 00:21:05 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.141: +1 -1 lines
Diff to previous 1.141 (colored)

s/OpenBSD/Id/ in CVS Ids

Revision 1.141 / (download) - annotate - [select for diffs], Fri Dec 14 05:18:02 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.140: +26 -34 lines
Diff to previous 1.140 (colored)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.140 / (download) - annotate - [select for diffs], Fri Dec 14 01:18:25 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.139: +1 -0 lines
Diff to previous 1.139 (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.139 / (download) - annotate - [select for diffs], Tue Dec 4 02:53:51 2018 UTC (20 months ago) by schwarze
Branch: MAIN
Changes since 1.138: +48 -39 lines
Diff to previous 1.138 (colored)

Clean up the validation of .Pp, .PP, .sp, and .br.  Make sure all
combinations are handled, and are handled in a systematic manner.
This resolves some erratic duplicate handling, handles a number of
missing cases, and improves diagnostics in various respects.

Move validation of .br and .sp to the roff validation module
rather than doing that twice in the mdoc and man validation modules.
Move the node relinking function to the roff library where it belongs.

In validation functions, only look at the node itself, at previous
nodes, and at descendants, not at following nodes or ancestors,
such that only nodes are inspected which are already validated.

Revision 1.138 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:10 2018 UTC (20 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.137: +31 -4 lines
Diff to previous 1.137 (colored)

In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)
to the standard forms (Pp, Ft, PP) up front, such that later code
does not need to look for the obsolete versions.
This reduces the risk of incomplete handling.

Revision 1.137 / (download) - annotate - [select for diffs], Sat Aug 18 02:08:27 2018 UTC (23 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.136: +2 -0 lines
Diff to previous 1.136 (colored)

implement the GNU man-ext .SY/.YS (synopsis block) macro in man(7),
used in most manual pages of the groff package

Revision 1.136 / (download) - annotate - [select for diffs], Thu Aug 16 23:43:37 2018 UTC (23 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.135: +1 -0 lines
Diff to previous 1.135 (colored)

implement the GNU man-ext .TQ macro in man(7),
used for example by groff_diff(7)

Revision 1.135 / (download) - annotate - [select for diffs], Thu Aug 16 15:05:34 2018 UTC (23 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.134: +2 -3 lines
Diff to previous 1.134 (colored)

Do not calculate a pointer to a memory location before the beginning of
a static array.  Christos Zoulas, Robert Elz, and Andreas Gustafsson
point out that is undefined behaviour by the C standard even if we
never access the pointer.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Apr 11 17:11:13 2018 UTC (2 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.133 / (download) - annotate - [select for diffs], Wed Jul 26 10:33:34 2017 UTC (3 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.132: +1 -2 lines
Diff to previous 1.132 (colored)

Fix a typo that caused a non-constant string
to be passed as a format string; no functional change;
reported by Michael <Stapelberg at debian>.

Revision 1.132 / (download) - annotate - [select for diffs], Sun Jun 25 11:42:02 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.131: +3 -1 lines
Diff to previous 1.131 (colored)

add support for the MT and ME mailto macros, used for example in wg(8);
patch from bentley@

Revision 1.131 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:32 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.130: +11 -7 lines
Diff to previous 1.130 (colored)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Jun 17 22:43:14 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.129: +8 -0 lines
Diff to previous 1.129 (colored)

style message about missing RCS ids; inspired by mdoclint

Revision 1.129 / (download) - annotate - [select for diffs], Sat Jun 17 16:47:48 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.128: +19 -2 lines
Diff to previous 1.128 (colored)

if .in is used inside the .TP head, it's always relative

Revision 1.128 / (download) - annotate - [select for diffs], Sun Jun 11 19:37:01 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.127: +2 -3 lines
Diff to previous 1.127 (colored)

Style message about legacy man(7) date format in mdoc(7) documents
and operating system dependent messages about missing or unexpected
Mdocdate; inspired by mdoclint(1).

Revision 1.127 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.126: +4 -1 lines
Diff to previous 1.126 (colored)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.126 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.125: +0 -1 lines
Diff to previous 1.125 (colored)

move .ll to the roff modules

Revision 1.125 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.124: +2 -44 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Thu May 4 17:48:28 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.123: +11 -1 lines
Diff to previous 1.123 (colored)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.123 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +12 -12 lines
Diff to previous 1.122 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.122 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:09 2016 UTC (4 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13_4, VERSION_1_13
Changes since 1.121: +10 -10 lines
Diff to previous 1.121 (colored)

Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a
tiny loop - not only making data smaller, but code shorter as well.

This gets rid of an implicit invariant that confused both static
analysis tools and human auditors.  No functional change.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Oct 22 21:54:23 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.120: +17 -32 lines
Diff to previous 1.120 (colored)

move man(7) validation into the dedicated validation phase, too

Revision 1.120 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:15 2015 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +0 -8 lines
Diff to previous 1.119 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Apr 19 14:00:19 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +1 -1 lines
Diff to previous 1.118 (colored)

Decouple the token code for "no request or macro" from the individual
high-level parsers to allow further unification of functions that
only need to recognize this code, but that don't care about different
high-level macrosets beyond that.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Apr 19 13:50:26 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +5 -4 lines
Diff to previous 1.117 (colored)

Unify node handling functions:
* node_alloc() for mdoc and man_node_alloc() -> roff_node_alloc()
* node_append() for mdoc and man_node_append() -> roff_node_append()
* mdoc_head_alloc() and man_head_alloc() -> roff_head_alloc()
* mdoc_body_alloc() and man_body_alloc() -> roff_body_alloc()
* mdoc_node_unlink() and man_node_unlink() -> roff_node_unlink()
* mdoc_node_free() and man_node_free() -> roff_node_free()
* mdoc_node_delete() and man_node_delete() -> roff_node_delete()
Minus 130 lines of code, no functional change.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:40 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Apr 2 23:48:19 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +13 -13 lines
Diff to previous 1.115 (colored)

Third step towards parser unification:
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.

Revision 1.115 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:17 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.114: +4 -4 lines
Diff to previous 1.114 (colored)

Second step towards parser unification:
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:50 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.113: +22 -19 lines
Diff to previous 1.113 (colored)

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Feb 6 11:54:36 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.112: +22 -21 lines
Diff to previous 1.112 (colored)

better error reporting regarding .OP .RS .UR .TH arguments

Revision 1.112 / (download) - annotate - [select for diffs], Fri Feb 6 09:38:43 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +1 -10 lines
Diff to previous 1.111 (colored)

better diagnostics about excess arguments to .PD .ft .sp

Revision 1.111 / (download) - annotate - [select for diffs], Fri Feb 6 08:28:35 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.110: +2 -10 lines
Diff to previous 1.110 (colored)

better error reporting for .br .fi .nf with arguments

Revision 1.110 / (download) - annotate - [select for diffs], Fri Feb 6 07:13:14 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

Delete the legacy generic warning type MANDOCERR_ARGCWARN,
replacing the last instances by more specific warnings.
Improved functionality, minus 50 lines of code.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Jan 24 02:41:49 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.108: +0 -1 lines
Diff to previous 1.108 (colored)

Strangely, ignoring the roff(7) .na request was implemented in the man(7)
parser.  Simplify the code by moving it into the roff(7) parser, also
making it work for mdoc(7).

Revision 1.108 / (download) - annotate - [select for diffs], Sun Dec 28 14:42:27 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.107: +2 -0 lines
Diff to previous 1.107 (colored)

mdoc(7) already uses the mandoc(1) -Ios argument in the footer line
when .Os has no argument, so do the same for man(7) when .TH has less
than four arguments; there is no reason to treat both differently.
Issue found following a question from Thomas Klausner <wiz at NetBSD>.

Revision 1.107 / (download) - annotate - [select for diffs], Fri Nov 28 05:51:32 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.106: +49 -64 lines
Diff to previous 1.106 (colored)

Simplify by making many functions in the man(7) parser void,
and some cleanup; no functional change, minus 70 lines.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (6 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.105: +1 -3 lines
Diff to previous 1.105 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Aug 6 15:09:05 2014 UTC (6 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.104: +12 -9 lines
Diff to previous 1.104 (colored)

Bring the handling of defective prologues even closer to groff,
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED.  Warn about it.
* Missing section in .Dt does not default to 1.  But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings.  Warn about it.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Aug 1 21:24:17 2014 UTC (6 years ago) by schwarze
Branch: MAIN
Changes since 1.103: +69 -120 lines
Diff to previous 1.103 (colored)

Simplify man(7) validation:
Drop pre-handlers, they were almost unused.
Drop the needless complexity of allowing more than one post-handler.

This saves one internal interface function, one static function, one
private struct definition, sixteen static arrays, and 45 lines of code.
No functional change.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Aug 1 17:40:34 2014 UTC (6 years ago) by schwarze
Branch: MAIN
Changes since 1.102: +5 -3 lines
Diff to previous 1.102 (colored)

demacrify: get rid of man_nmsg(), man_pmsg(), mdoc_nmsg(), mdoc_pmsg()

Revision 1.102 / (download) - annotate - [select for diffs], Fri Aug 1 17:27:44 2014 UTC (6 years ago) by schwarze
Branch: MAIN
Changes since 1.101: +10 -6 lines
Diff to previous 1.101 (colored)

mention requests and macros in more messages

Revision 1.101 / (download) - annotate - [select for diffs], Wed Jul 30 23:01:39 2014 UTC (6 years ago) by schwarze
Branch: MAIN
Changes since 1.100: +4 -22 lines
Diff to previous 1.100 (colored)

Improve handling of next-line scope broken by end of file.
Detect the condition earlier, report in the error message
which block is broken, and delete the broken block.
Consequently, empty section headers can no longer happen.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Jul 7 21:36:20 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.99: +4 -5 lines
Diff to previous 1.99 (colored)

Clean up ERROR messages related to document structure and macros:
Hierarchical naming and mention macro names in messages.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Jul 6 19:09:00 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.98: +3 -2 lines
Diff to previous 1.98 (colored)

Clean up messages related to plain text and to escape sequences.
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.

Revision 1.98 / (download) - annotate - [select for diffs], Sat Jul 5 12:34:17 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored)

Cleanup with respect to bad macro arguments.
* Fix .Sm with invalid arg: move arg out and toggle mode.
* Promote "unknown standard" from WARNING to ERROR, it loses information.
* Delete MANDOCERR_BADWIDTH, it would only indicate a mandoc(1) bug.
* Do not report MANDOCERR_BL_LATETYPE when there is no type at all.
* Mention macro names, arguments and fallbacks.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Jul 4 16:12:08 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.96: +6 -2 lines
Diff to previous 1.96 (colored)

Clean up messages regarding excess arguments:
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.

Revision 1.96 / (download) - annotate - [select for diffs], Wed Jul 2 11:43:20 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

Clean up warnings related to macros and nesting.
* Hierarchical naming of enum mandocerr items.
* Improve the wording to make it comprehensible.
* Mention the offending macro.
* Garbage collect one chunk of ancient, long unreachable code.

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jul 2 05:52:24 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.94: +10 -4 lines
Diff to previous 1.94 (colored)

Improve "skipping paragraph macro" messages,
showing which macro was skipped and before or after what.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jul 1 22:37:15 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.93: +5 -2 lines
Diff to previous 1.93 (colored)

Clean up the warnings related to document structure.
* Hierarchical naming of the related enum mandocerr items.
* Mention the offending macro, section title, or string.
While here, improve some wordings:
* Descriptive instead of imperative style.
* Uniform style for "missing" and "skipping".
* Where applicable, mention the fallback used.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Jun 20 23:02:31 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.92: +7 -5 lines
Diff to previous 1.92 (colored)

As suggested by jmc@, only include line and column numbers into messages
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual

Another example this applies to is documents having a prologue,
but lacking a body.  Do not throw a FATAL error for these; instead,
issue a WARNING and show the empty document, in the man(7) case with
the same amount of blank lines as groff does.  Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.

Revision 1.92 / (download) - annotate - [select for diffs], Fri Jun 20 17:24:00 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.91: +9 -4 lines
Diff to previous 1.91 (colored)

Start systematic improvements of error reporting.
So far, this covers all WARNINGs related to the prologue.

1) hierarchical naming of MANDOCERR_* constants
2) mention the macro name in messages where that adds clarity
3) add one missing MANDOCERR_DATE_MISSING msg
4) fix the wording of one message related to the man(7) prologue

Started on the plane back from Ottawa.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:04 2014 UTC (6 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.90: +42 -48 lines
Diff to previous 1.90 (colored)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:48 2014 UTC (6 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.89: +2 -1 lines
Diff to previous 1.89 (colored)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.89 / (download) - annotate - [select for diffs], Sun Mar 23 11:25:26 2014 UTC (6 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.88: +2 -1 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Mon Jan 6 22:39:25 2014 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.87: +8 -6 lines
Diff to previous 1.87 (colored)

Another 18% speedup for mandocdb(8) -Q, found by gprof(1).
In -Q mode, refrain form validating and normalizing the format
of the date given in .Dd or .TH, as it won't be used anyway.

For /usr/share/man, mandocdb -Q now takes 45% of the time of makewhatis(8).

Revision 1.87 / (download) - annotate - [select for diffs], Tue Dec 31 18:07:42 2013 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.86: +2 -6 lines
Diff to previous 1.86 (colored)

remove assignments that will be overwritten right afterwards,
and remove pointless local variables;
found in a clang output from Ulrich Spoerlein <uqs at FreeBSD>

Revision 1.86 / (download) - annotate - [select for diffs], Thu Oct 17 20:54:58 2013 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3
Changes since 1.85: +17 -2 lines
Diff to previous 1.85 (colored)

Implement the .UR/.UE block (uniform resource identifier) introduced in the
man-ext macros by Eric S. Raymond, enabled by default in groff_man(7).
Usual disclaimer: You don't write new man(7) code, so you are not going
to use these, either.
Improves e.g. the bzr(1) and etherape(1) manuals.
Thanks to naddy@ for bringing these to my attention.

Revision 1.85 / (download) - annotate - [select for diffs], Sat Nov 17 00:26:33 2012 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_2
Changes since 1.84: +72 -81 lines
Diff to previous 1.84 (colored)

Cleanup naming of local variables to make the code easier on the eye:
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.

ok kristaps@ some time ago

Revision 1.84 / (download) - annotate - [select for diffs], Sun Jul 29 12:35:42 2012 UTC (8 years ago) by schwarze
Branch: MAIN
Changes since 1.83: +3 -2 lines
Diff to previous 1.83 (colored)

Implement .PD for -Tascii.
Reminded about the missing feature by millert@.
This reduces mandoc/groff differences in OpenBSD base by 25%.
ok millert@

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jul 18 16:52:03 2012 UTC (8 years ago) by schwarze
Branch: MAIN
Changes since 1.82: +22 -2 lines
Diff to previous 1.82 (colored)

Drop empty .IP such that is does not cause additional vertical spacing.
Issue first reported by naddy@ in rsync(1).
OpenBSD rev. 1.55.

Revision 1.82 / (download) - annotate - [select for diffs], Wed Jul 18 16:41:09 2012 UTC (8 years ago) by schwarze
Branch: MAIN
Changes since 1.81: +20 -7 lines
Diff to previous 1.81 (colored)

Drop .sp and .br right after .SH and .SS.

Fixes vertical spacing after "OPTIONS" in gcc(1).
Issue first reported by naddy@ in rsync(1).

OpenBSD rev. 1.54.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jun 2 20:16:23 2012 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.80: +3 -1 lines
Diff to previous 1.80 (colored)

Minimal implementation of .EX and .EE for GNU compatibility.
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jan 3 15:16:24 2012 UTC (8 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.79: +7 -3 lines
Diff to previous 1.79 (colored)

Add support for `OP', one of the extended man macros.  This also requires
some man(7) changes to accomodate for the an-ext compatibility.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Dec 2 01:37:14 2011 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.78: +5 -1 lines
Diff to previous 1.78 (colored)

In man(7), when no explicit volume name is given, use the default
volume name for the respective manual section, just like in mdoc(7).
This gives us nicer page headers for cvs(1), lynx(1), tic(1),
mkhybrid(8), and many curses(3) manuals.

ok kristaps@

To not break compatibility, i wrote a corresponding patch for GNU troff
which Werner Lemberg accepted upstream at rev. 1.65 of:
http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff

Revision 1.78 / (download) - annotate - [select for diffs], Mon Nov 7 01:24:40 2011 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +11 -26 lines
Diff to previous 1.77 (colored)

When the HEAD scope of .TP is broken by another block macro,
do not abort with a FATAL error, but report a report a WARNING,
remove the broken .TP from the syntax tree, and prod on.
Reported repeatedly by ports people, at least by brad@ and jeremy@.
Also fixes rendition(4) in Xenocara.
ok kristaps@

Revision 1.77 / (download) - annotate - [select for diffs], Thu Nov 3 20:48:52 2011 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.76: +6 -4 lines
Diff to previous 1.76 (colored)

When .TH sets no data, leave the date field in the page footer blank,
do not use the current date.  This removes a gratuitous output difference
with respect to groff.
ok kristaps@

Revision 1.76 / (download) - annotate - [select for diffs], Sun Oct 16 12:20:34 2011 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.75: +6 -7 lines
Diff to previous 1.75 (colored)

Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Sep 6 17:53:50 2011 UTC (8 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_0
Changes since 1.74: +17 -2 lines
Diff to previous 1.74 (colored)

Revert removal of tab warning, suggested by schwarze@.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Sep 4 09:58:40 2011 UTC (8 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.73: +3 -18 lines
Diff to previous 1.73 (colored)

Remove check for tab.  man(7) says tab is Ok.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Sep 4 09:49:46 2011 UTC (8 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.72: +20 -10 lines
Diff to previous 1.72 (colored)

Teach -man that a literal context should be closed by SS/SH in the
backend (the front-end already accomodated for this).  Found indirectly
from a question by Brad Smith.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Jul 26 14:09:01 2011 UTC (9 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6
Changes since 1.71: +8 -38 lines
Diff to previous 1.71 (colored)

Move checking of escapes into roff.c, where we're already stepping
through looking for user-defined escapes.  This clears up a nice bit of
validation code.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Jul 24 18:15:14 2011 UTC (9 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_5
Changes since 1.70: +3 -2 lines
Diff to previous 1.70 (colored)

Scary-looking but otherwise harmless changes allow me to build for Windows.
That is to say, with mingw32.  This amounts to the following:

 (1) break compat.c into compat_strlcpy.c and compat_strlcat.c
 (2) add compat_getsubopt.c (from OpenBSD) and test-getsubopt.c
 (3) add test-strptime.c for HAVE_STRPTIME
 (4) add ifdef bits here and there, where necessary
 (5) remove some harmless unportable stuff (u_char, localtime_r)

I've added the appropriate mdocml.zip target to the Makefile, too.

Revision 1.70 / (download) - annotate - [select for diffs], Fri Jul 8 09:34:06 2011 UTC (9 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_4
Changes since 1.69: +20 -5 lines
Diff to previous 1.69 (colored)

Make sure that `br' and `sp' don't emit space before the initial `SH' in
-man.  This actually seems to be what groff does.  Sort-of.  Anyway,
it's required to get perlpod pages rendered nicely, so until perlpod
stops producing shit, do it.  Ok schwarze@.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Apr 13 09:57:08 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_3, VERSION_1_11_2
Changes since 1.68: +5 -8 lines
Diff to previous 1.68 (colored)

Remove the warning for empty bodies of `Sh', `Ss', `SH', and `SS'.  This
prompted by a TODO by schwarze@, originally from Gleydson Soares, that
an empty `SS' was raising an error (it hasn't for some time).  It makes
sense these shouldn't warn, as omitting their contents doesn't change
anything in the structure of the document (groff and mandoc specifically
account for the whitespace between empty sections).

This doesn't change any manuals, which only refer to the line arguments
(or possibly next-line, in the case of man(7) syntax).

Revision 1.68 / (download) - annotate - [select for diffs], Sat Apr 9 15:29:40 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.67: +31 -25 lines
Diff to previous 1.67 (colored)

Remove a2roffdeco() and mandoc_special() functions and replace them with
a public (mandoc.h) function mandoc_escape(), which merges the
functionality of both prior functions.

Reason: code duplication.  The a2roffdeco() and mandoc_special()
functions were pretty much the same thing and both quite complex.  This
allows one function to receive improvements in (e.g.) subexpression
handling and performance, instead of having to replicate functionality.

As such, the mandoc_escape() function already handles a superset of the
escapes handled in previous versions and has improvements in performance
(using strcspn(), for example) and reliable handling of subexpressions.

This code Works For Me, but may need work to catch any regressions.
Since the benefits are great (leaner code, simpler API), I'd rather have
it in-tree than floating as a patch.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Mar 22 15:30:30 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_1
Changes since 1.66: +5 -3 lines
Diff to previous 1.66 (colored)

Make empty sections and parts (SH, SS, RS) only produce a warning if it
has no children.  Noted by Brad, added to TODO by schwarze@.

Revision 1.66 / (download) - annotate - [select for diffs], Tue Mar 22 14:33:05 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored)

libmdoc.h and libman.h were including mdoc.h and man.h, respectively.
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Mar 20 16:02:05 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.64: +13 -10 lines
Diff to previous 1.64 (colored)

Consolidate messages.  Have all parse-time messages (in libmdoc,
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h.  This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Mar 17 11:56:17 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.63: +3 -4 lines
Diff to previous 1.63 (colored)

Clean-up in libman: make all calls to man_*msg not check return value.
Also convert man_vmsg to return void.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:51 2011 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +16 -24 lines
Diff to previous 1.62 (colored)

Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

Revision 1.62 / (download) - annotate - [select for diffs], Wed Feb 9 09:18:15 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.61: +3 -1 lines
Diff to previous 1.61 (colored)

Allow -man to process EQN as well.  Also fix a segfault in missing case
statements in the post-handler for EQN in -mdoc and -man.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Feb 6 21:44:36 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored)

Add initial libmdoc and libman top-most machinery for accepting TBL
directives.  For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).

Revision 1.60 / (download) - annotate - [select for diffs], Mon Jan 17 00:21:29 2011 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +24 -34 lines
Diff to previous 1.59 (colored)

Refrain from throwing fatal errors for
* .br .sp .nf .fi .na with arguments - just skip the arguments
* .TH lacking arguments - use empty strings instead like groff
* .TH with excessive arguments - skip those
Reminded by joerg@, ok kristaps@.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Jan 12 16:55:22 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.58: +20 -31 lines
Diff to previous 1.58 (colored)

Downgrade -man message of ignored empty paragraph to MANDOC_IGNPAR.  The
change in man_macro.c was from an assertion caused by a subtle problem:
(1) macro is removed, causing m->last to be m->last->parent; (2) by jumping
to the m->last->parent after post-validation, the original
m->last->parent is skipped; (3) the rewinder climbs to the root of the
tree and aborts.

The original issue recorded in the TODO by schwarze@, reminded by Brad
Smith.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Jan 12 15:50:42 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Make out-of-context `fi' invocations not cause an error, but just a
warning.  From a TODO by schwarze@, originally noted by Brad Smith.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jan 1 12:59:17 2011 UTC (9 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.56: +12 -4 lines
Diff to previous 1.56 (colored)

Add -man support for tables.  Like -mdoc, this consists of an
external-facing function man_addspan() (this required shuffling around
the descope routine) and hooks elsewhere.

Also fixed mdoc.c's post-validation of tables.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Dec 8 10:58:22 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8
Changes since 1.55: +1 -3 lines
Diff to previous 1.55 (colored)

Remove `i' and `r' macro handlers.  These macros, originally part of the
me package, aren't recognised by "groff -mandoc" so we don't need to do
so either.  Discussed on tech@ with schwarze@.

While at it, remove references to `b' in man.7.  As far as I know, this
was never supported anyway.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Dec 6 15:31:19 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_7
Changes since 1.54: +56 -1 lines
Diff to previous 1.54 (colored)

Add support for `ft' macro found in groff(7).  Based on a patch by
schwarze@, but without the -T[x]html handling, which structurally does
not work.  Also add man.7 documentation (not in original patch).

Revision 1.54 / (download) - annotate - [select for diffs], Mon Dec 6 13:56:56 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.53: +21 -19 lines
Diff to previous 1.53 (colored)

Make return(man_nmsg(...)) by a simple declaration.

Make non-uppercase warning only occur once.

Make scope-open-on-error warning only occur once.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Dec 6 13:50:41 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.52: +2 -4 lines
Diff to previous 1.52 (colored)

Allow HP/IP/etc. to have no arguments, as they're optional.  From a field-
tested patch by schwarze@.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Dec 5 16:14:16 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.51: +1 -5 lines
Diff to previous 1.51 (colored)

Remove `Sp', `Vb', and `Ve' (as per schwarze@'s changes in OpenBSD),
which are now accomodated for the new libroff modifications.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Nov 30 15:24:27 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.50: +192 -9 lines
Diff to previous 1.50 (colored)

Move all man_action.c routines into man_validate.c

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 11 15:45:36 2010 UTC (9 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

Quiesce Linux header-inclusion warnings.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Aug 20 01:02:07 2010 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.48: +3 -7 lines
Diff to previous 1.48 (colored)

Implement a simple, consistent user interface for error handling.
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK  kristaps@;  Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Jul 31 23:52:58 2010 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Sync to OpenBSD: add missing Copyright years.
I checked that substantial changes were committed
to these files during these years.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Jul 22 23:03:15 2010 UTC (10 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF, VERSION_1_10_5
Changes since 1.46: +6 -5 lines
Diff to previous 1.46 (colored)

Added `in' macro support for -man -Tascii.  This is not yet supported in
-Thtml (I'm surprised to note that neither is LITERAL mode).

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jul 20 14:56:42 2010 UTC (10 years ago) by kristaps
Branch: MAIN
Changes since 1.45: +26 -20 lines
Diff to previous 1.45 (colored)

Strip non-graphable input characters from input.  The manuals
specifically say that this is not allowed, and were it allowed, output
would be inconsistent across output media (-Tps will puke,
non-your-charset terminals will puke, etc.).

With this done, simplify check_text() to only check escapes and for
tabs.  Add in a new tab warning, too.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jun 28 14:39:17 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_4, VERSION_1_10_3
Changes since 1.44: +6 -1 lines
Diff to previous 1.44 (colored)

Notes: this must be done later.  \b in the input will cause havoc.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:28 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.43 / (download) - annotate - [select for diffs], Wed Jun 9 19:22:56 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)

Squash bug noted by Ulrich Spoerlein where "-" were being converted to
ASCII_HYPH, as per normal, but were screwing up mandoc_special().  Fixed
by making mandoc_special() first check isspace() instead of ! isgraph(),
then normalise its string as it passes out.  This require de-constifying
some validation routines not already de-constified (those in libman),
but that's ok, because I'd like to be pushing actions into validation
routines to save on space and redundant calculations.

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 25 12:44:53 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_1
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

Smarten BADCHAR check to allow ASCII_HYPH.
Fix index.sgml not to puke (the relevant section will be re-written for the release anyway, but I hate seeing errors).

Revision 1.41 / (download) - annotate - [select for diffs], Mon May 17 22:11:42 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.40: +39 -30 lines
Diff to previous 1.40 (colored)

Enable the unified error/warning enumeration in mandoc.h that's
stringified in main.c.

Allow `An' to handle an argument and child (with a warning).

Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a
warning).

Allow inconsistent column syntax to only raise a warning.

Revision 1.40 / (download) - annotate - [select for diffs], Mon May 17 10:50:32 2010 UTC (10 years, 2 months ago) by joerg
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

Add support for .AT. Properly implement .UC. Add regress tests.

Revision 1.39 / (download) - annotate - [select for diffs], Sat May 15 22:44:04 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.38: +1 -24 lines
Diff to previous 1.38 (colored)

Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the roff preprocessor.

Revision 1.38 / (download) - annotate - [select for diffs], Sat May 15 20:51:40 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.37: +2 -4 lines
Diff to previous 1.37 (colored)

Pull `ig' out of -man and leave it the roff preparser.

Revision 1.37 / (download) - annotate - [select for diffs], Sat May 15 15:54:39 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Removed restriction on integer manual sections in -man.

Revision 1.36 / (download) - annotate - [select for diffs], Fri May 14 16:19:26 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Pulled back in mysterious lost le1 <-> eq0 for Sp macro.

Revision 1.35 / (download) - annotate - [select for diffs], Sun May 9 21:19:42 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_25
Changes since 1.34: +2 -4 lines
Diff to previous 1.34 (colored)

Remove -fno-ign-chars as well-argued by Ingo Schwarze.  Patch by Ingo Schwarze, too.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Apr 3 14:12:48 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_24, VERSION_1_9_23
Changes since 1.33: +14 -3 lines
Diff to previous 1.33 (colored)

Modified version of Ingo Schwarze's patch so that -man doesn't puke when a TH isn't specified.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 29 10:10:35 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_22, VERSION_1_9_21, VERSION_1_9_20
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Final (?) fix to issue pointed out by Sascha Wildner: roff instructions clobbering prior scope rules and line modes.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Mar 27 10:04:56 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_19, VERSION_1_9_18
Changes since 1.31: +22 -3 lines
Diff to previous 1.31 (colored)

Fixed re-adjustment of scope in exiting roff instructions (libman).
Added title-case check for (libman).
Fixed premature closure of roff instruction scope (libman).
Added documentation of ignored roff macros to man(3).

Revision 1.31 / (download) - annotate - [select for diffs], Wed Mar 24 20:10:53 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_17
Changes since 1.30: +27 -1 lines
Diff to previous 1.30 (colored)

Using man_node_delete() instead of man_node_free()/man_node_freelist() and friends (much simpler).
Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original.
Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).

Revision 1.30 / (download) - annotate - [select for diffs], Tue Mar 23 11:30:48 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.29: +6 -3 lines
Diff to previous 1.29 (colored)

Support for pod2man standard header macros (Vb, Ve, Sp).  Based largely on a set of patches by Ingo Schwarze.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Mar 22 05:59:32 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_16
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored)

Accomodate (libman) for next-line macros followed by non-text macros `na', `sp', and `br'.
Based on a patch by Ingo Schwarze.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 1 17:14:28 2010 UTC (10 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre2, VERSION_1_9_15
Changes since 1.27: +5 -1 lines
Diff to previous 1.27 (colored)

Big check-in of compatibility layer.  This should work on most major architectures. Thanks to Joerg Sonnenberger.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Nov 2 06:22:45 2009 UTC (10 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre1, VERSION_1_9_14, VERSION_1_9_13
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Added mandoc_a2time() for proper date conversion.
Fitted TH and Dd handlers to use mandoc_a2time().
Documented date syntax for -man, fixed documentation for -mdoc.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Oct 24 05:45:05 2009 UTC (10 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_12, VERSION_1_9_11, VERSION_1_9_10
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Added `PD' to -man (doesn't do anything, yet).

Revision 1.25 / (download) - annotate - [select for diffs], Sun Oct 18 11:36:37 2009 UTC (10 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_9
Changes since 1.24: +4 -35 lines
Diff to previous 1.24 (colored)

Removed number-check for `sp' in -Tman, as nroff accepts non-numerics as a single vspace.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Aug 22 09:10:38 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_8, VERSION_1_9_7, VERSION_1_9_6, VERSION_1_9_5, VERSION_1_9_2
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Added `UC' libman macro (has no effect).
Corrected `UC' and `DT' not to print their arguments.
Noted that `UC' and `DT' shouldn't be used.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Aug 21 13:16:16 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_1
Changes since 1.22: +14 -2 lines
Diff to previous 1.22 (colored)

`RS' warns if empty body.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Aug 21 12:12:12 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.21: +12 -24 lines
Diff to previous 1.21 (colored)

Open explicit scope on libman exit now only generates warning.
Consecutive ELINE scopes are now pruned (with a warning).

Revision 1.21 / (download) - annotate - [select for diffs], Thu Aug 20 11:51:07 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +3 -2 lines
Diff to previous 1.20 (colored)

Added `DT' macro (pointed out by joerg@netbsd.org).

Revision 1.20 / (download) - annotate - [select for diffs], Wed Aug 19 12:15:58 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +1 -3 lines
Diff to previous 1.19 (colored)

libman checks for open explicit scopes on exit.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Aug 19 09:14:50 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.18: +5 -1 lines
Diff to previous 1.18 (colored)

Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).

Revision 1.18 / (download) - annotate - [select for diffs], Tue Aug 18 11:46:44 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_0
Changes since 1.17: +9 -7 lines
Diff to previous 1.17 (colored)

Fixed missing check for open ELINE scope in BLINE macro.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 13 11:45:29 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.16: +160 -59 lines
Diff to previous 1.16 (colored)

Significant overhaul in libman.  Macros are now block- and line-scoped (with
next-line scope extensions possible).  man.7 reflects block and line scoping,
and also includes a REFERENCE section that will be used as a template for the
big mdoc reference.  Many fixes in next-line behaviour for both inline and
block macros.  Added some macros for compatibility (from me.7).  Corrected
quoted-literal handling for libman.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jul 24 20:22:24 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_5, VERSION_1_8_4
Changes since 1.15: +40 -5 lines
Diff to previous 1.15 (colored)

Added `sp' support to libman.
Added `\c' to known escapes (only used in man, but still).

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jul 4 09:01:55 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_3, VERSION_1_8_2, VERSION_1_8_1, VERSION_1_8_0, VERSION_1_7_24, VERSION_1_7_23, VERSION_1_7_22, VERSION_1_7_21
Changes since 1.14: +18 -3 lines
Diff to previous 1.14 (colored)

Moved escape validation into libmandoc.h/mandoc.c (common between libman/libmdoc1).
libman supports MAN_IGN_ESCAPE (like MDOC_IGN_ESCAPE).
All popular escapes now handled consistently.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jun 22 13:09:17 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_20
Changes since 1.13: +16 -3 lines
Diff to previous 1.13 (colored)

libman documents require `TH' and at least one node.
libman requirements documented in man.7 STRUCTURE section.
Added STRUCTURE section to mdoc.7, too.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jun 22 10:40:04 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

Reverted max column width 80 -> 78 (schwarze@openbsd.org).

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 18 10:53:58 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.11: +3 -29 lines
Diff to previous 1.11 (colored)

Moved all formatted libman warn/error into man.c/libman.h.
Converted all formatted warn/errors into regular syntax.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jun 18 10:32:00 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.10: +49 -16 lines
Diff to previous 1.10 (colored)

Added -fno-ign-chars support to libman.
man_validate.c checks for non-tab/isprint words.
libman hashtable fixed (was ignoring .br).
Added ncount field to man_node, deprecating count() functions.
Documented use of tabs in man.7.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 16 19:55:28 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_19
Changes since 1.9: +2 -3 lines
Diff to previous 1.9 (colored)

Removed MAN___: moved MAN_br to its index (comments not passed into parser).
Fix: hashtable not fully formed after removal of MDOC___.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 10 20:18:43 2009 UTC (11 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_17, VERSION_1_7_16, VERSION_1_7_15, VERSION_1_7_14
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Fixed license email address.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Apr 12 19:45:26 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_13
Changes since 1.7: +10 -12 lines
Diff to previous 1.7 (colored)

Using proper license template (const).

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 5 16:34:22 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_12, VERSION_1_7_10, OPENBSD_CHECKIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

man(3) doesn't use err.h anymore.
Added .i to man(3).
Fixed up manuals.
Fixed up webpage.
Assertion fixes in man(3) (hashtable).
Fixed assertion for .IP in mandoc -man.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 2 06:51:44 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

mdoc_tokhash -> hash
Initial man hashtab (BROKEN).

Revision 1.5 / (download) - annotate - [select for diffs], Fri Mar 27 14:56:15 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

Added some new manuals (mdoc.3 mandoc_char.7).
Support for .br in libman.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 26 14:38:11 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_5
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Initial front-end formatting for -man pages.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Mar 26 09:55:39 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

Fixed reading whitespace for man.7 `.    TH'.
Documented this.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Mar 25 21:46:24 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +1 -2 lines
Diff to previous 1.1 (colored)

*** empty log message ***

Revision 1.1 / (download) - annotate - [select for diffs], Wed Mar 25 15:17:49 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN

Added man validator, renamed mdoc validator.

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.




CVSweb