aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/demandoc.c
Commit message (Collapse)AuthorAgeFilesLines
* Split -Wstyle into -Wstyle and the even lower -Wbase, and addIngo Schwarze2017-06-241-3/+4
| | | | | | | | | | | | | | | -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@.
* unify names of AST node flags; no change of cpp outputIngo Schwarze2017-01-101-3/+3
|
* getopt(3) is declared in <unistd.h>, and <getopt.h> is not needed;Ingo Schwarze2016-07-091-2/+1
| | | | from Joerg Sonnenberger via Thomas Klausner, NetBSD.
* Simplify the mparse_open() interface.Ingo Schwarze2016-01-081-2/+2
| | | | | | Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
* It was very surprising that a function called mparse_readfd()Ingo Schwarze2016-01-081-1/+2
| | | | | | | | | | | | | closed the file descriptor passed to it after completing its work, in particular considering the fact that it required its callers to call open(2) or mparse_open() beforehand. Change mparse_readfd() to not call close(2) and change the callers to call close(2) afterwards, more or less bringing open and close to the same level of the code and making review easier. Note that man.cgi(8) already did that, even though it was wrong in the past. Small restructuring suggested by Christos Zoulas (NetBSD).
* use the new function man_validate() here, tooIngo Schwarze2015-10-221-2/+4
|
* In order to become able to generate syntax tree nodes on the roff(7)Ingo Schwarze2015-10-201-3/+4
| | | | | | | | 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.
* Major character table cleanup:Ingo Schwarze2015-10-131-5/+4
| | | | | | | | | | | | | * 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.
* modernize style: "return" is not a functionIngo Schwarze2015-10-061-3/+3
|
* Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),Ingo Schwarze2015-04-181-3/+3
| | | | | | man_node() from the mandoc(3) semi-public interface and the internal wrapper functions print_mdoc() and print_man() from the HTML formatters. Minus 60 lines of code, no functional change.
* Profit from the unified struct roff_man and reduce the number ofIngo Schwarze2015-04-181-8/+7
| | | | | 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-3/+3
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* Second step towards parser unification:Ingo Schwarze2015-04-021-5/+5
| | | | | | | | | 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.
* First step towards parser unification:Ingo Schwarze2015-04-021-3/+4
| | | | | | 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.
* trim trailing white space, no code change;Ingo Schwarze2015-02-101-7/+7
| | | | from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
* be more careful about argc == 0Ingo Schwarze2015-02-071-4/+5
|
* Fatal errors no longer exist.Ingo Schwarze2015-01-151-9/+9
| | | | | | 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.
* Make the character table available to libroff so it can check theIngo Schwarze2014-10-281-2/+5
| | | | | | | | validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
* Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.Ingo Schwarze2014-08-101-3/+3
| | | | | | 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.
* Without the MPARSE_SO option, if the file contains nothing but aIngo Schwarze2014-03-191-2/+2
| | | | | | single .so request, do not read the file pointed to, but instead let mparse_result() provide the file name pointed to as a return value. To be used by makewhatis(8) in the future.
* cope with mparse_alloc() interface changeIngo Schwarze2014-03-191-2/+2
|
* Cope with mparse_alloc() interface change.Ingo Schwarze2014-01-051-2/+2
|
* catch up with the changed interface of mparse_alloc(), see mandoc.h rev 1.100Ingo Schwarze2012-05-311-2/+2
|
* Finishing touches on demandoc. It now backs over ending punctuation asKristaps Dzonsons2011-09-011-4/+16
| | | | | | well as leading punctuation. Again, this isn't the same as deroff (which uses, I think, some punctuation as delimiters), but it's easier to explain and simpler to audit.
* Make `-w' mode work much better. This is INCREDIBLY poorly specified inKristaps Dzonsons2011-09-011-2/+57
| | | | | | any other deroff manual, and as I don't think anybody actually uses deroff, I don't feel compelled to research its behaviour too much and can just do what's logical.
* Have demandoc throw away deroff's flags.Kristaps Dzonsons2011-09-011-30/+40
|
* Lint checks over demandoc.Kristaps Dzonsons2011-09-011-4/+3
|
* Allow compilation on OpenBSD.Kristaps Dzonsons2011-09-011-1/+2
|
* Add demandoc utility, a replacement for deroff.Kristaps Dzonsons2011-09-011-0/+180