aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
Commit message (Collapse)AuthorAgeFilesLines
...
* style checks related to .Er; inspired by mdoclint(1)Ingo Schwarze2017-06-071-1/+3
|
* Minimal implementation of the roff(7) .ce request (center a numberIngo Schwarze2017-06-061-1/+2
| | | | | of input lines without filling). Contrary to groff, high-level macros abort .ce mode for now.
* ignore blank lines in man(7) next line scope;Ingo Schwarze2017-06-031-1/+2
| | | | strange groff edge case behaviour found in multimedia/mjpegtools
* Partial implementation of \h (horizontal line drawing function).Ingo Schwarze2017-06-021-1/+2
| | | | | | | | | | | A full implementation would require access to output device properties and state variables (both only available after the main parser has finalized the parse tree) before numerical expansions in the roff preprocessor (i.e., before the main parser is even started). Not trying to pull that stunt right now because the static-width implementation committed here is sufficient for tcl-style manual pages and already more complicated than i would have suspected.
* Minimal implementation of the \h (horizontal motion) escape sequence.Ingo Schwarze2017-06-011-1/+2
| | | | Good enough to cope with the average DocBook insanity.
* STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)Ingo Schwarze2017-06-011-1/+2
|
* STYLE message about missing use of Ox/Nx/Fx/Dx; OK jmc@ wiz@Ingo Schwarze2017-05-311-1/+2
|
* STYLE message about useless macros we don't want (Bt Tn Ud);Ingo Schwarze2017-05-301-1/+3
| | | | not a WARNING because they don't endanger portability
* Introduce a new mandoc(1) message level, -W style, below -W warning.Ingo Schwarze2017-05-161-2/+4
| | | | | | | | | | | | | Switch -W all from meaning -W warning to meaning -W style. The meaning of -T lint does *not* change, it still implies -W warning. No messages on the new level yet, but they will come. Usually, i do not lightly make the user interface larger. But this has been planned for years, and EXIT STATUS 1 was reserved for it all the time. The message system is now stable enough to finally implement it. jmc@ regarding the concept: "really good idea"
* Using .Nd only makes sense in the NAME section.Ingo Schwarze2017-03-061-1/+2
| | | | | Warn if that macro occurs elsewhere. Triggered by a question from Dag-Erling Smoergrav <des @ FreeBSD>.
* Add a warning "new sentence, new line".Ingo Schwarze2017-01-281-1/+2
| | | | | | | | | This does not attempt to pinpoint each and every offender, but instead tries very hard to avoid false positives: Currently, there are only two false positives in the whole OpenBSD base system. Only do this in mdoc(7), not in man(7), because manuals written in man(7) typically have much worse problems than this. OK jmc@ on a previous version of the patch
* Warnings and errors that occur during mdoc_validate()Ingo Schwarze2017-01-091-1/+2
| | | | | | or during man_validate() have to affect the mandoc(1) EXIT STATUS. Many thanks to <Yuri dot Pankov at gmail dot com> (illumos developer) for reporting this regression.
* Stricter validation of the NAME section, in particular:Ingo Schwarze2017-01-081-3/+4
| | | | | | | - require a comma between names - reject all other text nodes - reject all empty Nm below NAME, not only in the leading position - reject Nm after Nd
* Make the second, section number argument of .Xr mandatory.Ingo Schwarze2016-12-281-1/+2
| | | | | | In fact, we have been requiring it for many years. The only reason to not warn when it was missing was excessive traditionalism - it was optional in 4.4BSD.
* Delete complicated code dealing with .Bl -tag without -width,Ingo Schwarze2016-10-091-2/+2
| | | | | | | | | | | | and just let it default to -width 6n, which agrees with the traditional -width Ds that is still in widespread use. I just pushed a patch upstream to GNU roff that does the same for groff_mdoc(7). Before, groff contained code that was even more complicated than mandoc, but both resulted in quite different user-visible output. Now, both agree, and output is nicer for both. Useless complication noticed by Carsten Kunze (Heirloom roff).
* Simplify the mparse_open() interface.Ingo Schwarze2016-01-081-3/+3
| | | | | | Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
* In private header files, __BEGIN_DECLS and __END_DECLS are pointless.Ingo Schwarze2015-11-071-4/+1
| | | | | | | | | | | | Because these work slightly differently on different systems, they are becoming a maintenance burden in the portable version, so delete them. Besides, one of the chief design goals of the mandoc toolbox is to make sure that nothing related to documentation requires C++. Consequently, linking mandoc against any kind of C++ program would defeat the purpose and is not supported. I don't understand why kristaps@ added them in the first place.
* If a .Bd block has no arguments at all, drop the block and only keepIngo Schwarze2015-10-301-1/+2
| | | | | its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@.
* Major character table cleanup:Ingo Schwarze2015-10-131-10/+6
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Remove the warning about children of .Vt blocks because actually,Ingo Schwarze2015-09-141-2/+1
| | | | | | | .Vt type global_variable No = Dv defined_constant ; is the best way to specify in the SYNOPSIS how a global variable is initialized in the rare case where that matters. Issue noticed by jmc@.
* Do not fork and exec gunzip(1), just link with libz instead.Ingo Schwarze2015-07-191-2/+1
| | | | | | | 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.
* Profit from the unified struct roff_man and reduce the number ofIngo Schwarze2015-04-181-2/+2
| | | | | arguments of mparse_result() by one. No functional change. Written on the ICE Bruxelles-Koeln on the way back from p2k15.
* Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze2015-04-181-7/+6
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* improve NAME section diagnostics;Ingo Schwarze2015-02-231-2/+5
| | | | confusing messages reported by Jan Stary <hans at stare dot cz>
* replace the last legacy generic message type, "argument count wrong",Ingo Schwarze2015-02-061-2/+3
| | | | by more specific messages, improving diagnostics for .cc .tr .Bl -column
* better error reporting regarding .OP .RS .UR .TH argumentsIngo Schwarze2015-02-061-1/+3
|
* Delete the legacy generic warning type MANDOCERR_ARGCWARN,Ingo Schwarze2015-02-061-2/+2
| | | | | replacing the last instances by more specific warnings. Improved functionality, minus 50 lines of code.
* better handle .Fo and .Fd without argumentIngo Schwarze2015-02-061-1/+2
| | | | better handle .Fo with more than one argument
* discard .Rs head arguments and improve .Rs diagnosticsIngo Schwarze2015-02-041-1/+2
|
* more specific .Nd diagnostics, allowing to get rid of enum check_lvlIngo Schwarze2015-02-041-1/+2
| | | | and the respective argument of check_count()
* Delete the redundant tbl span flags, just inspect the actual dataIngo Schwarze2015-01-301-4/+1
| | | | | | | | where needed, which is less fragile. This fixes a subtle NULL pointer access to tp->tbl.cols: Due to a bug in the man(7) parser, the first span of a table can end up in a .TP head, in which case tblcalc() was never called. Found by jsg@ with afl.
* Abolish struct tbl_head and replace it by an "int col" member inIngo Schwarze2015-01-301-14/+2
| | | | struct tbl_cell. No functional change, minus 40 lines of code.
* Clean up eqn(7) error handling:Ingo Schwarze2015-01-281-7/+1
| | | | | | | | * When "define" fails, do not drop the whole equation. * Free memory after "undef". * Use standard mandoc error types instead of rolling our own. * Delete obfuscating EQN_MSG() macro. * Add function prototypes while here.
* * Polish tbl(7) error reporting.Ingo Schwarze2015-01-281-8/+8
| | | | | | * Do not print out macro names in tbl(7) data blocks. * Like with GNU tbl, let empty tables cause a blank line. * Avoid producing empty tables in -Tman.
* Multiple parser and formatter fixes for line drawing in tbl(7).Ingo Schwarze2015-01-271-5/+7
| | | | | | | | | | | | * Allow mixing vertical line bars with the layout options of the preceding layout cell. * Correctly combine box options with layout lines. * Correctly print vertical lines in data rows, with the right spacing. * Correctly print cross markers and left and right ends of horizontal lines even if vertical lines differ above and below. * Avoid the bogus error message "no table data cells" when a table data section starts with a horizontal line. No increase in code size.
* Rework tbl(7) layout parsing:Ingo Schwarze2015-01-261-3/+10
| | | | | | | | | | | * Continue parsing even if part of the input is invalid. * Do not require whitespace between cell specifications. * Allow tabs as well as blanks between modifiers. * Mark the 'm' modifier as unsupported. * Parse and ignore the 'p' and 'v' modifiers. * Better warning and error messages. * Get rid of a static buffer. Improved functionality but minus 50 lines of code.
* More improvements regarding tbl(7) options.Ingo Schwarze2015-01-261-1/+3
| | | | | | | | | * Treat "allbox" as an alias for "box" for now. * Parse and ignore the GNU tbl "nowarn" option. * For separation, allow spaces, tabs, and commas only. * Mark eqn(7) within tbl(7) as unsupported. * Simplify the option table. * Improve and sort documentation.
* Improve (or rather, rewrite) tbl(7) option parsing.Ingo Schwarze2015-01-261-4/+5
| | | | | | | | | | | | * Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code.
* Support .RE with an argument; needed for audio/pms(1).Ingo Schwarze2015-01-241-1/+2
|
* Traditional roff(7) explicitly allows certain control charactersIngo Schwarze2015-01-221-2/+3
| | | | | | | in the input stream (SOH, STX, ETX, ENQ, ACK, BEL, BS) for specific purposes (leaders, backspace, delimiters, .tr), but making sure these don't leak through to the output is tricky, so mark them as unsupported for now.
* Rudimentary implementation of the roff(7) \o escape sequence (overstrike).Ingo Schwarze2015-01-211-2/+3
| | | | | | This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
* Split the -Werror message level into -Werror (broken manual, probablyIngo Schwarze2015-01-201-8/+13
| | | | | | | | | | | | | using mandoc is better than using groff) and -Wunsupp (manual using unsupported low-level roff(7) feature, probably using groff is better than using mandoc). Once this feature is complete, it is intended to help porting, making the decision whether to USE_GROFF easier. As a first step, distinguish four classes of roff(7) requests: 1. Supported (currently 24 requests) 2. Currently ignored because unimportant (120) -> no message 3. Ignored for good because insecure (14) -> -Werror 4. Currently unsupported (68) -> these trigger the new -Wunsupp messages
* Fatal errors no longer exist.Ingo Schwarze2015-01-151-5/+2
| | | | | | If a file can be opened, mandoc will produce some output; at worst, the output may be almost empty. Simplifies error handling and frees a message type for future use.
* downgrade .so failure from FATAL to ERRORIngo Schwarze2015-01-151-2/+2
|
* downgrade ".so with absolute path" from FATAL to ERROR;Ingo Schwarze2015-01-141-2/+2
| | | | allows to get rid of ROFF_ERR
* To get rid of SYSERR entries in enum mandocerr, downgrade problems withIngo Schwarze2015-01-141-7/+2
| | | | | | missing and unreadable files from SYSERR to ERROR. Needed for upcoming work. As a bonus, this minimally simplifies code and documentation.
* Simplify handling of system errors: just exit(3).Ingo Schwarze2015-01-141-8/+1
| | | | | We already do the same for malloc(3) failure. The is no virtue in trying to survive failure of fork(2) and the like.
* Ignore mdoc(7) and man(7) macros inside tbl(7) code because theyIngo Schwarze2014-12-161-1/+2
| | | | | would abort the table in an unclean way, causing assertion failures found by jsg@.
* header cleanup:Ingo Schwarze2014-12-011-3/+3
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* The file read.c is part of the parser, so it cannot include main.h,Ingo Schwarze2014-12-011-2/+2
| | | | | | | which is not part of the parser. Besides, the parser *does* modify the input buffer, so marking it "const" in the mparse_readmem() interface is an outright lie. Fix all this by killing the const, the UNCONST, and the bogus inclusion.